修改测试bug

This commit is contained in:
GGJ
2024-12-06 16:11:33 +08:00
parent 5db2b1428c
commit 366f561aa5
18 changed files with 541 additions and 456 deletions

View File

@@ -1,11 +1,11 @@
<template> <template>
<div v-loading="loading" style="position: relative"> <div v-loading="loading" style="position: relative">
<div id="boxr"> <div id="boxr">
<div id="rmsp" :style="`height:${vh};overflow: hidden;`"> <div id="rmsp" :style="`height:${vh};overflow: hidden;`">
<div class="bx" id="rms"></div> <div class="bx" id="rms"></div>
</div> </div>
</div> </div>
<!-- <el-button <!-- <el-button
style="position: absolute; right: 10px; top: 0px; z-index: 20000" style="position: absolute; right: 10px; top: 0px; z-index: 20000"
type="primary" type="primary"
link link
@@ -15,7 +15,7 @@
> >
下载 下载
</el-button> --> </el-button> -->
</div> </div>
</template> </template>
<script lang="js"> <script lang="js">
import html2canvas from "html2canvas"; import html2canvas from "html2canvas";
@@ -47,7 +47,7 @@ export default {
type: [Object, Array], type: [Object, Array],
}, },
height: { height: {
type: [String,Number], type: [String, Number],
default: false, default: false,
}, },
@@ -57,7 +57,6 @@ export default {
zoom: "", zoom: "",
loading: true, loading: true,
tabvalue: this.value, tabvalue: this.value,
valA: 0, valA: 0,
valB: 0, valB: 0,
isOpen: false, isOpen: false,
@@ -82,6 +81,7 @@ export default {
titles: "", titles: "",
vh: null, vh: null,
vw: null, vw: null,
echartlist: null
}; };
}, },
watch: { watch: {
@@ -97,13 +97,13 @@ export default {
}, },
created() { created() {
if (this.flag == 1) { if (this.flag == 1) {
this.vh = mainHeight(165).height this.vh = mainHeight(165).height
}else if( this.height != false){ } else if (this.height != false) {
this.vh = this.height this.vh = this.height
} else { } else {
this.vh = mainHeight(165,2).height this.vh = mainHeight(165, 2).height
} }
this.vw = '100%' this.vw = '100%'
}, },
mounted() { mounted() {
// this.$wave = $("#wave").eq(0); // this.$wave = $("#wave").eq(0);
@@ -115,13 +115,27 @@ export default {
this.query(); this.query();
}, },
methods: { methods: {
backbxlb() {
if (this.echartlist.length > 0) {
this.waveDatas = []
this.echartlist.forEach(item => {
item.dispose(); // 销毁echarts实例
})
}
},
download() { download() {
// 转换成canvas // 转换成canvas
html2canvas(document.getElementById("boxr"), { html2canvas(document.getElementById("boxr"), {
scale: 2, scale: 2,
}).then(function (canvas) { }).then(function (canvas) {
// 创建a标签实现下载 // 创建a标签实现下载
var creatIMg = document.createElement("a"); let creatIMg = document.createElement("a");
creatIMg.download = "rms波形.png"; // 设置下载的文件名, creatIMg.download = "rms波形.png"; // 设置下载的文件名,
creatIMg.href = canvas.toDataURL(); // 下载url creatIMg.href = canvas.toDataURL(); // 下载url
creatIMg.click(); creatIMg.click();
@@ -195,7 +209,7 @@ export default {
"% 持续时间:" + "% 持续时间:" +
this.boxoList.duration + this.boxoList.duration +
"s"; "s";
} else if(this.boxoList.systemType == "ZL"){ } else if (this.boxoList.systemType == "ZL") {
this.titles = this.titles =
// "变电站名称:" + // "变电站名称:" +
// this.boxoList.equipmentName + // this.boxoList.equipmentName +
@@ -204,11 +218,11 @@ export default {
" 发生时刻:" + " 发生时刻:" +
this.boxoList.startTime + this.boxoList.startTime +
" 暂降(骤升)幅值:" + " 暂降(骤升)幅值:" +
this.boxoList.evtParamVVaDepth + this.boxoList.evtParamVVaDepth +
" 持续时间:" + " 持续时间:" +
this.boxoList.evtParamTm + this.boxoList.evtParamTm +
"s"; "s";
}else { } else {
this.titles = this.titles =
"变电站名称:" + "变电站名称:" +
this.boxoList.subName + this.boxoList.subName +
@@ -234,24 +248,24 @@ export default {
if (this.iphasic === 0) { if (this.iphasic === 0) {
this.iphasic = 1; this.iphasic = 1;
} }
var picCounts = (this.wp.waveTitle.length - 1) / this.iphasic; let picCounts = (this.wp.waveTitle.length - 1) / this.iphasic;
this.waveDatas = []; this.waveDatas = [];
//循环筛选需求的数据 //循环筛选需求的数据
for (var i = 0; i < picCounts; i++) { for (let i = 0; i < picCounts; i++) {
this.fliteWaveData(this.wp, i) this.fliteWaveData(this.wp, i)
this.waveDatas.push({ this.waveDatas.push({
instantF :this.instantF, instantF: this.instantF,
instantS :this.instantS, instantS: this.instantS,
RMSF :this.RMSF, RMSF: this.RMSF,
RMSS :this.RMSS, RMSS: this.RMSS,
RMSFMinDetail :this.RMSFMinDetail, RMSFMinDetail: this.RMSFMinDetail,
RMSSMinDetail :this.RMSSMinDetail, RMSSMinDetail: this.RMSSMinDetail,
shunshiF :this.shunshiF, shunshiF: this.shunshiF,
shunshiS :this.shunshiS, shunshiS: this.shunshiS,
RMSFWave :this.RMSFWave, RMSFWave: this.RMSFWave,
RMSSWave :this.RMSSWave, RMSSWave: this.RMSSWave,
title :this.title, title: this.title,
unit :this.unit unit: this.unit
}); });
} }
@@ -276,31 +290,31 @@ export default {
}, },
//获取横向一个波形的全部数据包括瞬时波形的一次、二次值RMS波形的一次、二次值如果是电压的话还需要计算出对应的最大最小值 //获取横向一个波形的全部数据包括瞬时波形的一次、二次值RMS波形的一次、二次值如果是电压的话还需要计算出对应的最大最小值
fliteWaveData(wp, step) { fliteWaveData(wp, step) {
var shunData = wp.listWaveData; let shunData = wp.listWaveData;
var rmsData = wp.listRmsData; let rmsData = wp.listRmsData;
// console.log( // console.log(
// rmsData // rmsData
// ); // );
var pt = Number(wp.pt) / 1000; let pt = Number(wp.pt) / 1000;
var ct = Number(wp.ct); let ct = Number(wp.ct);
var titleList = wp.waveTitle; let titleList = wp.waveTitle;
//首先判断当前绘制的是电压还是电流 //首先判断当前绘制的是电压还是电流
var xishu = pt; //默认电压二次值转一次值乘以pt let xishu = pt; //默认电压二次值转一次值乘以pt
//三相名称 //三相名称
var aTitle = "", let aTitle = "",
bTitle = "", bTitle = "",
cTitle = "", cTitle = "",
unit = "电压"; unit = "电压";
//RMS最小值横、纵坐标、相别名称 //RMS最小值横、纵坐标、相别名称
var rmsvFirstX = 0, let rmsvFirstX = 0,
rmsvFirstY = 0, rmsvFirstY = 0,
rmsvSecondX = 0, rmsvSecondX = 0,
rmsvSecondY = 0, rmsvSecondY = 0,
firstZhou = "a", firstZhou = "a",
secondeZhou = "a"; secondeZhou = "a";
//每个波形对应的最大最小值 //每个波形对应的最大最小值
var ifmax, ifmin, ismax, ismin, rfmax, rfmin, rsmax, rsmin; let ifmax, ifmin, ismax, ismin, rfmax, rfmin, rsmax, rsmin;
var shunshiFA = [], let shunshiFA = [],
shunshiFB = [], shunshiFB = [],
shunshiFC = [], shunshiFC = [],
shunshiSA = [], shunshiSA = [],
@@ -318,7 +332,7 @@ export default {
xishu = ct; xishu = ct;
unit = "电流"; unit = "电流";
} }
for (var i = 1; i <= this.iphasic; i++) { for (let i = 1; i <= this.iphasic; i++) {
switch (i) { switch (i) {
case 1: case 1:
aTitle = titleList[this.iphasic * step + i].substring(1); aTitle = titleList[this.iphasic * step + i].substring(1);
@@ -349,43 +363,49 @@ export default {
rmsvSecondX = rmsData[0][0]; rmsvSecondX = rmsData[0][0];
} }
//瞬时值--同时还需要获取出瞬时值的一次、二次的最大最小值 //瞬时值--同时还需要获取出瞬时值的一次、二次的最大最小值
for (var shun = 0; shun < shunData.length; shun++) { for (let shun = 0; shun < shunData.length; shun++) {
if (shunData[shun][this.iphasic * step + 1] === undefined) { if (shunData[shun][this.iphasic * step + 1] === undefined) {
break; break;
} }
let shunFirstA = []
let shunFirstB = []
let shunFirstC = []
let shunSecondA = []
let shunSecondB = []
let shunSecondC = []
//根据波形数据相的数量来筛选数据 //根据波形数据相的数量来筛选数据
switch (this.iphasic) { switch (this.iphasic) {
case 1: case 1:
var shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu; shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu;
shunshiFA.push([shunData[shun][0], shunFirstA]); shunshiFA.push([shunData[shun][0], shunFirstA]);
ifmax = ifmax > shunFirstA ? ifmax : shunFirstA; ifmax = ifmax > shunFirstA ? ifmax : shunFirstA;
ifmin = ifmin < shunFirstA ? ifmin : shunFirstA; ifmin = ifmin < shunFirstA ? ifmin : shunFirstA;
var shunSecondA = shunData[shun][this.iphasic * step + 1]; shunSecondA = shunData[shun][this.iphasic * step + 1];
shunshiSA.push([shunData[shun][0], shunSecondA]); shunshiSA.push([shunData[shun][0], shunSecondA]);
ismax = ismax > shunSecondA ? ismax : shunSecondA; ismax = ismax > shunSecondA ? ismax : shunSecondA;
ismin = ismin < shunSecondA ? ismin : shunSecondA; ismin = ismin < shunSecondA ? ismin : shunSecondA;
break; break;
case 2: case 2:
var shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu; shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu;
var shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu; shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu;
shunshiFA.push([shunData[shun][0], shunFirstA]); shunshiFA.push([shunData[shun][0], shunFirstA]);
shunshiFB.push([shunData[shun][0], shunFirstB]); shunshiFB.push([shunData[shun][0], shunFirstB]);
ifmax = this.getMaxTwo(ifmax, shunFirstA, shunFirstB); ifmax = this.getMaxTwo(ifmax, shunFirstA, shunFirstB);
ifmin = this.getMinOpen(ifmin, shunFirstA, shunFirstB); ifmin = this.getMinOpen(ifmin, shunFirstA, shunFirstB);
var shunSecondA = shunData[shun][this.iphasic * step + 1]; shunSecondA = shunData[shun][this.iphasic * step + 1];
var shunSecondB = shunData[shun][this.iphasic * step + 2]; shunSecondB = shunData[shun][this.iphasic * step + 2];
shunshiSA.push([shunData[shun][0], shunSecondA]); shunshiSA.push([shunData[shun][0], shunSecondA]);
shunshiSB.push([shunData[shun][0], shunSecondB]); shunshiSB.push([shunData[shun][0], shunSecondB]);
ismax = this.getMaxTwo(ismax, shunSecondA, shunSecondB); ismax = this.getMaxTwo(ismax, shunSecondA, shunSecondB);
ismin = this.getMinOpen(ismin, shunSecondA, shunSecondB); ismin = this.getMinOpen(ismin, shunSecondA, shunSecondB);
break; break;
case 3: case 3:
var shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu; shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu;
var shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu; shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu;
var shunFirstC = shunData[shun][this.iphasic * step + 3] * xishu; shunFirstC = shunData[shun][this.iphasic * step + 3] * xishu;
shunshiFA.push([shunData[shun][0], shunFirstA]); shunshiFA.push([shunData[shun][0], shunFirstA]);
shunshiFB.push([shunData[shun][0], shunFirstB]); shunshiFB.push([shunData[shun][0], shunFirstB]);
shunshiFC.push([shunData[shun][0], shunFirstC]); shunshiFC.push([shunData[shun][0], shunFirstC]);
@@ -397,9 +417,9 @@ export default {
ifmin = this.getMin(ifmin, shunFirstA, shunFirstB, shunFirstC); ifmin = this.getMin(ifmin, shunFirstA, shunFirstB, shunFirstC);
} }
var shunSecondA = shunData[shun][this.iphasic * step + 1]; shunSecondA = shunData[shun][this.iphasic * step + 1];
var shunSecondB = shunData[shun][this.iphasic * step + 2]; shunSecondB = shunData[shun][this.iphasic * step + 2];
var shunSecondC = shunData[shun][this.iphasic * step + 3]; shunSecondC = shunData[shun][this.iphasic * step + 3];
shunshiSA.push([shunData[shun][0], shunSecondA]); shunshiSA.push([shunData[shun][0], shunSecondA]);
shunshiSB.push([shunData[shun][0], shunSecondB]); shunshiSB.push([shunData[shun][0], shunSecondB]);
shunshiSC.push([shunData[shun][0], shunSecondC]); shunshiSC.push([shunData[shun][0], shunSecondC]);
@@ -420,14 +440,20 @@ export default {
} }
//RMS值--同时还需要获取出RMS值的一次、二次的最大最小值 //RMS值--同时还需要获取出RMS值的一次、二次的最大最小值
for (var rms = 0; rms < rmsData.length; rms++) { for (let rms = 0; rms < rmsData.length; rms++) {
if (rmsData[rms][this.iphasic * step + 1] === undefined) { if (rmsData[rms][this.iphasic * step + 1] === undefined) {
break; break;
} }
let rmsFirstA = []
let rmsFirstB = []
let rmsFirstC = []
let rmsSecondA = []
let rmsSecondB = []
let rmsSecondC = []
//根据波形数据相的数量来筛选数据 //根据波形数据相的数量来筛选数据
switch (this.iphasic) { switch (this.iphasic) {
case 1: case 1:
var rmsFirstA = rmsData[rms][this.iphasic * step + 1] * xishu; rmsFirstA = rmsData[rms][this.iphasic * step + 1] * xishu;
rmsFA.push([rmsData[rms][0], rmsFirstA]); rmsFA.push([rmsData[rms][0], rmsFirstA]);
rfmax = rfmax > rmsFirstA ? rfmax : rmsFirstA; rfmax = rfmax > rmsFirstA ? rfmax : rmsFirstA;
rfmin = rfmin < rmsFirstA ? rfmin : rmsFirstA; rfmin = rfmin < rmsFirstA ? rfmin : rmsFirstA;
@@ -437,7 +463,7 @@ export default {
rmsvFirstX = rmsData[rms][0]; rmsvFirstX = rmsData[rms][0];
} }
var rmsSecondA = rmsData[rms][this.iphasic * step + 1]; rmsSecondA = rmsData[rms][this.iphasic * step + 1];
rmsSA.push([rmsData[rms][0], rmsSecondA]); rmsSA.push([rmsData[rms][0], rmsSecondA]);
rsmax = rsmax > rmsSecondA ? rsmax : rmsSecondA; rsmax = rsmax > rmsSecondA ? rsmax : rmsSecondA;
rsmin = rsmin < rmsSecondA ? rsmin : rmsSecondA; rsmin = rsmin < rmsSecondA ? rsmin : rmsSecondA;
@@ -448,8 +474,8 @@ export default {
} }
break; break;
case 2: case 2:
var rmsFirstA = rmsData[rms][this.iphasic * step + 1] * xishu; rmsFirstA = rmsData[rms][this.iphasic * step + 1] * xishu;
var rmsFirstB = rmsData[rms][this.iphasic * step + 2] * xishu; rmsFirstB = rmsData[rms][this.iphasic * step + 2] * xishu;
rmsFA.push([rmsData[rms][0], rmsFirstA]); rmsFA.push([rmsData[rms][0], rmsFirstA]);
rsmFB.push([rmsData[rms][0], rmsFirstB]); rsmFB.push([rmsData[rms][0], rmsFirstB]);
rfmax = this.getMaxTwo(rfmax, rmsFirstA, rmsFirstB); rfmax = this.getMaxTwo(rfmax, rmsFirstA, rmsFirstB);
@@ -464,8 +490,8 @@ export default {
rmsvFirstX = rmsData[rms][0]; rmsvFirstX = rmsData[rms][0];
} }
var rmsSecondA = rmsData[rms][this.iphasic * step + 1]; rmsSecondA = rmsData[rms][this.iphasic * step + 1];
var rmsSecondB = rmsData[rms][this.iphasic * step + 2]; rmsSecondB = rmsData[rms][this.iphasic * step + 2];
rmsSA.push([rmsData[rms][0], rmsSecondA]); rmsSA.push([rmsData[rms][0], rmsSecondA]);
rsmSB.push([rmsData[rms][0], rmsSecondB]); rsmSB.push([rmsData[rms][0], rmsSecondB]);
rsmax = this.getMaxTwo(rsmax, rmsSecondA, rmsSecondB); rsmax = this.getMaxTwo(rsmax, rmsSecondA, rmsSecondB);
@@ -481,9 +507,9 @@ export default {
} }
break; break;
case 3: case 3:
var rmsFirstA = rmsData[rms][this.iphasic * step + 1] * xishu; rmsFirstA = rmsData[rms][this.iphasic * step + 1] * xishu;
var rmsFirstB = rmsData[rms][this.iphasic * step + 2] * xishu; rmsFirstB = rmsData[rms][this.iphasic * step + 2] * xishu;
var rmsFirstC = rmsData[rms][this.iphasic * step + 3] * xishu; rmsFirstC = rmsData[rms][this.iphasic * step + 3] * xishu;
rmsFA.push([rmsData[rms][0], rmsFirstA]); rmsFA.push([rmsData[rms][0], rmsFirstA]);
rsmFB.push([rmsData[rms][0], rmsFirstB]); rsmFB.push([rmsData[rms][0], rmsFirstB]);
rmsFC.push([rmsData[rms][0], rmsFirstC]); rmsFC.push([rmsData[rms][0], rmsFirstC]);
@@ -505,9 +531,9 @@ export default {
rmsvFirstX = rmsData[rms][0]; rmsvFirstX = rmsData[rms][0];
} }
var rmsSecondA = rmsData[rms][this.iphasic * step + 1]; rmsSecondA = rmsData[rms][this.iphasic * step + 1];
var rmsSecondB = rmsData[rms][this.iphasic * step + 2]; rmsSecondB = rmsData[rms][this.iphasic * step + 2];
var rmsSecondC = rmsData[rms][this.iphasic * step + 3]; rmsSecondC = rmsData[rms][this.iphasic * step + 3];
rmsSA.push([rmsData[rms][0], rmsSecondA]); rmsSA.push([rmsData[rms][0], rmsSecondA]);
rsmSB.push([rmsData[rms][0], rmsSecondB]); rsmSB.push([rmsData[rms][0], rmsSecondB]);
rmsSC.push([rmsData[rms][0], rmsSecondC]); rmsSC.push([rmsData[rms][0], rmsSecondC]);
@@ -533,21 +559,21 @@ export default {
} }
} }
//瞬时一次值最大最小值 //瞬时一次值最大最小值
var instantFAn = {}; let instantFAn = {};
var instantSAn = {}; let instantSAn = {};
//var color; //let color;
var instantF = {}; let instantF = {};
var instantS = {}; let instantS = {};
var RMSF = {}; let RMSF = {};
var RMSS = {}; let RMSS = {};
var RMSFMinDetail = {}; let RMSFMinDetail = {};
var RMSSMinDetail = {}; let RMSSMinDetail = {};
var shunshiF = {}; let shunshiF = {};
var shunshiS = {}; let shunshiS = {};
var RMSFWave = {}; let RMSFWave = {};
var RMSSWave = {}; let RMSSWave = {};
var title = {}; let title = {};
//三相名称 //三相名称
title.aTitle = aTitle; title.aTitle = aTitle;
@@ -613,7 +639,7 @@ export default {
RMSSMinDetail.rmsvSecondX = rmsvSecondX; RMSSMinDetail.rmsvSecondX = rmsvSecondX;
RMSSMinDetail.rmsvSecondY = rmsvSecondY; RMSSMinDetail.rmsvSecondY = rmsvSecondY;
RMSSMinDetail.secondeZhou = secondeZhou; RMSSMinDetail.secondeZhou = secondeZhou;
return this.waveData( return this.waveData(
instantF, instantF,
instantS, instantS,
RMSF, RMSF,
@@ -632,33 +658,34 @@ export default {
initWave(waveDatas, time, type, severity, isOpen) { initWave(waveDatas, time, type, severity, isOpen) {
//清除之前增加的div //清除之前增加的div
// $("#wave ~ .bx").remove(); // $("#wave ~ .bx").remove();
this.echartlist = []
$("#rms ~ .bx").remove(); $("#rms ~ .bx").remove();
//设置暂降触发点的位置 一次值与二次值Y轴不同不是计算出来的 //设置暂降触发点的位置 一次值与二次值Y轴不同不是计算出来的
// var height = $(window).height() - 90; // let height = $(window).height() - 90;
var picHeight; let picHeight;
var show = true; let show = true;
if (isOpen) { if (isOpen) {
show = false; show = false;
} }
//var v = $("#interval").val(); //let v = $("#interval").val();
var isvisible = false; let isvisible = false;
var cu = [], let cu = null,
rmscu = [], rmscu = null,
rmscm = [], rmscm = null,
title, title =null,
unit, unit =null,
max, max =null,
min; min=null;
var a = "", let a = null,
b = "", b = "",
c = ""; c = "";
var adata = [], let adata = null,
bdata = [], bdata = null,
cdata = []; cdata = null;
var radata = [], let radata = null,
rbdata = [], rbdata = null,
rcdata = []; rcdata = null;
var rmsvX = 0, let rmsvX = 0,
rmsvY = 0, rmsvY = 0,
zhou = 0; zhou = 0;
// if (null == waveDatas || waveDatas.length === 1) { // if (null == waveDatas || waveDatas.length === 1) {
@@ -675,7 +702,7 @@ export default {
// this.rmsHeight = picHeight // this.rmsHeight = picHeight
// $wave.css("height", picHeight); // $wave.css("height", picHeight);
// $rms.css("height", picHeight); // $rms.css("height", picHeight);
var colors = []; let colors = [];
if (null == waveDatas) { if (null == waveDatas) {
cu = []; cu = [];
rmscu = []; rmscu = [];
@@ -801,7 +828,7 @@ export default {
break; break;
} }
if (waveDatas[0].unit === "电压") { if (waveDatas[0].unit === "电压") {
var xdata = this.wp.listRmsData[0][0]; let xdata = this.wp.listRmsData[0][0];
if (this.value === 1) { if (this.value === 1) {
this.fz = [ this.fz = [
this.wp.listRmsMinData[0][0], this.wp.listRmsMinData[0][0],
@@ -823,11 +850,10 @@ export default {
unit = "A"; unit = "A";
} }
//把剩余的DIV先拼接好 //把剩余的DIV先拼接好
for (var step = 1; step < waveDatas.length; step++) { for (let step = 1; step < waveDatas.length; step++) {
var rmsId = "rms" + step; let rmsId = "rms" + step;
var newDivRms = $( let newDivRms = $(
` <div style="height:${ ` <div style="height:${this.vh
this.vh
};overflow: hidden;"><div class='bx' id='${rmsId}' ></div></div>` };overflow: hidden;"><div class='bx' id='${rmsId}' ></div></div>`
); );
newDivRms.insertAfter($("#rmsp")); newDivRms.insertAfter($("#rmsp"));
@@ -855,27 +881,27 @@ export default {
// 绘制RMS波形图 // 绘制RMS波形图
let _this = this; let _this = this;
var myChartes = echarts.init(document.getElementById("rms")); let myChartes = echarts.init(document.getElementById("rms"));
// console.log("==========", radata); // console.log("==========", radata);
let echartsColor = {WordColor:"#000",thread:"#000000",FigureColor:["#07CCCA ","#00BFF5","#FFBF00","#77DA63","#D5FF6B","#Ff6600","#FF9100","#5B6E96","#66FFCC","#B3B3B3","#FF00FF","#CC00FF","#FF9999"]} let echartsColor = { WordColor: "#000", thread: "#000000", FigureColor: ["#07CCCA ", "#00BFF5", "#FFBF00", "#77DA63", "#D5FF6B", "#Ff6600", "#FF9100", "#5B6E96", "#66FFCC", "#B3B3B3", "#FF00FF", "#CC00FF", "#FF9999"] }
setTimeout(() => { setTimeout(() => {
document.getElementById("rms").style.width ='100%'; document.getElementById("rms").style.width = '100%';
document.getElementById("rms").style.height =_this.vh; document.getElementById("rms").style.height = _this.vh;
}, 0); }, 0);
var option = { let option = {
tooltip: { tooltip: {
top: "10px", top: "10px",
trigger: "axis", trigger: "axis",
borderColor: "grey", borderColor: "grey",
formatter: function (params) { formatter: function (params) {
var tips = ""; let tips = "";
tips += "时刻:" + params[0].data[0] + "</br/>"; tips += "时刻:" + params[0].data[0] + "</br/>";
for (var i = 0; i < params.length; i++) { for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != "暂降触发点") { if (params[i].seriesName != "暂降触发点") {
tips += tips +=
params[i].seriesName + ":" + (params[i].value[1]-0).toFixed(2) + "<br/>"; params[i].seriesName + ":" + (params[i].value[1] - 0).toFixed(2) + "<br/>";
} }
} }
return tips; return tips;
@@ -899,7 +925,7 @@ export default {
}, },
title: { title: {
left: "center", left: "center",
text: "电网侧-电压 "+title, text: "电网侧-电压 " + title,
subtitle: { subtitle: {
text: "电压", text: "电压",
align: "left", align: "left",
@@ -1137,40 +1163,41 @@ export default {
], ],
}; };
myChartes.setOption(option) myChartes.setOption(option)
// window.echartsArr.push(myChartes); // window.echartsArr.push(myChartes);
setTimeout(() => { setTimeout(() => {
myChartes.resize(); myChartes.resize();
this.loading = false; this.loading = false;
}, 500); }, 500);
this.echartlist.push(myChartes)
//第一个波形图数据绘制完毕后,绘制后续的波形图 //第一个波形图数据绘制完毕后,绘制后续的波形图
if (waveDatas !== null && waveDatas.length > 1) { if (waveDatas !== null && waveDatas.length > 1) {
var waveDatasTemp = waveDatas.slice(1); let waveDatasTemp = waveDatas.slice(1);
waveDatasTemp.reverse(); waveDatasTemp.reverse();
for (var step = 0; step < waveDatasTemp.length; step++) { for (let step = 0; step < waveDatasTemp.length; step++) {
var waveDataTemp = waveDatasTemp[step]; let waveDataTemp = waveDatasTemp[step];
this.drawPics(waveDataTemp, picHeight, step, show, myChartes,rmscm,rmscu,title); this.drawPics(waveDataTemp, picHeight, step, show, myChartes, rmscm, rmscu, title);
} }
} }
}, },
//绘制剩余横向的波形图 //绘制剩余横向的波形图
drawPics(waveDataTemp, picHeight, step, show, myChartes1,rmscm,rmscu,title) { drawPics(waveDataTemp, picHeight, step, show, myChartes1, rmscm, rmscu, title) {
step = step + 1; step = step + 1;
//新建瞬时DIV和RMS波形DIV //新建瞬时DIV和RMS波形DIV
// var waveId = 'wave' + step; // let waveId = 'wave' + step;
var rmsId = "rms" + step; let rmsId = "rms" + step;
// var v = $("#interval").val(); // let v = $("#interval").val();
var a = "", let a = "",
b = "", b = "",
c = ""; c = "";
var max, min, unit; let max, min, unit;
var adata = [], let adata =null,
bdata = [], bdata =null,
cdata = []; cdata =null;
var radata = [], let radata =null,
rbdata = [], rbdata =null,
rcdata = []; rcdata =null;
var colors = []; let colors =[];
switch (this.iphasic) { switch (this.iphasic) {
case 1: case 1:
a = waveDataTemp.title.aTitle; a = waveDataTemp.title.aTitle;
@@ -1226,58 +1253,59 @@ export default {
//绘制rms波形 //绘制rms波形
let _this = this; let _this = this;
var myChartes = echarts.init(document.getElementById(rmsId)); let myChartes = echarts.init(document.getElementById(rmsId));
//debugger //debugger
if(this.boxoList.systemType == "ZL"){ let titlename = ''
let str =[] if (this.boxoList.systemType == "ZL") {
str = rmsId.split('s') let str = []
let str1 = Number(str[1]) str = rmsId.split('s')
var titlename ='' let str1 = Number(str[1])
this.wp.channelNames.forEach((element,i) => {
if(i==4 || i==7 || i==10){ this.wp.channelNames.forEach((element, i) => {
if(str1==1 && i==4){ if (i == 4 || i == 7 || i == 10) {
let s =[] if (str1 == 1 && i == 4) {
let s1 ='' let s = []
s=element.split('A') let s1 = ''
if(s[0]=='LI'){ s = element.split('A')
s1 ='电网侧-电流' if (s[0] == 'LI') {
}else{ s1 = '电网侧-电流'
s1= s[0]+'侧'+s[1] } else {
} s1 = s[0] + '侧' + s[1]
}
titlename = s1+' '+title titlename = s1 + ' ' + title
}
if(str1==2 && i==7){
let s =[]
let s1 =''
s=element.split('A')
if(s[0]=='SU'){
s1 ='负载侧-电压'
}else{
s1= s[0]+'侧'+s[1]
} }
if (str1 == 2 && i == 7) {
let s = []
let s1 = ''
s = element.split('A')
if (s[0] == 'SU') {
s1 = '负载侧-电压'
} else {
s1 = s[0] + '侧' + s[1]
}
titlename = s1+' '+title titlename = s1 + ' ' + title
}
if(str1==3 && i==10){
let s =[]
let s1 =''
s=element.split('A')
if(s[0]=='SI'){
s1 ='负载侧-电流'
}else{
s1= s[0]+'侧'+s[1]
} }
if (str1 == 3 && i == 10) {
let s = []
let s1 = ''
s = element.split('A')
titlename = s1+' '+title if (s[0] == 'SI') {
s1 = '负载侧-电流'
} else {
s1 = s[0] + '侧' + s[1]
}
titlename = s1 + ' ' + title
}
} }
}
}); });
} }
let echartsColor = {WordColor:"#000",thread:"#000000",FigureColor:["#07CCCA ","#00BFF5","#FFBF00","#77DA63","#D5FF6B","#Ff6600","#FF9100","#5B6E96","#66FFCC","#B3B3B3","#FF00FF","#CC00FF","#FF9999"]} let echartsColor = { WordColor: "#000", thread: "#000000", FigureColor: ["#07CCCA ", "#00BFF5", "#FFBF00", "#77DA63", "#D5FF6B", "#Ff6600", "#FF9100", "#5B6E96", "#66FFCC", "#B3B3B3", "#FF00FF", "#CC00FF", "#FF9999"] }
var option = { let option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
borderColor: "grey", borderColor: "grey",
@@ -1289,13 +1317,13 @@ export default {
}, },
formatter: function (params) { formatter: function (params) {
// console.log(params) // console.log(params)
var tips = ""; let tips = "";
tips += "时刻:" + params[0].data[0] + "</br/>"; tips += "时刻:" + params[0].data[0] + "</br/>";
for (var i = 0; i < params.length; i++) { for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != "暂降触发点") { if (params[i].seriesName != "暂降触发点") {
tips += tips +=
params[i].seriesName + ":" + (params[i].value[1]-0).toFixed(2) + "<br/>"; params[i].seriesName + ":" + (params[i].value[1] - 0).toFixed(2) + "<br/>";
} }
} }
return tips; return tips;
@@ -1510,11 +1538,12 @@ export default {
], ],
}; };
myChartes.setOption(option) myChartes.setOption(option)
// window.echartsArr.push(myChartes); // window.echartsArr.push(myChartes);
setTimeout(() => { setTimeout(() => {
myChartes.resize(); myChartes.resize();
this.loading = false; this.loading = false;
}, 500); }, 500);
this.echartlist.push(myChartes)
echarts.connect([myChartes1, myChartes]); echarts.connect([myChartes1, myChartes]);
}, },
//根据多个值的比较返回其中最大值 //根据多个值的比较返回其中最大值

View File

@@ -5,14 +5,8 @@
<div class="bx" id="wave"></div> <div class="bx" id="wave"></div>
</div> </div>
</div> </div>
<el-button <el-button style="position: absolute; right: 10px; top: 0px; z-index: 20000" type="primary" link
style="position: absolute; right: 10px; top: 0px; z-index: 20000" icon="el-icon-Download" title="生成图片" @click="download">
type="primary"
link
icon="el-icon-Download"
title="生成图片"
@click="download"
>
下载 下载
</el-button> </el-button>
</div> </div>
@@ -23,6 +17,8 @@ import $ from 'jquery'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import url from '@/assets/img/point.png' import url from '@/assets/img/point.png'
import { t } from 'vxe-table'
import { set } from '@vueuse/core'
export default { export default {
props: { props: {
value: { value: {
@@ -72,15 +68,16 @@ export default {
titles: '', titles: '',
vh: null, vh: null,
vw: null, vw: null,
zoom: '' zoom: '',
echartlist: null
} }
}, },
created() { created() {
if (this.flag == 1) { if (this.flag == 1) {
this.vh = mainHeight(165).height this.vh = mainHeight(165).height
} else { } else {
this.vh = mainHeight(165,2).height this.vh = mainHeight(165, 2).height
} }
this.vw = '100%' this.vw = '100%'
}, },
@@ -96,7 +93,7 @@ export default {
} }
}, },
mounted() { mounted() {
// console.log(`123123`,this.boxoList,this.wp); // console.log(`123123`,this.boxoList,this.wp);
this.zoom = 1 / document.body.style.zoom this.zoom = 1 / document.body.style.zoom
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.zoom = 1 / document.body.style.zoom this.zoom = 1 / document.body.style.zoom
@@ -107,13 +104,27 @@ export default {
}) })
}, },
methods: { methods: {
download() { backbxlb() {
if (this.echartlist.length>0) {
console.log(123111);
this.waveDatas = []
this.echartlist.forEach(item => {
item.dispose(); // 销毁echarts实例
})
}
},
download() {
// 转换成canvas // 转换成canvas
html2canvas(document.getElementById('boxsj'), { html2canvas(document.getElementById('boxsj'), {
scale: 2 scale: 2
}).then(function (canvas) { }).then(function (canvas) {
// 创建a标签实现下载 // 创建a标签实现下载
var creatIMg = document.createElement('a') let creatIMg = document.createElement('a')
creatIMg.download = '瞬间波形.png' // 设置下载的文件名, creatIMg.download = '瞬间波形.png' // 设置下载的文件名,
creatIMg.href = canvas.toDataURL() // 下载url creatIMg.href = canvas.toDataURL() // 下载url
creatIMg.click() creatIMg.click()
@@ -190,18 +201,18 @@ export default {
if (this.iphasic === 0) { if (this.iphasic === 0) {
this.iphasic = 1 this.iphasic = 1
} }
var picCounts = (this.wp.waveTitle.length - 1) / this.iphasic let picCounts = (this.wp.waveTitle.length - 1) / this.iphasic
this.waveDatas = [] this.waveDatas = []
//循环筛选需求的数据 //循环筛选需求的数据
for (var i = 0; i < picCounts; i++) { for (let i = 0; i < picCounts; i++) {
this.fliteWaveData(this.wp, i) this.fliteWaveData(this.wp, i)
this.waveDatas.push({ this.waveDatas.push({
instantF :this.instantF, instantF: this.instantF,
instantS :this.instantS, instantS: this.instantS,
shunshiF :this.shunshiF, shunshiF: this.shunshiF,
shunshiS :this.shunshiS, shunshiS: this.shunshiS,
title :this.title, title: this.title,
unit :this.unit, unit: this.unit,
}) })
@@ -224,21 +235,21 @@ export default {
//获取横向一个波形的全部数据,包括瞬时波形的一次、二次值,如果是电压的话,还需要计算出对应的最大最小值 //获取横向一个波形的全部数据,包括瞬时波形的一次、二次值,如果是电压的话,还需要计算出对应的最大最小值
fliteWaveData(wp, step) { fliteWaveData(wp, step) {
var shunData = wp.listWaveData let shunData = wp.listWaveData
var pt = Number(wp.pt) / 1000 let pt = Number(wp.pt) / 1000
var ct = Number(wp.ct) let ct = Number(wp.ct)
var titleList = wp.waveTitle let titleList = wp.waveTitle
//首先判断当前绘制的是电压还是电流 //首先判断当前绘制的是电压还是电流
var xishu = pt //默认电压二次值转一次值乘以pt let xishu = pt //默认电压二次值转一次值乘以pt
//三相名称 //三相名称
var aTitle = '', let aTitle = '',
bTitle = '', bTitle = '',
cTitle = '', cTitle = '',
unit = '电压' unit = '电压'
//每个波形对应的最大最小值 //每个波形对应的最大最小值
var ifmax, ifmin, ismax, ismin let ifmax, ifmin, ismax, ismin
var shunshiFA = [], let shunshiFA = [],
shunshiFB = [], shunshiFB = [],
shunshiFC = [], shunshiFC = [],
shunshiSA = [], shunshiSA = [],
@@ -250,7 +261,7 @@ export default {
xishu = ct xishu = ct
unit = '电流' unit = '电流'
} }
for (var i = 1; i <= this.iphasic; i++) { for (let i = 1; i <= this.iphasic; i++) {
switch (i) { switch (i) {
case 1: case 1:
aTitle = titleList[this.iphasic * step + i].substring(1) aTitle = titleList[this.iphasic * step + i].substring(1)
@@ -271,42 +282,50 @@ export default {
} }
//瞬时值--同时还需要获取出瞬时值的一次、二次的最大最小值 //瞬时值--同时还需要获取出瞬时值的一次、二次的最大最小值
for (var shun = 0; shun < shunData.length; shun++) { for (let shun = 0; shun < shunData.length; shun++) {
if (shunData[shun][this.iphasic * step + 1] === undefined) { if (shunData[shun][this.iphasic * step + 1] === undefined) {
break break
} }
let shunFirstA = []
let shunFirstB = []
let shunFirstC = []
let shunSecondA = []
let shunSecondB = []
let shunSecondC = []
//根据波形数据相的数量来筛选数据 //根据波形数据相的数量来筛选数据
switch (this.iphasic) { switch (this.iphasic) {
case 1: case 1:
var shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu
shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu
shunshiFA.push([shunData[shun][0], shunFirstA]) shunshiFA.push([shunData[shun][0], shunFirstA])
ifmax = ifmax > shunFirstA ? ifmax : shunFirstA ifmax = ifmax > shunFirstA ? ifmax : shunFirstA
ifmin = ifmin < shunFirstA ? ifmin : shunFirstA ifmin = ifmin < shunFirstA ? ifmin : shunFirstA
var shunSecondA = shunData[shun][this.iphasic * step + 1] shunSecondA = shunData[shun][this.iphasic * step + 1]
shunshiSA.push([shunData[shun][0], shunSecondA]) shunshiSA.push([shunData[shun][0], shunSecondA])
ismax = ismax > shunSecondA ? ismax : shunSecondA ismax = ismax > shunSecondA ? ismax : shunSecondA
ismin = ismin < shunSecondA ? ismin : shunSecondA ismin = ismin < shunSecondA ? ismin : shunSecondA
break break
case 2: case 2:
var shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu
var shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu
shunshiFA.push([shunData[shun][0], shunFirstA]) shunshiFA.push([shunData[shun][0], shunFirstA])
shunshiFB.push([shunData[shun][0], shunFirstB]) shunshiFB.push([shunData[shun][0], shunFirstB])
ifmax = this.getMaxTwo(ifmax, shunFirstA, shunFirstB) ifmax = this.getMaxTwo(ifmax, shunFirstA, shunFirstB)
ifmin = this.getMinOpen(ifmin, shunFirstA, shunFirstB) ifmin = this.getMinOpen(ifmin, shunFirstA, shunFirstB)
var shunSecondA = shunData[shun][this.iphasic * step + 1] shunSecondA = shunData[shun][this.iphasic * step + 1]
var shunSecondB = shunData[shun][this.iphasic * step + 2] shunSecondB = shunData[shun][this.iphasic * step + 2]
shunshiSA.push([shunData[shun][0], shunSecondA]) shunshiSA.push([shunData[shun][0], shunSecondA])
shunshiSB.push([shunData[shun][0], shunSecondB]) shunshiSB.push([shunData[shun][0], shunSecondB])
ismax = this.getMaxTwo(ismax, shunSecondA, shunSecondB) ismax = this.getMaxTwo(ismax, shunSecondA, shunSecondB)
ismin = this.getMinOpen(ismin, shunSecondA, shunSecondB) ismin = this.getMinOpen(ismin, shunSecondA, shunSecondB)
break break
case 3: case 3:
var shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu shunFirstA = shunData[shun][this.iphasic * step + 1] * xishu
var shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu shunFirstB = shunData[shun][this.iphasic * step + 2] * xishu
var shunFirstC = shunData[shun][this.iphasic * step + 3] * xishu shunFirstC = shunData[shun][this.iphasic * step + 3] * xishu
shunshiFA.push([shunData[shun][0], shunFirstA]) shunshiFA.push([shunData[shun][0], shunFirstA])
shunshiFB.push([shunData[shun][0], shunFirstB]) shunshiFB.push([shunData[shun][0], shunFirstB])
shunshiFC.push([shunData[shun][0], shunFirstC]) shunshiFC.push([shunData[shun][0], shunFirstC])
@@ -318,9 +337,9 @@ export default {
ifmin = this.getMin(ifmin, shunFirstA, shunFirstB, shunFirstC) ifmin = this.getMin(ifmin, shunFirstA, shunFirstB, shunFirstC)
} }
var shunSecondA = shunData[shun][this.iphasic * step + 1] let shunSecondA = shunData[shun][this.iphasic * step + 1]
var shunSecondB = shunData[shun][this.iphasic * step + 2] let shunSecondB = shunData[shun][this.iphasic * step + 2]
var shunSecondC = shunData[shun][this.iphasic * step + 3] let shunSecondC = shunData[shun][this.iphasic * step + 3]
shunshiSA.push([shunData[shun][0], shunSecondA]) shunshiSA.push([shunData[shun][0], shunSecondA])
shunshiSB.push([shunData[shun][0], shunSecondB]) shunshiSB.push([shunData[shun][0], shunSecondB])
shunshiSC.push([shunData[shun][0], shunSecondC]) shunshiSC.push([shunData[shun][0], shunSecondC])
@@ -336,15 +355,15 @@ export default {
} }
} }
//瞬时一次值最大最小值 //瞬时一次值最大最小值
var instantFAn = {} let instantFAn = {}
var instantSAn = {} let instantSAn = {}
//var color; //let color;
var instantF = {} let instantF = {}
var instantS = {} let instantS = {}
var shunshiF = {} let shunshiF = {}
var shunshiS = {} let shunshiS = {}
var title = {} let title = {}
//三相名称 //三相名称
title.aTitle = aTitle title.aTitle = aTitle
@@ -383,38 +402,38 @@ export default {
} }
return this.waveData(instantF, instantS, shunshiF, shunshiS, title, unit) return this.waveData(instantF, instantS, shunshiF, shunshiS, title, unit)
}, },
//开始画图 //开始画图
initWave(waveDatas, time, type, severity, isOpen) { initWave(waveDatas, time, type, severity, isOpen) {
this.echartlist=[]
//清除之前增加的div //清除之前增加的div
// $("#wave ~ .bx1").remove(); // $("#wave ~ .bx1").remove();
$('div.bx1').remove() $('div.bx1').remove()
//设置暂降触发点的位置 一次值与二次值Y轴不同不是计算出来的 //设置暂降触发点的位置 一次值与二次值Y轴不同不是计算出来的
// var height = $(window).height() - 90; // let height = $(window).height() - 90;
var picHeight let picHeight
var show = true let show = true
if (isOpen) { if (isOpen) {
show = false show = false
} }
//var v = $("#interval").val(); //let v = $("#interval").val();
var isvisible = false let isvisible = false
var cu = [], let cu = null,
title, title = null,
unit, unit = null,
max, max = null,
min min = null
var a = '', let a = null,
b = '', b = null,
c = '' c = null
var adata = [], let adata = null,
bdata = [], bdata = null,
cdata = [] cdata = null
picHeight = this.vh picHeight = this.vh
// this.$wave.css('height', picHeight) // this.$wave.css('height', picHeight)
// this.$wave.css('width', this.vw) // this.$wave.css('width', this.vw)
var colors = [] let colors = []
if (null == waveDatas) { if (null == waveDatas) {
cu = [] cu = []
title = '该事件暂无波形图' title = '该事件暂无波形图'
@@ -499,9 +518,9 @@ export default {
unit = 'A' unit = 'A'
} }
//把剩余的DIV先拼接好 //把剩余的DIV先拼接好
for (var step = 1; step < waveDatas.length; step++) { for (let step = 1; step < waveDatas.length; step++) {
var waveId = 'wave' + step let waveId = 'wave' + step
var newDivShunshi = $(` <div style="height:${this.vh};overflow: hidden;"> let newDivShunshi = $(` <div style="height:${this.vh};overflow: hidden;">
<div class='bx1' id='${waveId}'> <div class='bx1' id='${waveId}'>
</div> </div>
</div>`) </div>`)
@@ -531,13 +550,13 @@ export default {
let wave = document.getElementById('wave') let wave = document.getElementById('wave')
let _this = this let _this = this
var myChartes = echarts.init(wave) let myChartes = echarts.init(wave)
let echartsColor = {WordColor:"#000",thread:"#000000",FigureColor:["#07CCCA ","#00BFF5","#FFBF00","#77DA63","#D5FF6B","#Ff6600","#FF9100","#5B6E96","#66FFCC","#B3B3B3","#FF00FF","#CC00FF","#FF9999"]} let echartsColor = { WordColor: "#000", thread: "#000000", FigureColor: ["#07CCCA ", "#00BFF5", "#FFBF00", "#77DA63", "#D5FF6B", "#Ff6600", "#FF9100", "#5B6E96", "#66FFCC", "#B3B3B3", "#FF00FF", "#CC00FF", "#FF9999"] }
setTimeout(() => { setTimeout(() => {
wave.style.width ='100%'; wave.style.width = '100%';
wave.style.height =_this.vh; wave.style.height = _this.vh;
}, 0); }, 0);
var option = { let option = {
tooltip: { tooltip: {
top: '10px', top: '10px',
trigger: 'axis', trigger: 'axis',
@@ -550,10 +569,10 @@ export default {
}, },
formatter: function (params) { formatter: function (params) {
// console.log(params) // console.log(params)
var tips = '' let tips = ''
tips += '时刻:' + params[0].data[0] + '</br/>' tips += '时刻:' + params[0].data[0] + '</br/>'
for (var i = 0; i < params.length; i++) { for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != '暂降触发点') { if (params[i].seriesName != '暂降触发点') {
tips += params[i].seriesName + ':' + (params[i].value[1] - 0).toFixed(2) + '<br/>' tips += params[i].seriesName + ':' + (params[i].value[1] - 0).toFixed(2) + '<br/>'
} }
@@ -776,13 +795,14 @@ export default {
myChartes.resize() myChartes.resize()
this.loading = false this.loading = false
}, 400) }, 400)
this.echartlist.push(myChartes)
//第一个波形图数据绘制完毕后,绘制后续的波形图 //第一个波形图数据绘制完毕后,绘制后续的波形图
if (waveDatas !== null && waveDatas.length > 1) { if (waveDatas !== null && waveDatas.length > 1) {
let waveDatasTemp = waveDatas.slice(1) let waveDatasTemp = waveDatas.slice(1)
waveDatasTemp.reverse() waveDatasTemp.reverse()
for (var step = 0; step < waveDatasTemp.length; step++) { for (let step = 0; step < waveDatasTemp.length; step++) {
var waveDataTemp = waveDatasTemp[step] let waveDataTemp = waveDatasTemp[step]
this.drawPics(waveDataTemp, picHeight, step, show, myChartes, title) this.drawPics(waveDataTemp, picHeight, step, show, myChartes, title)
} }
} }
@@ -792,15 +812,15 @@ export default {
let _this = this let _this = this
step = step + 1 step = step + 1
//新建瞬时DIV //新建瞬时DIV
var waveId = 'wave' + step let waveId = 'wave' + step
var a = '', let a = null,
b = '', b = null,
c = '' c = null
var max, min, unit let max, min, unit
var adata = [], let adata = null,
bdata = [], bdata = null,
cdata = [] cdata = null
var colors = [] let colors = []
switch (this.iphasic) { switch (this.iphasic) {
case 1: case 1:
a = waveDataTemp.title.aTitle a = waveDataTemp.title.aTitle
@@ -847,13 +867,14 @@ export default {
} else { } else {
unit = 'A' unit = 'A'
} }
let titlename = ''
// const echarts = require('echarts') // const echarts = require('echarts')
let waveIds = document.getElementById(waveId) let waveIds = document.getElementById(waveId)
if (this.boxoList.systemType == 'ZL') { if (this.boxoList.systemType == 'ZL') {
let str = [] let str = []
str = waveId.split('e') str = waveId.split('e')
let str1 = Number(str[1]) let str1 = Number(str[1])
var titlename = ''
this.wp.channelNames.forEach((element, i) => { this.wp.channelNames.forEach((element, i) => {
if (i == 4 || i == 7 || i == 10) { if (i == 4 || i == 7 || i == 10) {
if (str1 == 1 && i == 4) { if (str1 == 1 && i == 4) {
@@ -894,18 +915,18 @@ export default {
} }
}) })
} }
var myChartes = echarts.init(waveIds) let myChartes = echarts.init(waveIds)
let echartsColor = {WordColor:"#000",thread:"#000000",FigureColor:["#07CCCA ","#00BFF5","#FFBF00","#77DA63","#D5FF6B","#Ff6600","#FF9100","#5B6E96","#66FFCC","#B3B3B3","#FF00FF","#CC00FF","#FF9999"]} let echartsColor = { WordColor: "#000", thread: "#000000", FigureColor: ["#07CCCA ", "#00BFF5", "#FFBF00", "#77DA63", "#D5FF6B", "#Ff6600", "#FF9100", "#5B6E96", "#66FFCC", "#B3B3B3", "#FF00FF", "#CC00FF", "#FF9999"] }
var option = { let option = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
borderColor: 'grey', borderColor: 'grey',
formatter: function (params) { formatter: function (params) {
// console.log(params) // console.log(params)
var tips = '' let tips = ''
tips += '时刻:' + params[0].data[0] + '</br/>' tips += '时刻:' + params[0].data[0] + '</br/>'
for (var i = 0; i < params.length; i++) { for (let i = 0; i < params.length; i++) {
if (params[i].seriesName != '暂降触发点') { if (params[i].seriesName != '暂降触发点') {
tips += params[i].seriesName + ':' + (params[i].value[1] - 0).toFixed(2) + '<br/>' tips += params[i].seriesName + ':' + (params[i].value[1] - 0).toFixed(2) + '<br/>'
} }
@@ -1119,6 +1140,7 @@ export default {
myChartes.resize() myChartes.resize()
this.loading = false this.loading = false
}, 400) }, 400)
this.echartlist.push(myChartes)
echarts.connect([myChartes1, myChartes]) echarts.connect([myChartes1, myChartes])
}, },
//根据多个值的比较返回其中最大值 //根据多个值的比较返回其中最大值

View File

@@ -2,92 +2,67 @@
<div v-if="view2"> <div v-if="view2">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<span v-if="view2" style="font-size: 14px; font-weight: ; line-height: 30px">值类型选择:</span> <span style="font-size: 14px; line-height: 30px">值类型选择:</span>
<el-select <el-select style="min-width: 200px; width: 200px" @change="changeView" v-model="value"
v-if="view2" placeholder="请选择值类型">
style="min-width: 200px; width: 200px" <el-option v-for="item in options" :key="item.value" :label="item.label"
@change="changeView" :value="item.value"></el-option>
v-model="value"
placeholder="请选择值类型"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
<el-button v-if="view2 && senior" class="ml10" type="primary" @click="AdvancedAnalytics">高级分析</el-button> <el-button v-if="view2 && senior" class="ml10" type="primary"
@click="AdvancedAnalytics">高级分析</el-button>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-button <el-button @click="backbxlb" class="el-icon-refresh-right" icon="el-icon-CloseBold"
v-if="view2" style="float: right">
@click="backbxlb"
class="el-icon-refresh-right"
icon="el-icon-CloseBold"
style="float: right"
>
返回 返回
</el-button> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<div v-loading="loading" style="height: calc(100vh - 190px)">
<el-tabs v-if="view2" class="default-main" v-model="bxactiveName" @tab-click="bxhandleClick"> <el-tabs v-if="view4" class="default-main" v-model="bxactiveName" @tab-click="bxhandleClick">
<el-tab-pane <el-tab-pane label="瞬时波形" name="ssbx" class="boxbx pt10 pb10"
label="瞬时波形" :style="'height:' + bxecharts + ';overflow-y: scroll;'">
name="ssbx" <shushiboxi ref="shushiboxiRef" v-if="bxactiveName == 'ssbx' && showBoxi" :value="value"
class="boxbx pt10 pb10" :boxoList="boxoList" :wp="wp">
:style="'height:' + bxecharts + ';overflow-y: scroll;'" </shushiboxi>
> </el-tab-pane>
<shushiboxi <el-tab-pane label="RMS波形" class="boxbx pt10 pb10" name="rmsbx"
v-if="bxactiveName == 'ssbx' && showBoxi" :style="'height:' + bxecharts + ';overflow-y: scroll;'">
:value="value" <rmsboxi ref="rmsboxiRef" v-if="bxactiveName == 'rmsbx' && showBoxi" :value="value"
:boxoList="props.boxoList" :boxoList="boxoList" :wp="wp">
:wp="props.wp" </rmsboxi>
></shushiboxi> </el-tab-pane>
</el-tab-pane> </el-tabs>
<el-tab-pane <el-empty v-else description="暂无数据" style="height: calc(100vh - 190px)" />
label="RMS波形" </div>
class="boxbx pt10 pb10"
name="rmsbx"
:style="'height:' + bxecharts + ';overflow-y: scroll;'"
>
<rmsboxi
v-if="bxactiveName == 'rmsbx' && showBoxi"
:value="value"
:boxoList="props.boxoList"
:wp="props.wp"
></rmsboxi>
</el-tab-pane>
</el-tabs>
</div> </div>
<div v-if="view3" class="pd10"> <div v-if="view3" class="pd10">
<span style="font-weight: 500; font-size: 22px">高级分析</span> <span style="font-weight: 500; font-size: 22px">高级分析</span>
<el-button icon="el-icon-Back" @click="gaoBack" style="float: right">返回</el-button> <el-button icon="el-icon-Back" @click="gaoBack" style="float: right">返回</el-button>
<analytics :flag="true" :GJList="GJList" :boxoList="boxoList"></analytics> <analytics :flag="true" :GJList="GJList" :boxoList="boxoList"></analytics>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import shushiboxi from '@/components/echarts/shushiboxi.vue' import shushiboxi from '@/components/echarts/shushiboxi.vue'
import rmsboxi from '@/components/echarts/rmsboxi.vue' import rmsboxi from '@/components/echarts/rmsboxi.vue'
import analytics from '@/components/echarts/analytics.vue' import analytics from '@/components/echarts/analytics.vue'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
import { analysis } from '@/api/advance-boot/analyse' import { analysis } from '@/api/advance-boot/analyse'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { getMonitorEventAnalyseWave, downloadWaveFile } from '@/api/event-boot/transient'
const emit = defineEmits(['backbxlb']) const emit = defineEmits(['backbxlb'])
interface Props { interface Props {
boxoList: any // boxoList: any
wp: any, // wp: any,
senior?:boolean senior?: boolean
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
senior:false senior: false
}) })
const loading = ref(true)
const bxactiveName = ref('ssbx') const bxactiveName = ref('ssbx')
const rmsboxiRef = ref()
const value = ref(1) const value = ref(1)
const options = ref([ const options = ref([
{ {
@@ -99,27 +74,62 @@ const options = ref([
label: '二次值' label: '二次值'
} }
]) ])
const shushiboxiRef = ref()
const bxecharts = mainHeight(95).height as any const bxecharts = mainHeight(95).height as any
const view2 = ref(true) const view2 = ref(true)
const boxoList = ref(null)
const wp = ref(null)
const showBoxi = ref(true) const showBoxi = ref(true)
const view3 = ref(false) const view3 = ref(false)
const view4 = ref(false)
const GJList = ref([]) const GJList = ref([])
const open = async (row: any) => {
loading.value = true
await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
.then(res => {
row.loading = false
if (res != undefined) {
boxoList.value = row
wp.value = res.data
loading.value = false
view4.value = true
}
})
.catch(() => {
loading.value = false
})
}
const bxhandleClick = (tab: any) => { const bxhandleClick = (tab: any) => {
loading.value = true
if (tab.name == 'ssbx') { if (tab.name == 'ssbx') {
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
bxactiveName.value = 'ssbx' bxactiveName.value = 'ssbx'
} else if (tab.name == 'rmsbx') { } else if (tab.name == 'rmsbx') {
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
bxactiveName.value = 'rmsbx' bxactiveName.value = 'rmsbx'
} }
setTimeout(() => {
loading.value = false
},0)
// console.log(tab, event); // console.log(tab, event);
} }
const backbxlb = () => { const backbxlb = () => {
boxoList.value = null
wp.value = null
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
console.log("🚀 ~ backbxlb ~ rmsboxiRef.value:", rmsboxiRef.value)
emit('backbxlb') emit('backbxlb')
} }
// 高级分析 // 高级分析
const AdvancedAnalytics = () => { const AdvancedAnalytics = () => {
analysis({ analysis({
eventIndex: props.boxoList.eventId eventIndex: boxoList.value.eventId
}).then(res => { }).then(res => {
GJList.value = res.data GJList.value = res.data
view3.value = true view3.value = true
@@ -136,5 +146,6 @@ const gaoBack = () => {
view2.value = true view2.value = true
view3.value = false view3.value = false
} }
defineExpose({ open })
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -41,8 +41,8 @@
<Table ref="tableRef" /> <Table ref="tableRef" />
</div> </div>
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="view2"> <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
<waveForm senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" /> <waveForm ref="waveFormRef" senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" />
</div> </div>
</div> </div>
</template> </template>
@@ -67,7 +67,7 @@ const interfereoption = dictData.getBasicData('Interference_Source')
const eventList = dictData.getBasicData('Event_Statis') const eventList = dictData.getBasicData('Event_Statis')
const view = ref(true) const view = ref(true)
const view2 = ref(false) const view2 = ref(false)
const waveFormRef = ref()
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/event-boot/transient/getTransientValue', url: '/event-boot/transient/getTransientValue',
method: 'POST', method: 'POST',
@@ -129,20 +129,24 @@ const tableStore = new TableStore({
icon: 'el-icon-Plus', icon: 'el-icon-Plus',
render: 'basicButton', render: 'basicButton',
click: async row => { click: async row => {
row.loading = true view.value = false
boxoList.value = row setTimeout(() => {
await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 }) waveFormRef.value.open(row)
.then(res => { },100)
row.loading = false // row.loading = true
if (res != undefined) { // boxoList.value = row
wp.value = res.data // await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
view.value = false // .then(res => {
view2.value = true // row.loading = false
} // if (res != undefined) {
}) // wp.value = res.data
.catch(() => { // view.value = false
row.loading = false // view2.value = true
}) // }
// })
// .catch(() => {
// row.loading = false
// })
} }
}, },
{ {
@@ -150,7 +154,7 @@ const tableStore = new TableStore({
title: '暂无波形', title: '暂无波形',
type: '', type: '',
disabled: row => { disabled: row => {
return row.fileFlag == 1 return row.fileFlag != 0
}, },
icon: 'el-icon-Plus', icon: 'el-icon-Plus',
render: 'basicButton' render: 'basicButton'

View File

@@ -46,10 +46,7 @@ const dealStateList = ref([
label: '未解决', label: '未解决',
value: '0' value: '0'
}, },
{
label: '全部',
value: '1'
}
]) ])
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/supervision-boot/SupervisionUserComplaint/list', url: '/supervision-boot/SupervisionUserComplaint/list',

View File

@@ -62,10 +62,10 @@
</el-form-item> --> </el-form-item> -->
</template> </template>
<template #operation> <template #operation>
<el-button icon="el-icon-Plus" :disabled="flag != '2'" type="primary" @click="launch('发起预警单')"> <el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起预警单')">
发起预警单 发起预警单
</el-button> </el-button>
<el-button icon="el-icon-Plus" :disabled="flag != '2'" type="primary" @click="launch('发起告警单')"> <el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起告警单')">
发起告警单 发起告警单
</el-button> </el-button>
</template> </template>

View File

@@ -47,10 +47,7 @@ const dealStateList = ref([
label: '未解决', label: '未解决',
value: '0' value: '0'
}, },
{
label: '全部',
value: '1'
}
]) ])
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/pageProblemSurvey', url: '/supervision-boot/surveyTest/pageProblemSurvey',

View File

@@ -48,10 +48,7 @@ const dealStateList = ref([
label: '未解决', label: '未解决',
value: '0' value: '0'
}, },
{
label: '全部',
value: '1'
}
]) ])
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/supervision-boot/lineRunTestProblem/pageProblem', url: '/supervision-boot/lineRunTestProblem/pageProblem',

View File

@@ -11,7 +11,7 @@
</el-form-item> </el-form-item>
<el-form-item label="筛选"> <el-form-item label="筛选">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入关键字" <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入关键字"
clearable></el-input> clearable maxlength="32" show-word-limit></el-input>
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>

View File

@@ -10,7 +10,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="筛选"> <el-form-item label="筛选">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入关键字" clearable></el-input> <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入关键字" clearable maxlength="32" show-word-limit></el-input>
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>

View File

@@ -10,7 +10,7 @@
<el-form-item label="是否解决"> <el-form-item label="是否解决">
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决"> <el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
<el-option label="未解决" value="0"></el-option> <el-option label="未解决" value="0"></el-option>
<el-option label="全部" value="1"></el-option> <!-- <el-option label="全部" value="1"></el-option> -->
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>

View File

@@ -116,26 +116,28 @@
<el-input v-model.trim="form.latitude" :disabled="form.customSubstationFlag == 0" type="text" <el-input v-model.trim="form.latitude" :disabled="form.customSubstationFlag == 0" type="text"
placeholder="请输入纬度" /> placeholder="请输入纬度" />
</el-form-item> </el-form-item>
<el-form-item for="-" label="终端编码:" prop="monitoringTerminalCode">
<el-input v-model.trim="form.monitoringTerminalCode" autocomplete="off" placeholder="请输入终端编码"
@input="encode" />
</el-form-item>
<el-form-item for="-" label="终端名称:" prop="monitoringTerminalName">
<el-input v-model.trim="form.monitoringTerminalName" autocomplete="off" placeholder="请输入终端名称" />
</el-form-item>
<el-form-item for="-" label="终端型号:" prop="terminalType"> <el-form-item for="-" label="终端型号:" prop="terminalType">
<el-select v-model="form.terminalType" filterable clearable style="width: 100%" placeholder="请选择终端型号"> <el-select v-model="form.terminalType" filterable clearable style="width: 100%" placeholder="请选择终端型号">
<el-option v-for="item in terminalTypeList" :key="item.id" :label="item.name" <el-option v-for="item in terminalTypeList" :key="item.id" :label="item.name"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item for="-" label="终端名称:" prop="monitoringTerminalName">
<el-input v-model.trim="form.monitoringTerminalName" autocomplete="off" placeholder="请输入终端名称" />
</el-form-item>
<el-form-item for="-" label="通讯类型:"> <el-form-item for="-" label="通讯类型:">
<el-select v-model="form.frontType" clearable style="width: 100%" placeholder="请选择通讯类型"> <el-select v-model="form.frontType" clearable style="width: 100%" placeholder="请选择通讯类型">
<el-option v-for="item in frontTypeList" :key="item.id" :label="item.name" <el-option v-for="item in frontTypeList" :key="item.id" :label="item.name"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item for="-" label="终端编码:" prop="monitoringTerminalCode">
<el-input v-model.trim="form.monitoringTerminalCode" autocomplete="off" placeholder="请输入终端编码"
@change="encode" />
</el-form-item>
<el-form-item v-if="false" for="-" label="通讯状态:" prop="communicationStatus"> <el-form-item v-if="false" for="-" label="通讯状态:" prop="communicationStatus">
<el-select v-model="form.communicationStatus" clearable style="width: 100%" placeholder="请选择通讯状态" <el-select v-model="form.communicationStatus" clearable style="width: 100%" placeholder="请选择通讯状态"
:disabled="true"> :disabled="true">

View File

@@ -46,10 +46,7 @@ const dealStateList = ref([
label: '未解决', label: '未解决',
value: '0' value: '0'
}, },
{
label: '全部',
value: '1'
}
]) ])
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/supervision-boot/SupervisionUserComplaint/list', url: '/supervision-boot/SupervisionUserComplaint/list',

View File

@@ -47,10 +47,7 @@ const dealStateList = ref([
label: '未解决', label: '未解决',
value: '0' value: '0'
}, },
{
label: '全部',
value: '1'
}
]) ])
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/pageProblemSurvey', url: '/supervision-boot/surveyTest/pageProblemSurvey',

View File

@@ -48,10 +48,7 @@ const dealStateList = ref([
label: '未解决', label: '未解决',
value: '0' value: '0'
}, },
{
label: '全部',
value: '1'
}
]) ])
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/supervision-boot/lineRunTestProblem/pageProblem', url: '/supervision-boot/lineRunTestProblem/pageProblem',

View File

@@ -79,7 +79,7 @@
<Table ref="tableRef" /> <Table ref="tableRef" />
</div> </div>
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view"> <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
<waveForm senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" /> <waveForm ref="waveFormRef" senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" />
</div> </div>
<addForm ref="addFormRef" @onSubmit="tableStore.index()" /> <addForm ref="addFormRef" @onSubmit="tableStore.index()" />
</div> </div>
@@ -103,8 +103,7 @@ defineOptions({
}) })
const dictData = useDictData() const dictData = useDictData()
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const waveFormRef=ref()
const pageHeight = mainHeight(20) const pageHeight = mainHeight(20)
const view = ref(true) const view = ref(true)
const addFormRef = ref() const addFormRef = ref()
@@ -216,19 +215,23 @@ const tableStore = new TableStore({
icon: 'el-icon-Plus', icon: 'el-icon-Plus',
render: 'basicButton', render: 'basicButton',
click: async row => { click: async row => {
row.loading = true // row.loading = true
boxoList.value = row view.value = false
await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 }) setTimeout(() => {
.then(res => { waveFormRef.value.open(row)
row.loading = false },100)
if (res != undefined) { // boxoList.value = row
wp.value = res.data // await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
view.value = false // .then(res => {
} // row.loading = false
}) // if (res != undefined) {
.catch(() => { // wp.value = res.data
row.loading = false // view.value = false
}) // }
// })
// .catch(() => {
// row.loading = false
// })
} }
}, },
{ {

View File

@@ -31,8 +31,8 @@
</vxe-table> </vxe-table>
</el-dialog> </el-dialog>
</div> </div>
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="view2"> <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
<waveForm senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" /> <waveForm ref="waveFormRef" senior :boxoList="boxoList" :wp="wp" @backbxlb="backbxlb" />
</div> </div>
</div> </div>
</template> </template>
@@ -59,7 +59,7 @@ const loading = ref(false)
const view = ref(true) const view = ref(true)
const view2 = ref(false) const view2 = ref(false)
const TableHeaderRef = ref() const TableHeaderRef = ref()
const waveFormRef = ref()
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/advance-boot/process/querySagEventsPage', url: '/advance-boot/process/querySagEventsPage',
method: 'POST', method: 'POST',
@@ -126,20 +126,24 @@ const tableStore = new TableStore({
icon: 'el-icon-Plus', icon: 'el-icon-Plus',
render: 'basicButton', render: 'basicButton',
click: async row => { click: async row => {
row.loading = true view.value = false
boxoList.value = row setTimeout(() => {
await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 }) waveFormRef.value.open(row)
.then(res => { },100)
row.loading = false // row.loading = true
if (res != undefined) { // boxoList.value = row
wp.value = res.data // await getMonitorEventAnalyseWave({ id: row.eventId, systemType: 0 })
view.value = false // .then(res => {
view2.value = true // row.loading = false
} // if (res != undefined) {
}) // wp.value = res.data
.catch(() => { // view.value = false
row.loading = false // view2.value = true
}) // }
// })
// .catch(() => {
// row.loading = false
// })
} }
}, },
{ {
@@ -147,7 +151,7 @@ const tableStore = new TableStore({
title: '暂无波形', title: '暂无波形',
type: '', type: '',
disabled: row => { disabled: row => {
return row.fileFlag == 1 return row.fileFlag != 0
}, },
icon: 'el-icon-Plus', icon: 'el-icon-Plus',
render: 'basicButton' render: 'basicButton'

View File

@@ -1,13 +1,19 @@
<template> <template>
<div> <div>
<!-- 表头 --> <div v-show="view">
<TableHeader date-picker> <!-- 表头 -->
<template v-slot:operation> <TableHeader date-picker>
<el-button :icon='Download' type='primary' @click='download'>波形下载</el-button> <template v-slot:operation>
</template> <el-button :icon='Download' type='primary' @click='download'>波形下载</el-button>
</TableHeader> </template>
<!-- 表格 --> </TableHeader>
<Table ref='tableRef' :checkboxConfig='checkboxConfig' /> <!-- 表格 -->
<Table ref='tableRef' :checkboxConfig='checkboxConfig' />
</div>
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
<waveForm ref="waveFormRef" senior @backbxlb="backbxlb" />
</div>
</div> </div>
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
@@ -21,9 +27,13 @@ import { mainHeight } from '@/utils/layout'
import { useMonitoringPoint } from '@/stores/monitoringPoint' import { useMonitoringPoint } from '@/stores/monitoringPoint'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import { checkUser } from '@/api/user-boot/user' import { checkUser } from '@/api/user-boot/user'
import waveForm from '@/components/echarts/waveForm.vue'
import { VxeTablePropTypes } from 'vxe-table' import { VxeTablePropTypes } from 'vxe-table'
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient' import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
const view = ref(true)
const waveFormRef = ref()
const view2 = ref(false)
const pageHeight = mainHeight(20)
const dictData = useDictData() const dictData = useDictData()
const eventTypeOptions = dictData.getBasicData('Event_Statis') const eventTypeOptions = dictData.getBasicData('Event_Statis')
const monitoringPoint = useMonitoringPoint() const monitoringPoint = useMonitoringPoint()
@@ -53,7 +63,7 @@ const tableStore = new TableStore({
buttons: [ buttons: [
{ {
name: 'edit', name: 'edit',
title: '波形查看', title: '波形分析',
type: 'primary', type: 'primary',
icon: 'el-icon-Lock', icon: 'el-icon-Lock',
render: 'basicButton', render: 'basicButton',
@@ -61,15 +71,29 @@ const tableStore = new TableStore({
return row.fileFlag === 0 return row.fileFlag === 0
}, },
click: row => { click: row => {
getMonitorEventAnalyseWave({ // getMonitorEventAnalyseWave({
id: row.eventId, // id: row.eventId,
systemType: 0, // systemType: 0,
type: 0 // type: 0
}).then(res => { // }).then(res => {
console.log(res) // console.log(res)
ElMessage.error('暂无可下载的波形文件!') // ElMessage.error('暂无可下载的波形文件!')
}) // })
view.value = false
setTimeout(() => {
waveFormRef.value.open(row)
}, 100)
} }
},
{
name: 'edit',
title: '暂无波形',
type: '',
disabled: row => {
return row.fileFlag != 0
},
icon: 'el-icon-Plus',
render: 'basicButton'
} }
] ]
} }
@@ -96,6 +120,10 @@ const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig<any>>({
return row.fileFlag === 1 return row.fileFlag === 1
} }
}) })
const backbxlb = () => {
view.value = true
view2.value = false
}
const download = () => { const download = () => {
if (!tableStore.table.selection.length) { if (!tableStore.table.selection.length) {
ElMessage.warning('请选择数据') ElMessage.warning('请选择数据')