YaolongHan 4 anos atrás
pai
commit
a440cae563

+ 5 - 0
src/api/editer.ts

@@ -20,3 +20,8 @@ export function buildiFloor(postParams: any): any {
 export function readCategory(postParams: any): any {
     return httputils.postJson(`/equip-componnet/labsl/category`, postParams)
 }
+
+// 查询设备
+export function queryEquip(postParams: any): any {
+    return httputils.postJson(`/equip-componnet/labsl/query/equip`, postParams)
+}

+ 152 - 13
src/components/editview/leftToolBar/addItemModel.vue

@@ -9,7 +9,7 @@
   >
     <template #content class="xxx">
       <div class="getItem">
-        <div class="left">
+        <div id="left" class="left">
           <div class="top">
             <Cascader
               caption="专业系统"
@@ -20,14 +20,16 @@
               showPanel
               width="300"
               @change="changeItem"
-              @confirm="changeItem"
-              v-model="abc"
+              v-model="equipTypeList"
+              type="final"
             ></Cascader>
             <Cascader
               caption="建筑楼层"
               multiple
               :all="false"
               :data="buildFloorList"
+              @change="changeItem"
+              v-model="floorList"
               showPanel
               width="300"
             ></Cascader>
@@ -45,11 +47,13 @@
             />
           </div>
           <el-table
+            v-if="tableHeight > 0"
             size="small"
             ref="multipleTable"
             :data="tableData"
             tooltip-effect="dark"
             style="width: 100%"
+            :height="tableHeight"
             @selection-change="handleSelectionChange"
           >
             <el-table-column type="selection" width="55"> </el-table-column>
@@ -73,6 +77,13 @@
             >
             </el-table-column>
           </el-table>
+          <Pagination
+            class="page-box"
+            :pageCountShow="true"
+            :pageCount="1500"
+            :pageSizeSetting="true"
+            @change="currentChangeHandle"
+          />
         </div>
         <div class="right">
           <div class="top">
@@ -129,11 +140,11 @@
 <script>
 import { mapMutations, mapState } from "vuex";
 import { EquipmentList } from "./equipData";
-import { buildiFloor, readCategory } from "@/api/editer";
+import { buildiFloor, readCategory, queryEquip } from "@/api/editer";
 export default {
-  props: ["showAddItemModel"],
+  props: ["showAddItemModel", "filtIdList"],
   computed: {
-    ...mapState(["editCmd"]),
+    ...mapState(["editCmd", "projectId"]),
   },
   data() {
     return {
@@ -205,6 +216,8 @@ export default {
         },
       ],
       abc: [],
+      floorList: [], // 楼层选中条件
+      equipTypeList: [], //设备类型选中条件
       tableData: [
         {
           date: "2016-05-03",
@@ -241,17 +254,136 @@ export default {
           name: "王小虎",
           address: "上海市普陀区金沙江路 1518 弄",
         },
+        {
+          date: "2016-05-03",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-02",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-04",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-01",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-08",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-06",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-07",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-03",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-02",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-04",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-01",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-08",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-06",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-07",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-03",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-02",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-04",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-01",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-08",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-06",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
+        {
+          date: "2016-05-07",
+          name: "王小虎",
+          address: "上海市普陀区金沙江路 1518 弄",
+        },
       ],
       equipData: EquipmentList,
       buildFloorList: [], // 建筑查询数据
       categoryList: [], //设备类型
+      currentPage2: 5,
+      tableHeight: 0, //table的高度
     };
   },
   methods: {
     ...mapMutations(["SETEQUIPLIST"]),
-    changeItem(item) {
-      console.log(item);
+    // 筛选item
+    changeItem() {
+      const classCode = []; // 设备类型
+      const buildId = "buildId='' or buildId=''";
+      const floorId = "floorId='' or floorId=''";
+      let data = {
+        Orders: "name asc, createTime desc",
+        PageNumber: 1,
+        PageSize: 50,
+        Filters: `projectId='';not id in${this.filtIdList};classCode in${classCode};${buildId};${floorId}`,
+      };
+      queryEquip(data).then((res) => {});
     },
+    // 切换分页
+    currentChangeHandle() {},
     modalClose() {
       this.isShowModel = false;
       this.$emit("closeModel");
@@ -300,11 +432,11 @@ export default {
       return arr;
     },
     handleSelectionChange() {},
+    currentChangeHandle(pageMsg) {
+      console.log(pageMsg);
+    },
   },
   watch: {
-    abc: function (item) {
-      console.log(item);
-    },
     // 是否打开弹窗
     showAddItemModel(val) {
       this.isShowModel = val;
@@ -312,7 +444,7 @@ export default {
   },
   mounted() {
     const data = {
-      projectId: "Pj1101050029",
+      projectId: this.projectId,
     };
     // 建筑查询条件
     buildiFloor(data).then((res) => {
@@ -325,8 +457,9 @@ export default {
         [],
         ["code", "name", "children"]
       );
-      console.log(this.categoryList);
     });
+    const domLeft = document.getElementById("left");
+    this.tableHeight = domLeft.offsetHeight - 140;
   },
 };
 </script>
@@ -444,6 +577,7 @@ li {
   }
   .left {
     flex: 1;
+    position: relative;
     .top {
       width: 100%;
       height: 58px;
@@ -458,6 +592,11 @@ li {
         margin-left: 24px;
       }
     }
+    .page-box {
+      position: absolute;
+      right: 24px;
+      bottom: 24px;
+    }
   }
   .btn-list {
     width: 100%;

+ 2 - 1
src/components/editview/leftToolBar/legendList.vue

@@ -15,8 +15,9 @@
     <addItemModel
       @closeModel="showAddItemModel = false"
       :showAddItemModel="true"
+      :filtIdList="[]"
     ></addItemModel>
-      <!-- :showAddItemModel="showAddItemModel" -->
+    <!-- :showAddItemModel="showAddItemModel" -->
   </div>
 </template>
 <script>

+ 3 - 1
src/main.ts

@@ -6,7 +6,7 @@ import './assets/font/iconfont.css';
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 Vue.use(ElementUI);
-import { Input, Modal, Cascader, Popover,Icon  } from 'meri-design';
+import { Input, Modal, Cascader, Popover,Icon,Pagination  } from 'meri-design';
 import { Select } from 'ant-design-vue';
 // 按需引入公共组件
 Vue.use(Input)
@@ -15,6 +15,8 @@ Vue.use(Modal)
 Vue.use(Cascader)
 Vue.use(Popover)
 Vue.use(Icon)
+Vue.use(Pagination)
+
 Vue.config.productionTip = false;
 new Vue({
   router,