From 5fb65ada8ccc28eabf823b284de70fbd3ca1f41e Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期二, 28 九月 2021 18:29:36 +0800
Subject: [PATCH] 抓拍大图层级修复v1
---
src/pages/datapush/index/RightEvent.vue | 90 ++++++++++++++++++++++++++++++++------------
1 files changed, 65 insertions(+), 25 deletions(-)
diff --git a/src/pages/datapush/index/RightEvent.vue b/src/pages/datapush/index/RightEvent.vue
index ef2e973..f4dce22 100644
--- a/src/pages/datapush/index/RightEvent.vue
+++ b/src/pages/datapush/index/RightEvent.vue
@@ -203,7 +203,7 @@
<div slot="title" class="slot-title">
<p>璇烽�夋嫨鎯宠鎺ㄩ�佺殑瀛楁</p>
<div class="right">
- <el-checkbox v-model="allFieldChecked"></el-checkbox>
+ <el-checkbox v-model="allFieldChecked" @change="allCheckChange"></el-checkbox>
</div>
</div>
<div class="check-area" v-for="configObj in tempPushSet" :key="configObj.id">
@@ -215,7 +215,7 @@
</div>
<div class="flex-box flex-wrap">
<div class="param flex-box" v-for="param in configObj.children" :key="param.id">
- <el-checkbox v-model="param.checked"></el-checkbox>
+ <el-checkbox v-model="param.checked" @change="checkChildren"></el-checkbox>
<span class="param-name">{{param.name}}</span>
<el-input
v-model="param.alias"
@@ -372,12 +372,33 @@
openPushSetDialog() {
this.pushFieldDialog = true;
this.tempPushSet = JSON.parse(JSON.stringify(this.taskEditData.push_set));
+ this.checkFlag()
+ },
+ checkFlag() {
+ // debugger
+ let flag = true
+ this.tempPushSet.forEach(item => {
+ if (item.checked == false) {
+ flag = false
+ }
+ });
+ this.allFieldChecked = flag
+ },
+ checkChildren(val) {
+ console.log(val, 12121);
+ if (val == false) {
+ this.allFieldChecked = false
+ } else if (val == true && this.allFieldChecked == false) {
+ this.$nextTick(() => {
+ this.checkFlag()
+ })
+ }
+
},
varifyField(param) {
var reg = /^[A-Za-z]+[0-9-_]?$/;
if (!reg.test(param.alias)) {
this.$message('璇疯緭鍏ュ悎娉曞瓧娈靛悕');
- debugger
param.error = true;
} else {
param.error = false;
@@ -389,6 +410,15 @@
},
canclePushFieldSet() {
this.pushFieldDialog = false;
+ },
+ allCheckChange(val) {
+
+ this.tempPushSet.forEach(function (item) {
+ item.checked = val
+ item.children.forEach(function (child) {
+ child.checked = val
+ })
+ })
},
submitPushFieldSet() {
let flag = false;
@@ -407,14 +437,19 @@
//NO SUBMIT
return
}
+
this.taskEditData.push_set = this.tempPushSet;
- console.log(this.taskEditData.push_set);
this.pushFieldDialog = false;
+
+ // 淇濆瓨瑙勫垯
+ this.eventPushsSave()
},
toggleConfigCheck(configObj) {
+
configObj.children.forEach(child => {
child.checked = configObj.checked
})
+ this.checkFlag()
},
getPushFields() {
let _this = this;
@@ -442,8 +477,8 @@
});
},
delUrl(index) {
- this.$set(this.taskEditData.urls, index, this.baseRule)
- this.taskEditData.urls.splice(index, 1)
+ this.$set(this.taskEditData.urls, index, this.baseRule);
+ this.taskEditData.urls.splice(index, 1);
},
// 淇濆瓨
async eventPushsSave() {
@@ -480,15 +515,15 @@
}
if (i.rule_value === "all*all") {
- str += "鍏ㄩ儴"
+ str += "鍏ㄩ儴";
} else if (i.rule_value === "null*null") {
- str += "绌�"
+ str += "绌�";
} else {
- str += i.rule_value
+ str += i.rule_value;
}
if (str.length > 0) {
- ruleDesc.push(str)
+ ruleDesc.push(str);
}
});
// 澶勭悊瑙勫垯鍒楄〃鏁版嵁缁撴瀯
@@ -545,7 +580,7 @@
async getCameras() {
let rsp = await findByEventTopic({ topic: 'camera', type: 'name' });
if (rsp && rsp.success) {
- this.dictionary['camera'] = rsp.data
+ this.dictionary['camera'] = rsp.data;
}
rsp = await findByEventTopic({ topic: 'dbtable' });
@@ -569,7 +604,7 @@
value: task.name,
name: task.name
})
- hash[task.name] = true
+ hash[task.name] = true;
}
})
}
@@ -595,44 +630,48 @@
if (element.value === rule.topic_type) {
rule.topicArgOptions = element.children;
if (resetNext) {
- rule.topic_arg = rule.topicArgOptions[0].value
- this.selectArg(rule, resetNext)
+ rule.topic_arg = rule.topicArgOptions[0].value;
+ this.selectArg(rule, resetNext);
}
}
});
},
selectArg(rule, resetNext = false) {
+ debugger
let argInfo = rule.topicArgOptions.filter(arg => {
- return arg.value === rule.topic_arg
+ return arg.value === rule.topic_arg;
})
if (argInfo.length > 0) {
- let desc = argInfo[0].description.split(",")
+ let desc = argInfo[0].description.split(",");
if (desc.length > 0) {
rule.operatorTypeOpionts = this.dictionary.EVENTTYPECOMPUTE.filter(el => {
- return desc.indexOf(el.value) >= 0
+ return desc.indexOf(el.value) >= 0;
})
}
}
if (resetNext) {
- rule.operator_type = rule.operatorTypeOpionts[rule.operatorTypeOpionts.length - 1].value
- this.selectOperator(rule, resetNext)
+ rule.operator_type = rule.operatorTypeOpionts[rule.operatorTypeOpionts.length - 1].value;
+ this.selectOperator(rule, resetNext);
}
},
selectOperator(rule, resetNext = false) {
if (rule.operator_type === "option") {
- rule.ruleValueOptions = this.dictionary[rule.topic_type] ? this.dictionary[rule.topic_type] : []
- rule.rule_values = rule.rule_value.split(",")
+ rule.ruleValueOptions = this.dictionary[rule.topic_type] ? this.dictionary[rule.topic_type] : [];
+
+ if (rule.rule_value != "") {
+ rule.rule_values = rule.rule_value.split(",");
+ }
// 澶勭悊 鍏ㄩ儴/绌�
for (let i = 0; i < rule.rule_values.length; i++) {
if (rule.rule_values[i] === "all*all") {
- rule.rule_values[i] = "鍏ㄩ儴"
+ rule.rule_values[i] = "鍏ㄩ儴";
}
if (rule.rule_values[i] === "null*null") {
- rule.rule_values[i] = "绌�"
+ rule.rule_values[i] = "绌�";
}
}
@@ -659,7 +698,7 @@
}
}
- rule.rule_value = val.join(",")
+ rule.rule_value = val.join(",");
},
setOptionsDisable(rule) {
let isAllSelect = (rule.rule_values.indexOf("鍏ㄩ儴") >= 0);
@@ -718,7 +757,8 @@
}
],
radioValue: "1",
- eventTxt: ""
+ eventTxt: "",
+ push_set: this.pushFields
};
this.dataList = [];
},
--
Gitblit v1.8.0