Commit d24d7bc9 by 张杰

v1.6.0版本需求

1 parent e25b4b63
......@@ -59,23 +59,70 @@ export default {
// 初始化
init() {
let o = this.value;
let o = this.value.toString();
let list = this.cityList;
let arr = [];
if (!o) {
return false;
}
let m = list.find((k) => {
let n = k.children.find((j) => (j.name == o||j.code == o));
if (n) {
//let b = n.children.find(h => (h.name == n.name || h.code == n.code) )
// for(let i =0,len=list.length;i<len;i++){
// let k = list[i]
// if(k.code == o){
// arr.push(k.code)
// return false;
// }
// }
list.forEach((k) => {
// 只有省份
if (k.code == o) {
arr.push(k.code);
arr.push(n.code);
return;
}
if (k.children) {
k.children.forEach((j) => {
// 只有省市
if (j.code == o) {
arr.push(k.code);
arr.push(j.code);
return;
}
j.children &&
j.children.forEach((h) => {
// 只有省市区
if (h.code == o) {
arr.push(k.code);
arr.push(j.code);
arr.push(h.code);
return;
}
});
});
}
});
// let m = list.find((k) => {
// let n = k.children.find((j) => j.name == o || j.code == o);
// if (n) {
// arr.push(k.code);
// arr.push(n.code);
// return false;
// }
// });
this.city = arr;
console.log(arr);
},
// 展开数组
unfoldTree(arr, afterArray = []) {
let _this = this;
arr.map((k) => {
afterArray.push(k);
if (k.children) {
_this.unfoldTree(k.children, afterArray);
}
});
return afterArray;
},
},
};
</script>
......
......@@ -50,8 +50,8 @@
</el-radio-group>
<div class="shape_tip" v-show="form.shapeType==3">*注:地图任意位置,单击新增双击结束绘制。</div>
</el-form-item>
<el-form-item label="省市区" class="is-required" v-if="form.shapeType==4" prop="areaName">
<city-select v-model="form.areaName" :checkStrictly="true" @change="changeArea"></city-select>
<el-form-item label="省市区" class="is-required" v-if="form.shapeType==4" prop="areaCode">
<city-select v-model="form.areaCode" :checkStrictly="true" @change="changeArea"></city-select>
</el-form-item>
<el-form-item label="围栏类型" prop="bizFenceType">
<el-radio :label="14" v-model="form.bizFenceType">报警型</el-radio>
......@@ -208,7 +208,7 @@ export default {
timeType: [
{ required: true, message: "请选择监控周期", trigger: "change" },
],
areaName: [{ validator: checkArea, trigger: "blur" }],
areaCode: [{ validator: checkArea, trigger: "blur" }],
bizFenceType: [
{ required: true, message: "请选择围栏类型", trigger: "change" },
],
......@@ -596,11 +596,11 @@ export default {
}
list.map((k) => {
arr.push(k.sns);
arr.push(k.sn);
});
let oParams = {};
oParams.linkSns = arr;
oParams.linkSns = arr.toString();
oParams.fenceId = _this.fenceId;
REMOVE_ELECFENCE_LINKEDDEVICES(oParams).then((res) => {
if (res.code == 200) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!