|
@@ -458,7 +458,7 @@
|
|
|
deviceId: '',
|
|
deviceId: '',
|
|
|
deviceName: '',
|
|
deviceName: '',
|
|
|
deviceCode: '',
|
|
deviceCode: '',
|
|
|
- iotId:'',
|
|
|
|
|
|
|
+ iotId: '',
|
|
|
name: '', // 告警名称
|
|
name: '', // 告警名称
|
|
|
generateDocumentType: null, // 是否生成保修工单
|
|
generateDocumentType: null, // 是否生成保修工单
|
|
|
description: '', // 告警描述
|
|
description: '', // 告警描述
|
|
@@ -485,7 +485,7 @@
|
|
|
],
|
|
],
|
|
|
deviceName: [
|
|
deviceName: [
|
|
|
{ required: true, message: '请选择告警名称', trigger: 'blur' },
|
|
{ required: true, message: '请选择告警名称', trigger: 'blur' },
|
|
|
- { required: true, message: '请选择告警名称', trigger: 'change' },
|
|
|
|
|
|
|
+ { required: true, message: '请选择告警名称', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
name: [
|
|
name: [
|
|
|
{ required: true, message: '请输入告警名称', trigger: 'blur' }
|
|
{ required: true, message: '请输入告警名称', trigger: 'blur' }
|
|
@@ -504,7 +504,7 @@
|
|
|
this.baseInfoForm.deviceId = data.id;
|
|
this.baseInfoForm.deviceId = data.id;
|
|
|
this.baseInfoForm.deviceName = data.name;
|
|
this.baseInfoForm.deviceName = data.name;
|
|
|
this.baseInfoForm.deviceCode = data.code;
|
|
this.baseInfoForm.deviceCode = data.code;
|
|
|
- this.iotId== data.iotId;
|
|
|
|
|
|
|
+ this.iotId == data.iotId;
|
|
|
this.baseInfoForm.conditions = [];
|
|
this.baseInfoForm.conditions = [];
|
|
|
getPhysicalModel(data.id).then((res) => {
|
|
getPhysicalModel(data.id).then((res) => {
|
|
|
this.temperatureList = res.properties;
|
|
this.temperatureList = res.properties;
|
|
@@ -644,6 +644,7 @@
|
|
|
|
|
|
|
|
// 保存
|
|
// 保存
|
|
|
async saveWarningSetting() {
|
|
async saveWarningSetting() {
|
|
|
|
|
+ let is = false;
|
|
|
if (
|
|
if (
|
|
|
[1, 2, 5].includes(this.baseInfoForm.generateDocumentType) &&
|
|
[1, 2, 5].includes(this.baseInfoForm.generateDocumentType) &&
|
|
|
!this.baseInfoForm?.workItems?.length
|
|
!this.baseInfoForm?.workItems?.length
|
|
@@ -651,6 +652,21 @@
|
|
|
this.$message.error('规则不能为空!');
|
|
this.$message.error('规则不能为空!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!this.baseInfoForm?.conditions?.length) {
|
|
|
|
|
+ this.$message.error('触发条件不能为空');
|
|
|
|
|
+ return;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.baseInfoForm?.conditions.forEach((item, index) => {
|
|
|
|
|
+ console.log(item,'item')
|
|
|
|
|
+ if (!item.attributeCode || !item.operator || !item.thresholdValue) {
|
|
|
|
|
+ is = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (is) {
|
|
|
|
|
+ this.$message.error('触发条件内容没填写完整,前检查!');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.$refs.baseInfoFormRef.validate(async (valid) => {
|
|
this.$refs.baseInfoFormRef.validate(async (valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
this.saveLoading = true;
|
|
this.saveLoading = true;
|