From 5ccb9297e11314a903de819a04db1c44b736ef04 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Thu, 11 Apr 2024 11:18:08 +0800 Subject: [PATCH] 4.11 --- .../contrastAnalysis/components/barChart.vue | 4 ---- .../trendAnalysis/components/lineChart.vue | 6 +++--- .../energy/analysis/trendAnalysis/index.vue | 4 +++- .../components/AddTable.vue | 8 +++++++ .../components/energyQuantityManualAdd.vue | 1 + .../energyLimit/components/energyLimitAdd.vue | 21 +++++++++++++++---- 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/views/energy/analysis/contrastAnalysis/components/barChart.vue b/src/views/energy/analysis/contrastAnalysis/components/barChart.vue index c612503c..714f516f 100644 --- a/src/views/energy/analysis/contrastAnalysis/components/barChart.vue +++ b/src/views/energy/analysis/contrastAnalysis/components/barChart.vue @@ -76,10 +76,6 @@ export default { name: this.chartData[i].objName + this.chartData[i].objCode, type: 'bar', barMaxWidth: 20, - label: { - show: true, - position: 'top', - }, data: [], }; legendData.push(this.chartData[i].objName + this.chartData[i].objCode); diff --git a/src/views/energy/analysis/trendAnalysis/components/lineChart.vue b/src/views/energy/analysis/trendAnalysis/components/lineChart.vue index ce62c734..a49b6246 100644 --- a/src/views/energy/analysis/trendAnalysis/components/lineChart.vue +++ b/src/views/energy/analysis/trendAnalysis/components/lineChart.vue @@ -68,9 +68,9 @@ export default { var option = { color: ['#288AFF'], - // tooltip: { - // trigger: 'axis' - // }, + tooltip: { + trigger: 'axis', + }, grid: { left: '4%', right: '1%', diff --git a/src/views/energy/analysis/trendAnalysis/index.vue b/src/views/energy/analysis/trendAnalysis/index.vue index a06bc090..d42b7b55 100644 --- a/src/views/energy/analysis/trendAnalysis/index.vue +++ b/src/views/energy/analysis/trendAnalysis/index.vue @@ -57,8 +57,10 @@ export default { let listObj = { useNum: '消耗量' }; // 数据 for (let i = 0; i < arr.length; i++) { let obj = {}; + let fName = arr[i].time.slice(0, 4); + let lName = arr[i].time.slice(4, 6); obj.prop = arr[i].time; - obj.label = arr[i].time; + obj.label = fName + ' 第 ' + lName + ' 周'; obj.minWidth = 100; tempX.push(obj); listObj[arr[i].time] = arr[i].useNum || null; diff --git a/src/views/energy/base/energyQuantityManual/components/AddTable.vue b/src/views/energy/base/energyQuantityManual/components/AddTable.vue index 2b2c463a..b56df97d 100644 --- a/src/views/energy/base/energyQuantityManual/components/AddTable.vue +++ b/src/views/energy/base/energyQuantityManual/components/AddTable.vue @@ -45,6 +45,7 @@ @@ -70,6 +71,13 @@ export default { return []; }, }, + isEdit: { + type: Boolean, + required: true, + default: () => { + return false; + }, + }, }, data() { return {}; diff --git a/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue b/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue index ceeb44c8..e2f3bc22 100644 --- a/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue +++ b/src/views/energy/base/energyQuantityManual/components/energyQuantityManualAdd.vue @@ -42,6 +42,7 @@ diff --git a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue index 531b29c0..7ed3e7ee 100644 --- a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue +++ b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue @@ -66,7 +66,7 @@ placeholder="请选择" style="width: 100%"> @@ -154,6 +154,7 @@ import { createEnergyLimit, getEnergyParamList, } from '@/api/monitoring/energyLimit'; +import { energyTableGet } from '@/api/base/energyQuantityManual'; export default { name: 'energyLimitAdd', props: { @@ -203,6 +204,7 @@ export default { { required: true, message: '指标类型不能为空', trigger: 'change' }, ], }, + tableNameList: [], detailList: [], }; }, @@ -267,11 +269,22 @@ export default { } }, toggleType() { - if (this.form.energyTypeId && this.form.type) { - this.getDetailList(); - this.form.plcParamId = ''; + if (this.form.energyTypeId && this.form.method == 2) { + this.form.tableName = ''; + this.getTableNameList(this.form.energyTypeId); } }, + // 获取能源表名list + getTableNameList(id) { + energyTableGet({ energyTypeId: id }).then((res) => { + this.tableNameList = res.data.tableObjs || []; + if (this.tableNameList.length === 0) { + this.$modal.msgWarning( + '当前能源类型暂无配置表名,请先到《表名配置》页面配置' + ); + } + }); + }, // 递归处理分类回显问题 changeDetSelect(key, treeData) { let arr = []; // 递归时操作的数组