| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="时间段"> |
| | | <el-select v-model="sceneForm.workingTimes" placeholder="请选择" size="mini"> |
| | | <el-select v-model="sceneForm.workTimeId" placeholder="请选择" size="mini"> |
| | | <el-option v-for="item in VideoManageData.TimeRules" :key="item.id" :label="item.name" |
| | | :value="item.id"></el-option> |
| | | </el-select> |
| | |
| | | message: "事件等级不能为空", |
| | | }); |
| | | return false; |
| | | } else if (!this.sceneForm.workingTimes) { |
| | | } else if (!this.sceneForm.workTimeId) { |
| | | this.$notify({ |
| | | type: "warning", |
| | | message: "时间段不能为空", |
| | |
| | | message: "检测内容不能为空", |
| | | }); |
| | | return false; |
| | | } else if (!this.sceneForm.workingTimes) { |
| | | } else if (!this.sceneForm.warningRules) { |
| | | this.$notify({ |
| | | type: "warning", |
| | | message: "预警规则不能为空", |
| | | }); |
| | | return false; |
| | | } else if (!this.sceneForm.knowsList) { |
| | | this.$notify({ |
| | | type: "warning", |
| | | message: "知识库不能为空", |
| | | }); |
| | | return false; |
| | | } |
| | | // else if (!this.sceneForm.knowsList) { |
| | | // this.$notify({ |
| | | // type: "warning", |
| | | // message: "知识库不能为空", |
| | | // }); |
| | | // return false; |
| | | // } |
| | | return true; |
| | | }, |
| | | saveSceneRule() { |
| | |
| | | // labelName: timeOption ? timeOption.name : '' |
| | | // } |
| | | // }) |
| | | const fileIds = this.sceneForm.knowsList.map( |
| | | path => { |
| | | // 提取最后一级的文件ID并转换为数字 |
| | | const id = path[path.length - 1]; |
| | | return Number(id); // 或者使用 parseInt(id) 或 +id |
| | | } |
| | | ) |
| | | let fileIds = [] |
| | | if (this.sceneForm.knowsList) { |
| | | fileIds = this.sceneForm.knowsList.map( |
| | | path => { |
| | | // 提取最后一级的文件ID并转换为数字 |
| | | const id = path[path.length - 1]; |
| | | return Number(id); // 或者使用 parseInt(id) 或 +id |
| | | } |
| | | ) |
| | | } |
| | | this.sceneForm.taskName = this.sceneForm.scene_name |
| | | this.sceneForm.eventLevel = this.sceneForm.alarm_level |
| | | this.sceneForm.checks = this.sceneForm.checkContents |
| | | this.sceneForm.rules = this.sceneForm.warningRules |
| | | // this.sceneForm.workTimes = workTimes |
| | | this.sceneForm.workTimeId = this.sceneForm.workingTimes |
| | | this.sceneForm.taskDescription = this.sceneForm.desc |
| | | this.sceneForm.knows = fileIds, |
| | | this.onSaveScene(this.sceneForm); |