Browse Source

add new

master
panda 9 months ago
parent
commit
f0af324b3c
  1. 0
      src/assets/images/wechat.png
  2. BIN
      src/assets/images/头像.jpg
  3. 63
      src/assets/index.ts
  4. 590
      src/components/blogs/HomePage.vue
  5. 49
      src/components/blogs/QQCode.vue
  6. 49
      src/components/blogs/WechatCode.vue
  7. 23
      src/router/blog.ts
  8. 8
      src/types/custom.d.ts
  9. 1
      src/views/admin/DashBoardView.vue
  10. 11
      src/views/blog/AboutMe.vue
  11. 79
      src/views/blog/AmountChartView.vue

0
src/assets/images/wechat.jpg → src/assets/images/wechat.png

Before

Width: 600  |  Height: 600  |  Size: 78 KiB

After

Width: 600  |  Height: 600  |  Size: 78 KiB

BIN
src/assets/images/头像.jpg

After

Width: 690  |  Height: 690  |  Size: 57 KiB

63
src/assets/index.ts

@ -12,45 +12,28 @@ function createIconComponent(iconType: string) {
},
});
}
const TitleOutLined = createIconComponent('icon-xiongmaochizhuye');
const BlogOutLined = createIconComponent('icon-blog');
const SystemOutLined = createIconComponent('icon-system');
const PhotoOutLined = createIconComponent('icon-photo');
const FileOutLined = createIconComponent('icon-file');
const DiaryOutLined = createIconComponent('icon-diary');
const CommentOutLined = createIconComponent('icon-comment');
const TypeOutLined = createIconComponent('icon-type');
const MusicLined = createIconComponent('icon-musicfill');
const EmailLined = createIconComponent('icon-youxiang');
const GitHubLined = createIconComponent('icon-github');
const QQLined = createIconComponent('icon-QQ');
const WechatLined = createIconComponent('icon-wechat-fill');
const GravatarLined = createIconComponent('icon-brand-gravatar');
const RiLiLined = createIconComponent('icon-rili');
const YueDuLined = createIconComponent('icon-yuedu');
const YanJingLined = createIconComponent('icon-yanjing');
const XieZiLined = createIconComponent('icon-xiezi');
const CravatarLined = createIconComponent('icon-cravatar');
const iconComponents = {
TitleOutLined: createIconComponent('icon-xiongmaochizhuye'),
BlogOutLined: createIconComponent('icon-blog'),
SystemOutLined: createIconComponent('icon-system'),
PhotoOutLined: createIconComponent('icon-photo'),
FileOutLined: createIconComponent('icon-file'),
DiaryOutLined: createIconComponent('icon-diary'),
CommentOutLined: createIconComponent('icon-comment'),
TypeOutLined: createIconComponent('icon-type'),
MusicLined: createIconComponent('icon-musicfill'),
EmailLined: createIconComponent('icon-youxiang'),
GitHubLined: createIconComponent('icon-github'),
QQLined: createIconComponent('icon-QQ'),
WechatLined: createIconComponent('icon-wechat-fill'),
GravatarLined: createIconComponent('icon-brand-gravatar'),
RiLiLined: createIconComponent('icon-rili'),
YueDuLined: createIconComponent('icon-yuedu'),
YanJingLined: createIconComponent('icon-yanjing'),
XieZiLined: createIconComponent('icon-xiezi'),
CravatarLined: createIconComponent('icon-cravatar'),
}
export {
TitleOutLined,
BlogOutLined,
SystemOutLined,
PhotoOutLined,
FileOutLined,
DiaryOutLined,
CommentOutLined,
TypeOutLined,
MusicLined,
EmailLined,
GitHubLined,
QQLined,
WechatLined,
GravatarLined,
RiLiLined,
YueDuLined,
YanJingLined,
XieZiLined,
CravatarLined
}
export default iconComponents

590
src/components/blogs/HomePage.vue

@ -2,8 +2,7 @@
<Simplebar @scroll="handleScroll">
<!-- 头部导航菜单 -->
<div class="headerMenu" v-if="show_menu">
<a-menu v-model:selectedKeys="current" mode="horizontal" :items="items" style="border-bottom: none;"
@click="menuClick" />
<a-menu v-model:selectedKeys="current" mode="horizontal" :items="items" style="border-bottom: none;" />
<a-input-search v-model:value="value" placeholder="search" style="width: 200px" @search="onSearch" />
</div>
<div class="author" v-if="show_author"></div>
@ -30,25 +29,14 @@
<div class="leftBar">
<a-card hoverable>
<template #cover>
<img alt="example" :src="img" />
<img alt="example" src="/src/assets/images/头像.jpg" />
</template>
<h1>sunfree</h1>
<div class="cardText"></div>
<div class="button-group">
<a-button shape="circle" size="large" @click="cravatarClick" >
<CravatarLined style="color: red;"/>
</a-button>
<a-button shape="circle" size="large" @click="qqClick">
<QQLined />
</a-button>
<a-button shape="circle" size="large" @click="wechatClick">
<WechatLined />
</a-button>
<a-button shape="circle" size="large" @click="musicClick">
<MusicLined />
</a-button>
<a-button shape="circle" size="large" @click="githubClick">
<GitHubLined />
<a-button v-for="(button, index) in buttons" :key="index" shape="circle" size="large"
@click="handleClick(button.url)">
<component :is="button.icon" />
</a-button>
</div>
<div class="fold-panel">
@ -56,32 +44,18 @@
<template #expandIcon="{ isActive }">
<caret-right-outlined :rotate="isActive ? 90 : 0" />
</template>
<a-collapse-panel key="1" header="内容1" :style="customStyle">
<p>{{ text }}</p>
</a-collapse-panel>
<a-collapse-panel key="2" header="内容2" :style="customStyle">
<p>{{ text }}</p>
</a-collapse-panel>
<a-collapse-panel key="3" header="内容3" :style="customStyle">
<p>{{ text }}</p>
<a-collapse-panel v-for="panel in panels" :key=panel.num :header=panel.header
:style="customStyle">
<p>{{ panel.text }}</p>
</a-collapse-panel>
</a-collapse>
</div>
</a-card>
<a-card hoverable title="常用链接">
<div class="button-group">
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed">Link</a-button>
<a-button type="dashed" v-for="linkbutton in linkbuttons" :key="linkbutton.id">{{
linkbutton.linktext
}}</a-button>
</div>
</a-card>
</div>
@ -90,14 +64,8 @@
<a-card hoverable>
<div class="statistic">
<a-row>
<a-col :span="8">
<a-statistic title="DAYS" :value="112893" />
</a-col>
<a-col :span="8">
<a-statistic title="DIARYS" :value="112893" />
</a-col>
<a-col :span="8">
<a-statistic title="BLOGS" :value="112893" />
<a-col :span="8" v-for="statistic in statistics" :key="statistic.id">
<a-statistic :title=statistic.title :value=statistic.counts />
</a-col>
</a-row>
</div>
@ -138,9 +106,8 @@
</template>
<script lang="ts" setup>
import { h, reactive, ref, nextTick } from 'vue';
import { MenuProps } from 'ant-design-vue';
import type { MenuProps } from 'ant-design-vue';
import { HomeOutlined, HighlightOutlined, ProfileOutlined, CameraOutlined, UsergroupDeleteOutlined, DownCircleOutlined } from '@ant-design/icons-vue';
import { MusicLined, EmailLined, QQLined, WechatLined, GravatarLined, GitHubLined,CravatarLined } from "@/assets"
import Typed from 'typed.js';
import { onMounted, watch } from 'vue';
import type { CSSProperties } from 'vue';
@ -148,82 +115,224 @@ import { CaretRightOutlined } from '@ant-design/icons-vue';
import 'APlayer/dist/APlayer.min.css';
import APlayer from 'APlayer';
import { createEcharts } from "@/hooks/intex"
import { SettingOutlined, EditOutlined, EllipsisOutlined } from '@ant-design/icons-vue';
import { RiLiLined, YueDuLined, YanJingLined, XieZiLined } from '@/assets';
import { useRouter, useRoute } from 'vue-router';
const random = ref();
import iconComponents from "@/assets/index"
const router = useRouter()
const route = useRoute()
const heat = ref(null);
const activeKey = ref(['']);
const text = `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`;
const customStyle =
'background: #F5F5F5;border-radius: 4px;margin-bottom: 12px;border: 0;overflow: hidden';
const scrollbar = ref<Element | null>(null);
onMounted(() => {
// home
nextTick(() => {
const authorElement = document.querySelector('.author');
if (authorElement) {
new Typed('.author', {
strings: ['SunFree.'],
typeSpeed: 200,
backSpeed: 150,
loop: true,
loopCount: Infinity,
showCursor: false
});
/**
* 导航菜单
*/
const show_menu = ref(false);
const show_carousel = ref(true);
const show_author = ref(true)
const show_anchornDown = ref(true)
const mainCss = reactive({
marginTop: "0px"
})
const current = ref<string[]>(['home']);
const items = ref<MenuProps['items']>([
{
key: 'home',
icon: () => h(HomeOutlined),
label: h('a', { href: '/' }, '首页'),
title: '首页',
},
{
key: 'blog',
icon: () => h(HighlightOutlined),
label: h('a', { href: "/blog" }, '博客'),
title: '博客',
},
{
key: 'diary',
icon: () => h(ProfileOutlined),
label: h('a', { href: "/diary" }, '日记'),
title: '日记',
},
{
key: 'album',
icon: () => h(CameraOutlined),
label: '相册',
title: '相册',
children: [
{
label: '相册1',
key: 'album1',
// url: "album1"
},
{
label: '相册2',
key: 'album2',
},
{
label: '相册3',
key: 'album3',
},
{
label: '相册4',
key: 'album4',
},
],
},
{
key: 'chart',
icon: () => h(UsergroupDeleteOutlined),
label: h('a', { href: "/chart" }, '收支图'),
title: '收支图',
},
{
key: 'aboutme',
icon: () => h(UsergroupDeleteOutlined),
label: h('a', { href: "/aboutme" }, '关于sunfree'),
title: '关于sunfree',
},
]);
const updateCarouselVisibility = (routeName) => {
handleScrollEnabled.value = false;
if (scrollbar.value) {
scrollbar.value.scrollTop = 0;
}
if (routeName === 'home') {
handleScrollEnabled.value = true;
show_carousel.value = true;
show_menu.value = false
} else {
show_menu.value = true;
show_author.value = false;
show_carousel.value = false;
show_anchornDown.value = false;
mainCss.marginTop = '48px';
}
};
const cardTextElement = document.querySelector('.cardText');
if (cardTextElement) {
//
new Typed('.cardText', {
strings: ['做三流测试,品瀚霖人生!'],
typeSpeed: 200,
backSpeed: 150,
loop: true, //
loopCount: Infinity, //
showCursor: false //
router.beforeEach((to, from, next) => {
updateCarouselVisibility(to.name);
next();
});
//
const articleTitle = ref<string>('');
const onSearch = (searchValue: string) => {
console.log('use value', searchValue);
console.log('or use this.value', articleTitle.value);
};
const aplayerContainer = document.getElementById('aplayer');
if (aplayerContainer) {
new APlayer({
container: aplayerContainer,
mini: false,
autoplay: false,
theme: '#FADFA3',
loop: 'all',
order: 'random',
preload: 'auto',
volume: 0.7,
mutex: true,
listFolded: true,
listMaxHeight: 90,
lrcType: 3,
audio: [
/**
* 滚动条操作
*/
const scrollbar = ref<Element | null>(null);
const handleScrollEnabled = ref(true);
//
const handleScroll = () => {
if (!handleScrollEnabled.value) return;
if (scrollbar.value) {
const scrollOffset = scrollbar.value.scrollTop;
const halfViewportHeight = scrollbar.value.clientHeight / 2;
show_menu.value = scrollOffset > halfViewportHeight;
}
};
//
const downScroll = () => {
if (scrollbar.value) {
const scrollTop = scrollbar.value.scrollTop;
const viewportHeight = scrollbar.value.clientHeight;
const scrollDistance = viewportHeight - scrollTop - 48;
setTimeout(() => {
scrollbar.value!.scrollBy({ top: scrollDistance, behavior: 'smooth' });
}, 300);
}
};
/**
* 左侧栏
*/
//
const activeKey = ref(['']);
const customStyle = 'background: #F5F5F5;border-radius: 4px;margin-bottom: 12px;border: 0;overflow: hidden';
const panels = reactive([
{
name: 'name1',
artist: 'artist1',
url: 'url1.mp3',
cover: 'cover1.jpg',
lrc: 'lrc1.lrc',
theme: '#ebd0c2'
num: "1",
header: "内容1",
text: "内容1"
},
{
name: 'name2',
artist: 'artist2',
url: 'url2.mp3',
cover: 'cover2.jpg',
lrc: 'lrc2.lrc',
theme: '#46718b'
num: "2",
header: "内容2",
text: "内容2"
},
{
num: "3",
header: "内容3",
text: "内容3"
}
]
});
)
//
const buttons = ref([
{ icon: iconComponents.CravatarLined, url: 'https://cravatar.cn/' },
{ icon: iconComponents.QQLined, url: '/qqcode' },
{ icon: iconComponents.WechatLined, url: '/wechatcode' },
{ icon: iconComponents.MusicLined, url: 'https://music.163.com/#/playlist?id=160266689' },
{ icon: iconComponents.GitHubLined, url: 'https://gitee.com/c_panda' },
]);
const handleClick = (url: string) => {
window.open(url)
}
});
//
const linkbuttons = reactive([
{
id: "1",
linktext: "测试"
},
{
id: "2",
linktext: "开发"
},
{
id: "3",
linktext: "运营"
},
{
id: "4",
linktext: "实施"
}
])
/**
* 右侧栏
*/
//
const statistics = reactive([
{
id: "1",
title: "DAYS",
counts: "111"
},
{
id: "2",
title: "DIARYS",
counts: "111"
},
{
id: "3",
title: "BLOGS",
counts: "111"
},
])
//
const heat = ref(null);
const newData = <any>[];
// 60
const data = generateDates(60);
console.log(data)
//
for (let i = 0; i < 60; i += 15) {
// 15
const chunk = data.slice(i, i + 15).reverse();
newData.push(...chunk);
}
function generateDates(numDays: number) {
const dates = [];
@ -232,35 +341,23 @@ onMounted(() => {
const date = new Date(currentDate);
date.setDate(currentDate.getDate() - i);
dates.push(
{ date: date.toISOString().split('T')[0], blogCount: 0 }
{ date: date.toISOString().split('T')[0], writCount: 0 }
); //
}
return dates;
}
// 60
const data = generateDates(60);
console.log(`output->`, data)
data[3].blogCount = 5;
data[15].blogCount = 10;
data[25].blogCount = 3;
//
const newData = [];
for (let i = 0; i < 60; i += 15) {
// 15
const chunk = data.slice(i, i + 15).reverse();
newData.push(...chunk);
}
const formattedData = newData.map((value, index) => [index % 15, Math.floor(index / 15), value.blogCount]);
const writList=[5,4,3,2,1,0]
writList.forEach((item,index)=>{
data[index].writCount = item;
})
const formattedData = newData.map((value, index) => [index % 15, Math.floor(index / 15), value.writCount]);
const heatMapData = {
tooltip: {
position: 'top',
formatter: function (params: any) {
const item = newData[params.dataIndex];
if (item.blogCount > 0) {
return `${item.date}<br/>COMMENTS: ${item.blogCount}`;
if (item.writCount > 0) {
return `${item.date}<br/>COMMENTS: ${item.writCount}`;
} else {
return `${item.date}`;
}
@ -320,178 +417,75 @@ onMounted(() => {
}
}]
};
createEcharts(heat, heatMapData);
scrollbar.value = document.querySelector('.simplebar-content-wrapper');
// console.log(current.value)
// const storedShowMenu = localStorage.getItem('show_menu');
// const storedShowCarousel = localStorage.getItem('show_carousel');
// const storedScrollPosition = localStorage.getItem('scrollPosition');
// const storedMainCssMarginTop = localStorage.getItem('mainCss_marginTop');
// if (storedShowMenu !== null) {
// show_menu.value = storedShowMenu === 'true';
// }
// if (storedShowCarousel !== null) {
// show_carousel.value = storedShowCarousel === 'true';
// }
// if (storedScrollPosition !== null && scrollbar.value) {
// scrollbar.value.scrollTop = parseInt(storedScrollPosition, 10);
// }
// if (storedMainCssMarginTop !== null) {
// mainCss.marginTop = storedMainCssMarginTop;
// }
//
const random = ref();
})
//
const show_menu = ref(false);
const show_carousel = ref(true);
const show_author = ref(true)
const show_anchornDown = ref(true)
const mainCss = reactive({
marginTop: "0px"
})
const items = ref<MenuProps['items']>([
{
key: 'home',
icon: () => h(HomeOutlined),
label: '首页',
title: '首页',
url: '/'
},
{
key: 'blog',
icon: () => h(HighlightOutlined),
label: '博客',
title: '博客',
url: "/blog"
},
{
key: 'diary',
icon: () => h(ProfileOutlined),
label: '日记',
title: '日记',
url: '/diary'
},
{
key: 'album',
icon: () => h(CameraOutlined),
label: '相册',
title: '相册',
children: [
{
label: '相册1',
key: 'album1',
url: "album1"
},
{
label: '相册2',
key: 'album2',
},
{
label: '相册3',
key: 'album3',
},
{
label: '相册4',
key: 'album4',
},
],
},
onMounted(() => {
nextTick(() => {
const authorElement = document.querySelector('.author');
if (authorElement) {
new Typed('.author', {
strings: ['SunFree.'],
typeSpeed: 200,
backSpeed: 150,
loop: true,
loopCount: Infinity,
showCursor: false
});
};
const cardTextElement = document.querySelector('.cardText');
if (cardTextElement) {
//
new Typed('.cardText', {
strings: ['做三流测试,品瀚霖人生!'],
typeSpeed: 200,
backSpeed: 150,
loop: true, //
loopCount: Infinity, //
showCursor: false //
});
};
const aplayerContainer = document.getElementById('aplayer');
if (aplayerContainer) {
new APlayer({
container: aplayerContainer,
mini: false,
autoplay: false,
theme: '#FADFA3',
loop: 'all',
order: 'random',
preload: 'auto',
volume: 0.7,
mutex: true,
listFolded: true,
listMaxHeight: 90,
lrcType: 3,
audio: [
{
key: 'chart',
icon: () => h(UsergroupDeleteOutlined),
label: '收支图',
title: '收支图',
name: 'name1',
artist: 'artist1',
url: 'url1.mp3',
cover: 'cover1.jpg',
lrc: 'lrc1.lrc',
theme: '#ebd0c2'
},
{
key: 'aboutme',
icon: () => h(UsergroupDeleteOutlined),
label: '关于sunfree',
title: '关于sunfree',
},
]);
const handleScrollEnabled = ref(true);
//
const handleScroll = () => {
if (!handleScrollEnabled.value) return;
if (scrollbar.value) {
const scrollOffset = scrollbar.value.scrollTop;
const halfViewportHeight = scrollbar.value.clientHeight / 2;
show_menu.value = scrollOffset > halfViewportHeight;
}
};
const current = ref<string[]>(['home']);
const menuClick = ({ item }: { item: any }) => {
router.push(item.url);
}
// -
const downScroll = () => {
if (scrollbar.value) {
const scrollTop = scrollbar.value.scrollTop;
const viewportHeight = scrollbar.value.clientHeight;
const scrollDistance = viewportHeight - scrollTop - 48;
setTimeout(() => {
scrollbar.value!.scrollBy({ top: scrollDistance, behavior: 'smooth' });
}, 300);
}
};
//
// const articles=reactive({
// img:"",
// })
const value = ref<string>('');
const onSearch = (searchValue: string) => {
console.log('use value', searchValue);
console.log('or use this.value', value.value);
};
const img = ref("https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png")
const cravatarClick = () => {
window.open("https://cravatar.cn/")
}
const qqClick=()=>{
window.open("/qqcode",'_blank')
}
const wechatClick=()=>{
window.open("/wechatcode",'_blank')
}
const musicClick=()=>{
window.open("https://music.163.com/#/playlist?id=160266689")
}
const githubClick=()=>{
window.open("https://gitee.com/c_panda")
}
const updateCarouselVisibility = (routeName) => {
handleScrollEnabled.value = false;
if (scrollbar.value) {
scrollbar.value.scrollTop = 0;
name: 'name2',
artist: 'artist2',
url: 'url2.mp3',
cover: 'cover2.jpg',
lrc: 'lrc2.lrc',
theme: '#46718b'
}
if (routeName === 'home') {
handleScrollEnabled.value = true;
show_carousel.value = true;
show_menu.value = false
} else {
show_menu.value = true;
show_author.value = false;
show_carousel.value = false;
show_anchornDown.value = false;
mainCss.marginTop = '48px';
]
});
}
};
//
});
createEcharts(heat, heatMapData);
scrollbar.value = document.querySelector('.simplebar-content-wrapper');
})
watch(
() => route.name,
(newRouteName) => {
@ -509,12 +503,6 @@ watch(
},
{ immediate: true }
);
router.beforeEach((to, from, next) => {
updateCarouselVisibility(to.name);
next();
});
</script>
<style scoped>
.headerMenu {
@ -641,6 +629,7 @@ router.beforeEach((to, from, next) => {
position: relative;
margin-bottom: 24px;
}
.rightBar>:nth-child(4) div .article-text {
display: flex;
flex-direction: column;
@ -649,6 +638,7 @@ router.beforeEach((to, from, next) => {
left: 10%;
color: rgb(187, 185, 187);
}
#aplayer {
margin: 0;
}

49
src/components/blogs/QQCode.vue

@ -1,9 +1,52 @@
<template>
<a-image :preview="false" :width="500" :height="500" src="/src/assets/images/qq.png"/>
<div class="qq-poster">
<div>
<h1>QQ二维码</h1>
<p>欢迎扫描二维码与我共同探讨测试开发的学习和实践</p>
<div class="qr-code-container">
<img src="/src/assets/images/qq.png" alt="QR Code" class="qr-code" />
</div>
<p>扫码添加了解更多信息</p>
</div>
</div>
</template>
<script setup lang='ts'>
<script lang="ts" setup >
</script>
<style></style>
<style scoped>
.qq-poster {
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
h1 {
font-size: 24px;
margin-bottom: 10px;
}
p {
font-size: 16px;
margin: 10px 0;
}
.qr-code-container {
margin: 20px 0;
padding: 10px;
border: 2px solid #ccc;
display: inline-block;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.qr-code {
width: 200px;
height: 200px;
}
</style>

49
src/components/blogs/WechatCode.vue

@ -1,9 +1,52 @@
<template>
<a-qrcode error-level="H" value="https://www.antdv.com" icon="https://www.antdv.com/assets/logo.1ef800a8.svg" />
<div class="qq-poster">
<div>
<h1>微信二维码</h1>
<p>欢迎扫描二维码与我共同探讨测试开发的学习和实践</p>
<div class="qr-code-container">
<img src="/src/assets/images/wechat.png" alt="QR Code" class="qr-code" />
</div>
<p>扫码添加了解更多信息</p>
</div>
</div>
</template>
<script setup lang='ts'>
<script lang="ts" setup>
</script>
<style></style>
<style scoped>
.qq-poster {
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
h1 {
font-size: 24px;
margin-bottom: 10px;
}
p {
font-size: 16px;
margin: 10px 0;
}
.qr-code-container {
margin: 20px 0;
padding: 10px;
border: 2px solid #ccc;
display: inline-block;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.qr-code {
width: 200px;
height: 200px;
}
</style>

23
src/router/blog.ts

@ -7,6 +7,11 @@ const blogRoute:Array<RouteRecordRaw>=[
name: "home",
component: () => import("@/components/blogs/HomePage.vue"),
children:[
{
path:"/home",
name:"home",
component:()=>import("@/views/blog/HomePageView.vue")
},
{
path:"/blog",
name:"blog",
@ -18,27 +23,31 @@ const blogRoute:Array<RouteRecordRaw>=[
component:()=>import("@/views/blog/DiaryContentView.vue")
},
{
path:"/home",
name:"home",
component:()=>import("@/views/blog/HomePageView.vue")
path:"/chart",
name:"chart",
component:()=>import("@/views/blog/AmountChartView.vue")
},
{
path:"/aboutme",
name:"aboutme",
component:()=>import("@/views/blog/AboutMe.vue"),
},
]
},
{
path:"/ceshi",
name:"ceshi",
component:()=>import("@/components/blogs/ceshi.vue")
component:()=>import("@/components/blogs/ceshi.vue"),
},
{
path:"/qqcode",
name:"qqcode",
component:()=>import("@/components/blogs/QQCode.vue")
component:()=>import("@/components/blogs/QqCode.vue"),
},
{
path:"/wechatcode",
name:"wechatcode",
component:()=>import("@/components/blogs/WechatCode.vue")
component:()=>import("@/components/blogs/WeChatCode.vue"),
},
]
export default blogRoute

8
src/types/custom.d.ts

@ -1,4 +1,4 @@
declare module 'ant-design-vue';
declare module 'echarts';
declare module 'ant-design-vue/es/menu'
declare module 'animejs/lib/anime.es.js'
// declare module 'ant-design-vue';
// declare module 'echarts';
// declare module 'ant-design-vue/es/menu'
// declare module 'animejs/lib/anime.es.js'

1
src/views/admin/DashBoardView.vue

@ -89,7 +89,6 @@
</template>
<script setup lang='ts'>
import { BlogOutLined, PhotoOutLined, FileOutLined, DiaryOutLined, CommentOutLined } from "@/assets";
import { reactive, ref, onMounted } from 'vue';
import type { Ref } from 'vue';
import { createEcharts } from '@/hooks/intex'

11
src/views/blog/AboutMe.vue

@ -0,0 +1,11 @@
<template>
<div>这是关于我的内容</div>
</template>
<script setup lang='ts'>
</script>
<style>
</style>

79
src/views/blog/AmountChartView.vue

@ -1,11 +1,82 @@
<template>
<div>测试</div>
<div>
<div ref="staticLine" style="height: 300px;width: 1000px;"></div>
<div ref="staticLine" style="height: 300px;width: 1000px;"></div>
</div>
</template>
<script setup lang='ts'>
import { createEcharts } from '@/hooks/intex'
import { onMounted, ref } from 'vue';
const staticLine = ref(null)
onMounted(() => {
const staticLineData = {
title: {
text: 'Stacked Line'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'Video Ads',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'Direct',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: 'Search Engine',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
createEcharts(staticLine, staticLineData)
})
</script>
<style>
</style>
<style></style>
Loading…
Cancel
Save