查询台站数据提供率及有效率 无数据返回是,关闭定时器,等接口有数据是在执行

台站详情弹窗中字段调整
This commit is contained in:
任珮宇 2023-10-27 14:28:05 +08:00
parent 9dd1e3969a
commit a62efa494f
2 changed files with 111 additions and 99 deletions

View File

@ -7,6 +7,10 @@ export default {
label: 'FACILITY_NAME', label: 'FACILITY_NAME',
key: 'facilityName' key: 'facilityName'
}, },
{
label: 'FACILITY ID',
key: 'facilityId'
},
{ {
label: 'ACTIVITY DAY', label: 'ACTIVITY DAY',
key: 'activityDay' key: 'activityDay'
@ -35,10 +39,6 @@ export default {
label: 'CRITICALITYDATE', label: 'CRITICALITYDATE',
key: 'criticalityDate' key: 'criticalityDate'
}, },
{
label: 'FACILITY ID',
key: 'facilityId'
},
{ {
label: 'GRIDCONEETIONDATE', label: 'GRIDCONEETIONDATE',
key: 'gridconeetionDate' key: 'gridconeetionDate'
@ -83,6 +83,9 @@ export default {
[MarkerType.ImsRnStationP]: [{ [MarkerType.ImsRnStationP]: [{
label: 'STATIONCODE', label: 'STATIONCODE',
key: 'stationCode' key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, { }, {
label: 'COUNTRYCODE', label: 'COUNTRYCODE',
key: 'countryCode' key: 'countryCode'
@ -107,9 +110,6 @@ export default {
}, { }, {
label: 'MODDATE', label: 'MODDATE',
key: 'moddate' key: 'moddate'
}, {
label: 'STATIONID',
key: 'stationId'
}, { }, {
label: 'STATUS', label: 'STATUS',
key: 'status' key: 'status'
@ -138,6 +138,9 @@ export default {
[MarkerType.ImsRnStationG]: [{ [MarkerType.ImsRnStationG]: [{
label: 'STATIONCODE', label: 'STATIONCODE',
key: 'stationCode' key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, { }, {
label: 'COUNTRYCODE', label: 'COUNTRYCODE',
key: 'countryCode' key: 'countryCode'
@ -162,9 +165,6 @@ export default {
}, { }, {
label: 'MODDATE', label: 'MODDATE',
key: 'moddate' key: 'moddate'
}, {
label: 'STATIONID',
key: 'stationId'
}, { }, {
label: 'STATUS', label: 'STATUS',
key: 'status' key: 'status'
@ -193,6 +193,9 @@ export default {
[MarkerType.NRL]: [{ [MarkerType.NRL]: [{
label: 'STATIONCODE', label: 'STATIONCODE',
key: 'stationCode' key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, { }, {
label: 'COUNTRYCODE', label: 'COUNTRYCODE',
key: 'countryCode' key: 'countryCode'
@ -217,9 +220,6 @@ export default {
}, { }, {
label: 'MODDATE', label: 'MODDATE',
key: 'moddate' key: 'moddate'
}, {
label: 'STATIONID',
key: 'stationId'
}, { }, {
label: 'STATUS', label: 'STATUS',
key: 'status' key: 'status'

View File

@ -38,7 +38,7 @@
:scrollContainer="getScrollContainer" :scrollContainer="getScrollContainer"
class="data-list has-search" class="data-list has-search"
:class="{ :class="{
'show-search': searchPlacementVisible 'show-search': searchPlacementVisible,
}" }"
> >
<div class="search-filter-placement"> <div class="search-filter-placement">
@ -171,27 +171,27 @@ import DataListItem from './components/DataListItem.vue'
import ScrollContainer from '@/components/ScrollContainer/index.vue' import ScrollContainer from '@/components/ScrollContainer/index.vue'
import { getAction } from '../../api/manage' import { getAction } from '../../api/manage'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
const key= "updateList" const key = 'updateList'
export default { export default {
components: { components: {
Map, Map,
MapMarker, MapMarker,
MapPane, MapPane,
ScrollContainer, ScrollContainer,
DataListItem DataListItem,
}, },
watch: { watch: {
"$route": { $route: {
handler:function(val,oldVal) { handler: function (val, oldVal) {
if (val.name!=="station-operation") { if (val.name !== 'station-operation') {
this.$message.destroy() this.$message.destroy()
clearInterval(this.timer); clearInterval(this.timer)
this.timer = null this.timer = null
} }
}, },
deep:true, deep: true,
immediate:true immediate: true,
} },
}, },
data() { data() {
return { return {
@ -216,7 +216,7 @@ export default {
filter: { filter: {
searchText: undefined, searchText: undefined,
status: undefined, status: undefined,
type: undefined type: undefined,
}, },
filterVisible: false, // filterVisible: false, //
@ -226,7 +226,7 @@ export default {
treeData: [], // treeData: [], //
timer: null, timer: null,
updataFilterType: [] updataFilterType: [],
} }
}, },
created() { created() {
@ -235,8 +235,8 @@ export default {
this.getStationTypeList() this.getStationTypeList()
this.getStationTree() this.getStationTree()
}, },
beforeDestroy () { beforeDestroy() {
clearInterval(this.timer); clearInterval(this.timer)
this.timer = null this.timer = null
}, },
methods: { methods: {
@ -249,12 +249,12 @@ export default {
this.dataList = cloneDeep(res) this.dataList = cloneDeep(res)
this.markerList = cloneDeep(res) this.markerList = cloneDeep(res)
this.markerList_clone = cloneDeep(res) this.markerList_clone = cloneDeep(res)
this.getDataProvisionEfficiency(this.markerList_clone,"one") this.getDataProvisionEfficiency(this.markerList_clone, 'one')
this.timer = setInterval(() => { // this.timer = setInterval(() => {
setTimeout(() => { // setTimeout(() => {
this.getDataProvisionEfficiency(this.markerList_clone) // this.getDataProvisionEfficiency(this.markerList_clone)
}, 0); // }, 0);
}, 15000); // }, 15000);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.scrollContainerRef.checkScrollEnd() this.$refs.scrollContainerRef.checkScrollEnd()
}) })
@ -267,51 +267,62 @@ export default {
// //
async getDataProvisionEfficiency(arr, str) { async getDataProvisionEfficiency(arr, str) {
if (str && this.$route.path=="/station-operation") { if (str && this.$route.path == '/station-operation') {
this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 }) this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 })
} }
getAction('/stationOperation/getDataProvisionEfficiency').then(res => { getAction('/stationOperation/getDataProvisionEfficiency')
if (res.success) { .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() this.$message.destroy()
if (str && this.$route.path == "/station-operation") { console.error(error)
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)
})
}, },
// //
@ -338,7 +349,7 @@ export default {
async getStationTypeList() { async getStationTypeList() {
try { try {
const res = await getAction('/jeecg-station-operation/stationOperation/findStationType') 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) { } catch (error) {
console.error(error) console.error(error)
} }
@ -349,10 +360,10 @@ export default {
try { try {
const { success, result, message } = await getAction('/stationOperation/findTree') const { success, result, message } = await getAction('/stationOperation/findTree')
if (success) { if (success) {
result.forEach(item => { result.forEach((item) => {
item.stationCode = item.code item.stationCode = item.code
item.stationId = `root_${item.stationId}` item.stationId = `root_${item.stationId}`
item.children.forEach(child => { item.children.forEach((child) => {
child.stationCode = child.code child.stationCode = child.code
child.stationId = `${item.stationId}_parent_${child.stationId}` child.stationId = `${item.stationId}_parent_${child.stationId}`
}) })
@ -398,7 +409,7 @@ export default {
// All Data // All Data
onFilterChange() { onFilterChange() {
this.dataList = this.originalDataList.filter(dataItem => { this.dataList = this.originalDataList.filter((dataItem) => {
const filterSearchText = const filterSearchText =
!this.filter.searchText || !this.filter.searchText ||
-1 !== dataItem.stationName.toLowerCase().indexOf(this.filter.searchText.toLowerCase()) -1 !== dataItem.stationName.toLowerCase().indexOf(this.filter.searchText.toLowerCase())
@ -415,7 +426,8 @@ export default {
// //
locateFacility(stationItem) { locateFacility(stationItem) {
const find = this.markerList.find( 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) { if (!find) {
// //
@ -427,7 +439,7 @@ export default {
setTimeout(() => { setTimeout(() => {
// panTo // panTo
const overlays = this.$refs.mapRef.map.getOverlays() 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() const innerEle = currOverlay.getElement()
innerEle.classList.add('ani-bounding') innerEle.classList.add('ani-bounding')
@ -445,10 +457,10 @@ export default {
onChangeMarker(markerList) { onChangeMarker(markerList) {
this.markerList = markerList this.markerList = markerList
let curList = [] let curList = []
if (markerList.length>0) { if (markerList.length > 0) {
markerList.forEach(item => { markerList.forEach((item) => {
if (item.stationType!="Nuclear Facility" && item.stationType!="NRL") { if (item.stationType != 'Nuclear Facility' && item.stationType != 'NRL') {
this.orgStationList.forEach(el => { this.orgStationList.forEach((el) => {
if (parseInt(el.id) == item.stationId) { if (parseInt(el.id) == item.stationId) {
el.stationType = item.stationType el.stationType = item.stationType
el.stationId = item.stationId el.stationId = item.stationId
@ -457,9 +469,9 @@ export default {
}) })
} }
}) })
this.upDateStationList=curList this.upDateStationList = curList
} else { } else {
this.upDateStationList=[] this.upDateStationList = []
} }
}, },
@ -480,8 +492,8 @@ export default {
filterType, filterType,
filterDataQuality filterDataQuality
) )
this.markerList = this.originalDataList.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)) this.upDateStationList = this.orgStationList.filter((item) => filterType.includes(item.stationType))
}, },
// //
@ -495,8 +507,8 @@ export default {
getDictSelectTagContainer() { getDictSelectTagContainer() {
return document.body return document.body
} },
} },
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>