|
@@ -19,17 +19,14 @@
|
|
|
:data="categoryList"
|
|
|
showPanel
|
|
|
width="300"
|
|
|
- @change="changeItem"
|
|
|
- v-model="equipTypeList"
|
|
|
- type="final"
|
|
|
+ @confirm="changeEquip"
|
|
|
></Cascader>
|
|
|
<Cascader
|
|
|
caption="建筑楼层"
|
|
|
multiple
|
|
|
:all="false"
|
|
|
:data="buildFloorList"
|
|
|
- @change="changeItem"
|
|
|
- v-model="floorList"
|
|
|
+ @confirm="changeFloor"
|
|
|
showPanel
|
|
|
width="300"
|
|
|
></Cascader>
|
|
@@ -145,6 +142,12 @@ export default {
|
|
|
props: ["showAddItemModel", "filtIdList"],
|
|
|
computed: {
|
|
|
...mapState(["editCmd", "projectId"]),
|
|
|
+ filtIdListString() {
|
|
|
+ const filtIdListString = this.filtIdList.length
|
|
|
+ ? "not id in " + JSON.stringify(this.filtIdList) + ";"
|
|
|
+ : "";
|
|
|
+ return filtIdListString;
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -215,9 +218,9 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
],
|
|
|
- abc: [],
|
|
|
- floorList: [], // 楼层选中条件
|
|
|
- equipTypeList: [], //设备类型选中条件
|
|
|
+ equipTypeString: "", //设备类型选中条件
|
|
|
+ buildIdString: "",
|
|
|
+ floorIdString: "",
|
|
|
tableData: [
|
|
|
{
|
|
|
date: "2016-05-03",
|
|
@@ -370,8 +373,36 @@ export default {
|
|
|
methods: {
|
|
|
...mapMutations(["SETEQUIPLIST"]),
|
|
|
// 筛选item
|
|
|
- changeItem() {
|
|
|
+ changeEquip(list) {
|
|
|
const classCode = []; // 设备类型
|
|
|
+ list.forEach((val) => {
|
|
|
+ if (val.index == 3) {
|
|
|
+ classCode.push(val.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const floorId = "floorId='' or floorId=''";
|
|
|
+ const classCodeString = classCode.length
|
|
|
+ ? "classCode in " + JSON.stringify(classCode) + ";"
|
|
|
+ : "";
|
|
|
+ this.equipTypeString = classCodeString;
|
|
|
+ let data = {
|
|
|
+ Orders: "name asc, createTime desc",
|
|
|
+ PageNumber: 1,
|
|
|
+ PageSize: 50,
|
|
|
+ Filters: `projectId='${this.projectId}';${filtIdListString}${classCodeString}${buildIdString}${floorIdString}`,
|
|
|
+ };
|
|
|
+ queryEquip(data).then((res) => {
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeFloor(list) {
|
|
|
+ const classCode = []; // 设备类型
|
|
|
+ list.forEach((val) => {
|
|
|
+ if (val.index == 3) {
|
|
|
+ classCode.push(val.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.equipTypeList = classCode;
|
|
|
const buildId = "buildId='' or buildId=''";
|
|
|
const floorId = "floorId='' or floorId=''";
|
|
|
let data = {
|
|
@@ -384,10 +415,12 @@ export default {
|
|
|
},
|
|
|
// 切换分页
|
|
|
currentChangeHandle() {},
|
|
|
+ // 关闭弹窗
|
|
|
modalClose() {
|
|
|
this.isShowModel = false;
|
|
|
this.$emit("closeModel");
|
|
|
},
|
|
|
+ // 确认/提交
|
|
|
finish() {
|
|
|
// 获取数组
|
|
|
let list = [];
|
|
@@ -409,22 +442,35 @@ export default {
|
|
|
items.number = items.children.length;
|
|
|
},
|
|
|
// 构建树list
|
|
|
- mapList(list, arr = [], nameList = ["id", "localName", "floor"]) {
|
|
|
+ mapList(
|
|
|
+ list,
|
|
|
+ arr = [],
|
|
|
+ nameList = ["id", "localName", "floor"],
|
|
|
+ index = 0
|
|
|
+ ) {
|
|
|
+ index++;
|
|
|
if (list.length) {
|
|
|
list.forEach((item) => {
|
|
|
if (item[nameList[2]] && item[nameList[2]].length) {
|
|
|
const obj = {
|
|
|
title: item[nameList[1]],
|
|
|
id: item[nameList[0]],
|
|
|
+ index: index,
|
|
|
children: [],
|
|
|
};
|
|
|
- const children = this.mapList(item[nameList[2]], [], nameList);
|
|
|
+ const children = this.mapList(
|
|
|
+ item[nameList[2]],
|
|
|
+ [],
|
|
|
+ nameList,
|
|
|
+ index
|
|
|
+ );
|
|
|
obj.children = children;
|
|
|
arr.push(obj);
|
|
|
} else {
|
|
|
arr.push({
|
|
|
title: item[nameList[1]],
|
|
|
id: item[nameList[0]],
|
|
|
+ index: index,
|
|
|
});
|
|
|
}
|
|
|
});
|