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 | 298 | name: o === 'directConnection' ? '直连设备' : o === 'gateWay' ? '网关设备' : '网关子设备', |
| 299 | 299 | itemStyle: |
| 300 | 300 | o === 'directConnection' |
| 301 | - ? { color: '#5AEEED' } | |
| 301 | + ? { color: '#5C7BD9' } | |
| 302 | 302 | : o === 'gateWay' |
| 303 | - ? { color: '#0B55F1' } | |
| 304 | - : { color: '#00C678' }, | |
| 303 | + ? { color: '#91CC75' } | |
| 304 | + : { color: '#FAC859' }, | |
| 305 | 305 | }); |
| 306 | 306 | } |
| 307 | 307 | if (o === 'inActive' || o === 'onLine' || o === 'offLine') { |
| ... | ... | @@ -311,10 +311,10 @@ |
| 311 | 311 | name: o === 'inActive' ? '待激活' : o === 'onLine' ? '在线' : '离线', |
| 312 | 312 | itemStyle: |
| 313 | 313 | o === 'inActive' |
| 314 | - ? { color: '#F9C900' } | |
| 314 | + ? { color: '#5C7BD9' } | |
| 315 | 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 | 158 | const { send, close } = useWebSocket(state.server, { |
| 159 | 159 | async onConnected() { |
| 160 | 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 | 164 | entityId = content; |
| 163 | 165 | const sendValue = JSON.stringify({ |
| 164 | 166 | entityDataCmds: [ | ... | ... |
| ... | ... | @@ -157,7 +157,9 @@ |
| 157 | 157 | const { send, close } = useWebSocket(state.server, { |
| 158 | 158 | async onConnected() { |
| 159 | 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 | 163 | entityId = content; |
| 162 | 164 | const sendValue = JSON.stringify({ |
| 163 | 165 | entityDataCmds: [ | ... | ... |
| ... | ... | @@ -49,8 +49,11 @@ |
| 49 | 49 | const entityId = ref({}); |
| 50 | 50 | |
| 51 | 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 | 59 | </script> | ... | ... |