feat : index_enm 修改大屏内容
This commit is contained in:
parent
30e24fd8f5
commit
7d7eee19af
|
@ -109,7 +109,7 @@
|
||||||
<div class="flexItem">
|
<div class="flexItem">
|
||||||
<div class="itemTitle">
|
<div class="itemTitle">
|
||||||
<div class="itemTitleIcon"></div>
|
<div class="itemTitleIcon"></div>
|
||||||
<div>压缩空气、用水量</div>
|
<div>车间用水量</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="itemBody" id="line2"></div>
|
<div class="itemBody" id="line2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -220,6 +220,16 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-divider />
|
<el-divider />
|
||||||
|
<el-col :md="12" :sm="24">
|
||||||
|
<el-form-item
|
||||||
|
label="是否表示运行状态"
|
||||||
|
label-width="220"
|
||||||
|
>
|
||||||
|
<el-switch
|
||||||
|
v-model="form.is_rep_ep_running_state"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
<el-col :md="12" :sm="24">
|
||||||
<el-form-item label="所监测设备">
|
<el-form-item label="所监测设备">
|
||||||
<el-select
|
<el-select
|
||||||
|
@ -238,16 +248,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="12" :sm="24">
|
|
||||||
<el-form-item
|
|
||||||
label="是否表示所监测设备的运行状态"
|
|
||||||
label-width="220"
|
|
||||||
>
|
|
||||||
<el-switch
|
|
||||||
v-model="form.is_rep_ep_running_state"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :md="8" :sm="24">
|
<el-col :md="8" :sm="24">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="状态量基准值"
|
label="状态量基准值"
|
||||||
|
|
|
@ -169,6 +169,9 @@ export default {
|
||||||
end_time: null
|
end_time: null
|
||||||
},
|
},
|
||||||
chartOption: {
|
chartOption: {
|
||||||
|
title: {
|
||||||
|
text: 'Stacked Line'
|
||||||
|
},
|
||||||
color: ["#191970"],
|
color: ["#191970"],
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
|
@ -194,11 +197,15 @@ export default {
|
||||||
xAxis: {
|
xAxis: {
|
||||||
name: "",
|
name: "",
|
||||||
type: "category",
|
type: "category",
|
||||||
|
axisLabel: {
|
||||||
|
rotate: 45,
|
||||||
|
fontSize: 10,
|
||||||
|
},
|
||||||
data: [],
|
data: [],
|
||||||
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: "当前值",
|
name: "",
|
||||||
type: "value",
|
type: "value",
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -227,20 +234,33 @@ export default {
|
||||||
dataChange(req, tableData) {
|
dataChange(req, tableData) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let option = { ...that.chartOption };
|
let option = { ...that.chartOption };
|
||||||
// 获取 x 轴的数据
|
// 获取 x 轴的数据,如果query.type为小时,则显示小时,如果为天则显示天,如果为月则显示月
|
||||||
option.xAxis.data = tableData.map((item, index) => (index+1).toString());
|
if (that.query.type == "hour") {
|
||||||
|
option.title.text = "小时统计";
|
||||||
|
option.xAxis.data = tableData.reverse().map((item) => item.year.toString() + "-" + item.month.toString() + "-" + item.day.toString() + " " + item.hour.toString());
|
||||||
|
}else if (that.query.type == "day") {
|
||||||
|
option.title.text = "天统计";
|
||||||
|
option.xAxis.data = tableData.reverse().map((item, index) => item.year.toString() + "-" + item.month.toString() + "-" + item.day.toString());
|
||||||
|
}else if (that.query.type == "month") {
|
||||||
|
option.title.text = "月统计";
|
||||||
|
option.xAxis.data = tableData.reverse().map((item, index) => item.year.toString() + "-" + item.month.toString());
|
||||||
|
}else if (that.query.type == "day_s") {
|
||||||
|
option.title.text = "班天统计";
|
||||||
|
option.xAxis.data = tableData.length > 0 ? tableData.reverse().map((item, index) => item.day_s.toString()) : [];
|
||||||
|
}else if (that.query.type == "month_s") {
|
||||||
|
option.title.text = "班月统计";
|
||||||
|
option.xAxis.data = tableData.length > 0 ? tableData.reverse().map((item, index) => item.month_s.toString()) : [];
|
||||||
|
}
|
||||||
// 获取 y 轴的数据
|
// 获取 y 轴的数据
|
||||||
|
|
||||||
option.series = [
|
option.series = [
|
||||||
{
|
{
|
||||||
name: tableData[0].mpoint_name,
|
name: tableData.length > 0 ? tableData[0].mpoint_name : "",
|
||||||
type: 'line', // 折线图类型
|
type: 'line', // 折线图类型
|
||||||
data: tableData.map((item) => parseFloat(item.val)), // 将字符串转为数字
|
data: tableData.length > 0 ? tableData.reverse().map((item) => parseFloat(item.val)) : [], // 将字符串转为数字
|
||||||
smooth: true, // 平滑曲线
|
smooth: true, // 平滑曲线
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
option.legend.data = [tableData[0].mpoint_name];
|
option.legend.data = [tableData.length > 0 ? tableData[0].mpoint_name : ""];
|
||||||
// 更新图表选项
|
// 更新图表选项
|
||||||
that.chartOption = option;
|
that.chartOption = option;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue