|
|
@@ -100,9 +100,9 @@
|
|
|
border
|
|
|
:header-cell-style="{ background: '#F0F3F3' }"
|
|
|
>
|
|
|
- <el-table-column type="index" width="50" align="left" >
|
|
|
+ <el-table-column type="index" width="50" align="left">
|
|
|
<template slot="header">
|
|
|
- <el-button type="text" @click="addItem" style="padding: 0"
|
|
|
+ <el-button type="text" @click="addItem" style="padding: 0"
|
|
|
>新增</el-button
|
|
|
>
|
|
|
</template>
|
|
|
@@ -185,15 +185,17 @@
|
|
|
label="模板编码"
|
|
|
width="500"
|
|
|
>
|
|
|
- <template slot-scope="scope" >
|
|
|
+ <template slot-scope="scope">
|
|
|
<el-form-item
|
|
|
:prop="
|
|
|
'actionList.' + scope.$index + '.alertMessageTempateCode'
|
|
|
- " style="width: 100%"
|
|
|
+ "
|
|
|
+ style="width: 100%"
|
|
|
label-width="0"
|
|
|
:rules="contentConfigFormRules.alertMessageTempateCode"
|
|
|
>
|
|
|
- <el-select style="width: 100%"
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
placeholder="请选择"
|
|
|
v-model="scope.row.alertMessageTempateCode"
|
|
|
@change="changeTemplate(scope.row, scope.$index)"
|
|
|
@@ -251,7 +253,11 @@
|
|
|
rulesSave,
|
|
|
rulesUpdate,
|
|
|
getCode,
|
|
|
- getDetail
|
|
|
+ getDetail,
|
|
|
+ listAllRulesObj,
|
|
|
+ listAllDateUnit,
|
|
|
+ listAllActionType,
|
|
|
+ listAllAlertLevel
|
|
|
} from '@/api/ruleManagement/earlyWarning';
|
|
|
import { notifyTemplatePageAPI } from '@/api/notifyManage';
|
|
|
import { getUserPage } from '@/api/system/organization';
|
|
|
@@ -338,27 +344,11 @@
|
|
|
},
|
|
|
watch: {},
|
|
|
created() {
|
|
|
+ this.getAllData();
|
|
|
this.gettemplateList();
|
|
|
this.getInfo();
|
|
|
},
|
|
|
- mounted() {
|
|
|
- const str1 = localStorage.getItem('allRulesData');
|
|
|
- if (str1) {
|
|
|
- this.allRulesData = JSON.parse(str1);
|
|
|
- }
|
|
|
- const str2 = localStorage.getItem('cycleUnitOpt');
|
|
|
- if (str2) {
|
|
|
- this.cycleUnitOpt = JSON.parse(str2);
|
|
|
- }
|
|
|
- const str3 = localStorage.getItem('operationTypeData');
|
|
|
- if (str3) {
|
|
|
- this.operationTypeData = JSON.parse(str3);
|
|
|
- }
|
|
|
- const str4 = localStorage.getItem('allAlertLevelData');
|
|
|
- if (str4) {
|
|
|
- this.allAlertLevelData = JSON.parse(str4);
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
methods: {
|
|
|
handleInput(value) {
|
|
|
this.formData.alertCycleValue = this.$handleInputPublic(value);
|
|
|
@@ -375,7 +365,21 @@
|
|
|
}
|
|
|
this.formData.actionList[index].thresholdValue = finalValue;
|
|
|
},
|
|
|
-
|
|
|
+ async getAllData() {
|
|
|
+ try {
|
|
|
+ const res1 = await listAllRulesObj();
|
|
|
+ this.allRulesData = res1;
|
|
|
+ const res2 = await listAllDateUnit();
|
|
|
+ this.cycleUnitOpt = res2;
|
|
|
+ const res3 = await listAllActionType();
|
|
|
+ this.operationTypeData = res3;
|
|
|
+ const res4 = await listAllAlertLevel();
|
|
|
+ this.allAlertLevelData = res4;
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Failed to load data:', error);
|
|
|
+ throw error;
|
|
|
+ }
|
|
|
+ },
|
|
|
handleAddInfo(row, index) {
|
|
|
this.NumberOfPeople = '';
|
|
|
this.formData.actionList[index].targetAddress = '';
|
|
|
@@ -415,7 +419,6 @@
|
|
|
});
|
|
|
if (res?.list) {
|
|
|
this.templateData = res.list;
|
|
|
- localStorage.setItem('templateData', JSON.stringify(res.list));
|
|
|
}
|
|
|
},
|
|
|
async getInfo() {
|
|
|
@@ -518,7 +521,7 @@
|
|
|
|
|
|
// 保存
|
|
|
dataKeep() {
|
|
|
- console.log(this.isBindPlan,'dsdsds')
|
|
|
+ console.log(this.isBindPlan, 'dsdsds');
|
|
|
let form = deepClone(this.formData);
|
|
|
console.log(form, 'form');
|
|
|
if (form.actionList.length < 1) {
|
|
|
@@ -526,7 +529,10 @@
|
|
|
}
|
|
|
this.$refs.contentConfigForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- let request = (this.isBindPlan != 'add'&&this.isBindPlan != 'clone' )? rulesUpdate : rulesSave;
|
|
|
+ let request =
|
|
|
+ this.isBindPlan != 'add' && this.isBindPlan != 'clone'
|
|
|
+ ? rulesUpdate
|
|
|
+ : rulesSave;
|
|
|
|
|
|
let res = await request(form);
|
|
|
if (res) {
|