Commit 4d2427ca52540a9449c451f4e31a53372f86c3d7
Merge branch 'local_dev_ft' into 'main'
pref:优化饼图颜色 See merge request huang/yun-teng-iot-front!450
Showing
4 changed files
with
18 additions
and
11 deletions
@@ -298,10 +298,10 @@ | @@ -298,10 +298,10 @@ | ||
298 | name: o === 'directConnection' ? '直连设备' : o === 'gateWay' ? '网关设备' : '网关子设备', | 298 | name: o === 'directConnection' ? '直连设备' : o === 'gateWay' ? '网关设备' : '网关子设备', |
299 | itemStyle: | 299 | itemStyle: |
300 | o === 'directConnection' | 300 | o === 'directConnection' |
301 | - ? { color: '#5AEEED' } | 301 | + ? { color: '#5C7BD9' } |
302 | : o === 'gateWay' | 302 | : o === 'gateWay' |
303 | - ? { color: '#0B55F1' } | ||
304 | - : { color: '#00C678' }, | 303 | + ? { color: '#91CC75' } |
304 | + : { color: '#FAC859' }, | ||
305 | }); | 305 | }); |
306 | } | 306 | } |
307 | if (o === 'inActive' || o === 'onLine' || o === 'offLine') { | 307 | if (o === 'inActive' || o === 'onLine' || o === 'offLine') { |
@@ -311,10 +311,10 @@ | @@ -311,10 +311,10 @@ | ||
311 | name: o === 'inActive' ? '待激活' : o === 'onLine' ? '在线' : '离线', | 311 | name: o === 'inActive' ? '待激活' : o === 'onLine' ? '在线' : '离线', |
312 | itemStyle: | 312 | itemStyle: |
313 | o === 'inActive' | 313 | o === 'inActive' |
314 | - ? { color: '#F9C900' } | 314 | + ? { color: '#5C7BD9' } |
315 | : o === 'onLine' | 315 | : o === 'onLine' |
316 | - ? { color: '#5AEEED' } | ||
317 | - : { color: '#FF9C4A' }, | 316 | + ? { color: '#91CC75' } |
317 | + : { color: '#FAC859' }, | ||
318 | }); | 318 | }); |
319 | } | 319 | } |
320 | } | 320 | } |
@@ -158,7 +158,9 @@ | @@ -158,7 +158,9 @@ | ||
158 | const { send, close } = useWebSocket(state.server, { | 158 | const { send, close } = useWebSocket(state.server, { |
159 | async onConnected() { | 159 | async onConnected() { |
160 | if (isAdmin(props.role)) return; | 160 | if (isAdmin(props.role)) return; |
161 | - let content = JSON.parse(window.localStorage.getItem('entityId')); | 161 | + let content = |
162 | + JSON.parse(window.localStorage.getItem('entityId')) || | ||
163 | + JSON.parse(window.sessionStorage.getItem('entityId')); | ||
162 | entityId = content; | 164 | entityId = content; |
163 | const sendValue = JSON.stringify({ | 165 | const sendValue = JSON.stringify({ |
164 | entityDataCmds: [ | 166 | entityDataCmds: [ |
@@ -157,7 +157,9 @@ | @@ -157,7 +157,9 @@ | ||
157 | const { send, close } = useWebSocket(state.server, { | 157 | const { send, close } = useWebSocket(state.server, { |
158 | async onConnected() { | 158 | async onConnected() { |
159 | if (isAdmin(props.role)) return; | 159 | if (isAdmin(props.role)) return; |
160 | - let content = JSON.parse(window.localStorage.getItem('entityId')); | 160 | + let content = |
161 | + JSON.parse(window.localStorage.getItem('entityId')) || | ||
162 | + JSON.parse(window.sessionStorage.getItem('entityId')); | ||
161 | entityId = content; | 163 | entityId = content; |
162 | const sendValue = JSON.stringify({ | 164 | const sendValue = JSON.stringify({ |
163 | entityDataCmds: [ | 165 | entityDataCmds: [ |
@@ -49,8 +49,11 @@ | @@ -49,8 +49,11 @@ | ||
49 | const entityId = ref({}); | 49 | const entityId = ref({}); |
50 | 50 | ||
51 | onMounted(async () => { | 51 | onMounted(async () => { |
52 | - const res = await getEntitiesId(); | ||
53 | - entityId.value = res.data[0]?.entityId; | ||
54 | - window.localStorage.setItem('entityId', JSON.stringify(entityId.value)); | 52 | + if (role === 'TENANT_ADMIN') { |
53 | + const res = await getEntitiesId(); | ||
54 | + entityId.value = res.data[0]?.entityId; | ||
55 | + window.localStorage.setItem('entityId', JSON.stringify(entityId.value)); | ||
56 | + window.sessionStorage.setItem('entityId', JSON.stringify(entityId.value)); | ||
57 | + } | ||
55 | }); | 58 | }); |
56 | </script> | 59 | </script> |