feat : index_enm 修改大屏内容

This commit is contained in:
zty 2024-11-01 17:11:11 +08:00
parent 30e24fd8f5
commit 7d7eee19af
3 changed files with 40 additions and 19 deletions

View File

@ -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>

View File

@ -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="状态量基准值"

View File

@ -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;
}, },