3 Commits ae8e274117 ... 485604a206

Author SHA1 Message Date
  qule 485604a206 添加系统台账 3 years ago
  qule 82160cbbba 增加系统台账 3 years ago
  qule 8f6e8aa19d 增加系统台账页面 3 years ago

+ 12 - 0
src/assets/style/main.less

@@ -53,4 +53,16 @@ body {
     flex-direction: column;
     line-height: 26px;
     padding: 0px;
+}
+.middle_sty {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.icon-wushuju {
+    // display: block;
+    width: 100px;
+    height: 100px;
+    font-size: 50px !important;
+    // margin: auto;
 }

+ 17 - 12
src/components/old-adm/ledger/components/handsontables/system.vue

@@ -38,11 +38,11 @@
             :dialog="myDialog"
         ></upload-img-dialog>
         <pic-dialog :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
-        <div class="center middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
-            <p><i class="icon-wushuju iconfont"></i>请选择系统类型</p>
+        <div class="middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
+            <p style="text-align: center"><i class="icon-wushuju  middle_sty  iconfont"></i>请选择系统类型</p>
         </div>
-        <div class="center middle_sty" style="height: 91%" v-show="mess.deviceId && (!tableData || !tableData.length)">
-            <p><i class="icon-wushuju iconfont"></i>暂无数据</p>
+        <div class="middle_sty" style="height: 91%" v-show="mess.deviceId && (!tableData || !tableData.length)">
+            <p style="text-align: center"><i class="icon-wushuju middle_sty iconfont"></i>暂无数据</p>
         </div>
         <div v-show="mess.deviceId && tableData && tableData.length" v-loading="loading" id="handsontable" ref="handsontable"></div>
         <div v-show="mess.deviceId && tableData && tableData.length" class="right">
@@ -82,28 +82,33 @@
     </div>
 </template>
 <script>
-import { BeatchQueryParam, deleteGeneralSys, querySysLinkBuild, updateGeneralSys } from "@/api/scan/request";
-import { getDataDictionary, deliveredInfos } from "@/api/dict";
+// import { BeatchQueryParam, deleteGeneralSys, querySysLinkBuild, updateGeneralSys } from "@/api/scan/request";
+import Scan from '@/controller/old-adm/ScanController'
+// import { getDataDictionary, deliveredInfos } from "@/api/dict";
+import Dic from '@/controller/old-adm/dicController'
 
-import myCascader from "@/components/old-adm/ledger/lib/system";
+import myCascader from "@/components/old-adm/ledger/components/lib/system";
 import tools from "@/utils/old-adm/scan/tools";
-import handsonUtils from "@/utils/scan/hasontableUtils";
-import showTools from "@/utils/handsontable/notShow";
+import handsonUtils from "@/utils/old-adm/scan/hasontableUtils";
+import showTools from "@/utils/old-adm/handsontable/notShow";
 import qrcode from "@/components/old-adm/business_space/lib/qrcode";
 import uploadFilesDialog from "@/components/old-adm/dialogs/list/filesDialog";
 import uploadImgDialog from "@/components/old-adm/dialogs/list/uploadImgDialog";
 import picDialog from "@/components/old-adm/business_space/dialogs/list/picDialog";
 import myPagination from "@/components/old-adm/common/myPagination";
 import detailsDialog from "@/components/old-adm/business_space/lib/detailsDia";
-import systemRelevance from "@/components/old-adm/ledger/tableTransfers";
+import systemRelevance from "@/components/old-adm/ledger/components/tableTransfers";
 import Handsontable from "handsontable-pro";
-import text from "@/utils/handsontable/mainText";
+import text from "@/utils/old-adm/handsontable/mainText";
 import "handsontable-pro/dist/handsontable.full.css";
-import editSysfloor from "@/components/old-adm/ledger/lib/editSysFloor";
+import editSysfloor from "@/components/old-adm/ledger/components/lib/editSysFloor";
 import menum from "@/components/old-adm/dialogs/list/menum";
 
 import { mapGetters } from "vuex";
 
+const { BeatchQueryParam, deleteGeneralSys, querySysLinkBuild, updateGeneralSys } = Scan;
+const { getDataDictionary, deliveredInfos } = Dic;
+
 export default {
     components: {
         qrcode, //二维码页面

+ 3 - 1
src/components/old-adm/ledger/components/lib/buildfloorCascader.vue

@@ -3,7 +3,9 @@
 </template>
 <script>
 // import { buildingQuery } from "@/api/scan/request";
-import { buildingQuery } from '@/api/object/build';
+// import { buildingQuery } from '@/api/object/build';
+import Builder from "@/controller/old-adm/buildController";
+const { buildingQuery } = Builder;
 
 export default {
   data() {

+ 3 - 2
src/components/old-adm/ledger/components/lib/editSysFloor.vue

@@ -16,8 +16,9 @@
 </template>
 <script>
 import bfCascader from './buildfloorCascader'
-import { sysRelateBuild, sysRelateFloor } from "@/api/scan/request";
-
+// import { sysRelateBuild, sysRelateFloor } from "@/api/scan/request";
+import Scan from '@/controller/old-adm/ScanController'
+const { sysRelateBuild, sysRelateFloor } = Scan;
 export default {
   data() {
     return {

+ 27 - 14
src/components/old-adm/ledger/components/lib/system.vue

@@ -12,8 +12,13 @@
 </template>
 <script>
 import { mapGetters } from 'vuex';
-import { queryLinkSys } from "@/api/scan/request";
-import { queryPhysicsAllType } from "@/api/dict";
+// import { queryLinkSys } from "@/api/scan/request";
+// import { queryPhysicsAllType } from "@/api/dict";
+import Dic from '@/controller/old-adm/dicController'
+import Scan from '@/controller/old-adm/ScanController'
+
+const { queryPhysicsAllType } = Dic;
+const { queryLinkSys } = Scan;
 
 
 export default {
@@ -73,7 +78,7 @@ export default {
       this.value = val
       this.$emit("change", value)
     },
-    getData() {
+    async getData() {
       let param = {
         distinct: true,
         pageNumber: 1,
@@ -82,27 +87,35 @@ export default {
           "classCode", "CategoryName"
         ]
       }
-      queryLinkSys(param, res => {
+      try {
+        const res = await  queryLinkSys(param);
+        console.log({res})
         this.options = res.content;
         if (this.value && this.options.find(item => item.classCode === this.value)) {
           this.changeVal(this.value)
         } else {
             this.changeVal("")
         }
-      })
+      } catch (error) {
+        console.log({error})
+      }
+      
+      
     },
-    getAllData() {
+   async getAllData() {
       let param = {
         type: 'system'
       }
-      queryPhysicsAllType(param, res => {
-        this.options = this.changeArr(res.content)
-        if (this.value && this.options.find(item => item.classCode === this.value)) {
-          this.changeVal(this.value)
-        } else {
-            this.changeVal("")
-        }
-      })
+      const res = await queryPhysicsAllType(param);
+      
+      
+      this.options = this.changeArr(res.content)
+      if (this.value && this.options.find(item => item.classCode === this.value)) {
+        this.changeVal(this.value)
+      } else {
+          this.changeVal("")
+      }
+      
     },
     changeArr(arr) {
       let data = [];

+ 144 - 0
src/components/old-adm/ledger/system/index.vue

@@ -0,0 +1,144 @@
+<template>
+  <div id="deviceList">
+    <saga-title :mess="mess"></saga-title>
+    <div class="table-main">
+      <div class="search-header">
+        <floor-cascader @change="changeFloor"></floor-cascader>
+        <my-cascader ref="cascader" @change="changeDevice"></my-cascader>
+      </div>
+      <hanson-table @close="close" ref="tableMain"></hanson-table>
+    </div>
+    <table-transfers></table-transfers>
+  </div>
+</template>
+
+<script>
+import sagaTitle from "@/components/old-adm/ledger/components/lib/title";
+import floorCascader from "@/components/old-adm/ledger/components/lib/floorCascader";
+import myCascader from "@/components/old-adm/ledger/components/lib/system";
+import hansonTable from "@/components/old-adm/ledger/components/handsontables/system";
+import tableTransfers from "@/components/old-adm/ledger/components/tableTransfers";
+import { mapGetters } from "vuex";
+// import { countGeneralSys } from "@/api/scan/request"
+import Scan from '@/controller/old-adm/ScanController'
+import 'handsontable-pro/dist/handsontable.full.css'
+const { countGeneralSys } = Scan
+export default {
+  components: {
+    sagaTitle,
+    floorCascader,
+    myCascader,
+    hansonTable,
+    tableTransfers
+  },
+  data() {
+    return {
+      mess: {
+        perjectName: "",
+        name: [
+          {
+            key: "系统",
+            num: 0
+          }
+        ]
+      },
+      param: {
+        buildId: "",
+        floorId: "",
+        deviceId: "",
+        ProjId: '',
+        secret: ''
+      }
+    }
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"])
+  },
+  created() {
+    this.param.ProjId = this.projectId
+    this.param.secret = this.secret
+    this.countGeneralSys()
+    let SysType = this.$route.params.SysType;
+    if (SysType) {
+      this.$nextTick(() => {
+        this.$refs.cascader.changeVal(SysType)
+      })
+    }
+  },
+  watch: {
+    projectId() {
+      this.param.ProjId = this.projectId
+      this.param.secret = this.secret
+      this.countGeneralSys()
+    }
+  },
+  methods: {
+    close(val) {
+      this.countGeneralSys()
+      if (!!val && !!val.Category) {
+        if (this.$refs.cascader)
+          this.$refs.cascader.changeVal(val.Category)
+      }
+      this.$refs.cascader.getData()
+    },
+    //获取系统统计信息
+    countGeneralSys() {
+      let param = {}
+      countGeneralSys(param, res => {
+        this.mess.name[0].num = res.count
+      })
+    },
+    //修改楼层
+    changeFloor(value) {
+      if (value[0]) {
+        this.param.buildId = value[0]
+      }
+      if (value[1]) {
+        this.param.floorId = value[1]
+      } else {
+        this.param.floorId = null
+      }
+      if (!!this.param.deviceId) {
+        if (this.$refs.tableMain)
+          this.$refs.tableMain.getHeaderData(this.param);
+      }
+    },
+    //修改设备族
+    changeDevice(value) {
+      console.log({value})
+      this.param.deviceId = value.classCode
+      if (value) {
+        if (this.$refs.tableMain)
+          this.$refs.tableMain.getHeaderData(this.param);
+      }
+    }
+  }
+  
+
+}
+</script>
+
+<style lang="less" scoped>
+#deviceList {
+  overflow: hidden;
+  height: 100%;
+  background-color: #fff;
+  position: relative;
+  .table-main {
+    position: absolute;
+    top: 87px;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    background-color: #fff;
+    // border-radius: 5px;
+    // padding: 10px 0;
+  }
+  .search-header {
+    overflow: hidden;
+    padding-bottom: 10px;
+    margin: 0 10px;
+    border-bottom: 1px solid #bcbcbc;
+  }
+}
+</style>

+ 186 - 32
src/controller/old-adm/ScanController.ts

@@ -22,41 +22,195 @@ class ScanController {
     return fn ? fn(res) : res;
   }
   /**
-   * 查询不在当前系统下的设备
-   */
-  static async getEquipInSys(params) {
-    return await this.http.postRequest(equipquery_pre + `/sys-equip`, params);
+    *@description: 获取设定参数和动态参数
+
+    *@param {*} params
+
+    *@return {*}
+  */
+  static async BeatchQueryParam(params, fn) {
+    let data = params.data
+    const res = await ScanController.http.postRequest(`/rwd/iot/data/current?projectId=${params.projectId}&groupCode=${params.groupCode}&appId=${params.appId}`, data)
+    return fn ? fn(res) : res
+  }
+  /** 
+
+  *@description: 根据条件查询项目下设备部件数量
+
+  *@param {*} params
+
+  *@return {*}
+  */
+  static async countPartsDie(params) {
+    const res = await ScanController.http.postRequest('/equip-component/equip-query/count', params)
   }
   /**
-   * 创建资产所需(Family族id3位编码)-根据设备类型(4位编码)或部件类型(6位编码)查询,!!设备与设备族的关系
-   */
+
+  *@description: 根据设备或部件批量创建资产
+
+  *@param {*}
+
+  *@return {*}
+  */
+  static async createPropertys(params) {
+    return await ScanController.http.postRequest('/equip-component/equip-query/creat-propertys', params)
+  }
+  /**
+
+  *@description: 根据id删除资产信息
+
+  *@param {*}
+
+  *@return {*}
+  */
+    static async deleteProperty(params) {
+      return await ScanController.http.postRequest('/datacenter/object/property/delete', params)
+    }
+  /**
+
+  *@description: 查询资产 同时关联设备信息
+
+  *@param {*}
+
+  *@return {*}
+  */
+    static async propertyLinkEq(params) {
+      return await ScanController.http.postRequest('/equip-component/property/property-query', params)
+    }
+  /** 
+  @description: 修改资产的附件功能
+  @param {*}
+  @return {*}
+  */
+    static async propertyUpdate(params) {
+      return await ScanController.http.postRequest('/equip-component/property/update', params)
+    }
+  /**
+  *@description: 查询资产
+  *@param {*}
+  *@return {*}
+  */
+    static async queryProperty(params) {
+      return await ScanController.http.postRequest('/datacenter/object/property/query', params)
+    }
+  /**
+  *@description: 更新资产信息
+  *@param {*}
+  *@return {*}
+  */
+    static async updateProperty(params) {
+      return await ScanController.http.postRequest('/datacenter/object/property/update', params)
+    }
+  /**
+    *@description: 删除系统信息
+    *@param {*}
+    *@return {*}
+  */
+    static async deleteGeneralSys(params) {
+      return await ScanController.http.postRequest('/datacenter/object/general-system/delete', params)
+    }
+  /**
+
+  *@description: 更新系统信息
+  *@param {*}
+  *@return {*}
+  */
+  static async updateGeneralSys(params) {
+    return await ScanController.http.postRequest('/datacenter/object/general-system/update', params)
+  }
+  /**
+  @description: 创建资产所需(Family族id3位编码)-根据设备类型(4位编码)或部件类型(6位编码)查询,!!设备与设备族的关系
+  @param {*}
+  @return {*}
+  */
   static async getEquipBelongs(params) {
-    return await this.http.postRequest(dict_pre + "/family/query", params);
+    return await ScanController.http.postRequest('/datacenter/dict/family/query', params)
   }
+
   /**
-   * 设备清单 - 设备关联系统 系统1-n
-   */
-  static async sysLinkEquip(params) {
-    return await this.http.postRequest(
-      datacenter_pre + "/rel/sy-in-eq/link-sy-eq",
-      params
-    );
+  @description: 查询建筑信息
+  @param {*}
+  @return {*}
+  */
+    static async buildingQuery(params) {
+      return await ScanController.http.postRequest('/datacenter/object/building/query', params)
+    }
+    /**
+  @description: 关系-竖井所在建筑
+  @param {*}
+  @return {*}
+  */
+    static async shaftLinkBuild(params) {
+      return await ScanController.http.postRequest('/datacenter/rel/sh-in-bd/link-bd', params)
+    }
+    /** 
+  *@description: 查询系统信息 - 建筑楼层 - 系统一对多
+  *@param {*} params
+  *@return {*}
+  */
+  static async querySysLinkBuild(params, fn) {
+    let url = '/datacenter/object/general-system/query-new';
+    if (params.buildingId) {
+      url += `?buildingId=${params.buildingId}`
+    }
+    if (params.floorId) {
+      url += `&floorId=${params.floorId}`
+    }
+    const res = await ScanController.http.postRequest(url, params);
+    return fn ? fn(res) : res
+  }
+  static async countGeneralSys(params: any, fn: any) {
+    const res = await ScanController.http.postRequest('/datacenter/object/general-system/count', params)
+    return fn ? fn(res) : res
   }
   /**
-   * 获取设定参数和动态参数
-   */
-  static async BeatchQueryParam(params) {
-    return await this.http.postRequest(
-      rwd_pre +
-        `/iot/data/current?projectId=${params.projectId}&groupCode=${params.groupCode}&appId=${params.appId}`,
-      params
-    );
+  *@description: 获取楼层信息
+  *@param {*}
+  *@return {*}
+  */
+  static async getFloorMsgByFloorID(params?: any) {
+    return await ScanController.http.postRequest('/datacenter/object/floor/query', params)
   }
   /**
-   * 设备清单 - 删除设备
-   */
-  static async deleteEquip(params) {
-    return await this.http.postRequest(object_pre + "/equip/delete", params);
+    *@description: //设备清单 - 查询系统关联专业 - 查询系统信息 - 查询系统所属专业类型
+    *@param {*}
+    *@return {*}
+  */ 
+  static async queryLinkSys(params) {
+    return await ScanController.http.postRequest('/datacenter/object/general-system/query', params)
+  }
+  static async getAllProject(params, fn) {
+    const res = await ScanController.http.postRequest('/datacenter/object/project/query/obj', params)
+    return fn ? fn(res) : res
+  }
+
+  /**
+   * @description: 创建系统所在建筑关系,系统一对多,覆盖
+   * @param {*} params
+   * @param {*} fn
+   * @return {*}
+   */  
+  static async sysRelateBuild(params, fn) {
+    const res = await ScanController.http.postRequest('/datacenter/rel/sy-in-bd/link-bd', params);
+    return fn ? fn(res) : res
+  }
+  /**
+   * @description: 创建系统所在建筑关系,系统一对多,覆盖
+   * @param {*} params
+   * @param {*} fn
+   * @return {*}
+   */  
+  static async sysRelateFloor(params, fn) {
+    const res = await ScanController.http.postRequest('/datacenter/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`, 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`, params)
+    return fn ? fn(res) : res
   }
   /**
    * 设备清单 - 更新设备
@@ -69,11 +223,12 @@ class ScanController {
    * 设备清单 - 根据对象删除系统和设备的关系
    * @param params
    */
-  static async sysUnlinkEquip(params) {
-    return await this.http.postRequest(
+  static async sysUnlinkEquip(params, fn) {
+    const res = await this.http.postRequest(
       datacenter_pre + "/sy-in-eq/unlinks-sy-eq",
       params
     );
+    return fn ? fn(res) : res
   }
   static async zoneQuery() {}
   static async TypePartsDie() {}
@@ -111,8 +266,6 @@ class ScanController {
   static async queryUpdate(params) {
     return await this.http.postRequest(equipquery_pre + "/update", params);
   }
-  static async queryProperty() {}
-  static async querySysLinkBuild() {}
   static async equipLinkSys() {}
   /**
    * 查询建筑信息+count
@@ -174,6 +327,7 @@ class ScanController {
       params
     );
   }
-  static async getAllProject(params?: any, fn?: any) {}
 }
-export default ScanController;
+
+
+export default ScanController;

+ 26 - 38
src/controller/old-adm/dicController.ts

@@ -1,49 +1,37 @@
 import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
-import { dict_pre, equipcomponentdic_pre } from "./preTypes";
-export interface EquipCategoryReq {
-  distinct: boolean;
-  pageNumber: number;
-  pageSize: number;
-  projection: string[];
-}
-class DicController {
+class Dic {
   static http = new baseHttpUtils();
+
   /**
-   * 查询项目下类型的信息点
-   * @param params
-   * @returns
-   */
-  static async getDataDictionary(params) {
-    return await this.http.postRequest(dict_pre + "/query", params);
-  }
-  /**
-   * 统计-根据条件统计返回信息点
-   * @param params
-   * @returns
-   */
-  static async deliveredInfos(params) {
-    return await this.http.postRequest(
-      equipcomponentdic_pre + "/delivered/infos",
-      params
-    );
+   * @description: all - 查询数据字典 --列表表头 api/dict
+   * @param {*} params
+   * @return {*}
+   */  
+  static async getDataDictionary(params, fn) {
+    const res = await Dic.http.postRequest(`/datacenter/dict/query`, params);
+    return fn ? fn(res) : res
   }
+
   /**
-   * 字典-项目下已有的设备类型带系统
-   * @param params
-   * @returns
-   */
-  static async getEquipLkSys(params: EquipCategoryReq) {
-    return await this.http.postRequest(
-      dict_pre + "/system/equip/category",
-      params
-    );
+   * @description: 统计-根据条件统计返回信息点
+   * @param {*} params
+   * @return {*}
+   */  
+  static async deliveredInfos(params, fn) {
+    const res = await Dic.http.postRequest('/equip-component/dict/delivered/infos', params)
+    return fn ? fn(res) : res
   }
+  static async getEquipLkSys() {}
+  
   /**
-   * 头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
-   */
+  *  @description: 头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
+  *  @param {*}
+  *  @return {*}
+  */
   static async queryPhysicsAllType(params) {
-    return await this.http.postRequest(dict_pre + "/category", params);
+    return await Dic.http.postRequest('/datacenter/dict/category', params)
   }
+  
 }
 
-export default DicController;
+export default Dic;

+ 7 - 0
src/router/system.js

@@ -8,6 +8,8 @@ import systemGraph from "@/components/systemGraph";
 import systemGraphEdit from "@/components/systemGraph/edit";
 
 import facilityLedger from "@/components/old-adm/ledger/facility/index";
+// 系统台账
+import systemLedger from '@/components/old-adm/ledger/system/index';
 import batchPointAssets from '@/components/old-adm/ledger/facility/batchPoint' //批量维护设备位置
 import buildFloor from '@/components/old-adm/ready/buildfloor/index'
 
@@ -54,6 +56,11 @@ export default [
           }, {label: '批量维护设备位置'}]
         }
       },
+      {
+        path: "/ledger/list",
+        name: "设备台账",
+        component: systemLedger,
+      }
     ],
   },
   {