修改大屏和后台前端

dev_xd
haha 2025-05-10 01:07:53 +08:00
parent 08df9489a5
commit 9864ee43c7
3 changed files with 529 additions and 394 deletions

View File

@ -1,16 +1,14 @@
<template>
<div :style="{ 'height': height + 'px' }" ref="chart">
</div>
<div :style="{ 'height': height + 'px' }" ref="chart"></div>
</template>
<script>
export default {
props: {
data: {
type: [Object, Array]
type: [Object, Array],
},
height: {
type: Number
type: Number,
},
},
data() {
@ -27,7 +25,7 @@ export default {
},
getChartData() {
//
var chChartPie = echarts.init(this.$refs.chart);
var chChartPie = echarts.init(this.$refs.chart)
this.echartPie(chChartPie, this.data)
},
echartPie(chChart, data) {
@ -42,9 +40,9 @@ export default {
for (let i = 0; i < data.lineData.length; i++) {
series.push({
name: data.legend[i],
type: "line",
type: 'line',
smooth: true,
symbol: "circle",
symbol: 'circle',
symbolSize: 5,
showSymbol: false,
lineStyle: {
@ -59,7 +57,7 @@ export default {
},
},
data: data.lineData[i],
},)
})
}
}
@ -67,103 +65,110 @@ export default {
if (data.unit) {
unit = '单位:' + data.unit
}
let is1K = this.$dpi() == '1K'
let is2K = this.$dpi() == '2K'
this.option = {
tooltip: {
trigger: "axis",
trigger: 'axis',
axisPointer: {
lineStyle: {
color: "#57617B",
color: '#57617B',
},
},
textStyle: {
fontSize: is1K ? 12 : is2K ? 18 : 20,
},
},
legend: {
icon: "rect",
icon: 'rect',
itemWidth: 14,
itemHeight: 10,
itemGap: 15,
data: data.legend,
top: -5,
textStyle: {
fontSize: 14,
color: "#c8dbfc",
fontSize: is1K ? 12 : is2K ? 20 : 30,
color: '#c8dbfc',
},
},
grid: {
top: '15%',
left: "2%",
right: "3%",
bottom: "2%",
left: '2%',
right: '3%',
bottom: '2%',
containLabel: true,
},
xAxis: {
boundaryGap: false,
type: "category",
type: 'category',
data: data.date,
axisLine: {
//线x
show: true,
lineStyle: {
color: "#25597e",
type: "dashed",
color: '#25597e',
type: 'dashed',
},
},
axisTick: {
show: false
show: false,
},
axisLabel: {
//
textStyle: {
color: "#c5d9fc",
color: '#c5d9fc',
margin: 20,
fontSize: 14
fontSize: 12,
},
},
},
yAxis: {
name: unit,
type: "value",
type: 'value',
nameTextStyle: {
color: '#c5d9fc',
fontSize: is1K ? 12 : is2K ? 18 : 24,
},
axisLine: {
//线x
show: false,
lineStyle: {
color: "#c5d9fc",
type: "dashed",
color: '#c5d9fc',
type: 'dashed',
},
},
axisTick: {
show: false
show: false,
},
axisLabel: {
show: true,
//
textStyle: {
color: "#c5d9fc",
color: '#c5d9fc',
margin: 20,
fontSize: 14
fontSize: is1K ? 12 : is2K ? 16 : 20,
},
},
splitLine: {
show: true,
lineStyle: {
color: "#25597e",
type: "dashed",
color: '#25597e',
type: 'dashed',
},
},
},
series: series
};
chChart.setOption(this.option);
window.onresize = chChart.resize;
series: series,
}
chChart.setOption(this.option)
window.onresize = chChart.resize
})
},
},
watch: {
data: function (n, o) {
this.getChartData()
}
}
},
},
}
</script>

View File

@ -1,7 +1,7 @@
<template>
<div class="project-power-iot main-page">
<el-col :span="18">
<module-one-1-3 label="配电箱监测">
<el-col :span="18" style="height: 100%;">
<module-one-1-3 label="配电箱监测" class="left-data1">
<el-row>
<el-col :span="5">
<div class="process-control-current-value-con">
@ -10,7 +10,10 @@
</div>
<div class="process-control-current-value-data">
<div>A相电压</div>
<p v-cloak>{{ runData.voltageA }} <span></span></p>
<p v-cloak>
{{ runData.voltageA }}
<span></span>
</p>
</div>
</div>
</el-col>
@ -21,7 +24,10 @@
</div>
<div class="process-control-current-value-data">
<div>B相电压</div>
<p v-cloak>{{ runData.voltageB }} <span></span></p>
<p v-cloak>
{{ runData.voltageB }}
<span></span>
</p>
</div>
</div>
</el-col>
@ -32,7 +38,10 @@
</div>
<div class="process-control-current-value-data">
<div>C相电压</div>
<p v-cloak>{{ runData.voltageC }} <span></span></p>
<p v-cloak>
{{ runData.voltageC }}
<span></span>
</p>
</div>
</div>
</el-col>
@ -43,7 +52,10 @@
</div>
<div class="process-control-current-value-data">
<div>零线温度</div>
<p v-cloak>{{ runData.temperature }} <span></span></p>
<p v-cloak>
{{ runData.temperature }}
<span></span>
</p>
</div>
</div>
</el-col>
@ -51,7 +63,10 @@
<div class="process-control-current-value-con">
<div class="process-control-current-value-data">
<div>温度阈值</div>
<p class="red-data">{{ powerRun.ratedTemperature }} <span></span></p>
<p class="red-data">
{{ powerRun.ratedTemperature }}
<span></span>
</p>
</div>
</div>
</el-col>
@ -64,7 +79,10 @@
</div>
<div class="process-control-current-value-data">
<div>A相电流</div>
<p v-cloak>{{ runData.currentA }} <span>A</span></p>
<p v-cloak>
{{ runData.currentA }}
<span>A</span>
</p>
</div>
</div>
</el-col>
@ -75,7 +93,10 @@
</div>
<div class="process-control-current-value-data">
<div>B相电流</div>
<p v-cloak>{{ runData.currentB }} <span>A</span></p>
<p v-cloak>
{{ runData.currentB }}
<span>A</span>
</p>
</div>
</div>
</el-col>
@ -86,7 +107,10 @@
</div>
<div class="process-control-current-value-data">
<div>C相电流</div>
<p v-cloak>{{ runData.currentC }} <span>A</span></p>
<p v-cloak>
{{ runData.currentC }}
<span>A</span>
</p>
</div>
</div>
</el-col>
@ -94,31 +118,20 @@
</module-one-1-3>
<module-one-1-3 label="电压监控">
<div class="sjk-chart-line-title quality-button">
<div :class="trendBtnNav == 7 ? 'active' : ''" @click="initTrendData(7)">
近7天
<div :class="trendBtnNav == 7 ? 'active' : ''" @click="initTrendData(7)">7</div>
<div :class="trendBtnNav == 30 ? 'active' : ''" @click="initTrendData(30)">30</div>
</div>
<div :class="trendBtnNav == 30 ? 'active' : ''" @click="initTrendData(30)">
近30天
</div>
</div>
<trend-chart-line :height="220" :data="trendData"></trend-chart-line>
<trend-chart-line :key="chartKey" :height="chartHeight" :data="trendData"></trend-chart-line>
</module-one-1-3>
<module-one-1-3 label="电流监控">
<div class="sjk-chart-line-title quality-button">
<div :class="tumidityBtnNav == 7 ? 'active' : ''" @click="initTumidityData(7)">
近7天
<div :class="tumidityBtnNav == 7 ? 'active' : ''" @click="initTumidityData(7)">7</div>
<div :class="tumidityBtnNav == 30 ? 'active' : ''" @click="initTumidityData(30)">30</div>
</div>
<div
:class="tumidityBtnNav == 30 ? 'active' : ''"
@click="initTumidityData(30)"
>
近30天
</div>
</div>
<trend-chart-line :height="220" :data="tumidityData"></trend-chart-line>
<trend-chart-line :key="chartKey" :height="chartHeight" :data="tumidityData"></trend-chart-line>
</module-one-1-3>
</el-col>
<el-col :span="6">
<el-col :span="6" style="height: 100%;">
<div class="analyse-max">
<div class="analyse-map">
<div class="analyse-title analyse_title_blue">
@ -133,8 +146,7 @@
<div class="hj-moment-choice">
<div class="hj-moment-select">
<el-select v-model="powerRunId" @change="doIotSelect" popper-class="header-sel-project-pop">
<el-option v-for="item in powerRunList" :key="item.id" :label="item.deviceSn+'_'+item.deviceName"
:value="item.id"></el-option>
<el-option v-for="item in powerRunList" :key="item.id" :label="item.deviceSn+'_'+item.deviceName" :value="item.id"></el-option>
</el-select>
</div>
<div class="hj-moment-state">
@ -147,9 +159,7 @@
<tr>
<td>电箱等级</td>
<td>
<div class="hj-moment-blue">
{{ powerRun.levels }} 级配电箱
</div>
<div class="hj-moment-blue">{{ powerRun.levels }} 级配电箱</div>
</td>
</tr>
<tr>
@ -180,19 +190,10 @@
<div class="analyse-text">正在发生</div>
</div>
<div class="afoot-content">
<div
class="afoot-overflow process-afoot-overflow"
style="height: 530px"
id="afootOverflow"
@mouseout="listMinMouseout"
@mouseover="listMinMouseover"
>
<div class="afoot-overflow process-afoot-overflow" style="height: 530px" id="afootOverflow" @mouseout="listMinMouseout" @mouseover="listMinMouseover">
<div v-if="warningDataList.length == 0" class="not-data"></div>
<div
v-if="warningDataList.length > 0"
:class="forIndex == i ? 'afoot-con-for active' : 'afoot-con-for '"
v-for="(item, i) in warningDataList"
>
<template v-if="warningDataList.length > 0">
<div :key="i" :class="forIndex == i ? 'afoot-con-for active' : 'afoot-con-for '" v-for="(item, i) in warningDataList">
<div class="afoot-machinery-nam" v-cloak>{{ item.warningType }}</div>
<div class="afoot-machinery-info">
<div class="afoot-machinery-data">
@ -201,6 +202,7 @@
</div>
</div>
</div>
</template>
</div>
</div>
</div>
@ -213,9 +215,9 @@ export default {
data() {
return {
runData: {
voltageA:0.00,
voltageB:0.00,
voltageC:0.00,
voltageA: 0.0,
voltageB: 0.0,
voltageC: 0.0,
},
powerRun: {},
powerRunId: 0,
@ -227,141 +229,269 @@ export default {
warningDataList: [],
forIndex: 0,
warningInterval: undefined,
};
dpi: '',
chartKey: 0,
chartHeight: 220,
}
},
mounted() {
this.$store.dispatch("ChangeNav", 306);
this.$bus.$on("projectChange", (prj) => {
this.selProject = prj;
this.init();
});
this.selProject = this.$store.getters.selProject;
this.init();
this.$store.dispatch('ChangeNav', 306)
this.$bus.$on('projectChange', (prj) => {
this.selProject = prj
this.init()
})
this.selProject = this.$store.getters.selProject
this.reSize()
window.addEventListener('resize', () => {
if (this.dpi != this.$dpi()) {
this.reSize()
}
})
this.init()
},
methods: {
reSize() {
this.dpi = this.$dpi()
this.chartHeight = this.dpi == '1K' ? 180 : this.dpi == '2K' ? 260 : 500
this.chartKey++
console.log('------>', this.chartHeight)
},
init() {
if (!this.selProject) {
return;
return
}
this.$api.powerIot.findProAllConfigPoint(this.selProject.id).then((res) => {
if (res.data.length > 0) {
this.powerRunId = res.data[0].id;
this.powerRun = res.data[0];
this.initTrendData();
this.initTumidityData();
this.initPowerWarning();
this.powerRunId = res.data[0].id
this.powerRun = res.data[0]
this.initTrendData()
this.initTumidityData()
this.initPowerWarning()
}
this.powerRunList = res.data;
});
this.powerRunList = res.data
})
},
initTrendData(_date) {
if (_date) {
this.trendBtnNav = _date;
this.trendBtnNav = _date
}
this.$api.powerIot
.findIotDatasMonitor(this.selProject.id, this.powerRun.id, this.trendBtnNav)
.then((res) => {
this.$api.powerIot.findIotDatasMonitor(this.selProject.id, this.powerRun.id, this.trendBtnNav).then((res) => {
if (res.data.length > 0) {
this.runData = res.data[0];
res.data.reverse();
let _data1 = [];
let _data2 = [];
let _data3 = [];
let _data4 = [];
let _data5 = [];
let _data6 = [];
let _date8 = [];
res.data.forEach(item => {
_data1.push(item.voltageA);
_data2.push(item.voltageB);
_data3.push(item.voltageC);
_data4.push(item.voltageAb);
_data5.push(item.voltageBc);
_data6.push(item.voltageCa);
_date8.push(item.createTime);
});
let _lineData = [];
_lineData.push(_data1);
_lineData.push(_data2);
_lineData.push(_data3);
_lineData.push(_data4);
_lineData.push(_data5);
_lineData.push(_data6);
let _color = ['#0078e7','#f8e04d','#00bcd4','#008ffd','#f6d023','#5af9fd'];
let _legend = ['A相电压','B相电压','C相电压','AB相电压','BC相电压','CA相电压'];
let _trendData = {'lineData':_lineData,'color':_color,'legend':_legend,'unit':'V','date':_date8};
this.trendData = _trendData;
this.runData = res.data[0]
res.data.reverse()
let _data1 = []
let _data2 = []
let _data3 = []
let _data4 = []
let _data5 = []
let _data6 = []
let _date8 = []
res.data.forEach((item) => {
_data1.push(item.voltageA)
_data2.push(item.voltageB)
_data3.push(item.voltageC)
_data4.push(item.voltageAb)
_data5.push(item.voltageBc)
_data6.push(item.voltageCa)
_date8.push(item.createTime)
})
let _lineData = []
_lineData.push(_data1)
_lineData.push(_data2)
_lineData.push(_data3)
_lineData.push(_data4)
_lineData.push(_data5)
_lineData.push(_data6)
let _color = ['#0078e7', '#f8e04d', '#00bcd4', '#008ffd', '#f6d023', '#5af9fd']
let _legend = ['A相电压', 'B相电压', 'C相电压', 'AB相电压', 'BC相电压', 'CA相电压']
let _trendData = { lineData: _lineData, color: _color, legend: _legend, unit: 'V', date: _date8 }
this.trendData = _trendData
}
});
})
},
initTumidityData(_date) {
if (_date) {
this.tumidityBtnNav = _date;
this.tumidityBtnNav = _date
}
let _ratedCurrent = this.powerRun.ratedCurrent;
this.$api.powerIot
.findIotDatasMonitor(this.selProject.id, this.powerRun.id, this.tumidityBtnNav)
.then((res) => {
let _ratedCurrent = this.powerRun.ratedCurrent
this.$api.powerIot.findIotDatasMonitor(this.selProject.id, this.powerRun.id, this.tumidityBtnNav).then((res) => {
if (res.data.length > 0) {
res.data.reverse();
let _data1 = [];
let _data2 = [];
let _data3 = [];
let _data4 = [];
let _date8 = [];
res.data.forEach(item => {
_data1.push(item.currentA);
_data2.push(item.currentB);
_data3.push(item.currentC);
_data4.push(_ratedCurrent);
_date8.push(item.createTime);
});
let _lineData = [];
_lineData.push(_data1);
_lineData.push(_data2);
_lineData.push(_data3);
_lineData.push(_data4);
let _color = ['#008ffd','#f6d023','#5af9fd','#FF0016'];
let _legend = ['A相电流','B相电流','C相电流','电流阈值'];
let _tumidityData = {'lineData':_lineData,'color':_color,'legend':_legend,'unit':'A','date':_date8};
this.tumidityData = _tumidityData;
res.data.reverse()
let _data1 = []
let _data2 = []
let _data3 = []
let _data4 = []
let _date8 = []
res.data.forEach((item) => {
_data1.push(item.currentA)
_data2.push(item.currentB)
_data3.push(item.currentC)
_data4.push(_ratedCurrent)
_date8.push(item.createTime)
})
let _lineData = []
_lineData.push(_data1)
_lineData.push(_data2)
_lineData.push(_data3)
_lineData.push(_data4)
let _color = ['#008ffd', '#f6d023', '#5af9fd', '#FF0016']
let _legend = ['A相电流', 'B相电流', 'C相电流', '电流阈值']
let _tumidityData = { lineData: _lineData, color: _color, legend: _legend, unit: 'A', date: _date8 }
this.tumidityData = _tumidityData
}
});
})
},
initPowerWarning(){
this.$api.powerIot
.findIotWarnings(this.selProject.id, this.powerRun.id)
.then((res) => {
this.warningDataList = res.data;
});
initPowerWarning() {
this.$api.powerIot.findIotWarnings(this.selProject.id, this.powerRun.id).then((res) => {
this.warningDataList = res.data
})
},
doIotSelect(){
let _iots = this.powerRunList.filter(detail => detail.id == this.powerRunId);
doIotSelect() {
let _iots = this.powerRunList.filter((detail) => detail.id == this.powerRunId)
if (_iots.length > 0) {
this.powerRun = _iots[0];
this.initTrendData();
this.initTumidityData();
this.initPowerWarning();
this.powerRun = _iots[0]
this.initTrendData()
this.initTumidityData()
this.initPowerWarning()
}
},
automaticRoll() {
var height = $(".afoot-con-for").innerHeight()
var height = $('.afoot-con-for').innerHeight()
if (this.forIndex == this.warningDataList.length) {
this.forIndex = 0
} else {
this.forIndex = this.forIndex + 1
}
$("#afootOverflow").animate({ scrollTop: (height * this.forIndex) + 'px' })
$('#afootOverflow').animate({ scrollTop: height * this.forIndex + 'px' })
},
listMinMouseover() {
clearInterval(this.warningInterval);
clearInterval(this.warningInterval)
},
listMinMouseout() {
this.warningInterval = setInterval(this.automaticRoll, 5000);
this.warningInterval = setInterval(this.automaticRoll, 5000)
},
},
};
}
</script>
<style lang="less">
.project-power-iot {
.screen-one-1-3 {
height: calc(33% - 20px);
}
.left-data1 {
.current-value-img {
height: 80px;
width: 80px;
}
}
}
@media (min-width: 1921px) and (max-width: 2560px) {
.project-power-iot {
.left-data1 {
.el-row {
margin-top: 20px;
&:first-child {
margin-bottom: 30px;
}
}
.current-value-img {
height: 100px;
width: 100px;
img {
width: 50px;
height: 50px;
}
}
.process-control-current-value-data {
font-size: 26px;
}
}
.sjk-chart-line-title {
div {
font-size: 26px;
padding: 8px 16px;
}
}
.analyse-max {
* {
font-size: 18px;
}
.analyse-text,
.analyse-equipment {
font-size: 24px;
}
.analyse-title {
height: 64px;
}
.hj-moment-max {
td {
font-size: 18px;
}
}
.afoot-machinery-nam {
font-size: 18px;
}
}
.el-input__inner {
font-size: 18px;
height: 36px;
}
}
}
@media (min-width: 2561px) {
.project-power-iot {
.left-data1 {
.el-row {
margin-top: 60px;
&:first-child {
margin-bottom: 80px;
}
}
.current-value-img {
height: 160px;
width: 160px;
img {
width: 80px;
height: 80px;
}
}
.process-control-current-value-data {
font-size: 32px;
}
}
.sjk-chart-line-title {
div {
font-size: 32px;
padding: 10px 20px;
}
}
.analyse-max {
* {
font-size: 24px;
}
.analyse-text,
.analyse-equipment {
font-size: 32px;
}
.analyse-title {
height: 100px;
}
.hj-moment-max {
td {
font-size: 24px;
}
}
.afoot-machinery-nam {
font-size: 24px;
}
}
.el-input__inner {
font-size: 24px;
height: 48px;
}
}
}
</style>

View File

@ -346,7 +346,7 @@ function handleDelete(row) {
proxy.$modal
.confirm('是否确认删除建碳管理编号为【' + _ids + '】的数据项?')
.then(function () {
return delGreenCarbonData(_ids)
return delGreenCarbonData(row && row.id ? row.id : ids.value)
})
.then(() => {
getList()