From e603ba9f8ce4820bda2c2d2ff517d854f59f9cb6 Mon Sep 17 00:00:00 2001 From: stt Date: Mon, 24 Nov 2025 15:12:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9B=91=E6=B5=8B=E7=82=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cockpit/indicatorDistribution/index.vue | 41 ++++++++++++------- .../listOfMainMonitoringPoints/index.vue | 22 +++++----- src/views/pqs/cockpit/homePage/index.vue | 8 ---- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/components/cockpit/indicatorDistribution/index.vue b/src/components/cockpit/indicatorDistribution/index.vue index 5dc9f67..222171a 100644 --- a/src/components/cockpit/indicatorDistribution/index.vue +++ b/src/components/cockpit/indicatorDistribution/index.vue @@ -5,7 +5,12 @@ @@ -35,9 +40,7 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue' import TableStore from '@/utils/tableStore' import TableHeader from '@/components/table/header/index.vue' import MyEchart from '@/components/echarts/MyEchart.vue' -import { useRoute } from 'vue-router' -import { useTimeCacheStore } from '@/stores/timeCache' -import { limitProbabilityData } from '@/api/harmonic-boot/cockpit/cockpit' +import { limitProbabilityData, cslineList } from '@/api/harmonic-boot/cockpit/cockpit' const prop = defineProps({ w: { type: [String, Number] }, @@ -48,13 +51,12 @@ const prop = defineProps({ timeValue: { type: Object } }) -const options = ref(JSON.parse(window.localStorage.getItem('lineIdList') || '[]')) +// const options = ref(JSON.parse(window.localStorage.getItem('lineIdList') || '[]')) + +const lineList = ref() const headerHeight = ref(57) -const route = useRoute() -const timeCacheStore = useTimeCacheStore() - const selectChange = (showSelect: any, height: any, datePickerValue?: any) => { headerHeight.value = height @@ -77,17 +79,25 @@ const fullscreen = computed(() => { } }) - const echartList = ref() const echartList1 = ref() const probabilityData = ref() +const initLineList = async () => { + cslineList({}).then(res => { + lineList.value = res.data + tableStore.table.params.lineId = lineList.value[0].lineId + tableStore.index() + }) +} + // 越限程度概率分布 const initProbabilityData = () => { - if (!tableStore.table.params.lineId && options.value?.length > 0) { - tableStore.table.params.lineId = options.value[0].lineId + // 只有当 lineList 已加载且有数据时才设置默认 lineId + if (!tableStore.table.params.lineId && lineList.value && lineList.value.length > 0) { + tableStore.table.params.lineId = lineList.value[0].lineId } const params = { searchBeginTime: tableStore.table.params.searchBeginTime || prop.timeValue?.[0], @@ -164,7 +174,7 @@ const initProbabilityData = () => { show: false, // 设置为 false 隐藏右侧颜色条 min: 0, // max: 100, - max: zAxisMax, // 使用计算出的最大值加5 + max: zAxisMax, // 使用计算出的最大值加5 inRange: { color: ['#313695', '#00BB00', '#ff8000', '#d73027', '#a50026'] } @@ -394,8 +404,9 @@ const tableStore: any = new TableStore({ beforeSearchFun: () => { tableStore.table.params.searchBeginTime = tableStore.table.params.searchBeginTime || prop.timeValue?.[0] tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1] - if (!tableStore.table.params.lineId && options.value?.length > 0) { - tableStore.table.params.lineId = options.value[0].lineId + // 只有当 lineList 已加载且有数据时才设置默认 lineId + if (!tableStore.table.params.lineId && lineList.value && lineList.value.length > 0) { + tableStore.table.params.lineId = lineList.value[0].lineId } }, loadCallback: () => { @@ -441,7 +452,7 @@ const tableStore: any = new TableStore({ provide('tableStore', tableStore) onMounted(() => { - tableStore.index() + initLineList() }) watch( () => prop.timeKey, diff --git a/src/components/cockpit/listOfMainMonitoringPoints/index.vue b/src/components/cockpit/listOfMainMonitoringPoints/index.vue index 14451c5..956ab8f 100644 --- a/src/components/cockpit/listOfMainMonitoringPoints/index.vue +++ b/src/components/cockpit/listOfMainMonitoringPoints/index.vue @@ -1,7 +1,7 @@