This commit is contained in:
朱菊兰 2024-04-11 11:18:08 +08:00
parent 7f504e5cdd
commit 5ccb9297e1
6 changed files with 32 additions and 12 deletions

View File

@ -76,10 +76,6 @@ export default {
name: this.chartData[i].objName + this.chartData[i].objCode, name: this.chartData[i].objName + this.chartData[i].objCode,
type: 'bar', type: 'bar',
barMaxWidth: 20, barMaxWidth: 20,
label: {
show: true,
position: 'top',
},
data: [], data: [],
}; };
legendData.push(this.chartData[i].objName + this.chartData[i].objCode); legendData.push(this.chartData[i].objName + this.chartData[i].objCode);

View File

@ -68,9 +68,9 @@ export default {
var option = { var option = {
color: ['#288AFF'], color: ['#288AFF'],
// tooltip: { tooltip: {
// trigger: 'axis' trigger: 'axis',
// }, },
grid: { grid: {
left: '4%', left: '4%',
right: '1%', right: '1%',

View File

@ -57,8 +57,10 @@ export default {
let listObj = { useNum: '消耗量' }; // let listObj = { useNum: '消耗量' }; //
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
let obj = {}; let obj = {};
let fName = arr[i].time.slice(0, 4);
let lName = arr[i].time.slice(4, 6);
obj.prop = arr[i].time; obj.prop = arr[i].time;
obj.label = arr[i].time; obj.label = fName + ' 第 ' + lName + ' 周';
obj.minWidth = 100; obj.minWidth = 100;
tempX.push(obj); tempX.push(obj);
listObj[arr[i].time] = arr[i].useNum || null; listObj[arr[i].time] = arr[i].useNum || null;

View File

@ -45,6 +45,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-button <el-button
v-show="!isEdit"
class="addButton" class="addButton"
icon="el-icon-plus" icon="el-icon-plus"
@click="emitButtonClick"> @click="emitButtonClick">
@ -70,6 +71,13 @@ export default {
return []; return [];
}, },
}, },
isEdit: {
type: Boolean,
required: true,
default: () => {
return false;
},
},
}, },
data() { data() {
return {}; return {};

View File

@ -42,6 +42,7 @@
<add-table <add-table
:table-data="tableData" :table-data="tableData"
:table-name-list="tableNameList" :table-name-list="tableNameList"
:isEdit="isEdit"
@emitFun="inputChange" @emitFun="inputChange"
@emitButtonClick="emitButtonClick" /> @emitButtonClick="emitButtonClick" />
</el-col> </el-col>

View File

@ -66,7 +66,7 @@
placeholder="请选择" placeholder="请选择"
style="width: 100%"> style="width: 100%">
<el-option <el-option
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)" v-for="item in tableNameList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"></el-option> :value="item.value"></el-option>
@ -154,6 +154,7 @@ import {
createEnergyLimit, createEnergyLimit,
getEnergyParamList, getEnergyParamList,
} from '@/api/monitoring/energyLimit'; } from '@/api/monitoring/energyLimit';
import { energyTableGet } from '@/api/base/energyQuantityManual';
export default { export default {
name: 'energyLimitAdd', name: 'energyLimitAdd',
props: { props: {
@ -203,6 +204,7 @@ export default {
{ required: true, message: '指标类型不能为空', trigger: 'change' }, { required: true, message: '指标类型不能为空', trigger: 'change' },
], ],
}, },
tableNameList: [],
detailList: [], detailList: [],
}; };
}, },
@ -267,11 +269,22 @@ export default {
} }
}, },
toggleType() { toggleType() {
if (this.form.energyTypeId && this.form.type) { if (this.form.energyTypeId && this.form.method == 2) {
this.getDetailList(); this.form.tableName = '';
this.form.plcParamId = ''; 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) { changeDetSelect(key, treeData) {
let arr = []; // let arr = []; //