This commit is contained in:
shijing 2024-11-07 11:09:47 +08:00
commit fb79ad7943
6 changed files with 80 additions and 33 deletions

View File

@ -417,8 +417,8 @@ export default {
});
let chartDom = document.getElementById("myChart");
that.myChart = echarts.init(chartDom);
that.option.xAxis.data = xAxisData.reverse();
that.option.series[0].data = lineData.reverse();
that.option.xAxis.data = xAxisData;
that.option.series[0].data = lineData;
that.myChart.setOption(that.option);
});
},

View File

@ -109,7 +109,7 @@
<div class="flexItem">
<div class="itemTitle">
<div class="itemTitleIcon"></div>
<div>压缩空气用水量</div>
<div>车间用水量</div>
</div>
<div class="itemBody" id="line2"></div>
</div>
@ -255,6 +255,15 @@
</p>
</div>
</div>
<div class="elecItem">
<div class="elecItem_wrap">
<span>水泥包装工序电耗</span>
<p class="elec_number">
{{ hotData.bz_elec_consume_unit }}
<span class="elec_unit">kw.h/t</span>
</p>
</div>
</div>
</div>
</div>
</div>
@ -453,6 +462,7 @@ export default {
cen_consume_unit: "", //
sn_cen_consume_unit: "", //
sn_elec_consume_unit: "",//
bz_elec_consume_unit: "",//
},
tableData: [],
tezhongData: [],
@ -1088,6 +1098,22 @@ export default {
that.hotData.sn_cen_consume_unit = ress[0].cen_consume_unit;
});
});
this.$API.mtm.mgroup.list
.req({ page: 0, search: "水泥包装" })
.then((res) => {
that.yurefadianId = res[0].id;
let params = {};
params.page = 0;
params.year_s = that.currentYear;
params.month_s = that.currentMonth;
params.type = "month_s";
params.mgroup = that.yurefadianId;
this.$API.enm.enstat.req(params).then((ress) => {
that.hotData.bz_elec_consume_unit =
ress[0].elec_consume_unit;
that.hotData.sn_cen_consume_unit = ress[0].cen_consume_unit;
});
});
},
// this.$API.enm.mpoint.list
// .req({

View File

@ -220,6 +220,16 @@
</el-form-item>
</el-col>
<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-form-item label="所监测设备">
<el-select
@ -238,16 +248,7 @@
</el-select>
</el-form-item>
</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-form-item
label="状态量基准值"

View File

@ -169,6 +169,9 @@ export default {
end_time: null
},
chartOption: {
title: {
text: 'Stacked Line'
},
color: ["#191970"],
tooltip: {
trigger: "axis",
@ -194,11 +197,15 @@ export default {
xAxis: {
name: "",
type: "category",
axisLabel: {
rotate: 45,
fontSize: 10,
},
data: [],
},
yAxis: {
name: "当前值",
name: "",
type: "value",
},
@ -227,20 +234,33 @@ export default {
dataChange(req, tableData) {
let that = this;
let option = { ...that.chartOption };
// x
option.xAxis.data = tableData.map((item, index) => (index+1).toString());
// x query.type
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
option.series = [
{
name: tableData[0].mpoint_name,
name: tableData.length > 0 ? tableData[0].mpoint_name : "",
type: 'line', // 线
data: tableData.map((item) => parseFloat(item.val)), //
data: tableData.length > 0 ? tableData.reverse().map((item) => parseFloat(item.val)) : [], //
smooth: true, // 线
}
];
option.legend.data = [tableData[0].mpoint_name];
option.legend.data = [tableData.length > 0 ? tableData[0].mpoint_name : ""];
//
that.chartOption = option;
},

View File

@ -25,9 +25,9 @@
:params="{ search: '生产' }"
></ehsSelect>
</div>
<div v-if="currentM == 'xSelect'">
<div v-if="currentM == 'xtSelect'">
<h1>基于input封装的远程表格select-单选分页</h1>
<xSelect
<xtSelect
:apiObj="apiObj"
v-model="x2"
v-model:label="x2_name"
@ -36,7 +36,7 @@
>
<el-table-column label="id" prop="id"></el-table-column>
<el-table-column label="名称" prop="name"></el-table-column>
</xSelect>
</xtSelect>
<div>
当前选择
<h1>v-model: {{ x2 }}</h1>
@ -44,7 +44,7 @@
<h1>v-model:obj: {{ x2_obj }}</h1>
</div>
<h1 style="margin-top: 20px">基于input封装的远程表格select-多选不分页</h1>
<xSelect
<xtSelect
:apiObj="apiObj"
v-model="x2s"
v-model:obj="x2s_obj"
@ -53,7 +53,7 @@
>
<el-table-column label="id" prop="id"></el-table-column>
<el-table-column label="名称" prop="name"></el-table-column>
</xSelect>
</xtSelect>
<div>
当前选择
<h1>v-model: {{ x2s }}</h1>
@ -61,25 +61,25 @@
</div>
<h1 style="margin-top: 20px">基于input封装的固定选项select-单选</h1>
<xSelect
<xtSelect
:options="options"
v-model="x2sf"
style="width: 500px"
>
</xSelect>
</xtSelect>
<div>
当前选择
<h1>v-model: {{ x2sf }}</h1>
</div>
<h1 style="margin-top: 20px">基于input封装的固定选项select-多选</h1>
<xSelect
<xtSelect
:options="options"
v-model="x2sfs"
style="width: 500px"
:multiple="true"
>
</xSelect>
</xtSelect>
<div>
当前选择
<h1>v-model: {{ x2sfs }}</h1>
@ -117,7 +117,7 @@
</el-container>
</template>
<script>
// import xSelects from "@/components/xSelect/index2.vue";
// import xSelects from "@/components/xtSelect/index2.vue";
export default {
name: "testx",
components: {},
@ -125,7 +125,7 @@ export default {
return {
menu: [
"二维码",
"xSelect",
"xtSelect",
"ehsSelect",
"scEcharts",
"ehsUserSelect",

View File

@ -26,7 +26,7 @@ module.exports = defineConfig({
},
client: {
overlay: {
// runtimeErrors: false,
runtimeErrors: false,
},
},
},