|
@@ -104,9 +104,9 @@
|
|
|
style="width: 100%; margin-top: 10px"
|
|
|
:row-class-name="tableRowClassName"
|
|
|
>
|
|
|
- <el-table-column prop="date" label="设备类" style="width: 30%"> </el-table-column>
|
|
|
- <el-table-column prop="name" label="设备实例数量" tyle="width: 30%"> </el-table-column>
|
|
|
- <el-table-column prop="address" label="操作">
|
|
|
+ <el-table-column prop="codeName" label="设备类" style="width: 30%"> </el-table-column>
|
|
|
+ <el-table-column prop="total" label="设备实例数量" tyle="width: 30%"> </el-table-column>
|
|
|
+ <el-table-column prop="classCode" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<el-link type="primary" @click="editInfo(scope.row)" :underline="false">编辑信息点</el-link>
|
|
|
</template>
|
|
@@ -122,7 +122,8 @@
|
|
|
<el-button @click="close">取 消</el-button>
|
|
|
<el-button :disabled="!tableData.length" :type="tableData.length ? 'primary' : 'info'" @click="confirm">确 定</el-button>
|
|
|
</div>
|
|
|
- <edit-info-point type="equipment" @closeModal="showEditInfoPoint = false" :showDialog="showEditInfoPoint" />
|
|
|
+ <!-- TODO: -->
|
|
|
+ <!-- <edit-info-point type="equipment" @closeModal="showEditInfoPoint = false" :showDialog="showEditInfoPoint" /> -->
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -132,8 +133,8 @@
|
|
|
import editInfoPoint from "./editInfoPoint";
|
|
|
import { Select, TreeSelect } from "meri-design";
|
|
|
import { cloneDeep } from "lodash";
|
|
|
-import { dictQuery } from "@/api/datacenter";
|
|
|
-import { categoryQuery, typeQuery } from "@/api/equipcomponent";
|
|
|
+import { dictCategoryQuery, dictQuery, PartiInstancQuery } from "@/api/datacenter";
|
|
|
+import { categoryQuery, typeQuery, equipQuery } from "@/api/equipcomponent";
|
|
|
import { array2Tree } from "@/utils/utils";
|
|
|
const dataTree = [
|
|
|
{
|
|
@@ -199,47 +200,21 @@ export default {
|
|
|
spacePartitionTypeData: [],
|
|
|
curentSelectTree3: [], //选中的空间 功能类型
|
|
|
dialogTableVisible: false,
|
|
|
- spacePartitionInstance: "", //选中的空间分区下实例
|
|
|
+ spacePartitionInstance: [], //选中的空间分区下实例
|
|
|
selectData: [
|
|
|
- { id: "test1", name: "选择项" },
|
|
|
- { id: "test2", name: "单平米" },
|
|
|
- { id: "test3", name: "下级分项" },
|
|
|
- { id: "test4", name: "4444444" },
|
|
|
+ // { id: "test1", name: "选择项" },
|
|
|
],
|
|
|
tableData: [
|
|
|
- {
|
|
|
- date: "实例总数量 111111",
|
|
|
- },
|
|
|
- {
|
|
|
- date: "监控器",
|
|
|
- name: "111",
|
|
|
- address: "dfadfasdfa",
|
|
|
- },
|
|
|
- {
|
|
|
- date: "监控前端设备",
|
|
|
- name: "222",
|
|
|
- },
|
|
|
- {
|
|
|
- date: "监控控制箱",
|
|
|
- name: "333",
|
|
|
- },
|
|
|
- {
|
|
|
- date: "监控摄像头",
|
|
|
- name: "44",
|
|
|
- },
|
|
|
- {
|
|
|
- date: "水景系统",
|
|
|
- name: "11",
|
|
|
- },
|
|
|
- {
|
|
|
- date: "泳池系统",
|
|
|
- name: "11",
|
|
|
- },
|
|
|
- {
|
|
|
- date: "网络系统",
|
|
|
- name: "22",
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // date: "实例总数量 111111",
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // date: "监控器",
|
|
|
+ // name: "111",
|
|
|
+ // address: "dfadfasdfa",
|
|
|
+ // },
|
|
|
],
|
|
|
+ _tableData: [],
|
|
|
showEditInfoPoint: false, //显示编辑信息点弹窗
|
|
|
};
|
|
|
},
|
|
@@ -253,8 +228,11 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {},
|
|
|
- async mounted() {
|
|
|
+ mounted() {
|
|
|
// window.vm = this;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.showPopover = true;
|
|
|
+ }, 2000);
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
@@ -267,6 +245,8 @@ export default {
|
|
|
// 筛选树的最后一级,按照组件返回数组的name中/的个数
|
|
|
this.curentSelectTree1 = dataObj.filter((v) => v.name.split("/").length === 3).map((v) => v.id);
|
|
|
}
|
|
|
+ // 查询设备列表
|
|
|
+ this.curentSelectTree1.length && this.getTableData();
|
|
|
},
|
|
|
focusChange1(status) {
|
|
|
// console.log("focusChange", status);
|
|
@@ -274,7 +254,7 @@ export default {
|
|
|
/**
|
|
|
* 空间 分区类型树
|
|
|
*/
|
|
|
- treeChange2(data, dataObj) {
|
|
|
+ /* treeChange2(data, dataObj) {
|
|
|
// 清空选中的分区下的实例
|
|
|
this.spacePartitionInstance = [];
|
|
|
if (!dataObj) {
|
|
@@ -283,10 +263,12 @@ export default {
|
|
|
// 筛选树的最后一级,按照组件返回数组的name中/的个数
|
|
|
this.curentSelectTree2 = dataObj.filter((v) => v.name.split("/").length === 2).map((v) => v.id);
|
|
|
}
|
|
|
- },
|
|
|
+ }, */
|
|
|
spacePartitionTypeConfirm(data) {
|
|
|
- console.log(data);
|
|
|
- console.log(this.spacePartitionType);
|
|
|
+ // 查询分区下实例列表
|
|
|
+ if (this.spacePartitionType.length) {
|
|
|
+ this.getPartiInstance();
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* 空间 分区下实例
|
|
@@ -294,6 +276,7 @@ export default {
|
|
|
selectConfirm(data) {
|
|
|
console.log("selectConfirm");
|
|
|
console.log(data);
|
|
|
+ console.log(this.spacePartitionInstance);
|
|
|
},
|
|
|
focusChange2(status) {
|
|
|
// console.log("focusChange", status);
|
|
@@ -315,15 +298,7 @@ export default {
|
|
|
/**
|
|
|
* 显示弹窗时的处理
|
|
|
*/
|
|
|
- async initModal() {
|
|
|
- this.showPopover = false;
|
|
|
- // this.tableData = []; //TODO:
|
|
|
- // 没有tableData,显示popover
|
|
|
- if (!this.tableData.length) {
|
|
|
- this.timer = setTimeout(() => {
|
|
|
- this.showPopover = true;
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
+ initModal() {
|
|
|
// 查询设备实例树
|
|
|
this.getCategory();
|
|
|
// 分区类型 列表
|
|
@@ -334,22 +309,56 @@ export default {
|
|
|
* 查询设备实例树
|
|
|
*/
|
|
|
async getCategory() {
|
|
|
- let res = await categoryQuery({});
|
|
|
+ let res = await dictCategoryQuery({ type: "majorSystemEquip" });
|
|
|
console.log(res);
|
|
|
let tree = res?.content || [];
|
|
|
- tree.map((v) => (v.id = v.code));
|
|
|
+ // tree.map((v) => (v.id = v.code));
|
|
|
+ tree.forEach((item) => {
|
|
|
+ item._id = item.id;
|
|
|
+ item.id = item.code;
|
|
|
+ item?.children?.forEach((detail) => {
|
|
|
+ detail._id = detail.id;
|
|
|
+ detail.id = detail.code;
|
|
|
+ detail?.children.forEach((v) => (v.id = v.code));
|
|
|
+ });
|
|
|
+ });
|
|
|
this.dataTree1 = tree;
|
|
|
},
|
|
|
/**
|
|
|
* 空间分区类型 列表
|
|
|
*/
|
|
|
async getType() {
|
|
|
- let res = await typeQuery({});
|
|
|
+ let res = await dictCategoryQuery({ type: "space" });
|
|
|
let data = res?.content || [];
|
|
|
data.map((v) => (v.id = v.code));
|
|
|
// name,code--> { id: "test1", name: "选择项" },
|
|
|
this.spacePartitionTypeData = data;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 空间分区实例
|
|
|
+ */
|
|
|
+ async getPartiInstance() {
|
|
|
+ let postParams = {
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ floorId: "Fl11010500296bc7ca3a0d5d41419cf95c5b45116400",
|
|
|
+ buildingId: "Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6",
|
|
|
+ // floorId: "",
|
|
|
+ // buildingId: "",
|
|
|
+ zoneTypeList: this.spacePartitionType,
|
|
|
+ };
|
|
|
+ let res = await PartiInstancQuery(postParams);
|
|
|
+ console.log("==================");
|
|
|
+ console.log(res);
|
|
|
+ console.log(res.content);
|
|
|
+ let data = res.content.map((v) => {
|
|
|
+ return { id: v.id, name: v.localName };
|
|
|
+ });
|
|
|
+ this.selectData = data;
|
|
|
+ this.spacePartitionInstance = [];
|
|
|
+ // v-model="spacePartitionInstance"
|
|
|
+ // :selectdata="selectData"
|
|
|
+ },
|
|
|
// 空间功能类型
|
|
|
async getDict() {
|
|
|
let res = await dictQuery({
|
|
@@ -361,6 +370,35 @@ export default {
|
|
|
// 构造树
|
|
|
this.dataTree3 = array2Tree(data, "parentCode");
|
|
|
},
|
|
|
+ async getTableData() {
|
|
|
+ // 东坝地上二层
|
|
|
+ let postParams = {
|
|
|
+ equipTypes: this.curentSelectTree1, //设备类型 //["FFFSSN"],
|
|
|
+ zoneTypes: [], //空间类型
|
|
|
+ spaceIds: [], //空间实例id
|
|
|
+ funcTypes: [], //空间功能区类型
|
|
|
+ floorId: "Fl11010500296bc7ca3a0d5d41419cf95c5b45116400",
|
|
|
+ buildingId: "Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6",
|
|
|
+ };
|
|
|
+ let res = await equipQuery(postParams);
|
|
|
+ let data = res.content || [];
|
|
|
+ this._tableData = data;
|
|
|
+ let map = {};
|
|
|
+ data.map((item) => {
|
|
|
+ if (!map[item.classCode]) {
|
|
|
+ map[item.classCode] = {
|
|
|
+ classCode: item.classCode,
|
|
|
+ codeName: item.codeName,
|
|
|
+ total: 1,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ map[item.classCode].total++;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ let tableData = Object.values(map);
|
|
|
+ tableData.unshift({ codeName: "实例总数量: " + data.length });
|
|
|
+ this.tableData = tableData;
|
|
|
+ },
|
|
|
/**
|
|
|
* 合并第一行
|
|
|
*/
|
|
@@ -491,5 +529,10 @@ export default {
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+ /deep/ .el-dialog__footer {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|