|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<ele-modal
|
|
|
:visible.sync="visible"
|
|
|
- :title="isEdit ? '编辑告警配置' : '新增告警配置'"
|
|
|
+ title="告警配置"
|
|
|
width="70%"
|
|
|
append-to-body
|
|
|
:maxable="true"
|
|
|
@@ -23,6 +23,7 @@
|
|
|
v-model="form.level"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
+ :disabled="type == 'view'"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in options.alarmLevel"
|
|
|
@@ -35,7 +36,11 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="告警名称:" prop="name">
|
|
|
- <el-input v-model="form.name" placeholder="请输入" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.name"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="type == 'view'"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -44,6 +49,7 @@
|
|
|
v-model="form.energyTypeCode"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
+ :disabled="type == 'view'"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in energyClassificationList"
|
|
|
@@ -64,6 +70,7 @@
|
|
|
placeholder="请选择(可多选,为空则统计全部)"
|
|
|
readonly
|
|
|
@click.native="openAreaIds"
|
|
|
+ :disabled="type == 'view'"
|
|
|
/>
|
|
|
<!-- <areaSelect
|
|
|
v-model="form.areaIds"
|
|
|
@@ -88,7 +95,11 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="告警描述:" prop="description">
|
|
|
- <el-input v-model="form.description" placeholder="请输入" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.description"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="type == 'view'"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="8">
|
|
|
@@ -107,6 +118,7 @@
|
|
|
v-model="form.triggerLogic"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
+ :disabled="type == 'view'"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in options.triggerLogic"
|
|
|
@@ -127,7 +139,11 @@
|
|
|
class="condition-row"
|
|
|
>
|
|
|
<div class="condition-item">
|
|
|
- <el-select v-model="item.attribute" placeholder="请选择">
|
|
|
+ <el-select
|
|
|
+ v-model="item.attribute"
|
|
|
+ placeholder="请选择"
|
|
|
+ :disabled="type == 'view'"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="field in options.conditionField"
|
|
|
:key="field.value"
|
|
|
@@ -137,7 +153,11 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="condition-item">
|
|
|
- <el-select v-model="item.operator" placeholder="=">
|
|
|
+ <el-select
|
|
|
+ v-model="item.operator"
|
|
|
+ placeholder="="
|
|
|
+ :disabled="type == 'view'"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="op in options.conditionOperator"
|
|
|
:key="op.value"
|
|
|
@@ -150,6 +170,7 @@
|
|
|
<el-input
|
|
|
type="number"
|
|
|
v-model="item.thresholdValue"
|
|
|
+ :disabled="type == 'view'"
|
|
|
placeholder="请输入"
|
|
|
>
|
|
|
<template slot="append">{{ getCurrentUnit() }}</template>
|
|
|
@@ -167,11 +188,17 @@
|
|
|
<el-button
|
|
|
type="text"
|
|
|
class="danger-text"
|
|
|
+ v-if="type != 'view'"
|
|
|
@click="removeCondition(index)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</div>
|
|
|
- <el-button type="text" class="add-condition-btn" @click="addCondition">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ class="add-condition-btn"
|
|
|
+ @click="addCondition"
|
|
|
+ v-if="type != 'view'"
|
|
|
+ >
|
|
|
<i class="el-icon-plus"></i> 增加条件
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -179,7 +206,11 @@
|
|
|
<!-- 第三部分:通知设置 -->
|
|
|
<header-title title="通知设置"></header-title>
|
|
|
<div class="table-header">
|
|
|
- <el-button type="primary" size="small" @click="addNotifyPerson"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="addNotifyPerson"
|
|
|
+ v-if="type != 'view'"
|
|
|
>添加</el-button
|
|
|
>
|
|
|
</div>
|
|
|
@@ -197,7 +228,12 @@
|
|
|
></el-table-column>
|
|
|
<el-table-column label="通知人" min-width="200" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select filterable v-model="scope.row.receiverIds" size="small">
|
|
|
+ <el-select
|
|
|
+ filterable
|
|
|
+ v-model="scope.row.receiverIds"
|
|
|
+ size="small"
|
|
|
+ :disabled="type == 'view'"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in alarmNotifierList"
|
|
|
:key="item.id"
|
|
|
@@ -213,7 +249,13 @@
|
|
|
<el-tag size="small" type="primary">系统</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="80" align="center" fixed="right">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ width="80"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ v-if="type != 'view'"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
@@ -227,7 +269,11 @@
|
|
|
</el-form>
|
|
|
|
|
|
<template v-slot:footer>
|
|
|
- <el-button type="primary" @click="save()" v-loading="loading"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="save()"
|
|
|
+ v-loading="loading"
|
|
|
+ v-if="type != 'view'"
|
|
|
>确定</el-button
|
|
|
>
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
@@ -308,6 +354,7 @@
|
|
|
visible: false,
|
|
|
visible1: false,
|
|
|
loading: false,
|
|
|
+ type: 'add',
|
|
|
isEdit: false,
|
|
|
energyConsumingUnitList,
|
|
|
energyClassificationList: [],
|
|
|
@@ -330,9 +377,10 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- async open(row) {
|
|
|
+ async open(row, type) {
|
|
|
this.getUserList();
|
|
|
this.visible = true;
|
|
|
+ this.type = type;
|
|
|
this.loadEnergyClassificationList();
|
|
|
if (row && row.id) {
|
|
|
this.isEdit = true;
|