修改治理测试用例

This commit is contained in:
GGJ
2025-01-06 21:01:49 +08:00
parent 439a129589
commit 51782b09c2
10 changed files with 166 additions and 68 deletions

2
.env.zl Normal file
View File

@@ -0,0 +1,2 @@
NODE_ENV = zl
VITE_NAME="zl"

View File

@@ -5,7 +5,9 @@
"type": "module",
"scripts": {
"dev": "vite",
"dev:zl": "vite --mode zl",
"build": "vite build",
"build:zl": "vite build --mode zl",
"preview": "vite preview"
},
"dependencies": {

View File

@@ -26,6 +26,7 @@ import { mainHeight } from '@/utils/layout'
// url2: ("@/assets/dw.png"),
import url from '@/assets/img/point.png';
import url2 from '@/assets/img/dw.png';
const VITE_FLAG = import.meta.env.VITE_NAME == 'zl'
export default {
props: {
value: {
@@ -190,38 +191,39 @@ export default {
//根据后台查询的数据,清洗数据
initWaves() {
if (null != this.wp) {
if (this.boxoList.systemType == "pms") {
if (this.boxoList.systemType == 'pms') {
this.titles =
"变电站名称:" +
'变电站名称:' +
this.boxoList.powerStationName +
" 监测点名称:" +
' 监测点名称:' +
this.boxoList.measurementPointName +
" 发生时刻:" +
' 发生时刻:' +
this.boxoList.startTime +
" 暂降(骤升)幅值:" +
' 暂降(骤升)幅值:' +
(this.boxoList.featureAmplitude * 100).toFixed(0) +
"% 持续时间:" +
'% 持续时间:' +
this.boxoList.duration +
"s";
} else if (this.boxoList.systemType == "ZL") {
's'
} else if (this.boxoList.systemType == 'ZL') {
this.titles =
// "变电站名称:" +
// this.boxoList.equipmentName +
" 监测点名称:" +
this.boxoList.equipmentName +
" 发生时刻:" +
' 监测点名称:' +
this.boxoList.lineName +
' 发生时刻:' +
this.boxoList.startTime +
" 暂降(骤升)幅值:" +
' 暂降(骤升)幅值:' +
this.boxoList.evtParamVVaDepth +
" 持续时间:" +
' 持续时间:' +
this.boxoList.evtParamTm +
"s";
} else if (this.boxoList.systemType == 'WX') {
's'
}
else if (this.boxoList.systemType == 'WX') {
let featureAmplitude = this.boxoList.featureAmplitude + '' ? this.boxoList.featureAmplitude.toFixed(2) : '/'
if (String(this.boxoList.featureAmplitude).split('.')[1] == '00') {
this.boxoList.featureAmplitude = String(this.boxoList.featureAmplitude).split('.')[0]
}
this.titles =
' 监测点名称:' +
@@ -231,21 +233,21 @@ export default {
' 暂降(骤升)幅值:' +
(featureAmplitude) +
'% 持续时间:' +
(this.boxoList.persistTime ? this.boxoList.persistTime.toFixed(2) : '-') +
(this.boxoList.persistTime || this.boxoList.evtParamTm || '-') +
's'
} else {
this.titles =
"变电站名称:" +
'变电站名称:' +
this.boxoList.subName +
" 监测点名称:" +
' 监测点名称:' +
this.boxoList.lineName +
" 发生时刻:" +
' 发生时刻:' +
this.boxoList.startTime +
" 暂降(骤升)幅值:" +
' 暂降(骤升)幅值:' +
(this.boxoList.featureAmplitude * 100).toFixed(0) +
"% 持续时间:" +
'% 持续时间:' +
this.boxoList.duration +
"s";
's'
}
// this.eventValue = this.boxoList.eventValue;
@@ -848,7 +850,7 @@ export default {
unit = "A";
}
//把剩余的DIV先拼接好
for (var step = 1; step < waveDatas.length; step++) {
for (var step = waveDatas.length - 1; 0 < step && step < waveDatas.length; step--) {
var rmsId = "rms" + step;
var newDivRms = $(
` <div style="height:${this.vh
@@ -923,7 +925,7 @@ export default {
},
title: {
left: "center",
text: title,
text: VITE_FLAG ? "电网侧-电压 " + title : title,
subtitle: {
text: "电压",
align: "left",
@@ -1265,17 +1267,18 @@ export default {
var myChartes = echarts.init(document.getElementById(rmsId));
//debugger
if (this.boxoList.systemType == "ZL") {
if (VITE_FLAG) {
let str = []
str = rmsId.split('s')
let str1 = Number(str[1])
var titlename = ''
this.wp.channelNames.forEach((element, i) => {
if (i == 4 || i == 7 || i == 10) {
if (str1 == 1 && i == 4) {
let s = []
let s1 = ''
s = element.split('A')
if (str1 == 1 && i == 4) {
if (s[0] == 'LI') {
s1 = '电网侧-电流'
} else {
@@ -1285,9 +1288,7 @@ export default {
titlename = s1 + ' ' + title
}
if (str1 == 2 && i == 7) {
let s = []
let s1 = ''
s = element.split('A')
if (s[0] == 'SU') {
s1 = '负载侧-电压'
} else {
@@ -1297,9 +1298,7 @@ export default {
titlename = s1 + ' ' + title
}
if (str1 == 3 && i == 10) {
let s = []
let s1 = ''
s = element.split('A')
if (s[0] == 'SI') {
s1 = '负载侧-电流'

View File

@@ -18,6 +18,7 @@ import * as echarts from 'echarts'
import { mainHeight } from '@/utils/layout'
import url from '@/assets/img/point.png'
const VITE_FLAG = import.meta.env.VITE_NAME == 'zl'
export default {
props: {
value: {
@@ -523,7 +524,7 @@ export default {
//把剩余的DIV先拼接好
for (var step = 1; step < waveDatas.length; step++) {
for (var step = waveDatas.length - 1; 0 < step && step < waveDatas.length; step--) {
var waveId = 'wave' + step
var newDivShunshi = $(` <div style="height:${this.vh};overflow: hidden;">
<div class='bx1' id='${waveId}'>
@@ -599,7 +600,7 @@ export default {
},
title: {
left: 'center',
text: title,
text: VITE_FLAG ? "电网侧-电压 " + title : title,
textStyle: {
fontSize: '0.8rem',
color: _this.DColor ? '#fff' : echartsColor.WordColor
@@ -827,6 +828,7 @@ export default {
},
//绘制剩余横向的波形图
drawPics(waveDataTemp, picHeight, step, show, myChartes1, title) {
let _this = this
step = step + 1
//新建瞬时DIV
@@ -886,8 +888,10 @@ export default {
unit = 'A'
}
// const echarts = require('echarts')
let waveIds = document.getElementById(waveId)
if (this.boxoList.systemType == 'ZL') {
if (VITE_FLAG) {
let str = []
str = waveId.split('e')
let str1 = Number(str[1])

View File

@@ -122,9 +122,41 @@ const onMenuCollapse = () => {
menuCollapse.value = !menuCollapse.value
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
}
const filterNode = (value: string, data: any) => {
const filterNode = (value: string, data: any, node: any) => {
if (!value) return true
return data.name.includes(value)
// return data.name.includes(value)
if (data.name) {
return chooseNode(value, data, node)
}
}
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配则返回该节点以及其下的所有子节点如果参数是子节点则返回该节点的父节点。name是中文字符enName是英文字符.
const chooseNode = (value: string, data: any, node: any) => {
if (data.name.indexOf(value) !== -1) {
return true
}
const level = node.level
// 如果传入的节点本身就是一级节点就不用校验了
if (level === 1) {
return false
}
// 先取当前节点的父节点
let parentData = node.parent
// 遍历当前节点的父节点
let index = 0
while (index < level - 1) {
// 如果匹配到直接返回此处name值是中文字符enName是英文字符。判断匹配中英文过滤
if (parentData.data.name.indexOf(value) !== -1) {
return true
}
// 否则的话再往上一层做匹配
parentData = parentData.parent
index++
}
// 没匹配到返回false
return false
}
const changeDevice = (val: any) => {

View File

@@ -62,9 +62,41 @@ const onMenuCollapse = () => {
menuCollapse.value = !menuCollapse.value
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
}
const filterNode = (value: string, data: any) => {
const filterNode = (value: string, data: any, node: any) => {
if (!value) return true
return data.name.includes(value)
// return data.name.includes(value)
if (data.name) {
return chooseNode(value, data, node)
}
}
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配则返回该节点以及其下的所有子节点如果参数是子节点则返回该节点的父节点。name是中文字符enName是英文字符.
const chooseNode = (value: string, data: any, node: any) => {
if (data.name.indexOf(value) !== -1) {
return true
}
const level = node.level
// 如果传入的节点本身就是一级节点就不用校验了
if (level === 1) {
return false
}
// 先取当前节点的父节点
let parentData = node.parent
// 遍历当前节点的父节点
let index = 0
while (index < level - 1) {
// 如果匹配到直接返回此处name值是中文字符enName是英文字符。判断匹配中英文过滤
if (parentData.data.name.indexOf(value) !== -1) {
return true
}
// 否则的话再往上一层做匹配
parentData = parentData.parent
index++
}
// 没匹配到返回false
return false
}
const checkTreeNodeChange = () => {
// console.log(treeRef.value?.getCheckedNodes(), "ikkkkkiisiiisis");

View File

@@ -233,7 +233,7 @@ const search = () => {
}
},
xAxis: {
name: '时间',
name: '',
type: 'time',
axisLabel: {
formatter: {

View File

@@ -3,10 +3,20 @@
<div class="analyze-dvr" v-show="!isWaveCharts" :style="{ height: pageHeight.height }" v-loading="loading">
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
<TableHeader :showReset="false" showExport>
<TableHeader datePicker showExport>
<template v-slot:select>
<el-form-item label="关键字">
<el-input v-model.trim="tableStore.table.params.searchValue" placeholder="请输入关键字" />
<el-form-item label="事件类型">
<el-select v-model.trim="tableStore.table.params.eventType" clearable placeholder="请选择事件类型">
<el-option v-for="item in eventList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="位置">
<el-select v-model.trim="tableStore.table.params.location" clearable placeholder="请选择位置">
<el-option v-for="item in locationList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</template>
</TableHeader>
@@ -64,7 +74,7 @@ import TableHeader from '@/components/table/header/index.vue'
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'govern/analyze/DVR'
name: 'analyze/DVR/index'
})
const pageHeight = mainHeight(20)
const loading = ref(false)
@@ -75,23 +85,33 @@ const isWaveCharts = ref(false)
const bxactiveName = ref('ssbx')
const boxoList: any = ref({})
const wp = ref({})
const value = ref(1)
const eventList = ref([{
value: 'Evt_Sys_DipStr',
label: '电压暂降'
},
{
value: 'Evt_Sys_IntrStr',
label: '电压暂升'
},
{
value: 'Evt_Sys_IntrStr',
label: '电压中断'
}])
const locationList = ref([{
value: 'grid',
label: '电网侧'
},
{
value: 'load',
label: '负载侧'
}])
const waveFormAnalysisRef = ref()
const options = ref([
{
value: 1,
label: '一次值'
},
{
value: 2,
label: '二次值'
}
])
const tableStore = new TableStore({
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
method: 'POST',
column: [
{ title: '事件描述', field: 'showName', sortable: true },
{ title: '事件描述', field: 'showName', },
{ title: '发生位置', field: 'evtParamPosition' },
{ title: '持续时间(s)', field: 'evtParamTm' },
{ title: '暂降深度', field: 'evtParamVVaDepth' },
@@ -188,13 +208,17 @@ const tableStore = new TableStore({
}
})
tableStore.table.params.type = 0
tableStore.table.params.eventType=''
tableStore.table.params.location=''
provide('tableStore', tableStore)
const nodeClick = async (e: anyObj) => {
// console.log("🚀 ~ nodeClick ~ e:", e)
if (e.level == 2) {
loading.value = false
tableStore.table.params.deviceId = e.id
nextTick(() => {
tableStore.index()
})
}
}

View File

@@ -475,9 +475,8 @@ const tableStore = new TableStore({
icon: 'el-icon-Grid',
render: 'basicButton',
disabled: row => {
return (
row.devType == '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel == 'a0d4da4b5c17b2172362a3f5a27bf217'
return !(
row.devType == '2d4e186e2462590dedc765c5b6700a32'
)
},
click: row => {

View File

@@ -20,9 +20,11 @@
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
</template>
</TableHeader>
<div class="box">
<div id="luckysheet" v-loading="tableStore.table.loading"
:style="`height: calc(${tableStore.table.height} + 45px)`"></div>
<div class="box" v-loading="tableStore.table.loading">
<div id="luckysheet"
:style="`height: calc(${tableStore.table.height} + 45px)`"
v-if="tableStore.table.data.length > 0"></div>
<el-empty :style="`height: calc(${tableStore.table.height} + 45px)`" v-else description="暂无数据" />
</div>
</pane>
</splitpanes>
@@ -90,7 +92,6 @@ const flag = ref(true)
onMounted(() => {
const dom = document.getElementById('navigation-splitpanes')
if (dom) {
console.log("🚀 ~ onMounted ~ dom.offsetHeight:", dom.offsetWidth)
size.value = ((280 / (dom.offsetWidth - 7)) * 100)
}
@@ -114,11 +115,14 @@ const changetype = (val: any) => {
}
const handleNodeClick = (data: any, node: any) => {
if (data?.pid) {
dotList.value = data
setTimeout(() => {
tableStore.index()
}, 500)
} else {
tableStore.table.loading = false
}
}