From 7c906b4acf785180132f91db5d70c3a29fa85cd3 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期三, 21 六月 2023 09:39:13 +0800
Subject: [PATCH] 新增页面和配置,对接口

---
 src/components/Home/QuickNavigation.vue |  119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 113 insertions(+), 6 deletions(-)

diff --git a/src/components/Home/QuickNavigation.vue b/src/components/Home/QuickNavigation.vue
index 86ebd58..ef920be 100644
--- a/src/components/Home/QuickNavigation.vue
+++ b/src/components/Home/QuickNavigation.vue
@@ -1,17 +1,103 @@
 <template>
   <a-card title="快捷操作" class="quick">
-	<a style="color:blue">待叫应(1)</a>
-	<a >待审核</a>
-    <a>发布通知</a>
-    <a>查看统计</a>
-    <a>用户管理</a>
+    <a-tooltip overlayClassName="tip">
+      <template #title v-if="toResponse == 0">
+        暂无待叫应信息
+      </template>
+      <a :class="toResponse>0?'resColor':''" @click="toRes" v-if="userinfo.role.id == 3 && userinfo.unittype !==1">待叫应<span v-if="toResponse > 0">({{toResponse}})</span></a>
+    </a-tooltip>
+
+    <a-tooltip overlayClassName="tip">
+      <template #title v-if="toReview == 0">
+        暂无待审核信息
+      </template>
+      <a :class="toReview>0?'resColor':''" @click="toRev" v-if="userinfo.role.id == 2">待审核<span v-if="toReview > 0">({{toReview}})</span></a>
+    </a-tooltip>
+  <a href="massSend" v-if="userinfo.role.id == 3">发布通知</a>
+  <a>查看统计</a>
+  <a href="user" v-if="userinfo.role.id == 3">用户管理</a>
     <!-- <a-button><a-icon type="plus" />添加</a-button> -->
   </a-card>
 </template>
 
 <script>
+import msgDetailMod from "@/views/Admin/components/msgDetailMod";
+import {getMsgRecord, getResponseRecord} from "@/api/list";
+import {getUserInfo} from "@/util/storage";
+import {getReviewRecord} from "@/api/review";
+
 export default {
-  name: 'quick-navigation'
+  name: 'quick-navigation',
+  data() {
+    return {
+      userinfo: getUserInfo(),
+      toResponse: null,
+      toReview: null,
+    };
+  },
+  created() {
+    const t = this
+    t.getResData()
+    t.getReviewData()
+  },
+  methods: {
+    async getResData(){
+      const t = this
+      const res = await getMsgRecord({
+        pageIndex: 1,
+        pageSize: 10,
+        searchParams:{
+          responseStatus: 1,
+          startTime: '',
+          endTime: ''
+        }
+      })
+      if(res.data.code == 100){
+        t.toResponse = res.data.total
+      }else{
+        this.$message.error(res.data.msg)
+      }
+    },
+
+    async getReviewData(){
+      const t = this
+      const res = await getReviewRecord({
+        pageIndex: 1,
+        pageSize: 10,
+        searchParams:{
+          reviewStatus: 1,
+          startTime: '',
+          endTime: ''
+        }
+      })
+      if(res.data.code == 100){
+        t.toReview = res.data.total
+      }else{
+        this.$message.error(res.data.msg)
+      }
+    },
+
+    toRes(){
+      if(this.toResponse>0){
+        this.$router.push({
+          name: 'list',
+          query: {
+            type: 1
+          }
+        })
+      }
+    },
+    toRev(){
+      if(this.toReview>0){
+        this.$router.push({
+          name: 'msgReview',
+          query: {
+            type: 1
+          }
+        })
+      }
+    }
+  }
 }
 </script>
 
@@ -19,10 +105,31 @@
 .quick {
   a {
     display: inline-block;
+    text-align: center;
     width: 25%;
     font-size: 14px;
     margin-bottom: 13px;
     color: #333;
+
+    &:hover{
+      color: @link;
+    }
+  }
+  .resColor{
+    color: @danger;
   }
 }
 </style>
+<style lang="less">
+.tip{
+  .ant-tooltip-inner {
+  // 这里是框框
+    color: #333;
+    background-color: #fff!important;
+  }
+  .ant-tooltip-arrow::before {
+  // 这里是小三角形
+    background-color: #fff!important;
+  }
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.2