|
@@ -53,7 +53,7 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
|
|
|
|
+ <!-- <el-col :span="8">
|
|
|
<el-form-item label="周期" prop="alertCycleValue">
|
|
<el-form-item label="周期" prop="alertCycleValue">
|
|
|
<el-col :span="16">
|
|
<el-col :span="16">
|
|
|
<el-input
|
|
<el-input
|
|
@@ -76,7 +76,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
|
|
|
|
+ </el-col> -->
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="状态" prop="enabled">
|
|
<el-form-item label="状态" prop="enabled">
|
|
@@ -144,6 +144,36 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column prop="matterRuleId" label="预警规则" width="260">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="'actionList.' + scope.$index + '.matterRuleId'"
|
|
|
|
|
+ label-width="0"
|
|
|
|
|
+ :rules="contentConfigFormRules.matterRuleId"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ @click="
|
|
|
|
|
+ detailsDialog = true;
|
|
|
|
|
+ currentId = scope.row.matterRuleId;
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ scope.row.matterRuleName }}
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ @click="
|
|
|
|
|
+ currentIndex = scope.$index;
|
|
|
|
|
+ addDialog = true;
|
|
|
|
|
+ "
|
|
|
|
|
+ >
|
|
|
|
|
+ 选择
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="thresholdValue" label="阈值" width="100">
|
|
<el-table-column prop="thresholdValue" label="阈值" width="100">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
@@ -245,6 +275,49 @@
|
|
|
ref="selectPersonDialogRef"
|
|
ref="selectPersonDialogRef"
|
|
|
@changeParent="changeParent"
|
|
@changeParent="changeParent"
|
|
|
></select-person-dialog>
|
|
></select-person-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 添加规则 -->
|
|
|
|
|
+ <ele-modal
|
|
|
|
|
+ width="800px"
|
|
|
|
|
+ :visible="addDialog"
|
|
|
|
|
+ :append-to-body="true"
|
|
|
|
|
+ title="规则配置"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ @update:visible="addDialog = false"
|
|
|
|
|
+ :maxable="true"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-select v-model="ruleId" size="small" style="width: 100%" filterable>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in ruleNameList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ :label="item.code + '-' + item.name"
|
|
|
|
|
+ @click.native="ruleChange(item)"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <template v-slot:footer>
|
|
|
|
|
+ <el-button @click="addDialog = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="addRule"> 添加 </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ele-modal>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 规则详情 -->
|
|
|
|
|
+ <ele-modal
|
|
|
|
|
+ width="80%"
|
|
|
|
|
+ :visible="detailsDialog"
|
|
|
|
|
+ :append-to-body="true"
|
|
|
|
|
+ title="规则详情"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ @update:visible="detailsDialog = false"
|
|
|
|
|
+ :maxable="true"
|
|
|
|
|
+ >
|
|
|
|
|
+ <ruleDetails
|
|
|
|
|
+ :isModal="true"
|
|
|
|
|
+ :id="currentId"
|
|
|
|
|
+ v-if="detailsDialog"
|
|
|
|
|
+ ></ruleDetails>
|
|
|
|
|
+ </ele-modal>
|
|
|
|
|
+ <!-- ruleDetails -->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -262,9 +335,11 @@
|
|
|
import { notifyTemplatePageAPI } from '@/api/notifyManage';
|
|
import { notifyTemplatePageAPI } from '@/api/notifyManage';
|
|
|
import { getUserPage } from '@/api/system/organization';
|
|
import { getUserPage } from '@/api/system/organization';
|
|
|
import selectPersonDialog from './user-select/user-select.vue';
|
|
import selectPersonDialog from './user-select/user-select.vue';
|
|
|
|
|
+ import ruleDetails from '@/views/rulesManagement/matterRules/details.vue';
|
|
|
|
|
+ import { getRule } from '@/api/ruleManagement/plan';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components: { selectPersonDialog },
|
|
|
|
|
|
|
+ components: { selectPersonDialog, ruleDetails },
|
|
|
props: {
|
|
props: {
|
|
|
dialogTitle: {
|
|
dialogTitle: {
|
|
|
type: String,
|
|
type: String,
|
|
@@ -280,6 +355,13 @@
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
addMatterDialog: false,
|
|
addMatterDialog: false,
|
|
|
|
|
+ addDialog: false,
|
|
|
|
|
+ detailsDialog: false,
|
|
|
|
|
+ ruleId: '',
|
|
|
|
|
+ ruleName: '',
|
|
|
|
|
+ currentIndex: '',
|
|
|
|
|
+ ruleNameList: [],
|
|
|
|
|
+ currentId: '',
|
|
|
formData: {
|
|
formData: {
|
|
|
ruleCode: '',
|
|
ruleCode: '',
|
|
|
ruleName: '',
|
|
ruleName: '',
|
|
@@ -309,6 +391,10 @@
|
|
|
ruleObjCode: [
|
|
ruleObjCode: [
|
|
|
{ required: true, message: '请选择预警对象', trigger: 'blur' }
|
|
{ required: true, message: '请选择预警对象', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
|
|
+ // matterRuleId: [
|
|
|
|
|
+ // { required: true, message: '请选择预警规则', trigger: 'blur' }
|
|
|
|
|
+ // ],
|
|
|
|
|
+
|
|
|
alertCycleUnit: [
|
|
alertCycleUnit: [
|
|
|
{ required: true, message: '请输入周期单位', trigger: 'blur' }
|
|
{ required: true, message: '请输入周期单位', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
@@ -347,9 +433,36 @@
|
|
|
this.getAllData();
|
|
this.getAllData();
|
|
|
this.gettemplateList();
|
|
this.gettemplateList();
|
|
|
this.getInfo();
|
|
this.getInfo();
|
|
|
|
|
+ this.getRule();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ async getRule() {
|
|
|
|
|
+ const res = await getRule({
|
|
|
|
|
+ status: 1,
|
|
|
|
|
+ type: 8,
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: -1
|
|
|
|
|
+ });
|
|
|
|
|
+ this.ruleNameList = res?.list || [];
|
|
|
|
|
+ },
|
|
|
|
|
+ ruleChange(item) {
|
|
|
|
|
+ this.ruleId = item.id;
|
|
|
|
|
+ this.ruleName = item.name;
|
|
|
|
|
+ },
|
|
|
|
|
+ addRule() {
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.formData.actionList[this.currentIndex],
|
|
|
|
|
+ 'matterRuleId',
|
|
|
|
|
+ this.ruleId
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.formData.actionList[this.currentIndex],
|
|
|
|
|
+ 'matterRuleName',
|
|
|
|
|
+ this.ruleName
|
|
|
|
|
+ );
|
|
|
|
|
+ this.addDialog = false;
|
|
|
|
|
+ },
|
|
|
handleInput(value) {
|
|
handleInput(value) {
|
|
|
this.formData.alertCycleValue = this.$handleInputPublic(value);
|
|
this.formData.alertCycleValue = this.$handleInputPublic(value);
|
|
|
},
|
|
},
|
|
@@ -389,7 +502,7 @@
|
|
|
changeParent(list, index) {
|
|
changeParent(list, index) {
|
|
|
if (list.length > 10) {
|
|
if (list.length > 10) {
|
|
|
this.$message.warning('最多选择10个通知人!');
|
|
this.$message.warning('最多选择10个通知人!');
|
|
|
- return
|
|
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
this.NumberOfPeople = list.length;
|
|
this.NumberOfPeople = list.length;
|
|
|
console.log(list.length, 'list', this.isBindPlan);
|
|
console.log(list.length, 'list', this.isBindPlan);
|
|
@@ -531,6 +644,11 @@
|
|
|
if (form.actionList.length < 1) {
|
|
if (form.actionList.length < 1) {
|
|
|
this.$message.error('请添加事项内容!');
|
|
this.$message.error('请添加事项内容!');
|
|
|
}
|
|
}
|
|
|
|
|
+ let actionListLen = form.actionList.filter((item) => item.matterRuleId);
|
|
|
|
|
+ if (actionListLen?.length != form.actionList.length) {
|
|
|
|
|
+ this.$message.error('预警规则不能为空!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.$refs.contentConfigForm.validate(async (valid) => {
|
|
this.$refs.contentConfigForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
let request =
|
|
let request =
|