فهرست منبع

首页的待办事项

zhouying 2 روز پیش
والد
کامیت
f18b0259ef
2فایلهای تغییر یافته به همراه51 افزوده شده و 22 حذف شده
  1. 30 8
      src/views/dashboard/workbench/components/ProjectCard.vue
  2. 21 14
      src/views/dashboard/workbench/components/data.ts

+ 30 - 8
src/views/dashboard/workbench/components/ProjectCard.vue

@@ -8,13 +8,15 @@
       <CardGrid class="!md:w-1/3 !w-full">
         <span class="flex">
           <Icon :icon="item.icon" :color="item.color" size="30" />
-          <span class="text-lg ml-4">{{ item.title }}</span>
+          <span class="ml-4">{{ item.name }}</span>
         </span>
-        <div class="flex mt-2 h-10 text-secondary"> {{ item.desc }} </div>
-        <div class="flex justify-between text-secondary">
+        <div class="mt-2 h-10 text-secondary">
+          您当前有<a :href="item.url">{{ item.description }}</a>条数据待处理!
+        </div>
+        <!-- <div class="flex justify-between text-secondary">
           <span>{{ item.group }}</span>
           <span>{{ item.date }}</span>
-        </div>
+        </div> -->
       </CardGrid>
     </template>
   </Card>
@@ -23,12 +25,32 @@
   import { defineComponent } from 'vue';
   import { Card } from 'ant-design-vue';
   import { Icon } from '/@/components/Icon';
-  import { groupItems } from './data';
+  // import { groupItems } from './data';
 
   export default defineComponent({
     components: { Card, CardGrid: Card.Grid, Icon },
-    setup() {
-      return { items: groupItems };
-    },
+    // setup() {
+    //   return { items: groupItems };
+    // },
+  });
+</script>
+
+<script lang="ts" setup>
+  import { defHttp } from '/@/utils/http/axios';
+  import { ref, onMounted } from 'vue';
+  import { groupItems } from './data';
+  const items = ref(groupItems);
+
+  onMounted(() => {
+    loadData();
   });
+  async function loadData() {
+    try {
+      const res = await defHttp.get({ url: '/purCode/purOrder/getMsgByLogin' })
+      items.value = Array.isArray(res) ? res : [];
+    } catch (error) {
+      console.error(error);
+      items.value = [];
+    }
+  }
 </script>

+ 21 - 14
src/views/dashboard/workbench/components/data.ts

@@ -1,8 +1,9 @@
 interface GroupItem {
-  title: string;
+  name: string;
   icon: string;
+  description: string;
+  url: string;
   color: string;
-  desc: string;
   date: string;
   group: string;
 }
@@ -106,50 +107,56 @@ export const dynamicInfoItems: DynamicInfoItem[] = [
 
 export const groupItems: GroupItem[] = [
   {
-    title: 'Github',
+    name: 'Github',
     icon: 'carbon:logo-github',
+    description: '不要等待机会,而要创造机会。',
+    url: '',
     color: '',
-    desc: '不要等待机会,而要创造机会。',
     group: '开源组',
     date: '2021-04-01',
   },
   {
-    title: 'Vue',
+    name: 'Vue',
     icon: 'ion:logo-vue',
+    description: '现在的你决定将来的你。',
+    url: '',
     color: '#3fb27f',
-    desc: '现在的你决定将来的你。',
     group: '算法组',
     date: '2021-04-01',
   },
   {
-    title: 'Html5',
+    name: 'Html5',
     icon: 'ion:logo-html5',
+    description: '没有什么才能比努力更重要。',
+    url: '',
     color: '#e18525',
-    desc: '没有什么才能比努力更重要。',
     group: '上班摸鱼',
     date: '2021-04-01',
   },
   {
-    title: 'Angular',
+    name: 'Angular',
     icon: 'ion:logo-angular',
+    description: '热情和欲望可以突破一切难关。',
+    url: '',
     color: '#bf0c2c',
-    desc: '热情和欲望可以突破一切难关。',
     group: 'UI',
     date: '2021-04-01',
   },
   {
-    title: 'React',
+    name: 'React',
     icon: 'bx:bxl-react',
+    description: '健康的身体是实目标的基石。',
+    url: '',
     color: '#00d8ff',
-    desc: '健康的身体是实目标的基石。',
     group: '技术牛',
     date: '2021-04-01',
   },
   {
-    title: 'Js',
+    name: 'Js',
     icon: 'ion:logo-javascript',
+    description: '路是走出来的,而不是空想出来的。',
+    url: '',
     color: '#4daf1bc9',
-    desc: '路是走出来的,而不是空想出来的。',
     group: '架构组',
     date: '2021-04-01',
   },