|
|
@ -38,6 +38,7 @@
|
|
|
|
ref="tree"
|
|
|
|
ref="tree"
|
|
|
|
node-key="id"
|
|
|
|
node-key="id"
|
|
|
|
:default-expand-all="true"
|
|
|
|
:default-expand-all="true"
|
|
|
|
|
|
|
|
@check="getCheckedNodes"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
|
<span>{{ data.name }}</span>
|
|
|
|
<span>{{ data.name }}</span>
|
|
|
@ -79,6 +80,7 @@ export default {
|
|
|
|
children: "list",
|
|
|
|
children: "list",
|
|
|
|
label: "name",
|
|
|
|
label: "name",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
termidArr: [],
|
|
|
|
ruleid: "",
|
|
|
|
ruleid: "",
|
|
|
|
parmsList: [], //选中的通道
|
|
|
|
parmsList: [], //选中的通道
|
|
|
|
multipleSelection: [],
|
|
|
|
multipleSelection: [],
|
|
|
@ -90,6 +92,8 @@ export default {
|
|
|
|
//全选
|
|
|
|
//全选
|
|
|
|
checkAll: true,
|
|
|
|
checkAll: true,
|
|
|
|
isIndeterminate: true, //全选设置默认选中
|
|
|
|
isIndeterminate: true, //全选设置默认选中
|
|
|
|
|
|
|
|
timer: null,
|
|
|
|
|
|
|
|
termidArrNum: -1,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {},
|
|
|
|
mounted() {},
|
|
|
@ -106,7 +110,6 @@ export default {
|
|
|
|
getScheduleRulelAccessList({})
|
|
|
|
getScheduleRulelAccessList({})
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
this.listnr = res.data.list;
|
|
|
|
this.listnr = res.data.list;
|
|
|
|
|
|
|
|
|
|
|
|
this.aisleList = res.data.channellist;
|
|
|
|
this.aisleList = res.data.channellist;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((err) => {});
|
|
|
|
.catch((err) => {});
|
|
|
@ -132,42 +135,36 @@ export default {
|
|
|
|
handleCheckBox() {
|
|
|
|
handleCheckBox() {
|
|
|
|
console.log(this.zzListCheck);
|
|
|
|
console.log(this.zzListCheck);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//遍历数据
|
|
|
|
|
|
|
|
eachTreeData(data, callback, childKey) {
|
|
|
|
|
|
|
|
if (!childKey) childKey = "children";
|
|
|
|
|
|
|
|
data.forEach((d) => {
|
|
|
|
|
|
|
|
if (callback(d) !== false && d[childKey])
|
|
|
|
|
|
|
|
this.eachTreeData(d[childKey], callback, childKey);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//给树的每一个节点 添加一个唯一值key,并算出默认选中的节点key数组
|
|
|
|
|
|
|
|
addKeyToList(data) {
|
|
|
|
|
|
|
|
let key = 0;
|
|
|
|
|
|
|
|
this.eachTreeData(data, (d) => {
|
|
|
|
|
|
|
|
d.key = key++;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//获取所选值
|
|
|
|
//获取所选值
|
|
|
|
getCheckedNodes() {
|
|
|
|
getCheckedNodes() {
|
|
|
|
this.parmsList = [];
|
|
|
|
this.parmsList = [];
|
|
|
|
const checkedNodes = this.$refs.tree.getCheckedNodes(false, true); //若节点可被选择,则返回目前被选中的节点所组成的数组
|
|
|
|
const checkedNodes = this.$refs.tree.getCheckedNodes(false, true); //若节点可被选择,则返回目前被选中的节点所组成的数组
|
|
|
|
//const checkedParam = []; //定义选中的数组
|
|
|
|
//const checkedParam = []; //定义选中的数组
|
|
|
|
let index = -1;
|
|
|
|
let index = -1;
|
|
|
|
// console.log(checkedNodes);
|
|
|
|
console.log(checkedNodes);
|
|
|
|
if (checkedNodes.length !== 0) {
|
|
|
|
if (checkedNodes.length !== 0) {
|
|
|
|
checkedNodes.forEach((item) => {
|
|
|
|
checkedNodes.forEach((item) => {
|
|
|
|
// 父节点结构的情况 判断是否有list子节点,如果有定义数组结构
|
|
|
|
if (item.list == undefined) {
|
|
|
|
if (item.list !== undefined) {
|
|
|
|
console.log("1111111111111");
|
|
|
|
index++;
|
|
|
|
console.log(item);
|
|
|
|
this.parmsList[index] = {
|
|
|
|
this.termidArr.push(item.id);
|
|
|
|
//name: item.name,
|
|
|
|
|
|
|
|
termid: item.id,
|
|
|
|
|
|
|
|
channelidlist: [],
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//如果没有list 把子节点id push到 定义的数组channelidlist中
|
|
|
|
|
|
|
|
this.parmsList[index].channelidlist.push(item.id);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 父节点结构的情况 判断是否有list子节点,如果有定义数组结构
|
|
|
|
|
|
|
|
// if (item.list !== undefined) {
|
|
|
|
|
|
|
|
// index++;
|
|
|
|
|
|
|
|
// this.parmsList[index] = {
|
|
|
|
|
|
|
|
// //name: item.name,
|
|
|
|
|
|
|
|
// termid: item.id,
|
|
|
|
|
|
|
|
// channelidlist: [],
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
// console.log(item);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// console.log("aaaaaaaaaaaaaa");
|
|
|
|
|
|
|
|
// //如果没有list 把子节点id push到 定义的数组channelidlist中
|
|
|
|
|
|
|
|
// this.parmsList[index].channelidlist.push(item.id);
|
|
|
|
|
|
|
|
// }
|
|
|
|
//通过bsManufacturer 判断是否是 线路 获取线路id
|
|
|
|
//通过bsManufacturer 判断是否是 线路 获取线路id
|
|
|
|
// if (item.bsManufacturer !== undefined) {
|
|
|
|
// if (item.bsManufacturer !== undefined) {
|
|
|
|
// this.ruleid = item.id;
|
|
|
|
// this.ruleid = item.id;
|
|
|
@ -181,60 +178,57 @@ export default {
|
|
|
|
.filter((item) => item.channelidlist.length !== 0)
|
|
|
|
.filter((item) => item.channelidlist.length !== 0)
|
|
|
|
.map((item) => {
|
|
|
|
.map((item) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
termid: item.termid,
|
|
|
|
termid: this.termidArr[0],
|
|
|
|
channelidlist: item.channelidlist,
|
|
|
|
channelidlist: [this.checkedAisle],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.termidArr = Array.from(new Set(this.termidArr));
|
|
|
|
|
|
|
|
console.log(this.termidArr);
|
|
|
|
console.log(this.parmsList);
|
|
|
|
console.log(this.parmsList);
|
|
|
|
return this.parmsList;
|
|
|
|
return this.parmsList;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 保存确定操作
|
|
|
|
// 保存确定操作
|
|
|
|
submitForm() {
|
|
|
|
submitForm() {
|
|
|
|
console.log(this.zzListCheck);
|
|
|
|
console.log(this.termidArr);
|
|
|
|
console.log(this.checkedAisle);
|
|
|
|
this.timer = window.setInterval(() => {
|
|
|
|
let checkzzList = [];
|
|
|
|
this.termidArrNum++;
|
|
|
|
for (let i = 0; i < this.zzListCheck.length; i++) {
|
|
|
|
console.log(this.termidArrNum);
|
|
|
|
console.log(this.zzListCheck[i]);
|
|
|
|
if (this.termidArrNum < this.termidArr.length) {
|
|
|
|
checkzzList.push({
|
|
|
|
this.sureSum();
|
|
|
|
termid: this.zzListCheck[i],
|
|
|
|
} else {
|
|
|
|
channelidlist: [this.checkedAisle],
|
|
|
|
this.$message.success("添加成功");
|
|
|
|
});
|
|
|
|
this.isShow = false;
|
|
|
|
}
|
|
|
|
this.$parent.deviceList();
|
|
|
|
console.log(checkzzList);
|
|
|
|
clearTimeout(this.timer);
|
|
|
|
if (this.zzListCheck.length == 0) {
|
|
|
|
}
|
|
|
|
this.$message.error("请选择通道");
|
|
|
|
}, 1000);
|
|
|
|
} else {
|
|
|
|
},
|
|
|
|
setScheduleRulel({
|
|
|
|
//时间表
|
|
|
|
scheduleid: this.selid,
|
|
|
|
sureSum() {
|
|
|
|
list: checkzzList,
|
|
|
|
setScheduleRulel({
|
|
|
|
|
|
|
|
list: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
termid: this.termidArr[this.termidArrNum],
|
|
|
|
|
|
|
|
channelidlist: [this.checkedAisle],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
scheduleid: this.selid,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
// this.$message.success("添加成功");
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((res) => {
|
|
|
|
.catch((err) => {
|
|
|
|
this.isShow = false;
|
|
|
|
this.$message.error("添加失败");
|
|
|
|
this.$message.success("添加成功");
|
|
|
|
});
|
|
|
|
this.$parent.deviceList();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
|
|
|
this.$message.error("添加失败");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// if (this.parmsList.length == 0)
|
|
|
|
|
|
|
|
// return this.$message.error("通道不能为空");
|
|
|
|
|
|
|
|
// setScheduleRulel({ list: this.parmsList, ruleid: this.selid })
|
|
|
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
|
|
|
// this.isShow = false;
|
|
|
|
|
|
|
|
// this.$message.success("添加成功");
|
|
|
|
|
|
|
|
// this.$parent.deviceList();
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .catch((err) => {
|
|
|
|
|
|
|
|
// this.$message.error("添加失败");
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
display() {
|
|
|
|
display() {
|
|
|
|
this.isShow = true;
|
|
|
|
this.isShow = true;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hide() {
|
|
|
|
hide() {
|
|
|
|
this.isShow = false;
|
|
|
|
this.isShow = false;
|
|
|
|
|
|
|
|
clearTimeout(this.timer);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|