Commit fa6ab1882a845b7484122e383702cffe747f3fe3

Authored by sqy
1 parent 828168a7

'修改通知头像,修改首页样式'

... ... @@ -93,9 +93,7 @@ export const filterRoleList = async () => {
93 93 const userInfo: any = getAuthCache(USER_INFO_KEY);
94 94 const role = userInfo.roles[0];
95 95 const options = res.filter((item) => {
96   - if (role === 'SYS_ADMIN') {
97   - return item.roleType === 'PLATFORM_ADMIN';
98   - } else if (role === 'PLATFORM_ADMIN') {
  96 + if (role === 'SYS_ADMIN' || role === 'PLATFORM_ADMIN') {
99 97 return item.roleType === 'PLATFORM_ADMIN';
100 98 } else {
101 99 return item.roleType === 'CUSTOMER_USER';
... ...
... ... @@ -11,9 +11,7 @@ import { getAuthCache } from '/@/utils/auth';
11 11 import { ref } from 'vue';
12 12
13 13 const LOGIN_PATH = PageEnum.BASE_LOGIN;
14   -
15 14 const ROOT_PATH = RootRoute.path;
16   -
17 15 const whitePathList: string[] = [LOGIN_PATH];
18 16 // const userInfo1 = getAuthCache(USER_INFO_KEY);
19 17 // const userInfo = ref(userInfo1);
... ... @@ -30,7 +28,6 @@ export function createPermissionGuard(router: Router) {
30 28 userStore.getUserInfo.homePath &&
31 29 userStore.getUserInfo.homePath !== PageEnum.BASE_HOME
32 30 ) {
33   - console.log(userStore.getUserInfo.homePath);
34 31 next(userStore.getUserInfo.homePath);
35 32 return;
36 33 }
... ...
... ... @@ -13,27 +13,23 @@
13 13 <img src="/src/assets/images/tip.png" style="width: 1.125rem; height: 1.125rem" />
14 14 </div>
15 15 <div> 设备数(个) </div>
16   - <div class="flex mt-2" style="font-size: 0.75rem">
17   - <div class="flex mr-1" style="align-items: center"
  16 + <div class="mt-2" style="font-size: 0.75rem">
  17 + <div class="flex" style="align-items: center"
18 18 ><img
19 19 src="/src/assets/images/online.png"
20 20 class="mr-1"
21 21 style="width: 0.625rem; height: 0.625rem"
22 22 />
23 23 <span>在线{{ growCardList?.deviceInfo?.onLine }}</span>
24   - </div>
25   - <div class="flex mr-1" style="align-items: center">
26 24 <img
27 25 src="/src/assets/images/offline.png"
28   - class="mr-1"
  26 + class="mr-1 ml-1"
29 27 style="width: 0.625rem; height: 0.625rem"
30 28 />
31 29 <span> 离线{{ growCardList?.deviceInfo?.offLine }} </span>
32   - </div>
33   - <div class="flex mr-1" style="align-items: center">
34 30 <img
35 31 src="/src/assets/images/inactive.png"
36   - class="mr-1"
  32 + class="mr-1 ml-1"
37 33 style="width: 0.625rem; height: 0.625rem"
38 34 />
39 35 <span> 未激活{{ growCardList?.deviceInfo?.inActive }} </span>
... ... @@ -94,9 +90,10 @@
94 90 </div>
95 91 <div>
96 92 <span class="mr-2">数据点</span>
97   - <span style="color: #333; font-weight: bold">
98   - {{ toThousands(growCardList?.messageInfo?.dataPointsCount) }}</span
99   - >
  93 + <CountTo
  94 + style="color: #333; font-weight: bold"
  95 + :end-val="growCardList?.messageInfo?.dataPointsCount"
  96 + />
100 97 </div>
101 98 </div>
102 99 </div>
... ... @@ -126,7 +123,7 @@
126 123 </div>
127 124 </template>
128 125 <script lang="ts" setup>
129   - import { ref, onMounted, computed, defineComponent } from 'vue';
  126 + import { ref, onMounted, defineComponent } from 'vue';
130 127 import { Card } from 'ant-design-vue';
131 128 import { getHomeData } from '/@/api/dashboard';
132 129 import { isAdmin } from '/@/enums/roleEnum';
... ...
... ... @@ -19,7 +19,7 @@
19 19 <ListItemMeta>
20 20 <template #avatar>
21 21 <Avatar
22   - :src="item.user.avatar ?? 'https://q1.qlogo.cn/g?b=qq&nk=190848757&s=640'"
  22 + :src="item.sysNotice.avatar ?? 'https://q1.qlogo.cn/g?b=qq&nk=190848757&s=640'"
23 23 size="large"
24 24 />
25 25 </template>
... ... @@ -56,58 +56,7 @@
56 56 </div>
57 57
58 58 <Card v-else :bordered="false" :bodyStyle="{ padding: 0 }" v-bind="$attrs">
59   - <h1 style="color: rgba(0, 0, 0, 0.85); font-weight: bold; font-size: 16px" class="mb-2">
60   - 租户消息量TOP10</h1
61   - >
62 59 <Empty v-if="!tenantTop10.length" />
63   - <!-- <Descriptions :column="1">
64   - <template v-for="(item, index) in tenantTop10" :key="item.name">
65   - <DescriptionsItem>
66   - <span
67   - style="
68   - width: 1.25rem;
69   - height: 1.25rem;
70   - border: 1px solid;
71   - color: #0b55f1;
72   - border-radius: 50%;
73   - display: flex;
74   - align-items: center;
75   - justify-content: center;
76   - font-size: 13px;
77   - "
78   - :style="{
79   - color:
80   - index === 0
81   - ? '#f0a16e'
82   - : index === 1
83   - ? '#868585'
84   - : index === 2
85   - ? '#e78739'
86   - : '#4e84f5',
87   - backgroundColor:
88   - index === 0 ? '#FAD672' : index === 1 ? '#CBCAC9' : index === 2 ? '#F1B889' : '',
89   - borderColor:
90   - index === 0
91   - ? '#fdee7d'
92   - : index === 1
93   - ? '#e6e6e5'
94   - : index === 2
95   - ? '#f8c296'
96   - : '#0b55f1;',
97   - }"
98   - >{{ index + 1 }}</span
99   - >
100   - <div class="flex justify-between" style="width: 100%; margin-left: 0.625rem">
101   - <span>
102   - {{ item.name }}
103   - </span>
104   - <span :style="{ color: index === 0 ? '#EA5B42' : index === 2 ? '#E4751A' : '#666' }">
105   - {{ item.count }}
106   - </span>
107   - </div>
108   - </DescriptionsItem>
109   - </template>
110   - </Descriptions> -->
111 60 <div style="width: 100%; height: 390px" ref="top10Ref"></div>
112 61 <h1 style="color: rgba(0, 0, 0, 0.85); font-weight: bold; font-size: 16px">
113 62 本月即将过期租户</h1
... ... @@ -119,7 +68,7 @@
119 68
120 69 <script lang="ts">
121 70 import { defineComponent, ref, computed, onMounted } from 'vue';
122   - import { Card, Anchor, List, Avatar, Descriptions, Empty } from 'ant-design-vue';
  71 + import { Card, Anchor, List, Avatar, Empty } from 'ant-design-vue';
123 72 import { useUserStore } from '/@/store/modules/user';
124 73 import { getEnterPriseDetail } from '/@/api/oem';
125 74 import { notifyMyGetrPageApi } from '/@/api/stationnotification/stationnotifyApi';
... ... @@ -138,8 +87,6 @@
138 87 List,
139 88 ListItem: List.Item,
140 89 ListItemMeta: List.Item.Meta,
141   - // Descriptions,
142   - // DescriptionsItem: Descriptions.Item,
143 90 Avatar,
144 91 Time,
145 92 BasicTable,
... ... @@ -154,7 +101,6 @@
154 101 // 通知数据
155 102 const dataSource = ref([]);
156 103 const go = useGo();
157   -
158 104 const helpDoc = ref([
159 105 {
160 106 title: '如何接入设备?',
... ... @@ -173,7 +119,6 @@
173 119 href: '',
174 120 },
175 121 ]);
176   -
177 122 const activeKey = ref('tab1');
178 123 const tabListTitle = [
179 124 {
... ... @@ -232,15 +177,20 @@
232 177 const tenantCount = tenantTop10.value.map((item) => item.count);
233 178 setOptions({
234 179 xAxis: {},
  180 + title: {
  181 + text: '租户消息量TOP10',
  182 + },
235 183 yAxis: {
236 184 type: 'category',
237 185 data: tenantName,
238 186 inverse: true,
239 187 },
  188 + grid: {
  189 + containLabel: true,
  190 + left: '0%',
  191 + },
240 192 series: [
241 193 {
242   - realtimeSort: true,
243   - name: 'X',
244 194 type: 'bar',
245 195 data: tenantCount,
246 196 label: {
... ... @@ -276,18 +226,17 @@
276 226 },
277 227 });
278 228 </script>
279   -
280 229 <style scoped>
281 230 .noticeTitle:hover {
282 231 border-bottom: 1px solid #ccc;
283 232 }
284   - :deep.ant-anchor-link-active > .ant-anchor-link-title {
  233 + :deep(.ant-anchor-link-active > .ant-anchor-link-title) {
285 234 color: #666;
286 235 }
287   - :deep.ant-pagination-prev {
  236 + :deep(.ant-pagination-prev) {
288 237 display: none;
289 238 }
290   - :deep.ant-pagination-next {
  239 + :deep(.ant-pagination-next) {
291 240 display: none;
292 241 }
293 242 </style>
... ...
... ... @@ -235,6 +235,7 @@
235 235 }
236 236 state.dataPointList = newArray;
237 237 state.messageList = newArray1;
  238 + console.log(state.dataPointList, state.messageList);
238 239 }
239 240 }
240 241 },
... ...