Commit fa6ab1882a845b7484122e383702cffe747f3fe3

Authored by sqy
1 parent 828168a7

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

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