diff --git a/src/views/stationOperation/components/markerPopupColumns.js b/src/views/stationOperation/components/markerPopupColumns.js index 690c31c..43ecce2 100644 --- a/src/views/stationOperation/components/markerPopupColumns.js +++ b/src/views/stationOperation/components/markerPopupColumns.js @@ -7,6 +7,10 @@ export default { label: 'FACILITY_NAME', key: 'facilityName' }, + { + label: 'FACILITY ID', + key: 'facilityId' + }, { label: 'ACTIVITY DAY', key: 'activityDay' @@ -35,10 +39,6 @@ export default { label: 'CRITICALITYDATE', key: 'criticalityDate' }, - { - label: 'FACILITY ID', - key: 'facilityId' - }, { label: 'GRIDCONEETIONDATE', key: 'gridconeetionDate' @@ -83,6 +83,9 @@ export default { [MarkerType.ImsRnStationP]: [{ label: 'STATIONCODE', key: 'stationCode' + }, { + label: 'STATIONID', + key: 'stationId' }, { label: 'COUNTRYCODE', key: 'countryCode' @@ -107,9 +110,6 @@ export default { }, { label: 'MODDATE', key: 'moddate' - }, { - label: 'STATIONID', - key: 'stationId' }, { label: 'STATUS', key: 'status' @@ -138,6 +138,9 @@ export default { [MarkerType.ImsRnStationG]: [{ label: 'STATIONCODE', key: 'stationCode' + }, { + label: 'STATIONID', + key: 'stationId' }, { label: 'COUNTRYCODE', key: 'countryCode' @@ -162,9 +165,6 @@ export default { }, { label: 'MODDATE', key: 'moddate' - }, { - label: 'STATIONID', - key: 'stationId' }, { label: 'STATUS', key: 'status' @@ -193,6 +193,9 @@ export default { [MarkerType.NRL]: [{ label: 'STATIONCODE', key: 'stationCode' + }, { + label: 'STATIONID', + key: 'stationId' }, { label: 'COUNTRYCODE', key: 'countryCode' @@ -217,9 +220,6 @@ export default { }, { label: 'MODDATE', key: 'moddate' - }, { - label: 'STATIONID', - key: 'stationId' }, { label: 'STATUS', key: 'status' diff --git a/src/views/stationOperation/index.vue b/src/views/stationOperation/index.vue index 798c74d..355f9d1 100644 --- a/src/views/stationOperation/index.vue +++ b/src/views/stationOperation/index.vue @@ -38,7 +38,7 @@ :scrollContainer="getScrollContainer" class="data-list has-search" :class="{ - 'show-search': searchPlacementVisible + 'show-search': searchPlacementVisible, }" >
@@ -144,13 +144,13 @@ ref="mapRef" token="AAPK2b935e8bbf564ef581ca3c6fcaa5f2a71ZH84cPqqFvyz3KplFRHP8HyAwJJkh6cnpcQ-qkWh5aiyDQsGJbsXglGx0QM2cPm" > - { - setTimeout(() => { - this.getDataProvisionEfficiency(this.markerList_clone) - }, 0); - }, 15000); + this.getDataProvisionEfficiency(this.markerList_clone, 'one') + // this.timer = setInterval(() => { + // setTimeout(() => { + // this.getDataProvisionEfficiency(this.markerList_clone) + // }, 0); + // }, 15000); this.$nextTick(() => { this.$refs.scrollContainerRef.checkScrollEnd() }) @@ -267,51 +267,62 @@ export default { // 查询台站数据提供率及有效率 async getDataProvisionEfficiency(arr, str) { - if (str && this.$route.path=="/station-operation") { - this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 }) + if (str && this.$route.path == '/station-operation') { + this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 }) } - getAction('/stationOperation/getDataProvisionEfficiency').then(res => { - if (res.success) { + getAction('/stationOperation/getDataProvisionEfficiency') + .then((res) => { + if (res.success) { + this.$message.destroy() + if (str && this.$route.path == '/station-operation') { + this.$message.success({ content: 'Loaded!', key, duration: 2 }) + } + res.result.forEach((item) => { + arr.forEach((el) => { + if ( + parseInt(item.id) == el.stationId && + el.stationType != 'Nuclear Facility' && + el.stationType != 'NRL' + ) { + item.stationType = el.stationType + item.stationId = el.stationId + } + }) + }) + this.orgStationList = res.result + if (this.updataFilterType.length > 0) { + this.upDateStationList = this.orgStationList.filter((item) => + this.updataFilterType.includes(item.stationType) + ) + } else { + this.upDateStationList = res.result + } + if (this.markerList.length > 0) { + let curList = [] + this.markerList.forEach((item) => { + if (item.stationType != 'Nuclear Facility' && item.stationType != 'NRL') { + this.orgStationList.forEach((el) => { + if (parseInt(el.id) == item.stationId) { + curList.push(el) + } + }) + } + }) + this.upDateStationList = curList + } else { + this.upDateStationList = [] + } + setTimeout(() => { + this.getDataProvisionEfficiency(this.markerList_clone) + }, 10000) + } else { + this.$message.warning('This operation fails. Contact your system administrator') + } + }) + .catch((error) => { this.$message.destroy() - if (str && this.$route.path == "/station-operation") { - this.$message.success({ content: 'Loaded!', key, duration: 2 }) - } - res.result.forEach(item => { - arr.forEach(el => { - if (parseInt(item.id) == el.stationId&&el.stationType!="Nuclear Facility"&&el.stationType!="NRL") { - item.stationType = el.stationType - item.stationId = el.stationId - } - }) - }) - this.orgStationList = res.result - if (this.updataFilterType.length>0) { - this.upDateStationList = this.orgStationList.filter(item => this.updataFilterType.includes(item.stationType)) - } else { - this.upDateStationList = res.result - } - if (this.markerList.length > 0) { - let curList = [] - this.markerList.forEach(item => { - if (item.stationType!="Nuclear Facility" && item.stationType!="NRL") { - this.orgStationList.forEach(el => { - if (parseInt(el.id) == item.stationId) { - curList.push(el) - } - }) - } - }) - this.upDateStationList=curList - } else { - this.upDateStationList=[] - } - } else { - this.$message.warning("This operation fails. Contact your system administrator") - } - }).catch(error => { - this.$message.destroy() - console.error(error) - }) + console.error(error) + }) }, // 获取已关注站点列表 @@ -338,7 +349,7 @@ export default { async getStationTypeList() { try { const res = await getAction('/jeecg-station-operation/stationOperation/findStationType') - this.stationTypeList = res.filter(item => item).map(item => ({ label: item, value: item })) + this.stationTypeList = res.filter((item) => item).map((item) => ({ label: item, value: item })) } catch (error) { console.error(error) } @@ -349,10 +360,10 @@ export default { try { const { success, result, message } = await getAction('/stationOperation/findTree') if (success) { - result.forEach(item => { + result.forEach((item) => { item.stationCode = item.code item.stationId = `root_${item.stationId}` - item.children.forEach(child => { + item.children.forEach((child) => { child.stationCode = child.code child.stationId = `${item.stationId}_parent_${child.stationId}` }) @@ -398,7 +409,7 @@ export default { // 左侧 All Data 筛选 onFilterChange() { - this.dataList = this.originalDataList.filter(dataItem => { + this.dataList = this.originalDataList.filter((dataItem) => { const filterSearchText = !this.filter.searchText || -1 !== dataItem.stationName.toLowerCase().indexOf(this.filter.searchText.toLowerCase()) @@ -415,7 +426,8 @@ export default { // 定位台站 locateFacility(stationItem) { const find = this.markerList.find( - markerItem => markerItem.stationId == stationItem.stationId && markerItem.stationType == stationItem.stationType + (markerItem) => + markerItem.stationId == stationItem.stationId && markerItem.stationType == stationItem.stationType ) if (!find) { // 如果未显示,则不定位 @@ -427,7 +439,7 @@ export default { setTimeout(() => { // 在panTo结束后执行动画 const overlays = this.$refs.mapRef.map.getOverlays() - const currOverlay = overlays.getArray().find(item => item.id == `marker_${stationType}_${stationId}`) + const currOverlay = overlays.getArray().find((item) => item.id == `marker_${stationType}_${stationId}`) const innerEle = currOverlay.getElement() innerEle.classList.add('ani-bounding') @@ -445,10 +457,10 @@ export default { onChangeMarker(markerList) { this.markerList = markerList let curList = [] - if (markerList.length>0) { - markerList.forEach(item => { - if (item.stationType!="Nuclear Facility" && item.stationType!="NRL") { - this.orgStationList.forEach(el => { + if (markerList.length > 0) { + markerList.forEach((item) => { + if (item.stationType != 'Nuclear Facility' && item.stationType != 'NRL') { + this.orgStationList.forEach((el) => { if (parseInt(el.id) == item.stationId) { el.stationType = item.stationType el.stationId = item.stationId @@ -457,9 +469,9 @@ export default { }) } }) - this.upDateStationList=curList + this.upDateStationList = curList } else { - this.upDateStationList=[] + this.upDateStationList = [] } }, @@ -480,8 +492,8 @@ export default { filterType, filterDataQuality ) - this.markerList = this.originalDataList.filter(item => filterType.includes(item.stationType)) - this.upDateStationList = this.orgStationList.filter(item => filterType.includes(item.stationType)) + this.markerList = this.originalDataList.filter((item) => filterType.includes(item.stationType)) + this.upDateStationList = this.orgStationList.filter((item) => filterType.includes(item.stationType)) }, // 地图图标点击 @@ -495,8 +507,8 @@ export default { getDictSelectTagContainer() { return document.body - } - } + }, + }, }