|
@@ -26,7 +26,7 @@
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
|
|
|
<el-form-item label="频率" prop="frequency" :rules="[{ required: true, message: '请选择频率', trigger: 'change' }]">
|
|
|
- <el-select v-model="state.ruleForm.frequency" placeholder="请选择频率" @change="selectType" clearable>
|
|
|
+ <el-select v-model="state.ruleForm.frequency" placeholder="请选择频率" clearable>
|
|
|
<el-option v-for="item in eFrequency" :value="item.key" :key="item.key" :label="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -46,50 +46,67 @@
|
|
|
<el-button type="primary" @click="onPlus" link>新增规则<SvgIcon name="ele-Plus" /></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <el-row v-for="(item, index) in state.ruleForm.earlyWarningRules" :key="index" :gutter="10" class="w100 mb10">
|
|
|
- <el-col :span="7">
|
|
|
+ <el-row v-for="(item, index) in state.ruleForm.earlyWarningRules" :key="index" :gutter="10" class="w100 mb20">
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
|
|
|
<el-form-item
|
|
|
label="敏感词"
|
|
|
:prop="`earlyWarningRules.${index}.sensitiveWord`"
|
|
|
:rules="[{ required: true, message: '请填写敏感词', trigger: 'change' }]"
|
|
|
label-width="70px"
|
|
|
>
|
|
|
- <el-select-v2 v-model="item.sensitiveWord" :options="sensitiveWords" placeholder="请选择敏感词" class="w100" clearable filterable>
|
|
|
+ <el-select-v2 v-model="item.sensitiveWord" :options="sensitiveWords" placeholder="请选择敏感词" clearable filterable>
|
|
|
</el-select-v2>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="7">
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6">
|
|
|
<el-form-item
|
|
|
label="出现次数"
|
|
|
:prop="`earlyWarningRules.${index}.compareType`"
|
|
|
:rules="[{ required: true, message: '请选择出现次数', trigger: 'change' }]"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
- <el-select v-model="item.compareType" placeholder="请选择出现次数" @change="selectType" clearable>
|
|
|
+ <el-select v-model="item.compareType" placeholder="请选择出现次数" clearable>
|
|
|
<el-option v-for="item in eCompareType" :value="item.key" :key="item.key" :label="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="7">
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
|
|
|
<el-form-item
|
|
|
label=""
|
|
|
:prop="`earlyWarningRules.${index}.times`"
|
|
|
:rules="[{ required: true, message: '请填写次数', trigger: 'blur' }]"
|
|
|
label-width="0px"
|
|
|
>
|
|
|
- <el-input-number v-model="item.times" :min="1" :max="99">
|
|
|
+ <el-input-number v-model="item.times" :min="1" :max="99" :precision="0">
|
|
|
<template #suffix>
|
|
|
<span>次</span>
|
|
|
</template>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="3">
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
|
|
|
+ <el-form-item
|
|
|
+ label=""
|
|
|
+ :prop="`earlyWarningRules.${index}.sort`"
|
|
|
+ :rules="[{ required: true, message: '请填写排序', trigger: 'blur' }]"
|
|
|
+ label-width="0px"
|
|
|
+ >
|
|
|
+ <el-input-number v-model="item.sort" :min="1" :precision="0">
|
|
|
+ </el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :xs="24" :sm="12" :md="12" :lg="4" :xl="4">
|
|
|
<div class="flex">
|
|
|
- <el-select v-model="item.compareType" v-if="index">
|
|
|
- <el-option value="1" label="且" />
|
|
|
- <el-option value="2" label="或" />
|
|
|
- </el-select>
|
|
|
+ <el-form-item
|
|
|
+ label=""
|
|
|
+ :prop="`earlyWarningRules.${index}.nextWhere`"
|
|
|
+ :rules="[{ required: true, message: '请选择', trigger: 'change' }]"
|
|
|
+ label-width="0px"
|
|
|
+ >
|
|
|
+ <el-select v-model="item.nextWhere" style="width: 100px;" clearable>
|
|
|
+ <el-option v-for="item in eNextWhere" :value="item.key" :key="item.key" :label="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-button link type="danger" @click="onDelete(index)" v-if="index" class="ml10"><SvgIcon name="ele-Delete" /></el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -137,7 +154,15 @@ const state = reactive<any>({
|
|
|
earlyWarningTypeValue: null, // 预警类型
|
|
|
frequency: null, // 频率
|
|
|
isEnable:true, // 是否启用
|
|
|
- earlyWarningRules: [], // 预警规则
|
|
|
+ earlyWarningRules: [
|
|
|
+ {
|
|
|
+ sensitiveWord: null,
|
|
|
+ compareType: null,
|
|
|
+ times: null,
|
|
|
+ nextWhere:null,
|
|
|
+ sort:1
|
|
|
+ },
|
|
|
+ ], // 预警规则
|
|
|
earlyWarningRemark: null, // 预警原因
|
|
|
},
|
|
|
});
|
|
@@ -163,12 +188,14 @@ const earlyWarningType = ref<EmptyArrayType>([]); // 预警类型
|
|
|
const eFrequency = ref<EmptyArrayType>([]); // 频率
|
|
|
const eCompareType = ref<EmptyArrayType>([]); // 比较类型
|
|
|
const sensitiveWords = ref<EmptyArrayType>([]); // 敏感词
|
|
|
+const eNextWhere = ref<EmptyArrayType>([]); // 下一步
|
|
|
const queryBaseInfo = () => {
|
|
|
getEarlySettingBaseData().then((res) => {
|
|
|
earlyWarningLevel.value = res.result.earlyWarningLevel ?? [];
|
|
|
earlyWarningType.value = res.result.earlyWarningType ?? [];
|
|
|
eFrequency.value = res.result.eFrequency ?? [];
|
|
|
eCompareType.value = res.result.eCompareType ?? [];
|
|
|
+ eNextWhere.value = res.result.eNextWhere ?? [];
|
|
|
sensitiveWords.value =
|
|
|
res.result.sensitiveWords.map((item: any) => {
|
|
|
return {
|
|
@@ -194,6 +221,7 @@ const onPlus = () => {
|
|
|
sensitiveWord: null,
|
|
|
compareType: null,
|
|
|
times: null,
|
|
|
+ sort:state.ruleForm.earlyWarningRules.length+1
|
|
|
});
|
|
|
};
|
|
|
// 删除规则
|
|
@@ -212,6 +240,7 @@ const close = () => {
|
|
|
sensitiveWord: null,
|
|
|
compareType: null,
|
|
|
times: null,
|
|
|
+ sort:1
|
|
|
},
|
|
|
];
|
|
|
};
|