马宇豪
2023-06-27 24f9337e9bf1f163787fdc0617c8223619fac909
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<template>
  <a-card title="快捷操作" class="quick">
    <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-tooltip overlayClassName="tip">
    <template #title>
      数据统计页面待呈现
    </template>
    <a>查看统计</a>
  </a-tooltip>
  <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',
  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>
 
<style lang="less" scoped>
.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>