diff --git a/src/assets/images/station-operation/data-item-bg-active.png b/src/assets/images/station-operation/data-item-bg-active.png new file mode 100644 index 0000000..15652ea Binary files /dev/null and b/src/assets/images/station-operation/data-item-bg-active.png differ diff --git a/src/views/stationOperation/components/DataListItem.vue b/src/views/stationOperation/components/DataListItem.vue index b065b2d..6c54acc 100644 --- a/src/views/stationOperation/components/DataListItem.vue +++ b/src/views/stationOperation/components/DataListItem.vue @@ -4,7 +4,7 @@ {{ item.stationName || item.stationCode }}
-
+
@@ -42,9 +42,9 @@ export default { props: { item: { - type: Object - } - } + type: Object, + }, + }, } @@ -85,6 +85,10 @@ export default { flex-direction: column; justify-content: space-between; + &.active { + background-image: url(~@/assets/images/station-operation/data-item-bg-active.png); + } + .data-list-item-children { display: flex; justify-content: space-between; diff --git a/src/views/stationOperation/components/MapPane.vue b/src/views/stationOperation/components/MapPane.vue index 584b094..3085a9d 100644 --- a/src/views/stationOperation/components/MapPane.vue +++ b/src/views/stationOperation/components/MapPane.vue @@ -189,7 +189,7 @@
- + day @@ -268,15 +268,11 @@ import CustomModal from '@/components/CustomModal/index.vue' import CustomTree from '@/components/CustomTree/index.vue' import RealTimeDataChart from './RealTimeDataChart.vue' -import { getAction, postAction } from '../../../api/manage' +import { deleteAction, getAction, postAction } from '../../../api/manage' import { MarkerType, FilterIcon } from './markerEnum' import { Vector as VectorLayer } from 'ol/layer' import VectorSource from 'ol/source/Vector' -import { Circle } from 'ol/geom' -import { fromLonLat } from 'ol/proj' -import Feature from 'ol/Feature' -import { Fill, Stroke, Style } from 'ol/style' import { cloneDeep } from 'lodash' // Filter中的筛选列表 @@ -455,8 +451,6 @@ export default { this.initParentMapProps() document.addEventListener('fullscreenchange', this.onFullScreenChange) this.stationList = [] - - this.getDataRecieveSettings() }, destroyed() { document.removeEventListener('fullscreenchange', this.onFullScreenChange) @@ -739,7 +733,16 @@ export default { userId: this.$store.getters.userInfo.id, }) if (success) { + const { cacheTime, scaleInterval, timelineLength, updateIntervalTime, sysUserFocusStations } = result this.initialDataRecieveSettings = result + + this.dataRecieveStatusModel = { + cacheTime, + scaleInterval, + timelineLength, + updateIntervalTime, + } + this.dataStatusCheckedKeys = sysUserFocusStations.map((item) => parseInt(item.stationId)) } else { this.$message.error(message) } @@ -771,6 +774,7 @@ export default { const { success, result, message } = await getAction('/stationOperation/getDataReceivingStatus', { userId: this.$store.getters.userInfo.id, oneStationId: (this.stationInfo && this.stationInfo.stationId) || '', + cacheTime: this.initialDataRecieveSettings.cacheTime, }) this.maskVisi = false this.spinLoading = false @@ -804,24 +808,32 @@ export default { } }, + // 清理接收状态配置缓存 + async clearDataRecieveSetting() { + const { success, message } = await deleteAction('/sysUserFocusStation/deleteUserCache', { + userId: this.$store.getters.userInfo.id, + }) + if (!success) { + throw new Error(message) + } + }, + handleResize() { this.$refs.realtimeChartRef.resize() }, }, watch: { - dataStatusModalVisible(val) { + async dataStatusModalVisible(val) { if (val) { - this.dataStatusCheckedKeys = this.initialDataRecieveSettings.sysUserFocusStations.map((item) => - parseInt(item.stationId) - ) - this.dataRecieveStatusModel = { - cacheTime: this.initialDataRecieveSettings.cacheTime, - scaleInterval: this.initialDataRecieveSettings.scaleInterval, - timelineLength: this.initialDataRecieveSettings.timelineLength, - updateIntervalTime: this.initialDataRecieveSettings.updateIntervalTime, + try { + this.spinLoading = true + await this.clearDataRecieveSetting() + await this.getDataRecieveSettings() + this.startGetDataReceiveStatusList() + } catch (error) { + this.$message.error(error) + this.spinLoading = false } - - this.startGetDataReceiveStatusList() } else { clearInterval(this.timer) }