修改拓扑获取数据

This commit is contained in:
Shang Chen
2025-07-08 20:56:19 +08:00
parent a6e38185b5
commit cae0e7e2a4
2 changed files with 48 additions and 23 deletions

View File

@ -254,7 +254,7 @@
</div> </div>
</div> </div>
<dispositionPointDialog <DispositionPointData
is-topology is-topology
:show-div-location="true" :show-div-location="true"
:max-length="12" :max-length="12"
@ -350,12 +350,7 @@ export default {
} }
}, },
created() { created() {
if (this.$store.getters.menuList.length) {
this.permissionId = this.$store.getters.menuList.find((item) => {
return item.url === this.$route.path
}).id
}
this.queryDynamicConfigTitle()
}, },
methods: { methods: {
commandKey(item) { commandKey(item) {
@ -444,6 +439,12 @@ export default {
this.getPcsData() this.getPcsData()
}, },
async getPcsData() { async getPcsData() {
if (this.$store.getters.menuList.length) {
this.permissionId = this.$store.getters.menuList.find((item) => {
return item.url === this.$route.path
}).id
}
this.queryDynamicConfigTitle()
this.loading = true this.loading = true
try { try {
const res = await DynamicConfigPoint({ const res = await DynamicConfigPoint({
@ -524,8 +525,6 @@ export default {
}, },
getPcsDataValue(item, index) { getPcsDataValue(item, index) {
const dataKey = `pcsData_${item}` const dataKey = `pcsData_${item}`
console.log(this[dataKey], dataKey)
return this[dataKey] && this[dataKey].length > index ? this[dataKey][index].value : '' return this[dataKey] && this[dataKey].length > index ? this[dataKey][index].value : ''
} }
} }

View File

@ -14,7 +14,7 @@
</el-col> </el-col>
</el-row> </el-row>
<dispostionDialog :visible="show_dispostion" page-location="runChart" @close="close" @getData="getDynamicData" /> <DispositionChartData :visible="show_dispostion" page-location="runChart" @close="close" @getData="getDynamicData" />
<!-- <el-dialog <!-- <el-dialog
:append-to-body="true" title="站点拓扑" :visible.sync="dialogVisible" width="90%" top="40px" center :close-on-click-modal="false"> :append-to-body="true" title="站点拓扑" :visible.sync="dialogVisible" width="90%" top="40px" center :close-on-click-modal="false">
@ -42,7 +42,8 @@ export default {
stationId: null, stationId: null,
interval: null, interval: null,
show_dispostion: false, show_dispostion: false,
dialogVisible: false dialogVisible: false,
permissionId: null
} }
}, },
computed: { computed: {
@ -67,24 +68,41 @@ export default {
self.interval = null self.interval = null
} }
this.stationId = val.id this.stationId = val.id
this.$nextTick(() => { const timer = setInterval(() => {
this.getAllData() if (self.$store.getters.menuList.length) {
self.interval = setInterval(() => { self.getPermissionId()
this.getAllData() if (this.permissionId) {
}, 30000) clearInterval(timer)
}) }
}
}, 500)
} }
}, },
deep: true, deep: true,
immediate: true immediate: true
}, },
language: { permissionId: {
handler() { handler(val) {
this.$refs.leftBottom.getData() if (val && this.permissionId) {
setTimeout(() => {
this.getAllData()
}, 100)
this.interval = setInterval(() => {
this.getAllData()
}, 1000 * 60 * 2)
} }
}, },
deep: true deep: true
}, },
language: {
handler() {
this.$refs.leftBottom.getData()
},
deep: true
}
},
created() { created() {
@ -97,6 +115,11 @@ export default {
}, },
methods: { methods: {
getPermissionId() {
this.permissionId = this.$store.getters.menuList.find(item => {
return item.url === this.$route.path
})?.id
},
toScale() { toScale() {
this.dialogVisible = true this.dialogVisible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -123,10 +146,13 @@ export default {
this.$refs.topRight.show_point_dispostion = true this.$refs.topRight.show_point_dispostion = true
}, },
getAllData() { getAllData() {
setTimeout(() => {
this.getPermissionId()
this.$refs.leftTop.getData() this.$refs.leftTop.getData()
this.$refs.leftBottom.getData() this.$refs.leftBottom.getData()
this.$refs.topRight.getData() this.$refs.topRight.getData()
// this.$refs.bottomRight.getData() // this.$refs.bottomRight.getData()
}, 800)
} }
} }
} }