承载能力评估页面 绘制 79%

This commit is contained in:
GGJ
2024-03-04 20:33:32 +08:00
parent cf70adb959
commit 4b30fc8a01
15 changed files with 950 additions and 252 deletions

View File

@@ -0,0 +1,452 @@
<template>
<div v-loading="loading">
<div>
<div id="boxi" :style="`height:${vh};overflow: hidden;`">
<div class="bx" id="wave"></div>
</div>
<el-tabs type="border-card">
<el-tab-pane label="暂态波形上送" :style="'height:' + vhh">
<el-table
stripe
:data="Data"
:height="height"
border
style="width: 100%"
header-cell-class-name="table_header"
>
<el-table-column align="center" prop="number" label="事件段"></el-table-column>
<el-table-column align="center" prop="number" label="波形起始点相位(°)">
<el-table-column align="center" prop="number" label="A相"></el-table-column>
<el-table-column align="center" prop="number" label="B相"></el-table-column>
<el-table-column align="center" prop="number" label="C相"></el-table-column>
</el-table-column>
<el-table-column align="center" prop="number" label="跳变段电压变化率(V/ms)">
<el-table-column align="center" prop="number" label="A相"></el-table-column>
<el-table-column align="center" prop="number" label="B相"></el-table-column>
<el-table-column align="center" prop="number" label="C相"></el-table-column>
</el-table-column>
<el-table-column align="center" prop="number" label="相位跳变(°)">
<el-table-column align="center" prop="number" label="A相"></el-table-column>
<el-table-column align="center" prop="number" label="B相"></el-table-column>
<el-table-column align="center" prop="number" label="C相"></el-table-column>
</el-table-column>
<el-table-column align="center" prop="number" label="总分段数目"></el-table-column>
<el-table-column
align="center"
prop="number"
label="三相电压不平衡度(%)"
width="180"
></el-table-column>
<el-table-column align="center" prop="number" label="暂降类型"></el-table-column>
<el-table-column align="center" prop="number" label="暂降原因"></el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
import { mainHeight } from '@/utils/layout'
import * as echarts from 'echarts'
import url from '@/assets/img/point.png'
import $ from 'jquery'
export default {
props: {
flag: {
type: Boolean,
default: false
},
DColor: {
type: Boolean,
default: false
},
boxoList: {
type: [Object, Array]
},
GJList: {
type: [Object, Array]
}
},
data() {
return {
loading: true,
valA: 0,
isOpen: false,
time: '',
type: '',
severity: '',
iphasic: '',
eventValue: '',
persistTime: '',
lineName: '',
subName: '',
waveDatas: [],
Data: [],
height: null,
vhh: null,
ptpass: '',
waveHeight: undefined,
$wave: undefined,
color: '#006565',
charts: {},
arrpoints: [],
titles: '',
vh: null,
vw: null,
zoom: ''
}
},
created() {},
watch: {
value: function (a, b) {
if (a == 2) {
// $("#wave1").remove();
this.initWaves()
} else {
$('#wave1').remove()
this.initWaves()
}
}
},
mounted() {
this.setHeight()
window.addEventListener('resize', this.setHeight)
this.$wave = $('#wave').eq(0)
this.$nextTick(() => {
this.query()
})
},
beforeDestroy() {
window.removeEventListener('resize', this.setHeight)
},
methods: {
setHeight() {
this.zoom = 1 / document.body.style.zoom
if (this.flag) {
// console.log(123);
this.vh = mainHeight(250).height
} else {
// console.log(3333);
this.vh = mainHeight(270).height
}
},
query() {
this.loading = true
this.initWave()
},
//开始画图
initWave() {
//清除之前增加的div
// $("#wave ~ .bx1").remove();
$('div.bx1').remove()
//设置暂降触发点的位置 一次值与二次值Y轴不同不是计算出来的
// var height = $(window).height() - 90;
var picHeight
var show = true
//var v = $("#interval").val();
var isvisible = false
picHeight = this.vh
// this.$wave.css('height', picHeight)
// this.$wave.css('width', '100%')
$('#wave').css('height', picHeight)
$('#wave').css('width', this.vw)
var adata = []
var bdata = []
var cdata = []
var max = 0
var min = 0
//绘制横向第一个波形图
this.GJList.smp_x.forEach((item, ind) => {
if (this.GJList.smp_a[ind] > max) {
max = this.GJList.smp_a[ind]
} else if (this.GJList.smp_a[ind] < min) {
min = this.GJList.smp_a[ind]
}
if (this.GJList.smp_b[ind] > max) {
max = this.GJList.smp_b[ind]
} else if (this.GJList.smp_b[ind] < min) {
min = this.GJList.smp_b[ind]
}
if (this.GJList.smp_c[ind] > max) {
max = this.GJList.smp_c[ind]
} else if (this.GJList.smp_c[ind] < min) {
min = this.GJList.smp_c[ind]
}
adata.push([item, this.GJList.smp_a[ind]])
bdata.push([item, this.GJList.smp_b[ind]])
cdata.push([item, this.GJList.smp_c[ind]])
})
//绘制瞬时波形图
// const echarts = require('echarts')
let wave = document.getElementById('wave')
let _this = this
var myChartes = echarts.init(wave)
let echartsColor = {
WordColor: '#000',
thread: '#000000',
FigureColor: [
'#07CCCA ',
'#00BFF5',
'#FFBF00',
'#77DA63',
'#D5FF6B',
'#Ff6600',
'#FF9100',
'#5B6E96',
'#66FFCC',
'#B3B3B3',
'#FF00FF',
'#CC00FF',
'#FF9999'
]
}
var option = {
tooltip: {
top: '10px',
trigger: 'axis',
borderColor: 'grey',
backgroundColor: '#fff',
style: {
color: '#000',
fontSize: '15px',
padding: 10
},
formatter: function (params) {
// console.log(params)
var tips = ''
tips += '时刻:' + params[0].data[0] + '</br/>'
for (var i = 0; i < params.length; i++) {
if (params[i].seriesName != '暂降触发点') {
tips += params[i].seriesName + ':' + params[i].value[1] + '<br/>'
}
}
return tips
},
// axisPointer: {
// type: "cross",
// label: {
// color: "#fff",
// fontSize: 16,
// },
// },
textStyle: {
color: '#fff',
fontStyle: 'normal',
opacity: 0.35,
fontSize: 14
},
backgroundColor: 'rgba(0,0,0,0.35)',
borderWidth: 0
},
title: {
left: 'center',
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.measurementPointName,
textStyle: {
fontSize: 16,
color: _this.DColor ? '#fff' : echartsColor.WordColor
}
},
legend: {
left: '5%',
top: '20',
verticalAlign: 'top',
enabled: true,
itemDistance: 5,
textStyle: {
color: _this.DColor ? '#fff' : echartsColor.WordColor,
rich: {
a: {
verticalAlign: 'middle'
}
},
padding: [2, 0, 0, 0] //[上、右、下、左]
}
},
toolbox: {
show: false,
feature: {
//restore: {},
saveAsImage: {
iconStyle: {
borderColor: _this.DColor ? '#fff' : echartsColor.WordColor
}
}
}
},
xAxis: {
type: 'value',
name: '时刻',
boundaryGap: false,
min: this.GJList.smp_x[0],
max: this.GJList.smp_x[this.GJList.smp_x.length - 1] + 1,
title: {
text: 'ms',
textStyle: {
fontSize: 12,
color: _this.DColor ? '#fff' : echartsColor.WordColor
},
enabled: true,
align: 'high'
},
splitLine: {
show: false
},
axisTick: {
alignWithLabel: true
},
axisLine: {
lineStyle: {
color: _this.DColor ? '#fff' : echartsColor.thread
},
onZero: false //-----------重点
},
axisLabel: {
color: _this.DColor ? '#fff' : echartsColor.WordColor,
formatter: function (value, index) {
if (_this.valA != (value - 0).toFixed(0)) {
_this.valA = (value - 0).toFixed(0)
return (value - 0).toFixed(0)
}
}
//rotate:39
}
// data: this.syncExtremes,
},
yAxis: {
type: 'value',
name: 'kV',
title: {
align: 'high',
offset: 0,
text: 'kV',
rotation: 0,
y: -10
},
boundaryGap: [0, '100%'],
showLastLabel: true,
max: (max + 10).toFixed(2),
min: (min - 10).toFixed(2),
opposite: false,
nameTextStyle: {
color: _this.DColor ? '#fff' : echartsColor.WordColor
},
//minInterval: 1,
type: 'value',
axisLine: {
show: true,
lineStyle: {
color: _this.DColor ? '#fff' : echartsColor.thread
},
onZero: false //-----------重点
},
axisLabel: {
color: _this.DColor ? '#fff' : echartsColor.WordColor,
formatter: function (value, index) {
return (value - 0).toFixed(2)
}
},
splitLine: {
lineStyle: {
// 使用深浅的间隔色
color: [_this.DColor ? '#fff' : echartsColor.thread],
type: 'dashed',
opacity: 0.5
}
}
},
grid: {
left: '1%',
right: '40px',
bottom: '40px',
top: '55px',
containLabel: true
},
dataZoom: [
{
type: 'inside',
height: 13,
start: 0,
bottom: '20px',
end: 100
},
{
start: 0,
height: 13,
bottom: '20px',
end: 100
}
],
series: [
{
name: 'A相',
type: 'line',
smooth: true,
symbol: 'none',
sampling: 'lttb',
itemStyle: {
color: '#FFCC00'
},
data: adata
},
{
name: 'B相',
type: 'line',
smooth: true,
symbol: 'none',
sampling: 'lttb',
itemStyle: {
color: '#009900'
},
data: bdata
},
{
name: 'C相',
type: 'line',
smooth: true,
symbol: 'none',
sampling: 'lttb',
itemStyle: {
color: '#CC0000'
},
data: cdata
},
{
name: '暂降触发点',
type: 'scatter',
symbol: 'image://' + url,
itemStyle: {
width: 16,
height: 16
},
data: [[0, min]]
}
]
}
myChartes.setOption(option)
// window.echartsArr.push(myChartes)
setTimeout(() => {
myChartes.resize()
this.loading = false
}, 400)
//第一个波形图数据绘制完毕后,绘制后续的波形图
// let waveDatasTemp = waveDatas.slice(1);
// waveDatasTemp.reverse();
}
}
}
</script>

View File

@@ -0,0 +1,140 @@
<template>
<div v-if="view2">
<el-row>
<el-col :span="12">
<span v-if="view2" style="font-size: 14px; font-weight: ; line-height: 30px">值类型选择:</span>
<el-select
v-if="view2"
style="min-width: 200px; width: 200px"
@change="changeView"
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-button v-if="view2 && senior" class="ml10" type="primary" @click="AdvancedAnalytics">高级分析</el-button>
</el-col>
<el-col :span="12">
<el-button
v-if="view2"
@click="backbxlb"
type="primary"
class="el-icon-refresh-right"
icon="el-icon-CloseBold"
style="float: right"
>
返回
</el-button>
</el-col>
</el-row>
<el-tabs v-if="view2" class="default-main" v-model="bxactiveName" @tab-click="bxhandleClick">
<el-tab-pane
label="瞬时波形"
name="ssbx"
class="boxbx pt10 pb10"
:style="'height:' + bxecharts + ';overflow-y: scroll;'"
>
<shushiboxi
v-if="bxactiveName == 'ssbx' && showBoxi"
:value="value"
:boxoList="props.boxoList"
:wp="props.wp"
></shushiboxi>
</el-tab-pane>
<el-tab-pane
label="RMS波形"
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 v-if="view3" class="pd10">
<span style="font-weight: 500; font-size: 22px">高级分析</span>
<el-button type="primary" @click="gaoBack" style="float: right">返回</el-button>
<analytics :flag="true" :GJList="GJList" :boxoList="boxoList"></analytics>
</div>
</template>
<script setup lang="ts">
import shushiboxi from '@/components/echarts/shushiboxi.vue'
import rmsboxi from '@/components/echarts/rmsboxi.vue'
import analytics from '@/components/echarts/analytics.vue'
import { ref, reactive } from 'vue'
import { analysis } from '@/api/advance-boot/analyse'
import { mainHeight } from '@/utils/layout'
const emit = defineEmits(['backbxlb'])
interface Props {
boxoList: any
wp: any,
senior?:boolean
}
const props = withDefaults(defineProps<Props>(), {
senior:false
})
const bxactiveName = ref('ssbx')
const value = ref(1)
const options = ref([
{
value: 1,
label: '一次值'
},
{
value: 2,
label: '二次值'
}
])
const bxecharts = mainHeight(95).height as any
const view2 = ref(true)
const showBoxi = ref(true)
const view3 = ref(false)
const GJList = ref([])
const bxhandleClick = (tab: any) => {
if (tab.name == 'ssbx') {
bxactiveName.value = 'ssbx'
} else if (tab.name == 'rmsbx') {
bxactiveName.value = 'rmsbx'
}
// console.log(tab, event);
}
const backbxlb = () => {
emit('backbxlb')
}
// 高级分析
const AdvancedAnalytics = () => {
analysis({
eventIndex: props.boxoList.eventId
}).then(res => {
GJList.value = res.data
view3.value = true
view2.value = false
})
}
const changeView = () => {
showBoxi.value = false
setTimeout(() => {
showBoxi.value = true
}, 0)
}
const gaoBack = () => {
view2.value = true
view3.value = false
}
</script>
<style lang="scss" scoped></style>