Compare commits

22 Commits

Author SHA1 Message Date
guanj
7e4db9d4cd 修改菜单 2025-12-17 17:41:35 +08:00
sjl
67e2fa57d0 在线设备录入校验 2025-12-17 16:47:11 +08:00
stt
ad1fc11e61 删除打印 2025-12-10 13:33:06 +08:00
stt
6824864db2 没有波形图的时候显示暂无波形 2025-12-10 13:21:48 +08:00
stt
37ed693cea 实时数据页面样式修改 2025-12-10 10:30:32 +08:00
stt
0419af8e50 指标越限程度宽度修改 2025-12-09 15:21:42 +08:00
stt
5268b93dd0 监测点管理页面 2025-12-09 14:56:33 +08:00
guanj
4e6bd55089 修改报表样式 2025-12-09 13:58:37 +08:00
stt
4e0db29ab1 复位按钮隐藏 2025-12-09 11:36:52 +08:00
stt
9b0fd76f48 修改"下一个"按钮的状态 2025-12-08 15:23:38 +08:00
stt
f92b07c555 修改"下一个"按钮的状态 2025-12-08 14:21:27 +08:00
guanj
a77db278ac 修改驾驶舱时间问题 2025-12-08 13:30:46 +08:00
stt
51a0ae49a9 zoom缩放导致echarts偏移问题 2025-12-08 11:39:39 +08:00
stt
814e9917d6 弹框显示越限和不越限,不显示数值 2025-12-08 10:55:24 +08:00
stt
21f1c41196 宽度调整 2025-12-08 10:35:31 +08:00
stt
c188446e76 样式修改 2025-12-08 10:32:11 +08:00
stt
e2a5d084a5 下拉框添加filterable属性 2025-12-08 09:42:08 +08:00
stt
4ae27a9d6d 所以下拉框加filterable属性 2025-12-08 09:31:16 +08:00
stt
7783569f91 不越限样式调整 2025-12-08 09:01:00 +08:00
stt
f1ac67070f 指标越限明显样式调整 2025-12-08 08:55:36 +08:00
stt
77a9a2adfc Merge branch 'main' of http://192.168.1.22:3000/Web/admin-govern 2025-12-08 08:54:48 +08:00
stt
accc1f30f6 暂态事件样式调整 2025-12-08 08:54:44 +08:00
46 changed files with 1191 additions and 872 deletions

View File

@@ -261,4 +261,13 @@ export function getSimpleLine() {
}
export function getLineExport(data:any) {
return request({
url: '/cs-harmonic-boot/eventReport/getLineExport',
method: 'post',
data: data,
responseType: 'blob'
})
}

View File

@@ -1,7 +1,7 @@
<template>
<div>
<!--F47曲线 -->
<TableHeader ref="TableHeaderRef" :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
<TableHeader ref="TableHeaderRef" :showReset="false" :timeKeyList="prop.timeKey" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
<el-descriptions class="mt2" direction="vertical" :column="4" border>
<el-descriptions-item align="center" label="名称">{{ data.name }}</el-descriptions-item>
<el-descriptions-item align="center" label="事件总数">{{ data.gs }}</el-descriptions-item>
@@ -22,7 +22,6 @@
<el-dialog v-model="isWaveCharts" v-if="isWaveCharts" draggable :title="dialogTitle" append-to-body width="70%">
<waveFormAnalysis
v-loading="loading"
ref="waveFormAnalysisRef"
@handleHideCharts="isWaveCharts = false"
:wp="wp"
@@ -45,7 +44,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -447,7 +446,7 @@ const handleTolerableEventClick = async (row: any) => {
nextTick(() => {
if (waveFormAnalysisRef.value) {
//waveFormAnalysisRef.value.setHeight(false, 360)
waveFormAnalysisRef.value.setHeight(999, 130, 1.6666666)
// waveFormAnalysisRef.value.setHeight(999, 130, 1.6666666)
}
})
const messageInstance = ElMessage.info(`正在加载,请稍等...`)
@@ -475,6 +474,7 @@ const handleTolerableEventClick = async (row: any) => {
})
nextTick(() => {
waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(999, 130, 1.6666666)
waveFormAnalysisRef.value && waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
})
}

View File

@@ -6,6 +6,7 @@
:showReset="false"
@selectChange="selectChange"
datePicker
:timeKeyList="prop.timeKey"
v-if="fullscreen"
></TableHeader>
<my-echart
@@ -28,7 +29,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -17,7 +17,7 @@ import { yMethod } from '@/utils/echartMethod'
const prop = defineProps({
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object }
})

View File

@@ -6,6 +6,7 @@
:showReset="false"
@selectChange="selectChange"
datePicker
:timeKeyList="prop.timeKey"
v-if="fullscreen"
></TableHeader>
<my-echart
@@ -38,7 +39,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -97,7 +98,7 @@ const tableStore: any = new TableStore({
{
title: '越限最大值',
field: 'maxValue',
minWidth: '60',
minWidth: '70',
render: 'customTemplate',
customTemplate: (row: any) => {
const extentValue =
@@ -115,7 +116,7 @@ const tableStore: any = new TableStore({
{
title: '越限程度(%)',
field: 'extent',
minWidth: '60',
minWidth: '70',
render: 'customTemplate',
customTemplate: (row: any) => {
// 保留两个小数

View File

@@ -1,15 +1,15 @@
<template>
<div>
<!--治理效果报表 -->
<TableHeader :showReset="false" ref="TableHeaderRef" datePicker @selectChange="selectChange" v-if="fullscreen">
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" ref="TableHeaderRef" datePicker @selectChange="selectChange" v-if="fullscreen">
<template v-slot:select>
<el-form-item label="报表模板">
<el-select v-model="tableStore.table.params.tempId" placeholder="请选择报表模板" clearable>
<el-select filterable v-model="tableStore.table.params.tempId" placeholder="请选择报表模板" clearable>
<el-option v-for="item in templateList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="监测对象">
<el-select v-model="tableStore.table.params.sensitiveUserId" placeholder="请选择监测对象" clearable>
<el-select filterable v-model="tableStore.table.params.sensitiveUserId" placeholder="请选择监测对象" clearable>
<el-option v-for="item in idList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
@@ -43,7 +43,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -16,6 +16,7 @@
v-model="searchForm.index"
placeholder="请选择统计指标"
@change="onIndexChange($event)"
filterable
>
<el-option
v-for="item in indexOptions"
@@ -36,6 +37,7 @@
style="min-width: 120px !important"
placeholder="请选择"
v-model="searchForm.valueType"
filterable
>
<el-option value="max" label="最大值"></el-option>
<el-option value="min" label="最小值"></el-option>
@@ -59,6 +61,7 @@
placeholder="请选择谐波次数"
style="width: 100px"
class="mr20"
filterable
>
<el-option
v-for="vv in item.countOptions"

View File

@@ -9,6 +9,7 @@
v-model="tableStore.table.params.lineId"
placeholder="请选择监测点"
style="width: 150px"
filterable
>
<el-option
v-for="item in options"
@@ -48,7 +49,7 @@ const loop50 = (key: string) => {
list.push({
title: i + '次',
field: key + i + 'Overtime',
width: '80',
width: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
@@ -86,7 +87,7 @@ const tableStore: any = new TableStore({
{
title: '闪变越限(%)',
field: 'flickerOvertime',
width: '80',
width: '90',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`

View File

@@ -5,7 +5,7 @@
:showReset="false"
ref="TableHeaderRef"
@selectChange="selectChange"
datePicker
datePicker :timeKeyList="prop.timeKey"
v-if="fullscreen"
></TableHeader>
<my-echart
@@ -41,7 +41,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -7,7 +7,7 @@
@selectChange="selectChange"
datePicker
v-if="fullscreen"
:timeKeyList="['3']"
:timeKeyList="prop.timeKey"
></TableHeader>
<el-calendar
v-model="value"
@@ -32,7 +32,7 @@
<template #content>
<span v-html="getTextForDate(data.day)"></span>
</template>
<div class="details" v-html="getTextForDate(data.day)"></div>
<div class="details" v-html="fullscreen ? getTextForDate(data.day) : '有越限'"></div>
</el-tooltip>
</div>
</template>
@@ -51,7 +51,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -1,10 +1,10 @@
<template>
<div>
<!--指标越限概率分布 -->
<TableHeader :showReset="false" ref="TableHeaderRef" @selectChange="selectChange" datePicker v-if="fullscreen">
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" ref="TableHeaderRef" @selectChange="selectChange" datePicker v-if="fullscreen">
<template v-slot:select>
<el-form-item label="监测点">
<el-select size="small" v-model="tableStore.table.params.lineId">
<el-select size="small" filterable v-model="tableStore.table.params.lineId">
<el-option
v-for="item in lineList"
:key="item.lineId"
@@ -48,7 +48,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -16,6 +16,7 @@
v-model="searchForm.index"
placeholder="请选择统计指标"
@change="onIndexChange($event)"
filterable
>
<el-option
v-for="item in indexOptions"
@@ -36,6 +37,7 @@
style="min-width: 120px !important"
placeholder="请选择"
v-model="searchForm.valueType"
filterable
>
<el-option value="max" label="最大值"></el-option>
<el-option value="min" label="最小值"></el-option>
@@ -59,6 +61,7 @@
placeholder="请选择谐波次数"
style="width: 100px"
class="mr20"
filterable
>
<el-option
v-for="vv in item.countOptions"

View File

@@ -9,6 +9,7 @@
v-model="tableStore.table.params.lineId"
placeholder="请选择监测点"
style="width: 150px"
filterable
>
<el-option
v-for="item in options"
@@ -53,7 +54,7 @@ const loop50 = (key: string) => {
list.push({
title: i + '次',
field: key + i + 'Overtime',
width: '80',
width: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
@@ -91,7 +92,7 @@ const tableStore: any = new TableStore({
{
title: '闪变越限(分钟)',
field: 'flickerOvertime',
width: '80',
width: '90',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`

View File

@@ -1,7 +1,7 @@
<template>
<div>
<!--主要监测点列表 -->
<TableHeader :showReset="false" @selectChange="selectChange" v-if="fullscreen" datePicker ref="TableHeaderRef">
<TableHeader :showReset="false" :timeKeyList="prop.timeKey" @selectChange="selectChange" v-if="fullscreen" datePicker ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="关键词">
<el-input v-model="tableStore.table.params.keywords" clearable placeholder="请输关键字" />
@@ -32,7 +32,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -6,11 +6,11 @@
@selectChange="selectChange"
v-if="fullscreen"
ref="TableHeaderRef"
:timeKeyList="['4', '5']"
:timeKeyList="prop.timeKey"
>
<template v-slot:select>
<el-form-item label="监测点">
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点" clearable>
<el-select filterable v-model="tableStore.table.params.lineId" placeholder="请选择监测点" clearable>
<el-option
v-for="item in lineList"
:key="item.lineId"
@@ -20,7 +20,12 @@
</el-select>
</el-form-item>
<el-form-item label="用户功率">
<el-select v-model="tableStore.table.params.power" placeholder="请选择用户功率" clearable>
<el-select
filterable
v-model="tableStore.table.params.power"
placeholder="请选择用户功率"
clearable
>
<el-option v-for="item in powerList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
@@ -29,6 +34,7 @@
style="min-width: 120px !important"
placeholder="请选择"
v-model="tableStore.table.params.valueType"
filterable
>
<el-option value="max" label="最大值"></el-option>
<el-option value="min" label="最小值"></el-option>
@@ -37,7 +43,12 @@
</el-select>
</el-form-item>
<el-form-item label="电能质量指标">
<el-select v-model="tableStore.table.params.indicator" placeholder="请选择电能质量指标" clearable>
<el-select
filterable
v-model="tableStore.table.params.indicator"
placeholder="请选择电能质量指标"
clearable
>
<el-option v-for="item in indicatorList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
@@ -48,6 +59,7 @@
v-model="tableStore.table.params.harmonicCount"
placeholder="请选择谐波次数"
style="min-width: 80px !important"
filterable
>
<el-option
v-for="num in harmonicCountOptions"
@@ -88,7 +100,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -156,6 +168,30 @@ const setEchart = () => {
title: {
text: `${indicatorName}${powerName}负荷曲线拟合图`
},
tooltip: {
trigger: 'axis',
formatter: function (params: any) {
let result = params[0].name
params.forEach((item: any) => {
if (item.seriesName === indicatorName) {
// 对于电能质量指标格式化Y轴值显示
let valueText = ''
if (item.value[1] == 0) {
valueText = '不越限'
} else if (item.value[1] == 1) {
valueText = '越限'
} else {
valueText = item.value[1]
}
result += `<br/>${item.marker}${item.seriesName}: ${valueText}`
} else {
// 对于功率数据,正常显示数值
result += `<br/>${item.marker}${item.seriesName}: ${item.value[1]}`
}
})
return result
}
},
xAxis: {
type: 'time',
axisLabel: {
@@ -168,11 +204,12 @@ const setEchart = () => {
},
yAxis: [
{},
indicatorName ? {
indicatorName
? {
min: 0,
max: 1,
axisLabel: {
formatter: function(value: number) {
formatter: function (value: number) {
if (value === 0) {
return '不越限'
} else if (value === 1) {
@@ -181,7 +218,8 @@ const setEchart = () => {
return value
}
}
} : {}
}
: {}
],
grid: {
left: '10px',
@@ -209,6 +247,7 @@ const setEchart = () => {
{
name: indicatorName, // 动态设置指标名称
type: 'line',
step: 'end',
showSymbol: false,
// smooth: true,
data: [],

View File

@@ -9,6 +9,7 @@
v-model="tableStore.table.params.lineId"
placeholder="请选择监测点"
style="width: 150px"
filterable
>
<el-option
v-for="item in options"
@@ -48,7 +49,7 @@ const loop50 = (key: string) => {
list.push({
title: i + '次',
field: key + i + 'Overtime',
width: '80',
width: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
@@ -86,7 +87,7 @@ const tableStore: any = new TableStore({
{
title: '闪变越限(%)',
field: 'flickerOvertime',
width: '80',
width: '90',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`

View File

@@ -6,7 +6,7 @@
:showReset="false"
@selectChange="selectChange"
datePicker
v-if="fullscreen"
v-if="fullscreen" :timeKeyList="prop.timeKey"
></TableHeader>
<Table
ref="tableRef"
@@ -59,7 +59,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -111,32 +111,6 @@ const tableStore: any = new TableStore({
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
title: '治理对象',
field: 'sensitiveUser',
minWidth: '80'
},
{
title: '电压等级',
field: 'volGrade',
minWidth: '70'
},
{
title: '是否治理',
field: 'govern',
minWidth: '70'
},
// {
// title: '治理前报告',
// field: 'reportFileName',
// minWidth: '80',
// render: 'customTemplate',
// customTemplate: (row: any) => {
// return `<span style='cursor: pointer;text-decoration: underline;'>${row.reportFileName}</span>`
// }
// },
{
title: '监测点名称',
field: 'lineName',
@@ -146,16 +120,33 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.lineName}</span>`
}
},
{ title: '监测类型', field: 'position', minWidth: '70' },
{ title: '监测类型', field: 'position', minWidth: '80' },
{
title: '监测点状态',
field: 'runStatus',
minWidth: '80',
minWidth: '90',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='color: ${row.runStatus === '中断' ? '#FF0000' : ''}'>${row.runStatus}</span>`
}
},
{
title: '治理对象',
field: 'sensitiveUser',
minWidth: '90'
},
{
title: '电压等级',
field: 'volGrade',
minWidth: '80'
},
{
title: '是否治理',
field: 'govern',
minWidth: '80'
},
{
title: '最新数据时间',
field: 'latestTime',

View File

@@ -16,6 +16,7 @@
v-model="searchForm.index"
placeholder="请选择统计指标"
@change="onIndexChange($event)"
filterable
>
<el-option
v-for="item in indexOptions"
@@ -36,6 +37,7 @@
style="min-width: 120px !important"
placeholder="请选择"
v-model="searchForm.valueType"
filterable
>
<el-option value="max" label="最大值"></el-option>
<el-option value="min" label="最小值"></el-option>
@@ -59,6 +61,7 @@
placeholder="请选择谐波次数"
style="width: 100px"
class="mr20"
filterable
>
<el-option
v-for="vv in item.countOptions"

View File

@@ -9,6 +9,7 @@
v-model="tableStore.table.params.lineId"
placeholder="请选择监测点"
style="width: 150px"
filterable
>
<el-option
v-for="item in options"
@@ -48,7 +49,7 @@ const loop50 = (key: string) => {
list.push({
title: i + '次',
field: key + i + 'Overtime',
width: '80',
width: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row[key + i + 'Overtime']}</span>`
@@ -86,7 +87,7 @@ const tableStore: any = new TableStore({
{
title: '闪变越限(%)',
field: 'flickerOvertime',
width: '80',
width: '90',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`

View File

@@ -6,7 +6,7 @@
ref="TableHeaderRef"
@selectChange="selectChange"
datePicker
v-if="fullscreen"
v-if="fullscreen" :timeKeyList="prop.timeKey"
></TableHeader>
<my-echart
class="tall"
@@ -43,7 +43,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -6,7 +6,7 @@
:showReset="false"
@selectChange="selectChange"
datePicker
v-if="fullscreen"
v-if="fullscreen" :timeKeyList="prop.timeKey"
></TableHeader>
<Table
ref="tableRef"
@@ -29,7 +29,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -132,7 +132,7 @@ const tableStore: any = new TableStore({
},
{
title: '波形',
width: '100',
minWidth: '100',
render: 'buttons',
buttons: [
{

View File

@@ -7,7 +7,7 @@
@selectChange="selectChange"
datePicker
v-if="fullscreen"
:timeKeyList="['3']"
:timeKeyList="prop.timeKey"
></TableHeader>
<el-calendar
v-model="value"
@@ -43,9 +43,15 @@
v-for="item in list?.filter((item:any) => item.name == data.day)"
@click="descentClick(item)"
>
<!-- <div>电压暂降:{{ item.eventDown || 0 }}</div>
<div>电压中断:{{ item.eventOff || 0 }}</div>
<div>电压暂升:{{ item.eventUp || 0 }}</div> -->
<template v-if="fullscreen">
<div>电压暂降:{{ item.eventDown || 0 }}</div>
<div>电压中断:{{ item.eventOff || 0 }}</div>
<div>电压暂升:{{ item.eventUp || 0 }}</div>
</template>
<template v-else>暂态事件</template>
</div>
</el-tooltip>
</div>
@@ -68,7 +74,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -1,7 +1,7 @@
<template>
<div>
<!--暂态事件概率分布 -->
<TableHeader ref="TableHeaderRef" :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
<TableHeader ref="TableHeaderRef" :timeKeyList="prop.timeKey" :showReset="false" @selectChange="selectChange" datePicker v-if="fullscreen"></TableHeader>
<my-echart
class="tall"
:options="echartList"
@@ -33,7 +33,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -5,12 +5,12 @@
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef" @selectChange="selectChange">
<template v-slot:select>
<el-form-item label="监测点">
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称">
<el-select filterable v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.lineId"
:label="item.name"
:value="item.lineId"
/>
</el-select>
</el-form-item>
@@ -58,9 +58,9 @@ const boxoList: any = ref({})
const tableHeaderRef = ref()
const options = ref()
const heightRef = ref(mainHeight(168, 2.1).height)
const heightRef = ref(mainHeight(168, 2.2).height)
const selectChange = (flag: boolean, h: any) => {
heightRef.value = mainHeight(h, 2.1).height
heightRef.value = mainHeight(h, 2.2).height
}
const getSimpleLineList = async () => {
@@ -68,7 +68,6 @@ const getSimpleLineList = async () => {
options.value = res.data
}
const tableStore: any = new TableStore({
url: '/cs-harmonic-boot/event/pageEvent',
method: 'POST',
@@ -86,27 +85,27 @@ const tableStore: any = new TableStore({
{
title: '暂态时间',
field: 'startTime',
width: '180'
minWidth: '180'
},
{
title: '测点名称',
field: 'lineName',
width: '150'
minWidth: '150'
},
{
title: '暂态类型',
field: 'tag',
width: '100'
minWidth: '100'
},
{
title: '特征幅值(%)',
field: 'amplitude',
width: '100'
minWidth: '100'
},
{
title: '暂降深度(%)',
field: 'depth',
width: '100',
minWidth: '100',
formatter: (row: any) => {
// 当暂态类型不是电压暂升时,计算暂降深度 = 100 - 特征幅值
if (row.row.tag !== '电压暂升') {
@@ -124,12 +123,12 @@ const tableStore: any = new TableStore({
{
title: '持续时间(S)',
field: 'persistTime',
width: '100'
minWidth: '100'
},
{
title: '严重度',
field: 'severity',
width: '80'
minWidth: '80'
},
{
title: '波形',
@@ -192,7 +191,7 @@ const tableStore: any = new TableStore({
icon: 'el-icon-DataLine',
render: 'basicButton',
disabled: row => {
return !(!row.wavePath && row.evtParamTm < 20)
return !!row.wavePath
}
}
]

View File

@@ -6,7 +6,7 @@
:showReset="false"
@selectChange="selectChange"
datePicker
v-if="fullscreen"
v-if="fullscreen" :timeKeyList="prop.timeKey"
></TableHeader>
<my-echart
class="tall"
@@ -41,7 +41,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -50,6 +50,7 @@ const TableHeaderRef = ref()
const headerHeight = ref(57)
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
headerHeight.value = height

View File

@@ -4,14 +4,19 @@
<TableHeader
datePicker
ref="TableHeaderRef"
:timeKeyList="['4', '5']"
:timeKeyList="prop.timeKey"
:showReset="false"
@selectChange="selectChange"
v-if="fullscreen"
>
<template v-slot:select>
<el-form-item label="监测对象">
<el-select v-model="tableStore.table.params.sensitiveUserId" placeholder="请选择监测对象" clearable>
<el-select
filterable
v-model="tableStore.table.params.sensitiveUserId"
placeholder="请选择监测对象"
clearable
>
<el-option v-for="item in idList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
@@ -93,7 +98,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -449,7 +454,6 @@ watch(
}
}
)
</script>
<style lang="scss" scoped>
// :deep(.el-select) {

View File

@@ -258,7 +258,7 @@ self.onmessage = function (e) {
boxoList.measurementPointName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.duration +
@@ -269,7 +269,7 @@ self.onmessage = function (e) {
boxoList.equipmentName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
boxoList.evtParamVVaDepth +
' 持续时间:' +
boxoList.evtParamTm +
@@ -280,7 +280,7 @@ self.onmessage = function (e) {
boxoList.lineName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.persistTime +
@@ -293,7 +293,7 @@ self.onmessage = function (e) {
boxoList.lineName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.duration +

View File

@@ -109,7 +109,7 @@ const myChartess5 = ref<echarts.ECharts | null>(null)
const vh = computed(() => {
if (props.parentHeight == 999) {
return '310px'
return `calc((60vh - 150px) / 2 )`
} else if (props.parentHeight != 0) {
return mainHeight(props.parentHeight, 2).height
}
@@ -600,7 +600,7 @@ const initWave = (
$(`#${rmsId}`).css('height', picHeight).css('width', vw.value)
}
} else {
titleText = `变电站名称:${subName.value} 监测点名称:${lineName.value} 发生时刻:${time} 残余电压${(
titleText = `变电站名称:${subName.value} 监测点名称:${lineName.value} 发生时刻:${time} 暂降(骤升)幅值${(
Number(eventValue.value) * 1
).toFixed(0)}% 持续时间:${persistTime.value}s`
}
@@ -837,7 +837,7 @@ const initWave = (
data: rmscu
},
{
name: '最小残余电压',
name: '最小暂降(骤升)幅值',
type: 'scatter',
symbol: 'image://' + url2,
itemStyle: { width: 45, height: 45 },

View File

@@ -131,7 +131,7 @@ self.addEventListener('message', function (e) {
boxoList.measurementPointName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.duration +
@@ -142,7 +142,7 @@ self.addEventListener('message', function (e) {
boxoList.equipmentName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
boxoList.evtParamVVaDepth +
' 持续时间:' +
boxoList.evtParamTm +
@@ -153,7 +153,7 @@ self.addEventListener('message', function (e) {
boxoList.lineName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.persistTime +
@@ -166,7 +166,7 @@ self.addEventListener('message', function (e) {
boxoList.lineName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压' +
' 暂降(骤升)幅值' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.duration +

View File

@@ -88,7 +88,7 @@ const myChartess5 = ref<echarts.ECharts | null>(null)
const vh = computed(() => {
if (props.parentHeight == 999) {
return '310px'
return `calc((60vh - 150px) / 2 )`
} else if (props.parentHeight != 0) {
return mainHeight(props.parentHeight, 2).height
}
@@ -334,7 +334,7 @@ const initWave = (
$(`#${waveId}`).css('height', picHeight).css('width', vw.value)
}
} else {
titleText = `变电站名称:${subName.value} 监测点名称:${lineName.value} 发生时刻:${time} 残余电压${(
titleText = `变电站名称:${subName.value} 监测点名称:${lineName.value} 发生时刻:${time} 暂降(骤升)幅值${(
Number(eventValue.value) * 1
).toFixed(0)}% 持续时间:${persistTime.value}s`
}

View File

@@ -20,6 +20,7 @@
value-format="YYYY-MM-DD"
:shortcuts="shortcuts"
/>
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
<el-button :disabled="preDisabled" type="primary" :icon="DArrowRight" @click="next"></el-button>
@@ -98,10 +99,7 @@ const filteredTimeOptions = computed(() => {
return timeOptions.value
}
return timeOptions.value.filter((option: any) =>
props.timeKeyList.includes(option.value.toString())
)
return timeOptions.value.filter((option: any) => props.timeKeyList.includes(option.value.toString()))
})
onMounted(() => {
@@ -128,9 +126,13 @@ const checkInitialButtonStatus = () => {
const endTime = timeValue.value[1]
const currentDate = window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd')
// 如果结束时间小于当前日期,则不禁用"下一个"按钮
if (new Date(endTime + ' 00:00:00').getTime() < new Date(currentDate + ' 00:00:00').getTime()) {
preDisabled.value = false
// 只有当 props.nextFlag 为 false 时才应用限制
if (!props.nextFlag) {
// 如果结束时间早于当前日期则按钮可用preDisabled = false
// 如果结束时间晚于或等于当前日期则按钮禁用preDisabled = true
const endDateTime = new Date(endTime).getTime()
const currentDateTime = new Date(currentDate).getTime()
preDisabled.value = endDateTime >= currentDateTime
}
}
}
@@ -179,30 +181,15 @@ const timeChange = (e: number) => {
timeFlag.value = 1
}
nextTick(() => {
// 检查按钮状态
checkButtonStatus()
checkInitialButtonStatus()
})
// 触发 change 事件
emitChange()
}
// 添加按钮状态检查方法
const checkButtonStatus = () => {
if (timeValue.value && timeValue.value.length >= 2) {
const endTime = timeValue.value[1]
const currentDate = window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd')
// 如果结束时间大于等于当前日期,且 nextFlag 为 false则禁用"下一个"按钮
if (!props.nextFlag) {
if (new Date(endTime + ' 00:00:00').getTime() >= new Date(currentDate + ' 00:00:00').getTime()) {
preDisabled.value = true
} else {
preDisabled.value = false
}
}
}
}
// 当前
const nowTime = () => {
// console.log(interval.value, '000000000')

View File

@@ -90,7 +90,7 @@ interface Props {
showReset?: boolean //是否显示重置
showExport?: boolean //导出控制
timeCacheFlag?: boolean //是否取缓存时间
timeKeyList?: Array<string> //日期下拉列表
timeKeyList?: string[] //日期下拉列表
}
const props = withDefaults(defineProps<Props>(), {
@@ -102,7 +102,7 @@ const props = withDefaults(defineProps<Props>(), {
showReset: true,
showExport: false,
timeCacheFlag: true,
timeKeyList: () => [] // 修改为箭头函数返回空数组
timeKeyList: () => ['1', '2', '3', '4', '5'] // 修改为箭头函数返回空数组
})
// 处理 DatePicker 值变化事件

View File

@@ -1,5 +1,5 @@
<template>
<Tree ref="treRef" :width="width" :data="tree" default-expand-all @changePointType="changePointType" @onAdd="onAdd"/>
<Tree ref="treRef" :width="width" :showPush="props.showPush" :data="tree" default-expand-all @changePointType="changePointType" @onAdd="onAdd"/>
</template>
<script lang="ts" setup>
@@ -12,9 +12,11 @@ import { useDictData } from '@/stores/dictData'
interface Props {
template?: boolean
showPush?: boolean
}
const props = withDefaults(defineProps<Props>(), {
template: false
template: false,
showPush: false
})
defineOptions({
name: 'govern/deviceTree'
@@ -95,13 +97,16 @@ const info = (selectedNodeId?: string) => {
tree.value = []
}
nextTick(() => {
if (arr1.length) {
// 安全检查 treRef 和 treeRef1 是否存在
if (treRef.value && treRef.value.treeRef1 && treRef.value.treeRef1.setCurrentKey) {
// 安全检查 treRef 和 treeRef 是否存在
console.log("🚀 ~ info ~ treRef.value && treRef.value.treeRef && treRef.value.treeRef.setCurrentKey:", treRef.value && treRef.value.treeRef1 && treRef.value.treeRef1.setCurrentKey)
if (treRef.value && treRef.value.treeRef && treRef.value.treeRef.setCurrentKey) {
// 如果传入了要选中的节点ID则选中该节点否则选中第一个节点
console.log('selectedNodeId:', selectedNodeId);
if (selectedNodeId) {
treRef.value.treeRef1.setCurrentKey(selectedNodeId);
treRef.value.treeRef.setCurrentKey(selectedNodeId);
// 查找对应的节点数据并触发事件
let selectedNode = null;
const findNode = (nodes: any[]) => {
@@ -127,7 +132,7 @@ const info = (selectedNodeId?: string) => {
}
} else {
// 初始化选中第一个节点
treRef.value.treeRef1.setCurrentKey(arr1[0].id);
treRef.value.treeRef.setCurrentKey(arr1[0].id);
emit('init', {
level: 2,
...arr1[0]

View File

@@ -124,9 +124,7 @@ getDeviceTree().then(res => {
})
return
}
console.log("🚀 ~ file: deviceTree.vue ~ line 33 ~ getDeviceTree ~ tree:", arr3.length)
if (arr3.length) {
console.log("🚀 ~ file: deviceTree.vue ~ line 33 ~ getDeviceTree ~ tree:", arr3)
treRef.value.treeRef3.setCurrentKey(arr3[0].id)
// 注册父组件事件
emit('init', {

View File

@@ -10,7 +10,7 @@
<Icon name='el-icon-Search' style='font-size: 16px' />
</template>
</el-input>
<el-tooltip placement="bottom" :hide-after="0">
<el-tooltip placement="bottom" :hide-after="0" v-if="props.showPush">
<template #content>
<span>台账推送</span>
</template>
@@ -23,7 +23,7 @@
:style="{ color: config.getColorVal('elementUiPrimary') }"
@click="onAdd" />
</el-tooltip>
<!-- <Icon @click='onMenuCollapse' :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
<!-- <Icon @click='onMenuCollapse' :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'" v-else
:class="menuCollapse ? 'unfold' : ''" size='18' class='fold ml10 menu-collapse'
style='cursor: pointer' v-if='props.canExpand' /> -->
</div>
@@ -58,11 +58,13 @@ defineOptions({
interface Props {
width?: string
canExpand?: boolean
showPush?: boolean
}
const props = withDefaults(defineProps<Props>(), {
width: '280px',
canExpand: true
canExpand: true,
showPush: false
})
const config = useConfig()
const { proxy } = useCurrentInstance()

View File

@@ -372,7 +372,7 @@ export function getTimeOfTheMonth(key: any): [string, string] {
* @param fullscreen // 全屏是否全屏
*/
export function getTime(interval: number | 3, timeList: any, externalTime: any) {
console.log('🚀 ~ getTime ~ timeList:', timeList)
// console.log('🚀 ~ getTime ~ timeList:', timeList)
// 1、先匹配时间
// 检查 interval 是否在 timeList 中
if (timeList && timeList.includes(interval.toString())) {

View File

@@ -3,7 +3,7 @@
<el-scrollbar>
<el-form :inline="false" :model="form" label-width="auto" class="form-one">
<el-form-item label="上级菜单">
<el-cascader v-model.trim="form.pid" :options="tableStore.table.data" :props="cascaderProps"
<el-cascader v-model.trim="form.pid" :options="tableStore.table.data" :props="cascaderProps" clearable
style="width: 100%" />
</el-form-item>
<el-form-item label="菜单名称">
@@ -92,6 +92,7 @@ const open = (text: string, data: anyObj) => {
}
const submit = async () => {
if (form.id) {
form.pid = form.pid||'0'
await updateMenu(form)
} else {
form.code = 'menu'

View File

@@ -7,6 +7,7 @@
@node-click="nodeClick"
@init="nodeClick"
@onAdd="onAdd"
:showPush="true"
></CloudDeviceEntryTree>
</pane>
<pane style="background: #fff">
@@ -79,6 +80,7 @@
label-width="120px"
:inline="true"
ref="mainForm"
:model="formData"
>
<el-form-item
id="id100"
@@ -106,12 +108,13 @@
id="id200"
class="form-item"
label="省:"
prop="engineeringParam.province"
v-if="nodeLevel > 0 || pageStatus == 2"
:rules="{ required: true, message: '请选择省', trigger: 'change' }"
>
<el-select
filterable
v-model="engineeringParam.province"
v-model="formData.engineeringParam.province"
:disabled="
!((nodeLevel == 1 && pageStatus == 3) || (nodeLevel == 0 && pageStatus == 2))
"
@@ -131,12 +134,13 @@
id="id200"
class="form-item"
label="市:"
prop="engineeringParam.city"
v-if="nodeLevel > 0 || pageStatus == 2"
:rules="{ required: true, message: '请选择市', trigger: 'change' }"
>
<el-select
filterable
v-model="engineeringParam.city"
v-model="formData.engineeringParam.city"
:disabled="
!((nodeLevel == 1 && pageStatus == 3) || (nodeLevel == 0 && pageStatus == 2))
"
@@ -154,12 +158,13 @@
id="id300"
class="form-item"
label="工程名称:"
v-if="nodeLevel > 0 || pageStatus == 2"
:prop="'name'"
prop="engineeringParam.name"
:rules="{ required: true, message: '请输入工程名称', trigger: 'blur' }"
>
<el-input
v-model="engineeringParam.name"
v-model="formData.engineeringParam.name"
placeholder="请输入工程名称"
:disabled="
!((nodeLevel == 1 && pageStatus == 3) || (nodeLevel == 0 && pageStatus == 2))
@@ -170,10 +175,11 @@
id="id300"
class="form-item"
label="描述:"
prop="engineeringParam.description"
v-if="nodeLevel > 0 || pageStatus == 2"
>
<el-input
v-model="engineeringParam.description"
v-model="formData.engineeringParam.description"
placeholder="请输入描述"
:disabled="
!((nodeLevel == 1 && pageStatus == 3) || (nodeLevel == 0 && pageStatus == 2))
@@ -191,7 +197,7 @@
@tab-click="tabChange('deviceIndex')"
>
<el-tab-pane
v-for="(item, index) in projectInfoList"
v-for="(item, index) in formData.projectInfoList"
:key="index"
:label="item.name ? item.name : '新建项目' + index"
:name="index + ''"
@@ -200,6 +206,7 @@
<el-form-item
class="form-item"
label="项目名称:"
:prop="'projectInfoList[' + index + '].name'"
:rules="[
{ required: true, message: '请输入项目名称', trigger: 'blur' }
]"
@@ -219,6 +226,7 @@
<el-form-item
class="form-item"
label="地市:"
:prop="'projectInfoList[' + index + '].area'"
:rules="[{ required: true, message: '请输入地市', trigger: 'blur' }]"
>
<el-input
@@ -236,6 +244,7 @@
<el-form-item
class="form-item"
label="描述:"
:prop="'projectInfoList[' + index + '].description'"
:rules="[{ required: true, message: '请输入描述', trigger: 'blur' }]"
>
<el-input
@@ -269,7 +278,7 @@
@tab-click="tabChange('busBarIndex')"
>
<el-tab-pane
v-for="(busItem, bIndex) in deviceInfoList"
v-for="(busItem, bIndex) in formData.deviceInfoList"
:key="bIndex"
:label="busItem.name ? busItem.name : '新建装置' + bIndex"
:name="bIndex + ''"
@@ -278,6 +287,7 @@
<el-form-item
class="form-item"
label="装置名称:"
:prop="'deviceInfoList[' + bIndex + '].name'"
:rules="[
{ required: true, message: '请输入装置名称', trigger: 'blur' }
]"
@@ -298,6 +308,7 @@
id="id200"
class="form-item"
label="装置类型:"
:prop="'deviceInfoList[' + bIndex + '].devType'"
:rules="[
{ required: true, message: '请选择装置类型', trigger: 'change' }
]"
@@ -327,6 +338,7 @@
id="id200"
class="form-item"
label="装置型号:"
:prop="'deviceInfoList[' + bIndex + '].devModel'"
:rules="[
{ required: true, message: '请选择装置型号', trigger: 'change' }
]"
@@ -356,6 +368,7 @@
id="id200"
class="form-item"
label="装置接入方式:"
:prop="'deviceInfoList[' + bIndex + '].devAccessMethod'"
:rules="[
{ required: true, message: '请选择装置接入方式', trigger: 'change' }
]"
@@ -380,6 +393,7 @@
<el-form-item
class="form-item"
label="装置mac地址:"
:prop="'deviceInfoList[' + bIndex + '].mac'"
:rules="{
required: true,
message: '请输入装置mac地址',
@@ -403,7 +417,7 @@
placeholder="请输入网络设备ID"
></el-input>
</el-form-item> -->
<el-form-item class="form-item" label="合同号:">
<el-form-item class="form-item" label="合同号:" :prop="'deviceInfoList[' + bIndex + '].cntractNo'">
<el-input
v-model="busItem.cntractNo"
placeholder="请输入合同号"
@@ -419,6 +433,7 @@
<el-form-item
class="form-item"
label="所属前置机:"
:prop="'deviceInfoList[' + bIndex + '].nodeId'"
:rules="[
{ required: true, message: '请选择所属前置机', trigger: 'change' }
]"
@@ -437,7 +452,7 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item class="form-item" label="进程号:">
<el-form-item class="form-item" label="进程号:" :prop="'deviceInfoList[' + bIndex + '].nodeProcess'">
<el-input
v-model="busItem.nodeProcess"
placeholder="自动分配"
@@ -448,6 +463,7 @@
<el-form-item
class="form-item"
label="排序:"
:prop="'deviceInfoList[' + bIndex + '].sort'"
:rules="[{ required: true, message: '请输入排序', trigger: 'blur' }]"
>
<el-input
@@ -481,7 +497,7 @@
@tab-click="tabChange('lineIndex')"
>
<el-tab-pane
v-for="(lineItem, lIndex) in lineInfoList"
v-for="(lineItem, lIndex) in formData.lineInfoList"
:key="lIndex"
:label="lineItem.name ? lineItem.name : '新建监测点' + lIndex"
:name="lIndex + ''"
@@ -490,6 +506,7 @@
<el-form-item
class="form-item"
label="监测点名称:"
:prop="'lineInfoList[' + lIndex + '].name'"
:rules="{
required: true,
message: '请输入监测点名称',
@@ -511,6 +528,7 @@
<el-form-item
class="form-item"
label="线路号:"
:prop="'lineInfoList[' + lIndex + '].lineNo'"
:rules="{
required: true,
message: '请选择线路号',
@@ -540,6 +558,7 @@
<el-form-item
class="form-item"
label="接线方式:"
:prop="'lineInfoList[' + lIndex + '].conType'"
:rules="{ required: true, message: '请选择接线方式', trigger: 'blur' }"
>
<el-select
@@ -565,6 +584,7 @@
<el-form-item
class="form-item"
label="统计间隔:"
:prop="'lineInfoList[' + lIndex + '].lineInterval'"
:rules="{ required: true, message: '请选择统计间隔', trigger: 'blur' }"
>
<el-select
@@ -590,6 +610,7 @@
<el-form-item
class="form-item"
label="PT变比:"
:prop="'lineInfoList[' + lIndex + '].ptRatio'"
:rules="{ required: true, message: '请输入pt', trigger: 'blur' }"
>
<div style="width: 100%; display: flex; justify-content: space-between">
@@ -635,6 +656,7 @@
<el-form-item
class="form-item"
label="CT变比:"
:prop="'lineInfoList[' + lIndex + '].ctRatio'"
:rules="{ required: true, message: '请输入ct', trigger: 'blur' }"
>
<div style="width: 100%; display: flex; justify-content: space-between">
@@ -678,7 +700,7 @@
</div>
</el-form-item>
<el-form-item class="form-item" label="基准容量(MVA):" :rules="{ required: true, message: '请输入基准容量', trigger: 'blur' }">
<el-form-item class="form-item" label="基准容量(MVA):" :prop="'lineInfoList[' + lIndex + '].basicCapacity'" :rules="{ required: true, message: '请输入基准容量', trigger: 'blur' }">
<el-input-number
:controls="false"
:min="0"
@@ -697,6 +719,7 @@
<el-form-item
class="form-item"
label="短路容量(MVA):"
:prop="'lineInfoList[' + lIndex + '].shortCircuitCapacity'"
:rules="{ required: true, message: '请输入短路容量', trigger: 'blur' }"
>
<el-input-number
@@ -717,6 +740,7 @@
<el-form-item
class="form-item"
label="设备容量(MW):"
:prop="'lineInfoList[' + lIndex + '].devCapacity'"
:rules="{ required: true, message: '请输入设备容量', trigger: 'blur' }"
>
<el-input-number
@@ -737,6 +761,7 @@
<el-form-item
class="form-item"
label="协议容量(MW):"
:prop="'lineInfoList[' + lIndex + '].protocolCapacity'"
:rules="{ required: true, message: '请输入协议容量', trigger: 'blur' }"
>
<el-input-number
@@ -758,6 +783,7 @@
<el-form-item
class="form-item"
label="电压等级:"
:prop="'lineInfoList[' + lIndex + '].volGrade'"
:rules="{ required: true, message: '请选择电压等级', trigger: 'blur' }"
>
<el-select
@@ -783,6 +809,7 @@
<el-form-item
class="form-item"
label="用户对象:"
:prop="'lineInfoList[' + lIndex + '].monitorUser'"
:rules="{ required: true, message: '请选择用户对象', trigger: 'blur' }"
>
<el-select
@@ -808,6 +835,7 @@
<el-form-item
class="form-item"
label="监测对象类型:"
:prop="'lineInfoList[' + lIndex + '].monitorObj'"
:rules="{
required: true,
message: '请选择监测对象类型',
@@ -837,6 +865,7 @@
<el-form-item
class="form-item"
label="是否治理:"
:prop="'lineInfoList[' + lIndex + '].govern'"
:rules="{ required: true, message: '请选择是否治理', trigger: 'blur' }"
>
<el-select
@@ -858,6 +887,7 @@
<el-form-item
class="form-item"
label="运行状态:"
:prop="'lineInfoList[' + lIndex + '].runStatus'"
:rules="{ required: true, message: '请选择运行状态', trigger: 'blur' }"
>
<!-- 0运行1检修2停运3调试4退运 -->
@@ -1015,6 +1045,20 @@ const devTypeOptions2: any = ref([])
const treeClickCount = ref(0)
const areaTree: any = tree
const formData = ref({
lineInfoList: [] as LineInfo[],
projectInfoList:[] as ProjectInfo[],
deviceInfoList :[] as DeviceInfo[],
engineeringParam: {
city: '',
description: '',
name: '',
province: ''
}
})
const project = ref([
{ name: '治理设备', value: '治理设备' },
{ name: '便携式设备', value: '便携式设备' },
@@ -1042,12 +1086,12 @@ const lineSpaceArr = ref([
{ name: '10分钟', value: 10 }
])
//工程
const engineeringParam = ref({
city: '',
description: '',
name: '',
province: ''
})
// const engineeringParam = ref({
// city: '',
// description: '',
// name: '',
// province: ''
// })
interface ProjectInfo {
name: string
@@ -1055,7 +1099,7 @@ interface ProjectInfo {
description: string
}
// 项目信息列表
const projectInfoList = ref<ProjectInfo[]>([])
//const projectInfoList = ref<ProjectInfo[]>([])
interface DeviceInfo {
name: string
devModel: string
@@ -1069,7 +1113,7 @@ interface DeviceInfo {
nodeProcess: string
}
// 设备信息列表
const deviceInfoList = ref<DeviceInfo[]>([])
//const deviceInfoList = ref<DeviceInfo[]>([])
interface LineInfo {
name: string
lineNo: number
@@ -1091,7 +1135,7 @@ interface LineInfo {
protocolCapacity: number
}
// 监测点信息列表
const lineInfoList = ref<LineInfo[]>([])
//const lineInfoList = ref<LineInfo[]>([])
const arrdess: any = ref((rule: any, value: any, callback: any) => {
let reg1 =
/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
@@ -1115,8 +1159,8 @@ const arrdess: any = ref((rule: any, value: any, callback: any) => {
// 省市选择相关数据
const provinceOptions = computed(() => areaTree)
const cityOptions = computed(() => {
if (engineeringParam.value.province) {
const province = areaTree.find((item: any) => item.value === engineeringParam.value.province)
if (formData.value.engineeringParam.province) {
const province = areaTree.find((item: any) => item.value === formData.value.engineeringParam.province)
return province ? province.children : []
}
return []
@@ -1143,7 +1187,7 @@ const voltageLevelOptions = computed(() => {
// 省改变时清空市的选择
const provinceChange = () => {
engineeringParam.value.city = ''
formData.value.engineeringParam.city = ''
}
// 临时存储所有层级的数据
const tempAllLevelData = ref<any>({
@@ -1203,13 +1247,13 @@ const nodeClick = (e: anyObj, data: any) => {
// 关键修改确保tabs展开
setTimeout(() => {
// 设置默认选中的tab索引
if (nodeLevel.value >= 2 && projectInfoList.value.length > 0) {
if (nodeLevel.value >= 2 && formData.value.projectInfoList.length > 0) {
deviceIndex.value = '0'
}
if (nodeLevel.value >= 3 && deviceInfoList.value.length > 0) {
if (nodeLevel.value >= 3 && formData.value.deviceInfoList.length > 0) {
busBarIndex.value = '0'
}
if (nodeLevel.value >= 4 && lineInfoList.value.length > 0) {
if (nodeLevel.value >= 4 && formData.value.lineInfoList.length > 0) {
lineIndex.value = '0'
}
}, 100)
@@ -1317,18 +1361,18 @@ const cleanUnnecessaryData = () => {
switch (nodeLevel.value) {
case 0: // 根节点
// 清理所有数据
projectInfoList.value = []
deviceInfoList.value = []
lineInfoList.value = []
formData.value.projectInfoList = []
formData.value.deviceInfoList = []
formData.value.lineInfoList = []
break
case 1: // 工程节点
// 清理设备和监测点数据
deviceInfoList.value = []
lineInfoList.value = []
formData.value.deviceInfoList = []
formData.value.lineInfoList = []
break
case 2: // 项目节点
// 清理监测点数据
lineInfoList.value = []
formData.value.lineInfoList = []
break
case 3: // 设备节点
// 不清理任何数据
@@ -1376,17 +1420,17 @@ const queryNodeContent = () => {
}
getInfoById(nodeData.value.id).then((res: any) => {
Object.assign(engineeringParam.value, res.data)
engineeringParam.value.name = res.data.engineeringName
engineeringParam.value.description = res.data.engineeringDescription
projectInfoList.value = res.data.projectInfoList || []
Object.assign(formData.value.engineeringParam, res.data)
formData.value.engineeringParam.name = res.data.engineeringName
formData.value.engineeringParam.description = res.data.engineeringDescription
formData.value.projectInfoList = res.data.projectInfoList || []
if (nodeLevel.value >= 2) {
deviceInfoList.value = res.data.deviceInfoList || []
formData.value.deviceInfoList = res.data.deviceInfoList || []
}
if (nodeLevel.value >= 3) {
lineInfoList.value = res.data.lineInfoList || []
lineInfoList.value.map((item: any) => {
formData.value.lineInfoList = res.data.lineInfoList || []
formData.value.lineInfoList.map((item: any) => {
item.volGrade = item.volGrade + 'kV'
})
}
@@ -1408,30 +1452,30 @@ const add = () => {
switch (nodeLevel.value) {
case 0: // 新增工程不需要添加tab
// 初始化工程参数
engineeringParam.value.city = ''
engineeringParam.value.description = ''
engineeringParam.value.name = ''
engineeringParam.value.province = ''
formData.value.engineeringParam.city = ''
formData.value.engineeringParam.description = ''
formData.value.engineeringParam.name = ''
formData.value.engineeringParam.province = ''
// 清理其他层级数据
projectInfoList.value = []
deviceInfoList.value = []
lineInfoList.value = []
formData.value.projectInfoList = []
formData.value.deviceInfoList = []
formData.value.lineInfoList = []
break
case 1: // 新增项目添加一个新的项目tab
// 添加一个新的空项目到projectInfoList
projectInfoList.value.push({
formData.value.projectInfoList.push({
name: '',
area: '',
description: ''
})
deviceIndex.value = (projectInfoList.value.length - 1).toString()
deviceIndex.value = (formData.value.projectInfoList.length - 1).toString()
// 清理设备和监测点数据
deviceInfoList.value = []
lineInfoList.value = []
formData.value.deviceInfoList = []
formData.value.lineInfoList = []
break
case 2: // 新增设备添加一个新的设备tab
// 添加一个新的空设备到deviceInfoList
deviceInfoList.value.push({
formData.value.deviceInfoList.push({
name: '',
devModel: '',
devType: '',
@@ -1443,13 +1487,13 @@ const add = () => {
sort: 0,
nodeProcess: ''
})
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
busBarIndex.value = (formData.value.deviceInfoList.length - 1).toString()
// 清理监测点数据
lineInfoList.value = []
formData.value.lineInfoList = []
break
case 3: // 新增监测点添加一个新的监测点tab
// 添加一个新的空监测点到lineInfoList
lineInfoList.value.push({
formData.value.lineInfoList.push({
name: '',
lineNo: 1,
conType: 0,
@@ -1469,7 +1513,7 @@ const add = () => {
devCapacity: 0,
protocolCapacity: 0
})
lineIndex.value = (lineInfoList.value.length - 1).toString()
lineIndex.value = (formData.value.lineInfoList.length - 1).toString()
break
}
}
@@ -1513,7 +1557,7 @@ const update = () => {
*/
const updateEngineering = (id: any) => {
// 获取工程信息
const engData = engineeringParam.value
const engData = formData.value.engineeringParam
// 构建工程修改数据结构
const engineeringData = {
@@ -1538,7 +1582,7 @@ const updateEngineering = (id: any) => {
*/
const updateProjectFunc = (id: any) => {
// 获取当前选中的项目信息
const currentProject = projectInfoList.value[deviceIndex.value]
const currentProject = formData.value.projectInfoList[deviceIndex.value]
if (!currentProject) {
ElMessage({
type: 'error',
@@ -1561,7 +1605,7 @@ const updateProjectFunc = (id: any) => {
*/
const updateEquipmentFunc = (id: any) => {
// 获取当前选中的设备信息
const currentDevice = deviceInfoList.value[busBarIndex.value]
const currentDevice = formData.value.deviceInfoList[busBarIndex.value]
if (!currentDevice) {
ElMessage({
type: 'error',
@@ -1599,7 +1643,7 @@ const updateEquipmentFunc = (id: any) => {
*/
const updateLineFunc = (id: any) => {
// 获取当前选中的监测点信息
const currentLine = lineInfoList.value[lineIndex.value]
const currentLine = formData.value.lineInfoList[lineIndex.value]
if (!currentLine) {
ElMessage({
type: 'error',
@@ -1617,11 +1661,11 @@ const updateLineFunc = (id: any) => {
// 获取设备MAC地址和设备ID
let devMac = ''
let devId = ''
if (deviceInfoList.value && deviceInfoList.value[busBarIndex.value]) {
devMac = deviceInfoList.value[busBarIndex.value].mac || ''
if (formData.value.deviceInfoList && formData.value.deviceInfoList[busBarIndex.value]) {
devMac = formData.value.deviceInfoList[busBarIndex.value].mac || ''
// 如果有设备ID也获取它
if (deviceInfoList.value[busBarIndex.value].id) {
devId = deviceInfoList.value[busBarIndex.value].id || ''
if (formData.value.deviceInfoList[busBarIndex.value].id) {
devId = formData.value.deviceInfoList[busBarIndex.value].id || ''
}
}
@@ -1775,29 +1819,31 @@ const remove = () => {
}
// 下一步
const next = async () => {
await mainForm.value.validate((valid: any) => {
if (valid) {
// 在新增模式下pageStatus == 2保存当前数据并创建下一个层级的Tab
switch (nodeLevel.value) {
case 0: // 工程层级下一步创建项目Tab
// 保存当前工程信息到临时存储
tempAllLevelData.value.engineering = { ...engineeringParam.value }
tempAllLevelData.value.engineering = { ...formData.value.engineeringParam }
// 创建新的项目Tab
projectInfoList.value.push({
formData.value.projectInfoList.push({
name: '',
area: '',
description: ''
})
deviceIndex.value = (projectInfoList.value.length - 1).toString()
deviceIndex.value = (formData.value.projectInfoList.length - 1).toString()
nextfalg.value = false
nodeLevel.value = 1
break
case 1: // 项目层级下一步创建设备Tab
// 保存当前项目信息到临时存储
const currentProject = { ...projectInfoList.value[deviceIndex.value] }
const currentProject = { ...formData.value.projectInfoList[deviceIndex.value] }
tempAllLevelData.value.projects[deviceIndex.value] = currentProject
// 创建新的设备Tab
deviceInfoList.value.push({
formData.value.deviceInfoList.push({
name: '',
devModel: '',
devType: '',
@@ -1809,17 +1855,17 @@ const next = async () => {
sort: 0,
nodeProcess: ''
})
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
busBarIndex.value = (formData.value.deviceInfoList.length - 1).toString()
nextfalg.value = false
nodeLevel.value = 2
break
case 2: // 设备层级下一步创建监测点Tab
// 保存当前设备信息到临时存储
const currentDevice = { ...deviceInfoList.value[busBarIndex.value] }
const currentDevice = { ...formData.value.deviceInfoList[busBarIndex.value] }
tempAllLevelData.value.devices[busBarIndex.value] = currentDevice
// 创建新的监测点Tab
lineInfoList.value.push({
formData.value.lineInfoList.push({
name: '',
lineNo: 1,
conType: 0,
@@ -1839,19 +1885,22 @@ const next = async () => {
devCapacity: 0,
protocolCapacity: 0
})
lineIndex.value = (lineInfoList.value.length - 1).toString()
lineIndex.value = (formData.value.lineInfoList.length - 1).toString()
nextfalg.value = true
nodeLevel.value = 3
break
case 3: // 监测点层级
// 保存当前监测点信息到临时存储
const currentLine = { ...lineInfoList.value[lineIndex.value] }
const currentLine = { ...formData.value.lineInfoList[lineIndex.value] }
tempAllLevelData.value.lines[lineIndex.value] = currentLine
nextfalg.value = true
nodeLevel.value = 4
break
}
}
})
}
// 撤销
@@ -1873,7 +1922,9 @@ const black = () => {
}
// 确认提交
const onsubmit = () => {
const onsubmit = async () => {
await mainForm.value.validate((valid: any) => {
if (valid) {
if (pageStatus.value == 2) {
// 新增
// 检查是否是多层级新增还是单层级新增
@@ -1906,31 +1957,35 @@ const onsubmit = () => {
break
}
}
}
})
}
/**
* 一次性提交所有层级数据
*/
const submitAllLevelData = () => {
const submitAllLevelData = async () => {
let submitData: any = {}
await mainForm.value.validate((valid: any) => {
if (valid) {
// 根据当前节点层级构建相应的数据结构
switch (nodeLevel.value) {
case 0: // 只有工程
submitData = {
engineering: tempAllLevelData.value.engineering || { ...engineeringParam.value }
engineering: tempAllLevelData.value.engineering || { ...formData.value.engineeringParam }
}
break
case 1: // 工程 + 项目
// 工程信息
const engineeringData = tempAllLevelData.value.engineering || { ...engineeringParam.value }
const engineeringData = tempAllLevelData.value.engineering || { ...formData.value.engineeringParam }
// 项目信息
const projectData =
tempAllLevelData.value.projects.length > 0
? tempAllLevelData.value.projects.find(project => project !== undefined) || {}
: projectInfoList.value[0] || {}
: formData.value.projectInfoList[0] || {}
// 如果是从根节点开始新增工程和项目
if (nodeData.value.level === 0) {
submitData = {
@@ -1948,19 +2003,19 @@ const submitAllLevelData = () => {
case 2: // 工程 + 项目 + 设备
// 工程信息
const engineeringData2 = tempAllLevelData.value.engineering || { ...engineeringParam.value }
const engineeringData2 = tempAllLevelData.value.engineering || { ...formData.value.engineeringParam }
// 项目信息
const projectData2 =
tempAllLevelData.value.projects.length > 0
? tempAllLevelData.value.projects.find(project => project !== undefined) || {}
: projectInfoList.value[0] || {}
: formData.value.projectInfoList[0] || {}
// 设备信息
let devices = []
if (tempAllLevelData.value.devices.length > 0) {
devices = tempAllLevelData.value.devices.filter((d: any) => d && d.name)
} else {
devices = deviceInfoList.value.filter((d: any) => d && d.name)
devices = formData.value.deviceInfoList.filter((d: any) => d && d.name)
}
// 如果是从根节点开始新增
@@ -2004,20 +2059,20 @@ const submitAllLevelData = () => {
case 3: // 工程 + 项目 + 设备 + 监测点
case 4:
// 工程信息
const engineeringData3 = tempAllLevelData.value.engineering || { ...engineeringParam.value }
const engineeringData3 = tempAllLevelData.value.engineering || { ...formData.value.engineeringParam }
// 项目信息
const projectData3 =
tempAllLevelData.value.projects.length > 0
? tempAllLevelData.value.projects.find(project => project !== undefined) || {}
: projectInfoList.value[0] || {}
: formData.value.projectInfoList[0] || {}
// 设备信息
let devices2: any[] = []
if (tempAllLevelData.value.devices.length > 0) {
devices2 = tempAllLevelData.value.devices.filter((d: any) => d && d.name)
} else {
devices2 = deviceInfoList.value.filter((d: any) => d && d.name)
devices2 = formData.value.deviceInfoList.filter((d: any) => d && d.name)
}
// 监测点信息
@@ -2025,7 +2080,7 @@ const submitAllLevelData = () => {
if (tempAllLevelData.value.lines.length > 0) {
lines = tempAllLevelData.value.lines.filter((l: any) => l && l.name)
} else {
lines = lineInfoList.value.filter((l: any) => l && l.name)
lines = formData.value.lineInfoList.filter((l: any) => l && l.name)
}
// 如果是从根节点开始新增
@@ -2200,26 +2255,30 @@ const submitAllLevelData = () => {
}
}, 100)
})
}
})
}
/**
* 重置所有表单
*/
const resetAllForms = () => {
// 清空工程表单
engineeringParam.value.city = ''
engineeringParam.value.description = ''
engineeringParam.value.name = ''
engineeringParam.value.province = ''
formData.value.engineeringParam.city = ''
formData.value.engineeringParam.description = ''
formData.value.engineeringParam.name = ''
formData.value.engineeringParam.province = ''
// 清空项目表单
projectInfoList.value.forEach(project => {
formData.value.projectInfoList.forEach(project => {
project.name = ''
project.area = ''
project.description = ''
})
// 清空设备表单
deviceInfoList.value.forEach(device => {
formData.value.deviceInfoList.forEach(device => {
device.name = ''
device.devModel = ''
device.devType = ''
@@ -2231,7 +2290,7 @@ const resetAllForms = () => {
})
// 清空监测点表单
lineInfoList.value.forEach(line => {
formData.value.lineInfoList.forEach(line => {
line.name = ''
line.lineNo = 1
line.conType = 0
@@ -2268,10 +2327,10 @@ const submitData = () => {
case 0: // 新增工程
const engineering = {
engineering: {
city: engineeringParam.value.city,
description: engineeringParam.value.description,
name: engineeringParam.value.name,
province: engineeringParam.value.province
city: formData.value.engineeringParam.city,
description: formData.value.engineeringParam.description,
name: formData.value.engineeringParam.name,
province: formData.value.engineeringParam.province
}
}
@@ -2291,9 +2350,9 @@ const submitData = () => {
const project = {
engineeringIndex: nodeData.value?.id || '',
project: {
area: projectInfoList.value[deviceIndex.value]?.area || '',
description: projectInfoList.value[deviceIndex.value]?.description || '',
name: projectInfoList.value[deviceIndex.value]?.name || '',
area: formData.value.projectInfoList[deviceIndex.value]?.area || '',
description: formData.value.projectInfoList[deviceIndex.value]?.description || '',
name: formData.value.projectInfoList[deviceIndex.value]?.name || '',
engineeringId: nodeData.value?.id || ''
}
}
@@ -2321,7 +2380,7 @@ const submitData = () => {
break
case 2: // 新增设备
// 获取当前选中的设备信息
const currentDevice = deviceInfoList.value[busBarIndex.value]
const currentDevice = formData.value.deviceInfoList[busBarIndex.value]
if (!currentDevice) {
ElMessage({
type: 'error',
@@ -2374,7 +2433,7 @@ const submitData = () => {
break
case 3: // 新增监测点
// 获取当前选中的监测点信息
const currentLine = lineInfoList.value[lineIndex.value]
const currentLine = formData.value.lineInfoList[lineIndex.value]
if (!currentLine) {
ElMessage({
type: 'error',
@@ -2417,7 +2476,7 @@ const submitData = () => {
devCapacity: currentLine.devCapacity,
protocolCapacity: currentLine.protocolCapacity,
volGrade: volGradeValue,
devMac: deviceInfoList.value[busBarIndex.value].mac
devMac: formData.value.deviceInfoList[busBarIndex.value].mac
}
]
}
@@ -2452,12 +2511,12 @@ const submitData = () => {
const handleDeviceTabsEdit = (targetName: any, action: any) => {
if (action === 'add') {
// 新增项目
projectInfoList.value.push({
formData.value.projectInfoList.push({
name: '',
area: '',
description: ''
})
deviceIndex.value = (projectInfoList.value.length - 1).toString()
deviceIndex.value = (formData.value.projectInfoList.length - 1).toString()
} else if (action === 'remove') {
// 删除项目
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
@@ -2467,12 +2526,12 @@ const handleDeviceTabsEdit = (targetName: any, action: any) => {
})
.then(() => {
// 删除项目
if (projectInfoList.value[deviceIndex.value]?.id) {
if (formData.value.projectInfoList[deviceIndex.value]?.id) {
deleteProject(
projectInfoList.value[deviceIndex.value].id,
projectInfoList.value[deviceIndex.value].name,
projectInfoList.value[deviceIndex.value].area,
projectInfoList.value[deviceIndex.value].description,
formData.value.projectInfoList[deviceIndex.value].id,
formData.value.projectInfoList[deviceIndex.value].name,
formData.value.projectInfoList[deviceIndex.value].area,
formData.value.projectInfoList[deviceIndex.value].description,
0 // 0表示删除
).then((res: any) => {
ElMessage({
@@ -2480,10 +2539,10 @@ const handleDeviceTabsEdit = (targetName: any, action: any) => {
message: res.message
})
// 从列表中移除
projectInfoList.value.splice(deviceIndex.value, 1)
formData.value.projectInfoList.splice(deviceIndex.value, 1)
// 重新设置当前选中的tab
deviceIndex.value = projectInfoList.value.length
? (projectInfoList.value.length - 1).toString()
deviceIndex.value = formData.value.projectInfoList.length
? (formData.value.projectInfoList.length - 1).toString()
: '0'
// 重置相关索引
busBarIndex.value = '0'
@@ -2493,9 +2552,9 @@ const handleDeviceTabsEdit = (targetName: any, action: any) => {
})
} else {
// 如果是新增模式下删除未保存的项目
projectInfoList.value.splice(deviceIndex.value, 1)
deviceIndex.value = projectInfoList.value.length
? (projectInfoList.value.length - 1).toString()
formData.value.projectInfoList.splice(deviceIndex.value, 1)
deviceIndex.value = formData.value.projectInfoList.length
? (formData.value.projectInfoList.length - 1).toString()
: '0'
busBarIndex.value = '0'
lineIndex.value = '0'
@@ -2520,7 +2579,7 @@ const handleDeviceTabsEdit = (targetName: any, action: any) => {
const handleBusBarTabsEdit = (targetName: any, action: any) => {
if (action === 'add') {
// 新增设备
deviceInfoList.value.push({
formData.value.deviceInfoList.push({
name: '',
devModel: '',
devType: '',
@@ -2532,7 +2591,7 @@ const handleBusBarTabsEdit = (targetName: any, action: any) => {
sort: 0,
nodeProcess: ''
})
busBarIndex.value = (deviceInfoList.value.length - 1).toString()
busBarIndex.value = (formData.value.deviceInfoList.length - 1).toString()
} else if (action === 'remove') {
// 删除设备
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
@@ -2542,17 +2601,17 @@ const handleBusBarTabsEdit = (targetName: any, action: any) => {
})
.then(() => {
// 如果是编辑现有设备
if (deviceInfoList.value[busBarIndex.value]?.id) {
deleteEquipment(deviceInfoList.value[busBarIndex.value].id).then((res: any) => {
if (formData.value.deviceInfoList[busBarIndex.value]?.id) {
deleteEquipment(formData.value.deviceInfoList[busBarIndex.value].id).then((res: any) => {
ElMessage({
type: 'success',
message: res.message
})
// 从列表中移除
deviceInfoList.value.splice(busBarIndex.value, 1)
formData.value.deviceInfoList.splice(busBarIndex.value, 1)
// 重新设置当前选中的tab
busBarIndex.value = deviceInfoList.value.length
? (deviceInfoList.value.length - 1).toString()
busBarIndex.value = formData.value.deviceInfoList.length
? (formData.value.deviceInfoList.length - 1).toString()
: '0'
lineIndex.value = '0'
pageStatus.value = 1
@@ -2560,8 +2619,8 @@ const handleBusBarTabsEdit = (targetName: any, action: any) => {
})
} else {
// 如果是新增模式下删除未保存的设备
deviceInfoList.value.splice(busBarIndex.value, 1)
busBarIndex.value = deviceInfoList.value.length ? (deviceInfoList.value.length - 1).toString() : '0'
formData.value.deviceInfoList.splice(busBarIndex.value, 1)
busBarIndex.value = formData.value.deviceInfoList.length ? (formData.value.deviceInfoList.length - 1).toString() : '0'
lineIndex.value = '0'
ElMessage({
type: 'success',
@@ -2584,7 +2643,7 @@ const handleBusBarTabsEdit = (targetName: any, action: any) => {
const handleLineTabsEdit = (targetName: any, action: any) => {
if (action === 'add') {
// 新增监测点
lineInfoList.value.push({
formData.value.lineInfoList.push({
name: '',
lineNo: 1,
conType: 0,
@@ -2604,7 +2663,7 @@ const handleLineTabsEdit = (targetName: any, action: any) => {
devCapacity: 0,
protocolCapacity: 0
})
lineIndex.value = (lineInfoList.value.length - 1).toString()
lineIndex.value = (formData.value.lineInfoList.length - 1).toString()
} else if (action === 'remove') {
// 删除监测点
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
@@ -2614,23 +2673,23 @@ const handleLineTabsEdit = (targetName: any, action: any) => {
})
.then(() => {
// 如果是编辑现有监测点
if (lineInfoList.value[lineIndex.value]?.lineId) {
deleteLine(lineInfoList.value[lineIndex.value].lineId).then((res: any) => {
if (formData.value.lineInfoList[lineIndex.value]?.lineId) {
deleteLine(formData.value.lineInfoList[lineIndex.value].lineId).then((res: any) => {
ElMessage({
type: 'success',
message: res.message
})
// 从列表中移除
lineInfoList.value.splice(lineIndex.value, 1)
formData.value.lineInfoList.splice(lineIndex.value, 1)
// 重新设置当前选中的tab
lineIndex.value = lineInfoList.value.length ? (lineInfoList.value.length - 1).toString() : '0'
lineIndex.value = formData.value.lineInfoList.length ? (formData.value.lineInfoList.length - 1).toString() : '0'
pageStatus.value = 1
treedata()
})
} else {
// 如果是新增模式下删除未保存的监测点
lineInfoList.value.splice(lineIndex.value, 1)
lineIndex.value = lineInfoList.value.length ? (lineInfoList.value.length - 1).toString() : '0'
formData.value.lineInfoList.splice(lineIndex.value, 1)
lineIndex.value = formData.value.lineInfoList.length ? (formData.value.lineInfoList.length - 1).toString() : '0'
ElMessage({
type: 'success',
message: '删除成功'

View File

@@ -979,10 +979,10 @@ const getRealDataMqttMsg = async () => {
})
}, 30000)
mqttRef.value.on('message', (topic: any, message: any) => {
// console.log(
// '实时数据&实时趋势---mqtt接收到消息',
// JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
// )
console.log(
'实时数据&实时趋势---mqtt接收到消息',
JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
)
let obj = JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
if (lineId.value != obj.lineId || adminInfo.userIndex != obj.userId) return

View File

@@ -139,12 +139,13 @@ const handleBack = () => {
emit('handleHideCharts')
}
const setHeight = (h: any, vh: any, num = 1) => {
console.log('🚀 ~ setHeight ~ h:', h)
if (h != false) {
parentHeight.value = h
}
setTimeout(() => {
bxecharts.value = mainHeight(vh,num).height
bxecharts.value = mainHeight(vh, num).height
}, 100)
}
onMounted(() => {})

View File

@@ -142,7 +142,7 @@ const editd = (e: any) => {
const Aclick = (e: any) => {
//window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=zl`)
window.open(
'http://192.168.1.128:4001' +
window.location.origin +
`/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=${VITE_FLAG ? 'ypt' : 'zl'}`
)
}

View File

@@ -0,0 +1,267 @@
<template>
<div class="default-main" :style="height">
<splitpanes style="height: 100%" id="navigation-splitpanes">
<pane :size="size">
<CloudDeviceEntryTree
ref="TerminalRef"
@node-click="handleNodeClick"
@init="handleNodeClick"
></CloudDeviceEntryTree>
</pane>
<pane style="background: #fff" :style="height">
<TableHeader ref="TableHeaderRef" date-picker :show-search="false">
<template v-slot:select>
<!-- <el-form-item label=" 模板策略">
<el-select v-model="value" placeholder="请选择" @change="changeFn" clearable>
<el-option
v-for="item in templatePolicy"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item> -->
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成报告</el-button>
</template>
</TableHeader>
<div class="box" :style="`height: calc(${tableStore.table.height} + 65px)`">
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">监测点详情</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.xq">监测点详情</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">暂降事件列表</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.lb">表格</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">暂降密度</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.mdbg">表格</el-checkbox>
<el-checkbox v-model="formd.mdtx">图形</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">暂降事件点</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.sjdITIC">ITIC</el-checkbox>
<el-checkbox v-model="formd.sjdF47">F47</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">概率分布</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.glfbfz">暂降幅值</el-checkbox>
<el-checkbox v-model="formd.glfbsj">持续时间</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">月份统计</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.tjbg">表格</el-checkbox>
<el-checkbox v-model="formd.tjtx">图形</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">暂降原因</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.yybg">表格</el-checkbox>
<el-checkbox v-model="formd.yytx">图形</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12" class="mTop">
<div class="grid-content">
<div class="divBox">暂降类型</div>
</div>
</el-col>
<el-col :span="12" class="mTop">
<el-checkbox v-model="formd.lxbg">表格</el-checkbox>
<el-checkbox v-model="formd.lxtx">图形</el-checkbox>
</el-col>
</el-row>
<el-divider></el-divider>
</div>
</pane>
</splitpanes>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, provide } from 'vue'
import 'splitpanes/dist/splitpanes.css'
import { Splitpanes, Pane } from 'splitpanes'
import TableStore from '@/utils/tableStore'
import PointTree from '@/components/tree/pqs/pointTree.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout'
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
import { genFileId, ElMessage, ElNotification } from 'element-plus'
import type { UploadProps, UploadUserFile } from 'element-plus'
import CloudDeviceEntryTree from '@/components/tree/govern/cloudDeviceEntryTree.vue'
import { getLineExport } from '@/api/harmonic-boot/cockpit/cockpit'
defineOptions({
name: 'TransientReport/monitoringpointReport'
})
const height = mainHeight(20)
const size = ref(0)
const dictData = useDictData()
const TableHeaderRef = ref()
const dotList: any = ref({})
const Template: any = ref({})
const uploadList: any = ref([])
const formd: any = ref({
xq: true,
lb: true,
mdbg: false,
mdtx: false,
sjdITIC: false,
sjdF47: false,
glfbfz: false,
glfbsj: false,
tjbg: false,
tjtx: false,
yybg: false,
yytx: false,
lxbg: false,
lxtx: false,
type: 0
})
const tableStore = new TableStore({
url: '',
method: 'POST',
column: [],
beforeSearchFun: () => {},
loadCallback: () => {}
})
provide('tableStore', tableStore)
onMounted(() => {
const dom = document.getElementById('navigation-splitpanes')
if (dom) {
size.value = Math.round((180 / dom.offsetHeight) * 100)
}
})
const handleNodeClick = (data: any, node: any) => {
dotList.value = data
}
// 上传
const choose = (files: any) => {
const isJPG = files.raw.type === 'image/jpg'
const isJPEG = files.raw.type === 'image/jpeg'
const isPNG = files.raw.type === 'image/png'
if (!isJPG && !isPNG && !isJPEG) {
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
return false
}
uploadList.value = files
ElMessage.success('上传成功')
}
//生成报告
const exportEvent = () => {
if (dotList.value?.level != 4) {
return ElMessage.warning('请选择监测点进行报告生成!')
}
let a = ''
// formd.value.lineId = monitoringPoint.state.lineId
// formd.value.lineName = monitoringPoint.state.lineName.split('>').at(-1)
formd.value.lineId = dotList.value.id
formd.value.lineName = dotList.value.name
formd.value.searchBeginTime = TableHeaderRef.value.datePickerRef.timeValue[0]
formd.value.searchEndTime = TableHeaderRef.value.datePickerRef.timeValue[1]
formd.value.flag = TableHeaderRef.value.datePickerRef.interval
ElMessage('生成报告中,请稍等!')
getLineExport(formd.value).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
// createObjectURL(blob); //创建下载的链接
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '监测点报告' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
</script>
<style lang="scss">
.splitpanes.default-theme .splitpanes__pane {
background: #eaeef1;
}
.grid-content {
text-align: center;
}
.divBox {
width: 250px;
height: 31px;
margin: auto;
line-height: 32px;
border: 1px solid #c9c9c9;
&:hover {
border: 1px solid #002255;
}
}
.box {
padding: 10px;
// margin-top: 10px;
overflow-y: auto;
font-size: 15px;
}
.el-divider--horizontal {
margin: 10px 0;
}
.mTop {
margin-top: 5px;
margin-bottom: 5px;
}
</style>

View File

@@ -1,13 +1,8 @@
<template>
<div class="default-main" :style="height">
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
<splitpanes style="height: 100%" id="navigation-splitpanes">
<pane :size="size">
<!-- <pointTreeWx
:default-expand-all="false"
template
@node-click="handleNodeClick"
@init="handleNodeClick"
></pointTreeWx> -->
<CloudDeviceEntryTree
ref="TerminalRef"
@node-click="handleNodeClick"
@@ -81,7 +76,7 @@ import type { UploadProps, UploadUserFile } from 'element-plus'
import CloudDeviceEntryTree from '@/components/tree/govern/cloudDeviceEntryTree.vue'
import { exportModel } from '@/api/cs-harmonic-boot/datatrend'
defineOptions({
// name: 'harmonic-boot/report/word'
name: 'harmonic-boot/report/word'
})
const height = mainHeight(20)
const size = ref(0)

View File

@@ -25,7 +25,11 @@
:vertical-compact="false"
prevent-collision
:col-num="12"
:style="{ zoom: zoom }"
:style="{
transform: `scale(${zoom})`,
transformOrigin: 'top left',
width: zoom !== 1 ? `${100 / zoom}%` : '100%'
}"
>
<template #item="{ item }">
<div class="box">

View File

@@ -1,8 +1,9 @@
<template>
<div class="default-main" :style="{ padding: prop.height ? '0px !important' : '10px' }">
<!-- 实时数据 -->
<!-- 实时数据 走驾驶舱-->
<!-- 添加加载事件监听 -->
<div class="dataBox" :style="{ height: prop.height || pageHeight.height }">
<div class="dataBox" :style="{ height: prop.height ? prop.height : pageHeight.height }">
<div
class="iframe-container"
:style="{
@@ -22,9 +23,9 @@
</div>
<el-card class="bottom-container" style="min-height: 230px">
<div class="buttonBox">
<!-- <div class="buttonBox">
<el-button type="primary" icon="el-icon-Aim" @click="reset">复位</el-button>
</div>
</div> -->
<div class="tableBox">
<!-- <Table ref="tableRef" height="100%"></Table> -->
<vxe-table border auto-resize height="100%" :data="tableData" ref="tableRef">
@@ -52,7 +53,7 @@ import { mainHeight } from '@/utils/layout'
const prop = defineProps({
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object }
})
@@ -63,93 +64,25 @@ window.addEventListener('message', function (event) {
const { action, data } = event.data
if (action == 'securityDetailData') {
console.log('tableArray:', data)
// 处理接收到的 tableArray 数据
tableData.value = data
}
})
// const tableStore: any = new TableStore({
// url: '/user-boot/role/selectRoleDetail?id=0',
// method: 'POST',
// showPage: false,
// column: [
// {
// field: 'index',
// title: '序号',
// width: '80',
// formatter: (row: any) => {
// return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
// }
// },
// {
// title: '时间',
// field: 'whetherToGovern',
// minWidth: '70'
// },
// {
// title: '监测点名',
// field: 'name',
// minWidth: '90'
// // render: 'customTemplate',
// // customTemplate: (row: any) => {
// // return `<span style='cursor: pointer;text-decoration: underline;'>${row.name}</span>`
// // }
// },
// { title: '事件描述', field: 'question', minWidth: '200' }
// ],
// beforeSearchFun: () => {
// // tableStore.table.params.searchBeginTime = prop.timeValue?.[0] || getTimeOfTheMonth(prop.timeKey)[0]
// // tableStore.table.params.searchEndTime = prop.timeValue?.[1] || getTimeOfTheMonth(prop.timeKey)[1]
// },
// loadCallback: () => {
// tableStore.table.data = [
// {
// name: '10kV1#电动机',
// type: '电动机',
// whetherToGovern: '2025-01-01 15:00:00',
// question: '3次谐波电压、5次谐波电流、电压不平衡度超标'
// },
// {
// name: '10kV2#(治理后)',
// type: '电焊机',
// whetherToGovern: '2025-05-01 16:00:00',
// question: '所有指标均合格'
// },
// {
// name: '380V电焊机(治理前)',
// type: '电焊机',
// whetherToGovern: '2025-06-01 15:00:00',
// question: '5次谐波电流、电压不平衡度超标'
// },
// {
// name: '380V水泵机',
// type: '电动机',
// whetherToGovern: '2025-08-01 15:00:00',
// question: '所有指标均合格'
// }
// ]
// }
// })
const tableRef = ref()
// provide('tableRef', tableRef)
// const pageHeight = mainHeight(40)
// provide('tableStore', tableStore)
const pageHeight = mainHeight(40)
const reset = () => {
// 向 iframe 发送复位事件
sendResetToIframe();
sendResetToIframe()
// 清空表格数据
// tableData.value = [];
// tableData.value = [];
}
// 向 iframe 发送复位消息的函数
const sendResetToIframe = () => {
const iframe = document.getElementById('iframeLeft') as HTMLIFrameElement;
const iframe = document.getElementById('iframeLeft') as HTMLIFrameElement
if (iframe && iframe.contentWindow) {
iframe.contentWindow.postMessage(
{
@@ -157,7 +90,7 @@ const sendResetToIframe = () => {
payload: true
},
'*' // 生产环境中应替换为具体的域名
);
)
}
}
@@ -186,7 +119,7 @@ const iframeSrc = ref('')
onMounted(() => {
iframeSrc.value =
'http://192.168.1.128:4001' + `/zutai/?id=4b4f7f4260198776594f5f9d93a532e8&&name=stt&&preview=true#/preview_YPT`
window.location.origin + `/zutai/?id=4b4f7f4260198776594f5f9d93a532e8&&name=stt&&preview=true#/preview_YPT`
// tableStore.index()
@@ -261,16 +194,19 @@ const sendKeysToIframe = (keyList: string[]) => {
.iframe-container {
flex: 3.5;
}
:deep(.el-card__body) {
display: flex;
padding: 10px;
height: 100%;
.buttonBox {
display: flex;
width: 150px;
align-items: center;
justify-content: center;
}
.tableBox {
flex: 1;
width: 100%;