2025-10-20 13:25:30 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<!--主要监测点列表 -->
|
2025-11-12 09:51:28 +08:00
|
|
|
<TableHeader :showReset="false" @selectChange="selectChange" v-if="fullscreen" datePicker ref="tableHeaderRef">
|
2025-10-20 13:25:30 +08:00
|
|
|
<template v-slot:select>
|
|
|
|
|
<el-form-item label="关键词">
|
2025-11-10 14:47:18 +08:00
|
|
|
<el-input v-model="tableStore.table.params.keywords" clearable placeholder="请输关键字" />
|
2025-10-20 13:25:30 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</TableHeader>
|
2025-11-06 14:24:15 +08:00
|
|
|
<Table
|
|
|
|
|
ref="tableRef"
|
|
|
|
|
@cell-click="cellClickEvent"
|
2025-11-14 09:34:39 +08:00
|
|
|
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? -58 : 56}px )`"
|
2025-11-06 14:24:15 +08:00
|
|
|
></Table>
|
2025-10-20 13:25:30 +08:00
|
|
|
<!-- 指标越限详情 -->
|
|
|
|
|
<OverLimitDetails ref="OverLimitDetailsRef" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
2025-11-12 09:51:28 +08:00
|
|
|
import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
2025-10-20 13:25:30 +08:00
|
|
|
import TableStore from '@/utils/tableStore'
|
|
|
|
|
import Table from '@/components/table/index.vue'
|
|
|
|
|
import TableHeader from '@/components/table/header/index.vue'
|
2025-12-03 16:30:42 +08:00
|
|
|
import { getTime } from '@/utils/formatTime'
|
2025-11-10 14:47:18 +08:00
|
|
|
import OverLimitDetails from '@/components/cockpit/indicatorFittingChart/components/overLimitDetails.vue'
|
2025-11-06 14:24:15 +08:00
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
import { useTimeCacheStore } from '@/stores/timeCache'
|
|
|
|
|
|
2025-10-20 13:25:30 +08:00
|
|
|
const prop = defineProps({
|
2025-11-14 09:51:18 +08:00
|
|
|
w: { type: [String, Number] },
|
2025-11-14 13:24:21 +08:00
|
|
|
h: { type: [String, Number] },
|
|
|
|
|
width: { type: [String, Number] },
|
|
|
|
|
height: { type: [String, Number] },
|
|
|
|
|
timeKey: { type: [String, Number] },
|
2025-12-03 16:30:42 +08:00
|
|
|
timeValue: { type: Object },
|
|
|
|
|
interval: { type: Number }
|
2025-10-20 13:25:30 +08:00
|
|
|
})
|
|
|
|
|
const OverLimitDetailsRef = ref()
|
2025-11-05 14:45:56 +08:00
|
|
|
const headerHeight = ref(57)
|
2025-11-06 14:24:15 +08:00
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const timeCacheStore = useTimeCacheStore()
|
|
|
|
|
|
2025-11-12 09:51:28 +08:00
|
|
|
const tableHeaderRef = ref()
|
2025-11-05 14:45:56 +08:00
|
|
|
|
|
|
|
|
// 计算是否全屏展示
|
|
|
|
|
const fullscreen = computed(() => {
|
|
|
|
|
const w = Number(prop.w)
|
|
|
|
|
const h = Number(prop.h)
|
|
|
|
|
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
|
|
|
|
// 执行相应逻辑
|
|
|
|
|
return true
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-11-06 14:24:15 +08:00
|
|
|
|
2025-11-12 09:51:28 +08:00
|
|
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
|
|
|
|
headerHeight.value = height
|
|
|
|
|
|
2025-11-14 13:24:21 +08:00
|
|
|
if (datePickerValue && datePickerValue.timeValue) {
|
|
|
|
|
// 更新时间参数
|
|
|
|
|
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
|
|
|
|
tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
|
|
|
|
}
|
2025-11-12 09:51:28 +08:00
|
|
|
}
|
2025-11-06 14:24:15 +08:00
|
|
|
|
2025-10-20 13:25:30 +08:00
|
|
|
const tableStore: any = new TableStore({
|
2025-12-01 09:33:12 +08:00
|
|
|
url: '/cs-harmonic-boot/mainLine/list',
|
2025-10-20 13:25:30 +08:00
|
|
|
method: 'POST',
|
2025-11-12 09:51:28 +08:00
|
|
|
showPage: fullscreen.value ? true : false,
|
2025-10-20 13:25:30 +08:00
|
|
|
exportName: '主要监测点列表',
|
|
|
|
|
column: [
|
|
|
|
|
{
|
|
|
|
|
field: 'index',
|
|
|
|
|
title: '序号',
|
2025-10-21 16:11:00 +08:00
|
|
|
width: '80',
|
2025-10-20 13:25:30 +08:00
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '监测点名称',
|
2025-11-10 14:47:18 +08:00
|
|
|
field: 'lineName',
|
2025-10-20 13:25:30 +08:00
|
|
|
minWidth: '90',
|
|
|
|
|
render: 'customTemplate',
|
|
|
|
|
customTemplate: (row: any) => {
|
2025-11-10 14:47:18 +08:00
|
|
|
return `<span style='cursor: pointer;text-decoration: underline;'>${row.lineName}</span>`
|
2025-10-20 13:25:30 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: '监测对象类型',
|
2025-11-10 14:47:18 +08:00
|
|
|
field: 'objType',
|
2025-10-20 13:25:30 +08:00
|
|
|
minWidth: '90'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '是否治理',
|
2025-11-10 14:47:18 +08:00
|
|
|
field: 'govern',
|
2025-10-20 13:25:30 +08:00
|
|
|
minWidth: '70'
|
|
|
|
|
},
|
|
|
|
|
|
2025-11-12 09:51:28 +08:00
|
|
|
{ title: '主要存在的电能质量问题', field: 'problems', minWidth: '150', showOverflow: true }
|
2025-10-20 13:25:30 +08:00
|
|
|
],
|
|
|
|
|
beforeSearchFun: () => {
|
2025-12-03 16:30:42 +08:00
|
|
|
// tableStore.table.params.searchBeginTime = tableStore.table.params.searchBeginTime || prop.timeValue?.[0]
|
|
|
|
|
// tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
|
|
|
|
|
|
|
|
|
const time = getTime(prop.interval ?? 0, prop.timeKey, prop.timeValue)
|
|
|
|
|
tableStore.table.params.searchBeginTime = time[0]
|
|
|
|
|
tableStore.table.params.searchEndTime = time[1]
|
2025-10-20 13:25:30 +08:00
|
|
|
},
|
|
|
|
|
loadCallback: () => {
|
|
|
|
|
tableStore.table.height = `calc(${prop.height} - 80px)`
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
provide('tableRef', tableRef)
|
2025-11-10 14:47:18 +08:00
|
|
|
tableStore.table.params.keywords = ''
|
2025-10-20 13:25:30 +08:00
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
|
|
|
|
|
// 点击行
|
|
|
|
|
const cellClickEvent = ({ row, column }: any) => {
|
2025-11-10 14:47:18 +08:00
|
|
|
if (column.field == 'lineName') {
|
2025-11-12 09:51:28 +08:00
|
|
|
OverLimitDetailsRef.value.open(
|
|
|
|
|
row,
|
|
|
|
|
tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
|
|
|
|
|
tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
|
|
|
|
)
|
2025-10-20 13:25:30 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-06 14:24:15 +08:00
|
|
|
// 在组件挂载时设置缓存值到 DatePicker
|
2025-10-20 13:25:30 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
|
|
|
|
watch(
|
|
|
|
|
() => prop.timeKey,
|
|
|
|
|
val => {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
watch(
|
2025-11-14 13:42:26 +08:00
|
|
|
() => prop.timeValue,
|
2025-10-20 13:25:30 +08:00
|
|
|
(newVal, oldVal) => {
|
2025-11-14 13:42:26 +08:00
|
|
|
// 当外部时间值变化时,更新表格的时间参数
|
|
|
|
|
if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) {
|
|
|
|
|
tableStore.table.params.searchBeginTime = newVal[0]
|
|
|
|
|
tableStore.table.params.searchEndTime = newVal[1]
|
|
|
|
|
tableStore.index()
|
|
|
|
|
}
|
2025-10-20 13:25:30 +08:00
|
|
|
},
|
|
|
|
|
{
|
2025-11-14 13:42:26 +08:00
|
|
|
deep: true
|
2025-10-20 13:25:30 +08:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const addMenu = () => {}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped></style>
|