能源监控
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList"/>
|
||||
<energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList" :objList="objList"/>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -46,13 +46,19 @@
|
||||
<script>
|
||||
import { getEnergyLimitPage, deleteEnergyLimit } from "@/api/monitoring/energyLimit";
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType";
|
||||
// import { publicFormatter } from '@/utils/dict'
|
||||
import { getTree } from '@/api/base/factory'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import EnergyLimitAdd from './components/energyLimitAdd'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'objectId',
|
||||
prop: 'objName',
|
||||
label: '监控对象'
|
||||
},
|
||||
{
|
||||
prop: 'objectType',
|
||||
label: '对象备注',
|
||||
filter: publicFormatter('object_type')
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
@@ -60,7 +66,6 @@ const tableProps = [
|
||||
{
|
||||
prop: 'type',
|
||||
label: '监控模式'
|
||||
// filter: publicFormatter('energy_unit')
|
||||
},
|
||||
{
|
||||
prop: 'plcParamName',
|
||||
@@ -68,7 +73,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'limitType',
|
||||
label: '指标类型'
|
||||
label: '指标类型',
|
||||
filter: publicFormatter('monitor_index_type')
|
||||
},
|
||||
{
|
||||
prop: 'limitValue',
|
||||
@@ -88,9 +94,11 @@ export default {
|
||||
param: 'energyTypeId'
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
type: 'select',
|
||||
label: '指标类型',
|
||||
placeholder: '指标类型',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.MONITOR_INDEX_TYPE),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'limitType'
|
||||
},
|
||||
{
|
||||
@@ -103,7 +111,7 @@ export default {
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-type:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('monitoring:energy-limit:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@@ -112,13 +120,13 @@ export default {
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-type:update')
|
||||
this.$auth.hasPermi('monitoring:energy-limit:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-type:delete')
|
||||
this.$auth.hasPermi('monitoring:energy-limit:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
@@ -141,7 +149,12 @@ export default {
|
||||
energyTypeId: null,
|
||||
limitType: null
|
||||
},
|
||||
energyTypeList: []
|
||||
energyTypeList: [],
|
||||
typeList: [
|
||||
{label: '合并', value: '1'},
|
||||
{label: '详细', value: '2'}
|
||||
],
|
||||
objList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -150,6 +163,8 @@ export default {
|
||||
})
|
||||
this.getList();
|
||||
this.getTypeList()
|
||||
// 获取对象树形结构
|
||||
this.getObjTree()
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
@@ -178,6 +193,13 @@ export default {
|
||||
getList() {
|
||||
getEnergyLimitPage(this.queryParams).then(response => {
|
||||
let arr = response.data.list || [];
|
||||
arr&&arr.map(item => {
|
||||
this.typeList.map(i => {
|
||||
if (item.type === i.value) {
|
||||
item.type = i.label
|
||||
}
|
||||
})
|
||||
})
|
||||
this.list = arr
|
||||
this.total = response.data.total;
|
||||
});
|
||||
@@ -209,13 +231,18 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除能源类型为"' + row.name + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除监控参数为"' + row.plcParamName + '"的数据项?').then(function() {
|
||||
return deleteEnergyLimit(row.id);
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
getObjTree() {
|
||||
getTree().then(res => {
|
||||
this.objList = res.data || []
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user