删除监测点列表的缓存
This commit is contained in:
@@ -5,7 +5,12 @@
|
||||
<template v-slot:select>
|
||||
<el-form-item label="监测点">
|
||||
<el-select size="small" v-model="tableStore.table.params.lineId">
|
||||
<el-option v-for="item in options" :key="item.lineId" :label="item.name" :value="item.lineId" />
|
||||
<el-option
|
||||
v-for="item in lineList"
|
||||
:key="item.lineId"
|
||||
:label="item.name"
|
||||
:value="item.lineId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
@@ -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],
|
||||
@@ -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,
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型">
|
||||
<el-select style="min-width: 120px !important" placeholder="请选择" v-model="tableStore.table.params.valueType">
|
||||
<el-select
|
||||
style="min-width: 120px !important"
|
||||
placeholder="请选择"
|
||||
v-model="tableStore.table.params.valueType"
|
||||
>
|
||||
<el-option value="max" label="最大值"></el-option>
|
||||
<el-option value="min" label="最小值"></el-option>
|
||||
<el-option value="avg" label="平均值"></el-option>
|
||||
@@ -32,8 +36,8 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div v-if="shouldShowHarmonicCount()" style="display: flex;color: var(--el-text-color-regular);">
|
||||
<span style="width: 160px;">{{ getHarmonicTypeName() }}谐波次数</span>
|
||||
<div v-if="shouldShowHarmonicCount()" style="display: flex; color: var(--el-text-color-regular)">
|
||||
<span style="width: 160px">{{ getHarmonicTypeName() }}谐波次数</span>
|
||||
<el-select
|
||||
v-model="tableStore.table.params.harmonicCount"
|
||||
placeholder="请选择谐波次数"
|
||||
@@ -94,7 +98,6 @@ const showEchart = ref(true)
|
||||
|
||||
const chartsList = ref<any>([])
|
||||
|
||||
|
||||
// 计算是否全屏展示
|
||||
const fullscreen = computed(() => {
|
||||
const w = Number(prop.w)
|
||||
@@ -122,13 +125,10 @@ const indicatorList = ref()
|
||||
const initLineList = async () => {
|
||||
cslineList({}).then(res => {
|
||||
lineList.value = res.data
|
||||
if (lineList.value && lineList.value.length > 0) {
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const echartList = ref()
|
||||
|
||||
const headerHeight = ref(57)
|
||||
@@ -143,7 +143,6 @@ const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
||||
}
|
||||
|
||||
const setEchart = () => {
|
||||
|
||||
// 获取当前选择的功率和指标名称
|
||||
const powerName = powerList.value?.find((item: any) => item.id === tableStore.table.params.power)?.name || '功率'
|
||||
const indicatorName =
|
||||
@@ -395,7 +394,6 @@ watch(
|
||||
|
||||
onMounted(() => {
|
||||
initLineList().then(() => {
|
||||
// 确保 lineList 加载完成后再初始化其他数据
|
||||
initCode()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -71,7 +71,6 @@ import { queryActivatePage, queryByPagePath } from '@/api/system-boot/csstatisti
|
||||
import RoutingConfig from '@/views/pqs/cockpit/homePage/components/routingConfig.vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import {cslineList} from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
const { push } = useRouter()
|
||||
const datePickerRef = ref()
|
||||
const router = useRouter()
|
||||
@@ -247,17 +246,10 @@ const handleDatePickerChange = (value: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 监测点列表
|
||||
const initCSlineList = async () => {
|
||||
const res = await cslineList({})
|
||||
window.localStorage.setItem('lineIdList', JSON.stringify(res.data))
|
||||
}
|
||||
|
||||
// 生命周期钩子
|
||||
onMounted(() => {
|
||||
// initRowHeight()
|
||||
fetchLayoutData()
|
||||
initCSlineList()
|
||||
|
||||
// 添加窗口大小变化监听器
|
||||
window.addEventListener('resize', handleResize)
|
||||
|
||||
Reference in New Issue
Block a user