From 998cff2189462a97cb8d6e1e7b9f88d9ecca524b Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期四, 14 七月 2022 14:34:36 +0800
Subject: [PATCH] add device clusterpwd change to authPwd
---
src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue | 40 ++++++++++++++++++++++++++++++----------
1 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue b/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue
index 1ed8212..89a9593 100644
--- a/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue
+++ b/src/views/hashrate/CameraManage/CameraRules/components/AddRuleBox.vue
@@ -7,9 +7,9 @@
<div class="close iconfont" @click="close"></div>
- <el-form :model="ruleForm">
+ <el-form :model="ruleForm" :rules="rules" ref="form">
<div class="label">鍦烘櫙鍚嶇О</div>
- <el-form-item>
+ <el-form-item prop="scene_name">
<el-input
class="h32"
v-model="ruleForm.scene_name"
@@ -34,7 +34,7 @@
</el-form-item>
<div class="label">鏃堕棿娈�</div>
- <el-form-item>
+ <el-form-item prop="time_rule_id">
<el-select
class="h32 left"
v-model="ruleForm.time_rule_id"
@@ -114,9 +114,6 @@
this.eventAudio.addEventListener("ended", () => {
this.togglePlay = true;
});
- if (this.editData.type) {
- this.initEditData();
- }
},
data() {
return {
@@ -151,6 +148,14 @@
value: 5,
},
],
+ rules: {
+ scene_name: [
+ { required: true, message: "璇疯緭鍏ュ満鏅悕绉�", trigger: "blur" },
+ ],
+ time_rule_id: [
+ { required: true, message: "璇烽�夋嫨鏃堕棿娈�", trigger: "blur" },
+ ],
+ },
soundPath: "",
togglePlay: true,
eventAudio: new Audio(),
@@ -172,6 +177,12 @@
voiceId: this.editData.rule.voiceId,
index: this.editData.index,
};
+ this.soundList.forEach((item) => {
+ if (item.id == this.editData.rule.voiceId) {
+ this.ruleForm.voiceId = item.id;
+ this.ruleForm.voice = item;
+ }
+ });
},
getSounds() {
let _this = this;
@@ -179,8 +190,11 @@
.then((res) => {
if (res.success) {
_this.soundList = [{ id: "", name: "绌�", path: "" }].concat(
- res.data
+ res.data.voices
);
+ if (_this.editData.type) {
+ _this.initEditData();
+ }
}
})
.catch((e) => console.log(e));
@@ -214,9 +228,15 @@
this.$emit("close");
},
save() {
- this.$emit("save", {
- action: this.editData.type ? "edit" : "add",
- data: this.ruleForm,
+ this.$refs["form"].validate((valid) => {
+ if (valid) {
+ this.$emit("save", {
+ action: this.editData.type ? "edit" : "add",
+ data: this.ruleForm,
+ });
+ } else {
+ return false;
+ }
});
},
},
--
Gitblit v1.8.0