qule 3 years ago
parent
commit
c182a82f66

File diff suppressed because it is too large
+ 1596 - 1375
src/components/old-adm/ledger/components/handsontables/device.vue


+ 71 - 51
src/components/old-adm/ledger/components/lib/cascader.vue

@@ -1,35 +1,50 @@
 <template>
   <div id="cascaderMap">
-    <span class="buildFloor" style="margin-right: 12px;">设备类别</span>
+    <span class="buildFloor" style="margin-right: 12px">设备类别</span>
     <slot></slot>
-    <el-select v-model="value" placeholder="请选择" clearable :props="props" filterable
-               :style="isWidth ? '' : 'width:160px;'" size="small"
-               @change="changeVal">
-      <el-option v-for="item in options" :key="item.code" :label="item.facility" :value="item.code"></el-option>
+    <el-select
+      v-model="value"
+      placeholder="请选择"
+      clearable
+      :props="props"
+      filterable
+      :style="isWidth ? '' : 'width:160px;'"
+      size="small"
+      @change="changeVal"
+    >
+      <el-option
+        v-for="item in options"
+        :key="item.code"
+        :label="item.facility"
+        :value="item.code"
+      ></el-option>
     </el-select>
+    <el-checkbox v-model="checked" @change="getData"
+      >仅项目交付范围内</el-checkbox
+    >
     <!-- <el-cascader placeholder="请选择" :options="options" v-model="value" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small"
       @change="changeVal" change-on-select></el-cascader> -->
   </div>
 </template>
 <script>
-import { mapGetters } from 'vuex';
-import DicController from '@/controller/old-adm/dicController';
-import EquipController from '@/controller/old-adm/equipController';
+import { mapGetters } from "vuex";
+import DicController from "@/controller/old-adm/dicController";
+import EquipController from "@/controller/old-adm/equipController";
 
 export default {
   name: "getCode",
   props: {
     isWidth: {
       type: Boolean,
-      default: true
+      default: true,
     },
     all: {
       type: Boolean,
       default: false,
-    }
+    },
   },
   computed: {
-    ...mapGetters("layout", ["projectId"])
+    ...mapGetters("layout", ["projectId"]),
   },
   data() {
     return {
@@ -37,41 +52,41 @@ export default {
       options: [],
       props: {
         value: "code",
-        label: "facility"
+        label: "facility",
       },
       falg: true,
-      content: []
+      content: [],
+      checked: true,
     };
   },
   created() {
     this.getData();
-
   },
   watch: {
     projectId() {
-      this.value = '';
+      this.value = "";
       this.getData();
-    }
+    },
   },
   methods: {
     setValue(val) {
-      this.value = val
+      this.value = val;
     },
     //修改val
     changeVal(val) {
-      let value = {}
+      let value = {};
       let flag = true;
-      this.options.map(item => {
+      this.options.map((item) => {
         if (item.code == val) {
           flag = false;
-          value = item
+          value = item;
         }
-      })
-      this.value = val
+      });
+      this.value = val;
       if (flag) {
-        this.value = '';
+        this.value = "";
       }
-      this.$emit("change", value)
+      this.$emit("change", value);
     },
     //获取当前项目下的设备类型(只拿到编码-需要过滤)
     getData(val) {
@@ -79,12 +94,10 @@ export default {
         distinct: true,
         pageNumber: 1,
         pageSize: 1000,
-        projection: [
-          "classCode"
-        ]
-      }
-      if (val && val[0] != 'all') {
-        param2.filters = ''
+        projection: ["classCode"],
+      };
+      if (val && val[0] != "all") {
+        param2.filters = "";
         if (val[0] == "noKnow") {
           param2.filters += `;buildingId isNull`;
         } else if (val[0] && val[0] != "all") {
@@ -95,47 +108,54 @@ export default {
         } else if (val[1] && val[1] != "all") {
           param2.filters += `;floorId='${val[1]}'`;
         }
-        param2.filters = param2.filters.slice(1)
+        param2.filters = param2.filters.slice(1);
       }
 
       let param1 = {
-        type: "equipment"
-      }
+        type: "equipment",
+        deliveryType: this.checked ? 0 : 1,
+      };
 
-      Promise.all([EquipController.queryEquip(param2), DicController.queryPhysicsAllType(param1)]).then((res) => {
-        let allData = res[0], data = res[1]
-        this.options = this.formatOptions(data.content)
+      Promise.all([
+        EquipController.queryEquip(param2),
+        DicController.queryPhysicsAllType(param1),
+      ]).then((res) => {
+        let allData = res[0],
+          data = res[1];
+        this.options = this.formatOptions(data.content);
         if (!this.all) {
-          this.content = data.content.map(t => {
-            return t.classCode
+          this.content = data.content.map((t) => {
+            return t.classCode;
           });
           this.filterForOptions();
         }
         if (this.value) {
-          this.changeVal(this.value)
+          this.changeVal(this.value);
         }
-      })
+      });
     },
     //格式化options数据
     formatOptions(arr) {
       let data = [];
-      arr && arr.map(t => {
-        let temp = {};
-        temp.code = t.code;
-        temp.facility = t.name === t.aliasName ? t.name : `${t.name}(${t.aliasName})`;
-        data.push(temp)
-      })
+      arr &&
+        arr.map((t) => {
+          let temp = {};
+          temp.code = t.code;
+          temp.facility =
+            t.name === t.aliasName ? t.name : `${t.name}(${t.aliasName})`;
+          data.push(temp);
+        });
       return data;
     },
     //过滤
     filterForOptions() {
-      this.options = this.options.filter(item => {
+      this.options = this.options.filter((item) => {
         if (this.content.indexOf(item.code) > -1) {
-          return item
+          return item;
         }
-      })
-    }
-  }
+      });
+    },
+  },
 };
 </script>
 <style lang="less" scoped>

+ 117 - 117
src/components/old-adm/ledger/components/lib/equipCascader.vue

@@ -1,142 +1,142 @@
 <template>
-    <div id="cascaderMap">
-        <span class="buildFloor" style="margin-right: 12px">设备类别</span>
-        <el-cascader
-            ref="cascader"
-            v-model="value"
-            placeholder="请选择"
-            filterable
-            clearable
-            :props="props"
-            :options="options"
-            :style="isWidth ? '' : 'width:160px;'"
-            size="small"
-            @change="changeVal"
-            popper-class="equip-cascader"
-        >
-        </el-cascader>
-    </div>
+  <div id="cascaderMap">
+    <span class="buildFloor" style="margin-right: 12px">设备类别</span>
+    <el-cascader
+      ref="cascader"
+      v-model="value"
+      placeholder="请选择"
+      filterable
+      clearable
+      :props="props"
+      :options="options"
+      :style="isWidth ? '' : 'width:160px;'"
+      size="small"
+      @change="changeVal"
+      popper-class="equip-cascader"
+    >
+    </el-cascader>
+  </div>
 </template>
 <script>
 import { mapGetters } from "vuex";
 import Dic from "@/controller/old-adm/dicController";
 
 export default {
-    name: "getCode",
-    props: {
-        isWidth: {
-            type: Boolean,
-            default: true,
-        },
-        all: {
-            type: Boolean,
-            default: false,
-        },
+  name: "getCode",
+  props: {
+    isWidth: {
+      type: Boolean,
+      default: true,
     },
-    computed: {
-        ...mapGetters("layout", ["projectId"]),
+    all: {
+      type: Boolean,
+      default: false,
     },
-    data() {
-        return {
-            value: [],
-            options: [],
-            props: {
-                value: "code",
-                label: "name",
-                children: "children",
-            },
-        };
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId"]),
+  },
+  data() {
+    return {
+      value: [],
+      options: [],
+      props: {
+        value: "code",
+        label: "name",
+        children: "children",
+      },
+    };
+  },
+  created() {
+    this.getData();
+  },
+  watch: {
+    projectId() {
+      this.value = "";
+      this.getData();
     },
-    created() {
-        this.getData();
+  },
+  methods: {
+    setValue(val) {
+      let flag = true;
+      this.options.forEach((sys) => {
+        sys.children.forEach((eq) => {
+          if (eq.code === val) {
+            flag = false;
+            this.value = [sys.code, eq.code];
+          }
+        });
+      });
+      // 如果未找到对应的设备类,则置空
+      if (flag) this.value = [];
     },
-    watch: {
-        projectId() {
-            this.value = "";
-            this.getData();
-        },
-    },
-    methods: {
-        setValue(val) {
-            let flag = true;
-            this.options.forEach((sys) => {
-                sys.children.forEach((eq) => {
-                    if (eq.code === val) {
-                        flag = false;
-                        this.value = [sys.code, eq.code];
-                    }
-                });
-            });
-            // 如果未找到对应的设备类,则置空
-            if (flag) this.value = [];
-        },
-        //修改val
-        changeVal(val) {
-            let value = {};
-            if (val && val[1]) {
-                this.options.forEach((sys) => {
-                    sys.children.forEach((eq) => {
-                        if (eq.code === val[1]) {
-                            value.facility = eq.name;
-                            value.code = eq.code;
-                        }
-                    });
-                });
-            }
-            this.$emit("change", value);
-        },
-        //获取当前项目下的设备类型(只拿到编码-需要过滤)
-        async getData(val) {
-            let params = {
-                distinct: true,
-                pageNumber: 1,
-                pageSize: 1000,
-                projection: ["classCode"],
-            };
-            if (val && val[0] != "all") {
-                params.filters = "";
-                if (val[0] == "noKnow") {
-                    params.filters += `;buildingId isNull`;
-                } else if (val[0] && val[0] != "all") {
-                    params.filters += `;buildingId='${val[0]}'`;
-                }
-                if (val[1] == "noKnow") {
-                    params.filters += `;floorId isNull`;
-                } else if (val[1] && val[1] != "all") {
-                    params.filters += `;floorId='${val[1]}'`;
-                }
-                params.filters = params.filters.slice(1);
+    //修改val
+    changeVal(val) {
+      let value = {};
+      if (val && val[1]) {
+        this.options.forEach((sys) => {
+          sys.children.forEach((eq) => {
+            if (eq.code === val[1]) {
+              value.facility = eq.name;
+              value.code = eq.code;
             }
-            const res = await Dic.getEquipLkSys(params)
-            if (res.content) {
-                this.options = res.content;
-            } else {
-                this.options = [];
-            }
-            
-        },
+          });
+        });
+      }
+      this.$emit("change", value);
+    },
+    //获取当前项目下的设备类型(只拿到编码-需要过滤)
+    async getData(val) {
+      let params = {
+        distinct: true,
+        pageNumber: 1,
+        pageSize: 1000,
+        projection: ["classCode"],
+        type: "equipment",
+      };
+      if (val && val[0] != "all") {
+        params.filters = "";
+        if (val[0] == "noKnow") {
+          params.filters += `;buildingId isNull`;
+        } else if (val[0] && val[0] != "all") {
+          params.filters += `;buildingId='${val[0]}'`;
+        }
+        if (val[1] == "noKnow") {
+          params.filters += `;floorId isNull`;
+        } else if (val[1] && val[1] != "all") {
+          params.filters += `;floorId='${val[1]}'`;
+        }
+        params.filters = params.filters.slice(1);
+      }
+      const res = await Dic.getEquipLkSys(params);
+      if (res.content) {
+        this.options = res.content;
+      } else {
+        this.options = [];
+      }
     },
+  },
 };
 </script>
 <style lang="less">
 .equip-cascader {
-    .el-cascader-menu__wrap {
-        height: 550px;
-    }
+  .el-cascader-menu__wrap {
+    height: 550px;
+  }
 }
 </style>
 <style lang="less" scoped>
 #cascaderMap {
-    float: left;
-    margin-left: 10px;
+  float: left;
+  margin-left: 10px;
 
-    .buildFloor {
-        color: #999999;
-        font-size: 14px;
-    }
+  .buildFloor {
+    color: #999999;
+    font-size: 14px;
+  }
 
-    /deep/ .el-scrollbar__wrap {
-        height: 563px;
-    }
+  /deep/ .el-scrollbar__wrap {
+    height: 563px;
+  }
 }
 </style>

+ 21 - 21
src/controller/old-adm/ScanController.ts

@@ -47,7 +47,7 @@ class ScanController {
   */
   static async countPartsDie(params) {
     const res = await ScanController.http.postRequest(
-      "/equip-component/equip-query/count",
+      equipquery_pre + "/count",
       params
     );
   }
@@ -61,7 +61,7 @@ class ScanController {
   */
   static async createPropertys(params) {
     return await ScanController.http.postRequest(
-      "/equip-component/equip-query/creat-propertys",
+      equipquery_pre + "/creat-propertys",
       params
     );
   }
@@ -75,7 +75,7 @@ class ScanController {
   */
   static async deleteProperty(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/property/delete",
+      object_pre + "/property/delete",
       params
     );
   }
@@ -89,7 +89,7 @@ class ScanController {
   */
   static async propertyLinkEq(params) {
     return await ScanController.http.postRequest(
-      "/equip-component/property/property-query",
+      datacenter_pre + "/property/property-query",
       params
     );
   }
@@ -100,7 +100,7 @@ class ScanController {
   */
   static async propertyUpdate(params) {
     return await ScanController.http.postRequest(
-      "/equip-component/property/update",
+      datacenter_pre + "/property/update",
       params
     );
   }
@@ -111,7 +111,7 @@ class ScanController {
    */
   static async queryProperty(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/property/query",
+      object_pre + "/property/query",
       params
     );
   }
@@ -122,7 +122,7 @@ class ScanController {
    */
   static async updateProperty(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/property/update",
+      object_pre + "/property/update",
       params
     );
   }
@@ -133,7 +133,7 @@ class ScanController {
    */
   static async deleteGeneralSys(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/general-system/delete",
+      object_pre + "/general-system/delete",
       params
     );
   }
@@ -145,7 +145,7 @@ class ScanController {
   */
   static async updateGeneralSys(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/general-system/update",
+      object_pre + "/general-system/update",
       params
     );
   }
@@ -156,7 +156,7 @@ class ScanController {
   */
   static async getEquipBelongs(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/dict/family/query",
+      dict_pre + "/family/query",
       params
     );
   }
@@ -168,7 +168,7 @@ class ScanController {
   */
   static async buildingQuery(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/building/query",
+      object_pre + "/building/query",
       params
     );
   }
@@ -179,7 +179,7 @@ class ScanController {
   */
   static async shaftLinkBuild(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/rel/sh-in-bd/link-bd",
+      datacenter_pre + "/rel/sh-in-bd/link-bd",
       params
     );
   }
@@ -189,7 +189,7 @@ class ScanController {
    *@return {*}
    */
   static async querySysLinkBuild(params, fn) {
-    let url = "/datacenter/object/general-system/query-new";
+    let url = object_pre + "/general-system/query-new";
     if (params.buildingId) {
       url += `?buildingId=${params.buildingId}`;
     }
@@ -201,7 +201,7 @@ class ScanController {
   }
   static async countGeneralSys(params: any, fn: any) {
     const res = await ScanController.http.postRequest(
-      adm_middleware + "/object/general-system/count",
+      object_pre + "/general-system/count",
       params
     );
     return fn ? fn(res) : res;
@@ -213,7 +213,7 @@ class ScanController {
    */
   static async getFloorMsgByFloorID(params?: any) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/floor/query",
+      object_pre + "/floor/query",
       params
     );
   }
@@ -224,13 +224,13 @@ class ScanController {
    */
   static async queryLinkSys(params) {
     return await ScanController.http.postRequest(
-      "/datacenter/object/general-system/query",
+      object_pre + "/general-system/query",
       params
     );
   }
   static async getAllProject(params, fn) {
     const res = await ScanController.http.postRequest(
-      "/datacenter/object/project/query/obj",
+      object_pre + "/project/query/obj",
       params
     );
     return fn ? fn(res) : res;
@@ -244,7 +244,7 @@ class ScanController {
    */
   static async sysRelateBuild(params, fn) {
     const res = await ScanController.http.postRequest(
-      "/datacenter/rel/sy-in-bd/link-bd",
+      datacenter_pre + "/rel/sy-in-bd/link-bd",
       params
     );
     return fn ? fn(res) : res;
@@ -257,21 +257,21 @@ class ScanController {
    */
   static async sysRelateFloor(params, fn) {
     const res = await ScanController.http.postRequest(
-      "/datacenter/rel/sy-in-fl/link-fl",
+      datacenter_pre + "/rel/sy-in-fl/link-fl",
       params
     );
     return fn ? fn(res) : res;
   }
   static async getEquipInSys(params, fn) {
     const res = await ScanController.http.postRequest(
-      `/equip-component/equip-query/sys-equip`,
+      `${equipquery_pre}/sys-equip`,
       params
     );
     return fn ? fn(res) : res;
   }
   static async sysLinkEquip(params, fn) {
     const res = await ScanController.http.postRequest(
-      `/datacenter/rel/sy-in-eq/link-sy-eq`,
+      `${datacenter_pre}/rel/sy-in-eq/link-sy-eq`,
       params
     );
     return fn ? fn(res) : res;

+ 15 - 19
src/controller/old-adm/buildController.ts

@@ -1,6 +1,7 @@
 import FloorController from "./floorController";
 import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
 import { logicConfig } from "@/logicConfig";
+import { object_pre } from "./preTypes";
 
 export interface BuildReq {
   pageNumber: number;
@@ -10,7 +11,7 @@ export interface BuildReq {
 }
 class BuildController {
   static http = new baseHttpUtils();
-  static pre = "/datacenter/object";
+  static pre = object_pre;
   /**
    * 获取建筑信息
    * @param {BuildReq} params
@@ -21,40 +22,35 @@ class BuildController {
   }
   /**
    * @description: 处理楼层接口数据为树状结构
-   * @param {*} 
+   * @param {*}
    * @return {*}
-   */ 
+   */
   static async buildDataFormat(params) {
     try {
-      const res =  await this.buildingQuery(params);
+      const res = await this.buildingQuery(params);
       if (res.result != logicConfig.resultObj.success) {
         return;
       }
-      return res?.content.map(item => {
-        const { id, localName:name  } = item;
-        const children =  item?.floor?.map(subitem => ({
+      return res?.content.map((item) => {
+        const { id, localName: name } = item;
+        const children = item?.floor?.map((subitem) => ({
           id: subitem.buildingId,
           name: subitem.localName,
           open: false,
           disabled: false,
-          checked: 'uncheck'
-        }))
+          checked: "uncheck",
+        }));
         return {
           id,
           name,
           open: false,
           disabled: false,
-          checked: 'uncheck',
+          checked: "uncheck",
           children,
-        }
-
-      })
-
-    } catch (error) {
-      
-    }
-
-  } 
+        };
+      });
+    } catch (error) {}
+  }
   static async getData(buildFloorData) {
     let data,
       buildParams = {

+ 4 - 4
src/controller/old-adm/dicController.ts

@@ -1,5 +1,5 @@
 import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
-import { dict_pre } from "./preTypes";
+import { dict_pre, equipcomponentdic_pre } from "./preTypes";
 class Dic {
   static http = new baseHttpUtils();
 
@@ -9,7 +9,7 @@ class Dic {
    * @return {*}
    */
   static async getDataDictionary(params, fn) {
-    const res = await Dic.http.postRequest(`/datacenter/dict/query`, params);
+    const res = await Dic.http.postRequest(`${dict_pre}/query`, params);
     return fn ? fn(res) : res;
   }
 
@@ -20,7 +20,7 @@ class Dic {
    */
   static async deliveredInfos(params, fn) {
     const res = await Dic.http.postRequest(
-      "/equip-component/dict/delivered/infos",
+      dict_pre + "/delivered/infos",
       params
     );
     return fn ? fn(res) : res;
@@ -43,7 +43,7 @@ class Dic {
    *  @return {*}
    */
   static async queryPhysicsAllType(params) {
-    return await Dic.http.postRequest("/datacenter/dict/category", params);
+    return await Dic.http.postRequest(dict_pre + "/category", params);
   }
   /**
    *  @description: 设置项目数据字典显隐 --列表表头 api/dict

+ 3 - 3
src/controller/old-adm/preTypes.ts

@@ -1,11 +1,11 @@
-export const datacenter_pre = "/datacenter";
+export const datacenter_pre = "/adm-middleware";
 export const dict_pre = `${datacenter_pre}/dict`;
 export const object_pre = `${datacenter_pre}/object`;
 export const rwd_pre = "/rwd";
 
 export const equipcomponent_pre = "/equip-component";
-export const equipquery_pre = `${equipcomponent_pre}/equip-query`;
-export const equipcomponentdic_pre = `${equipcomponent_pre}/dict`;
+export const equipquery_pre = `${datacenter_pre}/equip-query`;
+export const equipcomponentdic_pre = `${datacenter_pre}/dict`;
 
 export const graphhic_pre = `${datacenter_pre}/graphic`;