Browse Source

肖皓月

皓月 2 months ago
parent
commit
1436ee1640
6 changed files with 863 additions and 141 deletions
  1. 12 0
      .vscode/tasks.json
  2. 21 21
      src/locales/zh-CN.ts
  3. 113 113
      src/views/Home/Index.vue
  4. 7 7
      src/views/Home/echarts-data.ts
  5. 391 0
      备份backup/Index.vue
  6. 319 0
      备份backup/Index2.vue

+ 12 - 0
.vscode/tasks.json

@@ -0,0 +1,12 @@
+{
+	"version": "2.0.0",
+	"tasks": [
+		{
+			"type": "npm",
+			"script": "dev",
+			"problemMatcher": [],
+			"label": "npm: dev",
+			"detail": "vite --mode env.local"
+		}
+	]
+}

+ 21 - 21
src/locales/zh-CN.ts

@@ -163,7 +163,7 @@ export default {
     transactionAmount: '成交金额',
     transactionAmount: '成交金额',
     totalShopping: '购物总量',
     totalShopping: '购物总量',
     monthlySales: '每月销售额',
     monthlySales: '每月销售额',
-    userAccessSource: '用户访问来源',
+    userAccessSource: '参观者身份',
     january: '一月',
     january: '一月',
     february: '二月',
     february: '二月',
     march: '三月',
     march: '三月',
@@ -178,31 +178,31 @@ export default {
     december: '十二月',
     december: '十二月',
     estimate: '预计',
     estimate: '预计',
     actual: '实际',
     actual: '实际',
-    directAccess: '直接访问',
-    mailMarketing: '邮件营销',
-    allianceAdvertising: '联盟广告',
-    videoAdvertising: '视频广告',
-    searchEngines: '搜索引擎',
-    weeklyUserActivity: '每周用户活跃量',
+    directAccess: '教职工',
+    mailMarketing: '学生',
+    allianceAdvertising: '标本管理员',
+    videoAdvertising: '教职工家属',
+    searchEngines: '校外人员',
+    weeklyUserActivity: '参观者最感兴趣的标本类型',
     activeQuantity: '活跃量',
     activeQuantity: '活跃量',
-    monday: '周一',
-    tuesday: '周二',
-    wednesday: '周三',
-    thursday: '周四',
-    friday: '周五',
-    saturday: '周六',
-    sunday: '周日'
+    monday: '植物',
+    tuesday: '动物',
+    wednesday: '骨骼',
+    thursday: '矿物',
+    friday: '化石',
+    saturday: '浸渍',
+    sunday: '风干'
   },
   },
   workplace: {
   workplace: {
     welcome: '你好',
     welcome: '你好',
-    happyDay: '祝你开心每一天!',
-    toady: '今日',
-    notice: '通知公告',
-    project: '项目数',
-    access: '项目访问',
-    toDo: '待办',
+    happyDay: '欢迎来到桂林理工大学地质博物馆!!!',
+    toady: '今日初雪첫눈',
+    notice: '项目功能备注',
+    project: '工作台功能名称',
+    access: '网页访问量',
+    toDo: '今日参观人数',
     introduction: '一个正经的简介',
     introduction: '一个正经的简介',
-    shortcutOperation: '快捷入口',
+    shortcutOperation: '操作备注',
     operation: '操作',
     operation: '操作',
     index: '指数',
     index: '指数',
     personal: '个人',
     personal: '个人',

+ 113 - 113
src/views/Home/Index.vue

@@ -1,19 +1,19 @@
 <template>
 <template>
   <div>
   <div>
-    <el-card shadow="never">
+    <el-card shadow="never"> 
       <el-skeleton :loading="loading" animated>
       <el-skeleton :loading="loading" animated>
         <el-row :gutter="16" justify="space-between">
         <el-row :gutter="16" justify="space-between">
           <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
           <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
             <div class="flex items-center">
             <div class="flex items-center">
-              <el-avatar :src="avatar" :size="70" class="mr-16px">
+              <el-avatar :src="avatar" :size="0" class="mr-16px">
                 <img src="@/assets/imgs/avatar.gif" alt="" />
                 <img src="@/assets/imgs/avatar.gif" alt="" />
               </el-avatar>
               </el-avatar>
               <div>
               <div>
                 <div class="text-20px">
                 <div class="text-20px">
                   {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
                   {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
                 </div>
                 </div>
-                <div class="mt-10px text-14px text-gray-500">
-                  {{ t('workplace.toady') }},20℃ - 32℃!
+                <div class="mt-10px text-14px text-gray-500"> 
+                  {{ t('workplace.toady') }},-100℃~-50℃!
                 </div>
                 </div>
               </div>
               </div>
             </div>
             </div>
@@ -129,14 +129,14 @@
         </template>
         </template>
         <el-skeleton :loading="loading" animated>
         <el-skeleton :loading="loading" animated>
           <el-row>
           <el-row>
-            <el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
+            <!-- <el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
               <div class="flex items-center">
               <div class="flex items-center">
                 <Icon :icon="item.icon" class="mr-8px" />
                 <Icon :icon="item.icon" class="mr-8px" />
                 <el-link type="default" :underline="false" @click="setWatermark(item.name)">
                 <el-link type="default" :underline="false" @click="setWatermark(item.name)">
                   {{ item.name }}
                   {{ item.name }}
                 </el-link>
                 </el-link>
               </div>
               </div>
-            </el-col>
+            </el-col> -->
           </el-row>
           </el-row>
         </el-skeleton>
         </el-skeleton>
       </el-card>
       </el-card>
@@ -144,11 +144,11 @@
         <template #header>
         <template #header>
           <div class="h-3 flex justify-between">
           <div class="h-3 flex justify-between">
             <span>{{ t('workplace.notice') }}</span>
             <span>{{ t('workplace.notice') }}</span>
-            <el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
+            <!-- <el-link type="primary" :underline="false">{{ t('action.more') }}</el-link> -->
           </div>
           </div>
         </template>
         </template>
         <el-skeleton :loading="loading" animated>
         <el-skeleton :loading="loading" animated>
-          <div v-for="(item, index) in notice" :key="`dynamics-${index}`">
+          <!-- <div v-for="(item, index) in notice" :key="`dynamics-${index}`">
             <div class="flex items-center">
             <div class="flex items-center">
               <el-avatar :src="avatar" :size="35" class="mr-16px">
               <el-avatar :src="avatar" :size="35" class="mr-16px">
                 <img src="@/assets/imgs/avatar.gif" alt="" />
                 <img src="@/assets/imgs/avatar.gif" alt="" />
@@ -165,7 +165,7 @@
               </div>
               </div>
             </div>
             </div>
             <el-divider />
             <el-divider />
-          </div>
+          </div> -->
         </el-skeleton>
         </el-skeleton>
       </el-card>
       </el-card>
     </el-col>
     </el-col>
@@ -177,15 +177,15 @@ import { EChartsOption } from 'echarts'
 import { formatTime } from '@/utils'
 import { formatTime } from '@/utils'
 
 
 import { useUserStore } from '@/store/modules/user'
 import { useUserStore } from '@/store/modules/user'
-import { useWatermark } from '@/hooks/web/useWatermark'
-import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
+// import { useWatermark } from '@/hooks/web/useWatermark'
+import type { WorkplaceTotal, Project,  } from './types'
 import { pieOptions, barOptions } from './echarts-data'
 import { pieOptions, barOptions } from './echarts-data'
 
 
 defineOptions({ name: 'Home' })
 defineOptions({ name: 'Home' })
 
 
 const { t } = useI18n()
 const { t } = useI18n()
 const userStore = useUserStore()
 const userStore = useUserStore()
-const { setWatermark } = useWatermark()
+// const { setWatermark } = useWatermark()
 const loading = ref(true)
 const loading = ref(true)
 const avatar = userStore.getUser.avatar
 const avatar = userStore.getUser.avatar
 const username = userStore.getUser.nickname
 const username = userStore.getUser.nickname
@@ -199,9 +199,9 @@ let totalSate = reactive<WorkplaceTotal>({
 
 
 const getCount = async () => {
 const getCount = async () => {
   const data = {
   const data = {
-    project: 40,
-    access: 2340,
-    todo: 10
+    project: 666,
+    access: 6,
+    todo: 2333
   }
   }
   totalSate = Object.assign(totalSate, data)
   totalSate = Object.assign(totalSate, data)
 }
 }
@@ -211,121 +211,121 @@ let projects = reactive<Project[]>([])
 const getProject = async () => {
 const getProject = async () => {
   const data = [
   const data = [
     {
     {
-      name: 'ruoyi-vue-pro',
-      icon: 'akar-icons:github-fill',
-      message: 'https://github.com/YunaiV/ruoyi-vue-pro',
-      personal: 'Spring Boot 单体架构',
-      time: new Date()
+      name: '历年标本数量统计',
+      // icon: '',
+      //message: 'https://lib.glut.edu.cn/',
+      //personal: 'Spring Boot 单体架构',
+      //time: new Date()
     },
     },
     {
     {
-      name: 'yudao-ui-admin-vue3',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-vue3',
-      personal: 'Vue3 + element-plus',
-      time: new Date()
+      name: '本年标本出库情况',
+      // icon: 'logos:vue',
+      //message: 'https://libopac.glut.edu.cn/opac/reader/space',
+      //personal: 'Vue3 + element-plus',
+      //time: new Date()
     },
     },
     {
     {
-      name: 'yudao-ui-admin-vben',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-vben',
-      personal: 'Vue3 + vben(antd)',
-      time: new Date()
+      name: '本年标本入库情况',
+      // icon: 'logos:vue',
+      // message: 'https://github.com/yudaocode/yudao-ui-admin-vben',
+      // personal: 'Vue3 + vben(antd)',
+      // time: new Date()
     },
     },
     {
     {
-      name: 'yudao-cloud',
-      icon: 'akar-icons:github',
-      message: 'https://github.com/YunaiV/yudao-cloud',
-      personal: 'Spring Cloud 微服务架构',
-      time: new Date()
+      name: '本年标本回库情况',
+      // icon: 'akar-icons:github',
+      // message: 'https://github.com/YunaiV/yudao-cloud',
+      // personal: 'Spring Cloud 微服务架构',
+      // time: new Date()
     },
     },
     {
     {
-      name: 'yudao-ui-mall-uniapp',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-uniapp',
-      personal: 'Vue3 + uniapp',
-      time: new Date()
+      name: '历年标本来源增减统计',
+      // icon: 'logos:vue',
+      // message: 'https://github.com/yudaocode/yudao-ui-admin-uniapp',
+      // personal: 'Vue3 + uniapp',
+      // time: new Date()
     },
     },
     {
     {
-      name: 'yudao-ui-admin-vue2',
-      icon: 'logos:vue',
-      message: 'https://github.com/yudaocode/yudao-ui-admin-vue2',
-      personal: 'Vue2 + element-ui',
-      time: new Date()
+      name: '按标本类别统计库存数',
+      // icon: 'logos:vue',
+      // message: 'https://github.com/yudaocode/yudao-ui-admin-vue2',
+      // personal: 'Vue2 + element-ui',
+      // time: new Date()
     }
     }
   ]
   ]
   projects = Object.assign(projects, data)
   projects = Object.assign(projects, data)
 }
 }
 
 
 // 获取通知公告
 // 获取通知公告
-let notice = reactive<Notice[]>([])
-const getNotice = async () => {
-  const data = [
-    {
-      title: '系统支持 JDK 8/17/21,Vue 2/3',
-      type: '通知',
-      keys: ['通知', '8', '17', '21', '2', '3'],
-      date: new Date()
-    },
-    {
-      title: '后端提供 Spring Boot 2.7/3.2 + Cloud 双架构',
-      type: '公告',
-      keys: ['公告', 'Boot', 'Cloud'],
-      date: new Date()
-    },
-    {
-      title: '全部开源,个人与企业可 100% 直接使用,无需授权',
-      type: '通知',
-      keys: ['通知', '无需授权'],
-      date: new Date()
-    },
-    {
-      title: '国内使用最广泛的快速开发平台,超 300+ 人贡献',
-      type: '公告',
-      keys: ['公告', '最广泛'],
-      date: new Date()
-    }
-  ]
-  notice = Object.assign(notice, data)
-}
+// let notice = reactive<Notice[]>([])
+// const getNotice = async () => {
+//   const data = [
+//     {
+//       title: '桂林理工大学',
+//       type: '学校',
+//       keys: ['学校', '理工', ],
+//       date: new Date() 
+//     },
+//     {
+//       title: '测绘地理信息学院',
+//       type: '学院',
+//       keys: ['学院', '测绘', ],
+//       date: new Date()
+//     },
+//     {
+//       title: '壹斗米工作室',
+//       type: '组织',
+//       keys: ['组织', '壹'],
+//       date: new Date()
+//     },
+//     {
+//       title: '桂林理工大学地质博物馆',
+//       type: '地点',
+//       keys: ['地点', '地质'],
+//       date: new Date()
+//     }
+//   ]
+//   notice = Object.assign(notice, data)
+// }
 
 
 // 获取快捷入口
 // 获取快捷入口
-let shortcut = reactive<Shortcut[]>([])
+// let shortcut = reactive<Shortcut[]>([])
 
 
-const getShortcut = async () => {
-  const data = [
-    {
-      name: 'Github',
-      icon: 'akar-icons:github-fill',
-      url: 'github.io'
-    },
-    {
-      name: 'Vue',
-      icon: 'logos:vue',
-      url: 'vuejs.org'
-    },
-    {
-      name: 'Vite',
-      icon: 'vscode-icons:file-type-vite',
-      url: 'https://vitejs.dev/'
-    },
-    {
-      name: 'Angular',
-      icon: 'logos:angular-icon',
-      url: 'github.io'
-    },
-    {
-      name: 'React',
-      icon: 'logos:react',
-      url: 'github.io'
-    },
-    {
-      name: 'Webpack',
-      icon: 'logos:webpack',
-      url: 'github.io'
-    }
-  ]
-  shortcut = Object.assign(shortcut, data)
-}
+// const getShortcut = async () => {
+//   const data = [
+//     {
+//       name: 'Github',
+//       icon: 'akar-icons:github-fill',
+//       url: 'github.io'
+//     },
+//     {
+//       name: 'Vue',
+//       icon: 'logos:vue',
+//       url: 'vuejs.org'
+//     },
+//     {
+//       name: 'Vite',
+//       icon: 'vscode-icons:file-type-vite',
+//       url: 'https://vitejs.dev/'
+//     },
+//     {
+//       name: 'Angular',
+//       icon: 'logos:angular-icon',
+//       url: 'github.io'
+//     },
+//     {
+//       name: 'React',
+//       icon: 'logos:react',
+//       url: 'github.io'
+//     },
+//     {
+//       name: 'Webpack',
+//       icon: 'logos:webpack',
+//       url: 'github.io'
+//     }
+//   ]
+//   // shortcut = Object.assign(shortcut, data)
+// }
 
 
 // 用户来源
 // 用户来源
 const getUserAccessSource = async () => {
 const getUserAccessSource = async () => {
@@ -379,8 +379,8 @@ const getAllApi = async () => {
   await Promise.all([
   await Promise.all([
     getCount(),
     getCount(),
     getProject(),
     getProject(),
-    getNotice(),
-    getShortcut(),
+    // getNotice(),
+    // getShortcut(),
     getUserAccessSource(),
     getUserAccessSource(),
     getWeeklyUserActivity()
     getWeeklyUserActivity()
   ])
   ])

+ 7 - 7
src/views/Home/echarts-data.ts

@@ -95,14 +95,14 @@ export const pieOptions: EChartsOption = {
     {
     {
       name: t('analysis.userAccessSource'),
       name: t('analysis.userAccessSource'),
       type: 'pie',
       type: 'pie',
-      radius: '55%',
+      radius: '60%',
       center: ['50%', '60%'],
       center: ['50%', '60%'],
       data: [
       data: [
-        { value: 335, name: t('analysis.directAccess') },
-        { value: 310, name: t('analysis.mailMarketing') },
-        { value: 234, name: t('analysis.allianceAdvertising') },
-        { value: 135, name: t('analysis.videoAdvertising') },
-        { value: 1548, name: t('analysis.searchEngines') }
+        { value: 10, name: t('analysis.directAccess') },
+        { value: 20, name: t('analysis.mailMarketing') },
+        { value: 30, name: t('analysis.allianceAdvertising') },
+        { value: 40, name: t('analysis.videoAdvertising') },
+        { value: 50, name: t('analysis.searchEngines') }
       ]
       ]
     }
     }
   ]
   ]
@@ -145,7 +145,7 @@ export const barOptions: EChartsOption = {
   series: [
   series: [
     {
     {
       name: t('analysis.activeQuantity'),
       name: t('analysis.activeQuantity'),
-      data: [13253, 34235, 26321, 12340, 24643, 1322, 1324],
+      data: [111, 222, 333, 444, 555, 666, 777],
       type: 'bar'
       type: 'bar'
     }
     }
   ]
   ]

+ 391 - 0
备份backup/Index.vue

@@ -0,0 +1,391 @@
+<template>
+  <div>
+    <el-card shadow="never">
+      <el-skeleton :loading="loading" animated>
+        <el-row :gutter="16" justify="space-between">
+          <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
+            <div class="flex items-center">
+              <el-avatar :src="avatar" :size="70" class="mr-16px">
+                <img src="@/assets/imgs/avatar.gif" alt="" />
+              </el-avatar>
+              <div>
+                <div class="text-20px">
+                  {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
+                </div>
+                <div class="mt-10px text-14px text-gray-500">
+                  {{ t('workplace.toady') }},20℃ - 32℃!
+                </div>
+              </div>
+            </div>
+          </el-col>
+          <el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
+            <div class="h-70px flex items-center justify-end lt-sm:mt-10px">
+              <div class="px-8px text-right">
+                <div class="mb-16px text-14px text-gray-400">{{ t('workplace.project') }}</div>
+                <CountTo
+                  class="text-20px"
+                  :start-val="0"
+                  :end-val="totalSate.project"
+                  :duration="2600"
+                />
+              </div>
+              <el-divider direction="vertical" />
+              <div class="px-8px text-right">
+                <div class="mb-16px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
+                <CountTo
+                  class="text-20px"
+                  :start-val="0"
+                  :end-val="totalSate.todo"
+                  :duration="2600"
+                />
+              </div>
+              <el-divider direction="vertical" border-style="dashed" />
+              <div class="px-8px text-right">
+                <div class="mb-16px text-14px text-gray-400">{{ t('workplace.access') }}</div>
+                <CountTo
+                  class="text-20px"
+                  :start-val="0"
+                  :end-val="totalSate.access"
+                  :duration="2600"
+                />
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </el-skeleton>
+    </el-card>
+  </div>
+
+  <el-row class="mt-8px" :gutter="8" justify="space-between">
+    <el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
+      <el-card shadow="never">
+        <template #header>
+          <div class="h-3 flex justify-between">
+            <span>{{ t('workplace.project') }}</span>
+            <el-link
+              type="primary"
+              :underline="false"
+              href="https://github.com/yudaocode"
+              target="_blank"
+            >
+              {{ t('action.more') }}
+            </el-link>
+          </div>
+        </template>
+        <el-skeleton :loading="loading" animated>
+          <el-row>
+            <el-col
+              v-for="(item, index) in projects"
+              :key="`card-${index}`"
+              :xl="8"
+              :lg="8"
+              :md="8"
+              :sm="24"
+              :xs="24"
+            >
+              <el-card shadow="hover" class="mr-5px mt-5px">
+                <div class="flex items-center">
+                  <Icon :icon="item.icon" :size="25" class="mr-8px" />
+                  <span class="text-16px">{{ item.name }}</span>
+                </div>
+                <div class="mt-12px text-9px text-gray-400">{{ t(item.message) }}</div>
+                <div class="mt-12px flex justify-between text-12px text-gray-400">
+                  <span>{{ item.personal }}</span>
+                  <span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
+                </div>
+              </el-card>
+            </el-col>
+          </el-row>
+        </el-skeleton>
+      </el-card>
+
+      <el-card shadow="never" class="mt-8px">
+        <el-skeleton :loading="loading" animated>
+          <el-row :gutter="20" justify="space-between">
+            <el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
+              <el-card shadow="hover" class="mb-8px">
+                <el-skeleton :loading="loading" animated>
+                  <Echart :options="pieOptionsData" :height="280" />
+                </el-skeleton>
+              </el-card>
+            </el-col>
+            <el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
+              <el-card shadow="hover" class="mb-8px">
+                <el-skeleton :loading="loading" animated>
+                  <Echart :options="barOptionsData" :height="280" />
+                </el-skeleton>
+              </el-card>
+            </el-col>
+          </el-row>
+        </el-skeleton>
+      </el-card>
+    </el-col>
+    <el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
+      <el-card shadow="never">
+        <template #header>
+          <div class="h-3 flex justify-between">
+            <span>{{ t('workplace.shortcutOperation') }}</span>
+          </div>
+        </template>
+        <el-skeleton :loading="loading" animated>
+          <el-row>
+            <el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
+              <div class="flex items-center">
+                <Icon :icon="item.icon" class="mr-8px" />
+                <el-link type="default" :underline="false" @click="setWatermark(item.name)">
+                  {{ item.name }}
+                </el-link>
+              </div>
+            </el-col>
+          </el-row>
+        </el-skeleton>
+      </el-card>
+      <el-card shadow="never" class="mt-8px">
+        <template #header>
+          <div class="h-3 flex justify-between">
+            <span>{{ t('workplace.notice') }}</span>
+            <el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
+          </div>
+        </template>
+        <el-skeleton :loading="loading" animated>
+          <div v-for="(item, index) in notice" :key="`dynamics-${index}`">
+            <div class="flex items-center">
+              <el-avatar :src="avatar" :size="35" class="mr-16px">
+                <img src="@/assets/imgs/avatar.gif" alt="" />
+              </el-avatar>
+              <div>
+                <div class="text-14px">
+                  <Highlight :keys="item.keys.map((v) => t(v))">
+                    {{ item.type }} : {{ item.title }}
+                  </Highlight>
+                </div>
+                <div class="mt-16px text-12px text-gray-400">
+                  {{ formatTime(item.date, 'yyyy-MM-dd') }}
+                </div>
+              </div>
+            </div>
+            <el-divider />
+          </div>
+        </el-skeleton>
+      </el-card>
+    </el-col>
+  </el-row>
+</template>
+<script lang="ts" setup>
+import { set } from 'lodash-es'
+import { EChartsOption } from 'echarts'
+import { formatTime } from '@/utils'
+
+import { useUserStore } from '@/store/modules/user'
+import { useWatermark } from '@/hooks/web/useWatermark'
+import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
+import { pieOptions, barOptions } from './echarts-data'
+
+defineOptions({ name: 'Home' })
+
+const { t } = useI18n()
+const userStore = useUserStore()
+const { setWatermark } = useWatermark()
+const loading = ref(true)
+const avatar = userStore.getUser.avatar
+const username = userStore.getUser.nickname
+const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
+// 获取统计数
+let totalSate = reactive<WorkplaceTotal>({
+  project: 0,
+  access: 0,
+  todo: 0
+})
+
+const getCount = async () => {
+  const data = {
+    project: 40,
+    access: 2340,
+    todo: 10
+  }
+  totalSate = Object.assign(totalSate, data)
+}
+
+// 获取项目数
+let projects = reactive<Project[]>([])
+const getProject = async () => {
+  const data = [
+    {
+      name: 'ruoyi-vue-pro',
+      icon: 'akar-icons:github-fill',
+      message: 'https://github.com/YunaiV/ruoyi-vue-pro',
+      personal: 'Spring Boot 单体架构',
+      time: new Date()
+    },
+    {
+      name: 'yudao-ui-admin-vue3',
+      icon: 'logos:vue',
+      message: 'https://github.com/yudaocode/yudao-ui-admin-vue3',
+      personal: 'Vue3 + element-plus',
+      time: new Date()
+    },
+    {
+      name: 'yudao-ui-admin-vben',
+      icon: 'logos:vue',
+      message: 'https://github.com/yudaocode/yudao-ui-admin-vben',
+      personal: 'Vue3 + vben(antd)',
+      time: new Date()
+    },
+    {
+      name: 'yudao-cloud',
+      icon: 'akar-icons:github',
+      message: 'https://github.com/YunaiV/yudao-cloud',
+      personal: 'Spring Cloud 微服务架构',
+      time: new Date()
+    },
+    {
+      name: 'yudao-ui-mall-uniapp',
+      icon: 'logos:vue',
+      message: 'https://github.com/yudaocode/yudao-ui-admin-uniapp',
+      personal: 'Vue3 + uniapp',
+      time: new Date()
+    },
+    {
+      name: 'yudao-ui-admin-vue2',
+      icon: 'logos:vue',
+      message: 'https://github.com/yudaocode/yudao-ui-admin-vue2',
+      personal: 'Vue2 + element-ui',
+      time: new Date()
+    }
+  ]
+  projects = Object.assign(projects, data)
+}
+
+// 获取通知公告
+let notice = reactive<Notice[]>([])
+const getNotice = async () => {
+  const data = [
+    {
+      title: '系统支持 JDK 8/17/21,Vue 2/3',
+      type: '通知',
+      keys: ['通知', '8', '17', '21', '2', '3'],
+      date: new Date()
+    },
+    {
+      title: '后端提供 Spring Boot 2.7/3.2 + Cloud 双架构',
+      type: '公告',
+      keys: ['公告', 'Boot', 'Cloud'],
+      date: new Date()
+    },
+    {
+      title: '全部开源,个人与企业可 100% 直接使用,无需授权',
+      type: '通知',
+      keys: ['通知', '无需授权'],
+      date: new Date()
+    },
+    {
+      title: '国内使用最广泛的快速开发平台,超 300+ 人贡献',
+      type: '公告',
+      keys: ['公告', '最广泛'],
+      date: new Date()
+    }
+  ]
+  notice = Object.assign(notice, data)
+}
+
+// 获取快捷入口
+let shortcut = reactive<Shortcut[]>([])
+
+const getShortcut = async () => {
+  const data = [
+    {
+      name: 'Github',
+      icon: 'akar-icons:github-fill',
+      url: 'github.io'
+    },
+    {
+      name: 'Vue',
+      icon: 'logos:vue',
+      url: 'vuejs.org'
+    },
+    {
+      name: 'Vite',
+      icon: 'vscode-icons:file-type-vite',
+      url: 'https://vitejs.dev/'
+    },
+    {
+      name: 'Angular',
+      icon: 'logos:angular-icon',
+      url: 'github.io'
+    },
+    {
+      name: 'React',
+      icon: 'logos:react',
+      url: 'github.io'
+    },
+    {
+      name: 'Webpack',
+      icon: 'logos:webpack',
+      url: 'github.io'
+    }
+  ]
+  shortcut = Object.assign(shortcut, data)
+}
+
+// 用户来源
+const getUserAccessSource = async () => {
+  const data = [
+    { value: 335, name: 'analysis.directAccess' },
+    { value: 310, name: 'analysis.mailMarketing' },
+    { value: 234, name: 'analysis.allianceAdvertising' },
+    { value: 135, name: 'analysis.videoAdvertising' },
+    { value: 1548, name: 'analysis.searchEngines' }
+  ]
+  set(
+    pieOptionsData,
+    'legend.data',
+    data.map((v) => t(v.name))
+  )
+  pieOptionsData!.series![0].data = data.map((v) => {
+    return {
+      name: t(v.name),
+      value: v.value
+    }
+  })
+}
+const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
+
+// 周活跃量
+const getWeeklyUserActivity = async () => {
+  const data = [
+    { value: 13253, name: 'analysis.monday' },
+    { value: 34235, name: 'analysis.tuesday' },
+    { value: 26321, name: 'analysis.wednesday' },
+    { value: 12340, name: 'analysis.thursday' },
+    { value: 24643, name: 'analysis.friday' },
+    { value: 1322, name: 'analysis.saturday' },
+    { value: 1324, name: 'analysis.sunday' }
+  ]
+  set(
+    barOptionsData,
+    'xAxis.data',
+    data.map((v) => t(v.name))
+  )
+  set(barOptionsData, 'series', [
+    {
+      name: t('analysis.activeQuantity'),
+      data: data.map((v) => v.value),
+      type: 'bar'
+    }
+  ])
+}
+
+const getAllApi = async () => {
+  await Promise.all([
+    getCount(),
+    getProject(),
+    getNotice(),
+    getShortcut(),
+    getUserAccessSource(),
+    getWeeklyUserActivity()
+  ])
+  loading.value = false
+}
+
+getAllApi()
+</script>

+ 319 - 0
备份backup/Index2.vue

@@ -0,0 +1,319 @@
+<template>
+  <el-row :class="prefixCls" :gutter="20" justify="space-between">
+    <el-col :lg="6" :md="12" :sm="12" :xl="6" :xs="24">
+      <el-card class="mb-20px" shadow="hover">
+        <el-skeleton :loading="loading" :rows="2" animated>
+          <template #default>
+            <div :class="`${prefixCls}__item flex justify-between`">
+              <div>
+                <div
+                  :class="`${prefixCls}__item--icon ${prefixCls}__item--peoples p-16px inline-block rounded-6px`"
+                >
+                  <Icon :size="40" icon="svg-icon:peoples" />
+                </div>
+              </div>
+              <div class="flex flex-col justify-between">
+                <div :class="`${prefixCls}__item--text text-16px text-gray-500 text-right`"
+                  >{{ t('analysis.newUser') }}
+                </div>
+                <CountTo
+                  :duration="2600"
+                  :end-val="102400"
+                  :start-val="0"
+                  class="text-right text-20px font-700"
+                />
+              </div>
+            </div>
+          </template>
+        </el-skeleton>
+      </el-card>
+    </el-col>
+
+    <el-col :lg="6" :md="12" :sm="12" :xl="6" :xs="24">
+      <el-card class="mb-20px" shadow="hover">
+        <el-skeleton :loading="loading" :rows="2" animated>
+          <template #default>
+            <div :class="`${prefixCls}__item flex justify-between`">
+              <div>
+                <div
+                  :class="`${prefixCls}__item--icon ${prefixCls}__item--message p-16px inline-block rounded-6px`"
+                >
+                  <Icon :size="40" icon="svg-icon:message" />
+                </div>
+              </div>
+              <div class="flex flex-col justify-between">
+                <div :class="`${prefixCls}__item--text text-16px text-gray-500 text-right`"
+                  >{{ t('analysis.unreadInformation') }}
+                </div>
+                <CountTo
+                  :duration="2600"
+                  :end-val="81212"
+                  :start-val="0"
+                  class="text-right text-20px font-700"
+                />
+              </div>
+            </div>
+          </template>
+        </el-skeleton>
+      </el-card>
+    </el-col>
+
+    <el-col :lg="6" :md="12" :sm="12" :xl="6" :xs="24">
+      <el-card class="mb-20px" shadow="hover">
+        <el-skeleton :loading="loading" :rows="2" animated>
+          <template #default>
+            <div :class="`${prefixCls}__item flex justify-between`">
+              <div>
+                <div
+                  :class="`${prefixCls}__item--icon ${prefixCls}__item--money p-16px inline-block rounded-6px`"
+                >
+                  <Icon :size="40" icon="svg-icon:money" />
+                </div>
+              </div>
+              <div class="flex flex-col justify-between">
+                <div :class="`${prefixCls}__item--text text-16px text-gray-500 text-right`"
+                  >{{ t('analysis.transactionAmount') }}
+                </div>
+                <CountTo
+                  :duration="2600"
+                  :end-val="9280"
+                  :start-val="0"
+                  class="text-right text-20px font-700"
+                />
+              </div>
+            </div>
+          </template>
+        </el-skeleton>
+      </el-card>
+    </el-col>
+
+    <el-col :lg="6" :md="12" :sm="12" :xl="6" :xs="24">
+      <el-card class="mb-20px" shadow="hover">
+        <el-skeleton :loading="loading" :rows="2" animated>
+          <template #default>
+            <div :class="`${prefixCls}__item flex justify-between`">
+              <div>
+                <div
+                  :class="`${prefixCls}__item--icon ${prefixCls}__item--shopping p-16px inline-block rounded-6px`"
+                >
+                  <Icon :size="40" icon="svg-icon:shopping" />
+                </div>
+              </div>
+              <div class="flex flex-col justify-between">
+                <div :class="`${prefixCls}__item--text text-16px text-gray-500 text-right`"
+                  >{{ t('analysis.totalShopping') }}
+                </div>
+                <CountTo
+                  :duration="2600"
+                  :end-val="13600"
+                  :start-val="0"
+                  class="text-right text-20px font-700"
+                />
+              </div>
+            </div>
+          </template>
+        </el-skeleton>
+      </el-card>
+    </el-col>
+  </el-row>
+  <el-row :gutter="20" justify="space-between">
+    <el-col :lg="10" :md="24" :sm="24" :xl="10" :xs="24">
+      <el-card class="mb-20px" shadow="hover">
+        <el-skeleton :loading="loading" animated>
+          <Echart :height="300" :options="pieOptionsData" />
+        </el-skeleton>
+      </el-card>
+    </el-col>
+    <el-col :lg="14" :md="24" :sm="24" :xl="14" :xs="24">
+      <el-card class="mb-20px" shadow="hover">
+        <el-skeleton :loading="loading" animated>
+          <Echart :height="300" :options="barOptionsData" />
+        </el-skeleton>
+      </el-card>
+    </el-col>
+    <el-col :span="24">
+      <el-card class="mb-20px" shadow="hover">
+        <el-skeleton :loading="loading" :rows="4" animated>
+          <Echart :height="350" :options="lineOptionsData" />
+        </el-skeleton>
+      </el-card>
+    </el-col>
+  </el-row>
+</template>
+<script lang="ts" setup>
+import { set } from 'lodash-es'
+import { EChartsOption } from 'echarts'
+
+import { useDesign } from '@/hooks/web/useDesign'
+import type { AnalysisTotalTypes } from './types'
+import { barOptions, lineOptions, pieOptions } from './echarts-data'
+
+defineOptions({ name: 'Home2' })
+
+const { t } = useI18n()
+const loading = ref(true)
+const { getPrefixCls } = useDesign()
+const prefixCls = getPrefixCls('panel')
+const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
+
+let totalState = reactive<AnalysisTotalTypes>({
+  users: 0,
+  messages: 0,
+  moneys: 0,
+  shoppings: 0
+})
+
+const getCount = async () => {
+  const data = {
+    users: 102400,
+    messages: 81212,
+    moneys: 9280,
+    shoppings: 13600
+  }
+  totalState = Object.assign(totalState, data)
+}
+
+// 用户来源
+const getUserAccessSource = async () => {
+  const data = [
+    { value: 335, name: 'analysis.directAccess' },
+    { value: 310, name: 'analysis.mailMarketing' },
+    { value: 234, name: 'analysis.allianceAdvertising' },
+    { value: 135, name: 'analysis.videoAdvertising' },
+    { value: 1548, name: 'analysis.searchEngines' }
+  ]
+  set(
+    pieOptionsData,
+    'legend.data',
+    data.map((v) => t(v.name))
+  )
+  set(pieOptionsData, 'series.data', data)
+}
+const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
+
+// 周活跃量
+const getWeeklyUserActivity = async () => {
+  const data = [
+    { value: 13253, name: 'analysis.monday' },
+    { value: 34235, name: 'analysis.tuesday' },
+    { value: 26321, name: 'analysis.wednesday' },
+    { value: 12340, name: 'analysis.thursday' },
+    { value: 24643, name: 'analysis.friday' },
+    { value: 1322, name: 'analysis.saturday' },
+    { value: 1324, name: 'analysis.sunday' }
+  ]
+  set(
+    barOptionsData,
+    'xAxis.data',
+    data.map((v) => t(v.name))
+  )
+  set(barOptionsData, 'series', [
+    {
+      name: t('analysis.activeQuantity'),
+      data: data.map((v) => v.value),
+      type: 'bar'
+    }
+  ])
+}
+
+const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption
+
+// 每月销售总额
+const getMonthlySales = async () => {
+  const data = [
+    { estimate: 100, actual: 120, name: 'analysis.january' },
+    { estimate: 120, actual: 82, name: 'analysis.february' },
+    { estimate: 161, actual: 91, name: 'analysis.march' },
+    { estimate: 134, actual: 154, name: 'analysis.april' },
+    { estimate: 105, actual: 162, name: 'analysis.may' },
+    { estimate: 160, actual: 140, name: 'analysis.june' },
+    { estimate: 165, actual: 145, name: 'analysis.july' },
+    { estimate: 114, actual: 250, name: 'analysis.august' },
+    { estimate: 163, actual: 134, name: 'analysis.september' },
+    { estimate: 185, actual: 56, name: 'analysis.october' },
+    { estimate: 118, actual: 99, name: 'analysis.november' },
+    { estimate: 123, actual: 123, name: 'analysis.december' }
+  ]
+  set(
+    lineOptionsData,
+    'xAxis.data',
+    data.map((v) => t(v.name))
+  )
+  set(lineOptionsData, 'series', [
+    {
+      name: t('analysis.estimate'),
+      smooth: true,
+      type: 'line',
+      data: data.map((v) => v.estimate),
+      animationDuration: 2800,
+      animationEasing: 'cubicInOut'
+    },
+    {
+      name: t('analysis.actual'),
+      smooth: true,
+      type: 'line',
+      itemStyle: {},
+      data: data.map((v) => v.actual),
+      animationDuration: 2800,
+      animationEasing: 'quadraticOut'
+    }
+  ])
+}
+
+const getAllApi = async () => {
+  await Promise.all([getCount(), getUserAccessSource(), getWeeklyUserActivity(), getMonthlySales()])
+  loading.value = false
+}
+
+getAllApi()
+</script>
+
+<style lang="scss" scoped>
+$prefix-cls: #{$namespace}-panel;
+
+.#{$prefix-cls} {
+  &__item {
+    &--peoples {
+      color: #40c9c6;
+    }
+
+    &--message {
+      color: #36a3f7;
+    }
+
+    &--money {
+      color: #f4516c;
+    }
+
+    &--shopping {
+      color: #34bfa3;
+    }
+
+    &:hover {
+      :deep(.#{$namespace}-icon) {
+        color: #fff !important;
+      }
+
+      .#{$prefix-cls}__item--icon {
+        transition: all 0.38s ease-out;
+      }
+
+      .#{$prefix-cls}__item--peoples {
+        background: #40c9c6;
+      }
+
+      .#{$prefix-cls}__item--message {
+        background: #36a3f7;
+      }
+
+      .#{$prefix-cls}__item--money {
+        background: #f4516c;
+      }
+
+      .#{$prefix-cls}__item--shopping {
+        background: #34bfa3;
+      }
+    }
+  }
+}
+</style>