浏览代码

Merge branch 'dev' of http://39.106.8.246:3003/web/ibms into dev

 Conflicts:
	src/components/ledger/handsontables/device.vue
shaun-sheep 5 年之前
父节点
当前提交
ee763b8ad2

+ 1 - 1
package.json

@@ -36,7 +36,7 @@
     "@saga-web/base": "2.1.9",
     "@saga-web/draw": "2.1.61",
     "@saga-web/graphy": "2.1.34",
-    "@saga-web/cad-engine": "2.0.432"
+    "@saga-web/cad-engine": "2.0.461"
   },
   "devDependencies": {
     "ajv": "^6.9.1",

+ 7 - 1
src/api/scan/request.js

@@ -1842,6 +1842,12 @@ export function notSyncObject(param, success) {
 
 // 岗位和关联的资产信息点值不一致
 export function postRelationInforAtpism(param, success) {
-    let url = `${baseUrl}/datacenter//statistics/eq2pe-count`
+    let url = `${baseUrl}/datacenter/statistics/eq2pe-count`
     http.postJson(url, param, success)
+}
+
+// 查询所有设备和部件的类型
+export function getAllEqPaType(param, success) {
+  let url = `${baseUrl}/datacenter/class-def/query-equip-comm-type`
+  http.postJson(url, param, success)
 }

+ 103 - 74
src/components/business_space/newGraphy/graphy.vue

@@ -15,9 +15,10 @@
             width="180px" @select="handleSelect">
             <i class="el-icon-search el-input__icon" slot="suffix" @click="handleSelect"></i>
             <template slot-scope="{ item }">
-              <div class="name" style="position: relative;">
-                {{ item.data.RoomLocalName | cutString(8) }}
-                <span class="addr" style="position: absolute;right:10px;color:#409EFF;">定位</span>
+              <div class="name" style="position: relative;padding-right:40px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;"
+                :title="item.data.RoomLocalName">
+                {{ item.data.RoomLocalName }}
+                <span class="addr" style="position: absolute;right:0;color:#409EFF;">定位</span>
               </div>
             </template>
           </el-autocomplete>
@@ -108,7 +109,6 @@ import {
   groupCreRelaZoneAndISp
 } from "@/api/scan/request"
 
-//  BSP => 业务空间
 export default {
   components: {
     canvasFun,
@@ -148,12 +148,13 @@ export default {
       groupCreateDialogVis: false, //批量创建业务空间弹窗
       groupCreateType: 1, //批量创建方式
       zoneDisable: true, // 重新划分是否禁用
+      sourceIdToISP: {}
     }
   },
   computed: {
     ...mapGetters('layout', ['projectId'])
   },
-  created() {},
+  created() { },
   mounted() {
     this.canvasWidth = this.$refs.graphy.offsetWidth;
     this.canvasHeight = this.$refs.graphy.offsetHeight;
@@ -205,9 +206,12 @@ export default {
       queryZone(pa, res => {
         this.BIMIDToSID = {}
         this.BIMIDToSIName = {}
+        this.sourceIdToISP = {}
         res.Content.map(t => {
-          this.BIMIDToSID[t.BIMID.split(":")[1]] = t.RoomID;
-          this.BIMIDToSIName[t.BIMID.split(":")[1]] = t.RoomLocalName || t.RoomName;
+          let key = t.BIMID.split(":")[1];
+          this.BIMIDToSID[key] = t.RoomID;
+          this.BIMIDToSIName[key] = t.RoomLocalName || t.RoomName;
+          this.sourceIdToISP[key] = t;
         })
       })
     },
@@ -474,16 +478,42 @@ export default {
     },
     // 根据图创建新的业务空间-弹窗返回确认创建
     createRoom(val) {
+      // const zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
+      // let spaces = {};
+      // if (this.scene.cutItem || this.scene.sceneMark) {
+      //   // 如果有划分,求交集
+      //   // 格式为Poly(先与业务空间求差集)
+      //   const obj = this.scene.getZoneDifference(true);
+      //   // 差集与楼层平面图或用户划分区域求交集
+      //   spaces = this.scene.getPloyIntersect(obj)
+      // } else {
+      //   // 格式为SPoint[]
+      //   spaces = this.scene.getZoneDifference();
+      // }
+      // for (let key in spaces) {
+      //   spaces[key].map(t => {
+      //     let temp = t.map(item => {
+      //       return {
+      //         X: 1*item.x.toFixed(2),
+      //         Y: -item.y.toFixed(2),
+      //         Z: 0
+      //       }
+      //     })
+      //     zoneObj.Outline.push([temp]);
+      //   })
+      //   let curISP = this.sourceIdToISP[key];
+      //   curISP && IspaceIdList.push(curISP.RoomID);
+      //   zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+      // }
+      // 数据计算导致浏览器奔溃,临时注释
       let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
       let selectSpaces = this.scene.getSelectedSpaces();
       selectSpaces.map(t => {
         zoneObj.Outline.push(t.data.OutLine);
-        if (this.BIMIDToSID[t.data.SourceId]) {
-          IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
-        }
-        if (t.data.Height && (zoneObj.Height == 0 || t.data.Height < zoneObj.Height)) {
-          zoneObj.Height = t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height;
-        }
+        let key = t.data.SourceId;
+        let curISP = this.sourceIdToISP[key];
+        curISP && IspaceIdList.push(curISP.RoomID);
+        zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
       })
       // 如果有划分,求交集
       if (this.scene.cutItem || this.scene.sceneMark) {
@@ -492,7 +522,7 @@ export default {
         arr.map(t => {
           let temp = t.map(item => {
             return {
-              X: item.x,
+              X: 1 * item.x,
               Y: -item.y,
               Z: 0
             }
@@ -500,6 +530,7 @@ export default {
           zoneObj.Outline.push([temp]);
         })
       }
+      // 至此
       if (!zoneObj.Outline.length) {
         zoneObj.Outline = null;
       }
@@ -509,38 +540,39 @@ export default {
       this.createSingleBSP(zoneObj, IspaceIdList)
     },
     // 根据图从未关联平面图的业务空间中选择--按钮返回关联信号
-    createFromUnrelated(BSP) {
-      BSP.Outline = [];
-      BSP.Height = 0;
-      let arr = this.scene.getSelectedSpaces(), IspaceIdList = [];
-      arr.map(t => {
-        BSP.Outline.push(t.data.OutLine);
-        if (this.BIMIDToSID[t.data.SourceId]) {
-          IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
-        }
-        if (t.Height && (BSP.Height == 0 || t.Height < BSP.Height)) {
-          BSP.Height = t.Height > 100 ? (t.Height / 1000).toFixed(2) : t.Height;
-        }
-      })
-      // 如果有划分,求交集
+    createFromUnrelated(zoneObj) {
+      zoneObj.Outline = [];
+      zoneObj.Height = 0;
+      let spaces = {}, IspaceIdList = [];
       if (this.scene.cutItem || this.scene.sceneMark) {
-        BSP.Outline = [];
-        let spaceIntersect = this.scene.getIntersect();
-        spaceIntersect.map(t => {
+        // 如果有划分,求交集
+        // 格式为Poly(先与业务空间求差集)
+        const obj = this.scene.getZoneDifference(true);
+        // 差集与楼层平面图或用户划分区域求交集
+        spaces = this.scene.getPloyIntersect(obj)
+      } else {
+        // 格式为SPoint[]
+        spaces = this.scene.getZoneDifference();
+      }
+      for (let key in spaces) {
+        spaces[key].map(t => {
           let temp = t.map(item => {
             return {
-              X: item.x,
-              Y: -item.y,
+              X: 1 * item.x.toFixed(2),
+              Y: -item.y.toFixed(2),
               Z: 0
             }
           })
-          BSP.Outline.push([temp]);
+          zoneObj.Outline.push([temp]);
         })
+        let curISP = this.sourceIdToISP[key];
+        curISP && IspaceIdList.push(curISP.RoomID);
+        zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
       }
-      if (!BSP.Outline.length) {
-        BSP.Outline = null;
+      if (!zoneObj.Outline.length) {
+        zoneObj.Outline = null;
       }
-      this.updateBSPOutline(BSP, IspaceIdList)
+      this.updateBSPOutline(zoneObj, IspaceIdList)
     },
     // 编辑空间详情
     editeSpaceDetail() {
@@ -625,48 +657,45 @@ export default {
     // 根据图批量创建所选业务空间
     groupCreateZone() {
       let arr = this.scene.getSelectedSpaces();
-      let spaces = [];
-      // 如果有划分,求交集
+      let createSpaces = [], spaces = {};
       if (this.scene.cutItem || this.scene.sceneMark) {
-        let outlines = this.scene.getIntersectInSpace();
-        for (let k in outlines) {
-          outlines[k] = outlines[k].map(t => {
-            t = t.map(item => {
-              item = item.map(j => {
-                return { X: j.x, Y: -j.y, Z: 0 }
-              })
-              return item
-            })
-            return t;
-          })
-        }
-        spaces = arr.map(t => {
-          return {
-            IspaceId: this.BIMIDToSID[t.data.SourceId],
-            RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
-            Outline: outlines[t.data.SourceId],
-            BuildingId: this.buildFloor[0],
-            FloorId: this.buildFloor[1],
-            Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
-          }
-        }).filter(item => item.Outline && item.Outline.length)
+        // 如果有划分,求交集
+        // 格式为Poly(先与业务空间求差集)
+        const obj = this.scene.getZoneDifference(true);
+        // 差集与楼层平面图或用户划分区域求交集
+        spaces = this.scene.getPloyIntersect(obj)
       } else {
-        spaces = arr.map(t => {
-          return {
-            IspaceId: this.BIMIDToSID[t.data.SourceId],
-            RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
-            Outline: [t.data.OutLine],
-            BuildingId: this.buildFloor[0],
-            FloorId: this.buildFloor[1],
-            Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
-          }
-        })
+        // 格式为SPoint[]
+        spaces = this.scene.getZoneDifference();
       }
-      if (spaces.length) {
+      for (let key in spaces) {
+        let zoneObj = { Outline: [], Height: 0 }
+        spaces[key].map(t => {
+          let temp = t.map(item => {
+            return {
+              X: 1 * item.x.toFixed(2),
+              Y: -item.y.toFixed(2),
+              Z: 0
+            }
+          })
+          zoneObj.Outline.push([temp]);
+        })
+        if (!zoneObj.Outline.length) {
+          continue
+        }
+        let curISP = this.sourceIdToISP[key];
+        zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+        zoneObj.IspaceId = curISP.RoomID;
+        zoneObj.RoomLocalName = curISP.RoomLocalName;
+        zoneObj.BuildingId = this.buildFloor[0];
+        zoneObj.FloorId = this.buildFloor[1];
+        createSpaces.push(zoneObj);
+      }
+      if (createSpaces.length) {
         this.canvasLoading = true;
-        this.groupCreateBSP(spaces)
+        this.groupCreateBSP(createSpaces)
       } else {
-        this.$message.warning('未选择本层空间');
+        this.$message.warning('未选择空间');
       }
     },
     // 更新业务空间和元空间的关系

+ 1 - 0
src/components/config_point/dictionaryCascader.vue

@@ -78,6 +78,7 @@ export default {
 </script>
 <style lang="less" scoped>
 .cascader-container {
+  margin-bottom: 0;
   /deep/ .el-cascader {
     width: 89%;
     display: block;

+ 1 - 1
src/components/config_point/step3_point/3_temps.vue

@@ -686,7 +686,7 @@ export default {
   .flex-around {
     display: flex;
     justify-content: space-around;
-    margin-bottom: 5px;
+    // margin-bottom: 5px;
     width: 100%;
     overflow: hidden;
     .point-despoint {

+ 193 - 187
src/components/ledger/handsontables/device.vue

@@ -920,200 +920,206 @@
         }
       },
 
-      //获取到了正确的信息
-      getInfors(infos, row, el) {
-        let val = this.hot.colToProp(row.col);
-        let inputMode = this.inputMap[val];
-        this.row = row.row;
-        this.messKey = val;
-        this.firmDataType = 'row'
-        lStorage.set('screen_data', {path: this.$route.path, data: {equip: infos}})
-        switch (val) {
-          //操作
-          case 'caozuo':
-            // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
-            this.$message("开发中...")
-            return false
-          //设备二维码图片
-          case 'EquipQRCode':
-            this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
-            if (!!this.qrcodeUrl) {
-              this.myDialog.qrcode = true;
-            } else {
-              this.$message("此设备没有设备二维码");
-            }
-            return false
-          //关联系统
-          case 'LinkSystem':
-            if (!this.onlyRead) {
-              this.curDevice = infos.EquipID;
-              this.systemList = this.tableData[row.row].LinkSystem || [];
-              this.myDialog.systemType = true;
-            }
-            return false
-          //关联资产
-          case 'LinkEquipLocalName':
-            if (!this.onlyRead) {
-              this.myDialog.changeRea = true;
-            }
-            return false
-          //品牌型号弹窗
-          case 'DPManufacturerID':
-            if (!this.onlyRead) {
-              this.myDialog.firm = true;
-            }
-            return false
-          //供应商信息弹窗
-          case 'DPSupplierID':
-            if (!this.onlyRead) {
-              this.myDialog.supplier = true;
+        //获取到了正确的信息
+        getInfors(infos, row, el) {
+            let val = this.hot.colToProp(row.col);
+            let inputMode = this.inputMap[val];
+            this.row = row.row;
+            this.messKey = val;
+            this.firmDataType = 'row'
+            lStorage.set('screen_data', { path: this.$route.path, data: { equip: infos } })
+            switch (val) {
+                //操作
+                case 'caozuo':
+                    // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
+                    this.$message("开发中...")
+                    return false
+                //设备二维码图片
+                case 'EquipQRCode':
+                    this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
+                    if (!!this.qrcodeUrl) {
+                        this.myDialog.qrcode = true;
+                    } else {
+                        this.$message("此设备没有设备二维码");
+                    }
+                    return false
+                //关联系统
+                case 'LinkSystem':
+                    if (!this.onlyRead) {
+                        this.curDevice = infos.EquipID;
+                        this.systemList = this.tableData[row.row].LinkSystem || [];
+                        this.myDialog.systemType = true;
+                    }
+                    return false
+                //关联资产
+                case 'LinkEquipLocalName':
+                    if (!this.onlyRead) {
+                        this.myDialog.changeRea = true;
+                    }
+                    return false
+                //品牌型号弹窗
+                case 'DPManufacturerID':
+                    if (!this.onlyRead) {
+                        this.myDialog.firm = true;
+                    }
+                    return false
+                //供应商信息弹窗
+                case 'DPSupplierID':
+                    if (!this.onlyRead) {
+                        this.myDialog.supplier = true;
+                    }
+                    return false
+                //维修商信息弹窗
+                case 'DPMaintainerID':
+                    if (!this.onlyRead) {
+                        this.myDialog.maintainer = true;
+                    }
+                    return false
+                //保险公司信息
+                case 'DPInsurerID':
+                    if (!this.onlyRead) {
+                        this.myDialog.insurer = true;
+                    }
+                    return false
+                //供应合同编号
+                case 'LedgerParam.SupplyPurchase.SupplierContractID':
+                    if (!this.onlyRead) {
+                        let ContractIDflag = null;
+                        let DPSdata = this.tableData[row.row].DPSupplierID;
+                        if (DPSdata) {
+                            ContractIDflag = DPSdata.split("-")[0];
+                        }
+                        if (!!ContractIDflag) {
+                            this.id = ContractIDflag;
+                            this.myDialog.supply = true;
+                        } else {
+                            this.$message("请先选择供应商");
+                        }
+                    }
+                    return false
+                //保险单号
+                case 'LedgerParam.InsuranceDoc.InsuranceNum':
+                    if (!this.onlyRead) {
+                        let DPInsurerIDflag = null;
+                        let DPIdata = this.tableData[row.row].DPInsurerID;
+                        if (DPIdata) {
+                            DPInsurerIDflag = DPIdata.split("-")[0];
+                        }
+                        if (!!DPInsurerIDflag) {
+                            this.id = DPInsurerIDflag;
+                            this.myDialog.guarantee = true;
+                        } else {
+                            this.$message("请先选择保险商");
+                        }
+                    }
+                    return false
+                //保险文件--设备文档--安装质检报告
+                case 'LedgerParam.InsuranceDoc.InsuranceFile':
+                case 'LedgerParam.PhotoDoc.Archive':
+                case 'LedgerParam.Siteinstall.CheckReport':
+                    let IPSdata = tools.dataForKey(this.tableData[row.row], val);
+                    this.filesArr = IPSdata ? IPSdata : [];
+                    if (!this.onlyRead || this.filesArr.length) {
+                        this.myDialog.uploadFiles = true;
+                    }
+                    return false
+                //安装照片--安装图纸--设备铭牌照片--设备图纸
+                case 'LedgerParam.Siteinstall.InstallPic':
+                case 'LedgerParam.Siteinstall.InstallDrawing':
+                case 'LedgerParam.PhotoDoc.Nameplate':
+                case 'LedgerParam.PhotoDoc.Drawing':
+                    let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
+                    this.imgsArr = SSPPdata ? SSPPdata : [];
+                    if (!this.onlyRead || this.imgsArr.length) {
+                        this.myDialog.uploadImgs = true;
+                    }
+                    return false
+                //设备照片
+                case 'LedgerParam.PhotoDoc.Pic':
+                    let Pdata = tools.dataForKey(this.tableData[row.row], val);
+                    this.picsArr = Pdata ? Pdata : [];
+                    if (!this.onlyRead || this.picsArr.length) {
+                        this.myDialog.pic = true;
+                    }
+                    return false
+                //包含的部件字段
+                case 'Count':
+                    if (this.onlyRead) {
+                        this.$router.push({path: '/ledger/parts', query: {deviceId: infos.EquipID}});
+                    } else {
+                        this.$router.push({
+                            path: '/ledger/partsmanage',
+                            query: {deviceId: infos.EquipID, typeId: this.mess.deviceId}
+                        });
+                    }
+                    return false
+                default:
+                    break;
             }
-            return false
-          //维修商信息弹窗
-          case 'DPMaintainerID':
-            if (!this.onlyRead) {
-              this.myDialog.maintainer = true;
+            if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
+                this.updateInfoPoint = val
+                this.updateInput = tools.dataForKey(this.tableData[row.row], val)
+                this.myDialog.update = true
             }
-            return false
-          //保险公司信息
-          case 'DPInsurerID':
-            if (!this.onlyRead) {
-              this.myDialog.insurer = true;
+        },
+        //关闭临时维护弹窗回调
+        handleCloseUpdate() {
+            this.updateInputShow = false
+            this.updateInfoPoint = ''
+            this.updateInput = ''
+        },
+        //更新临时维护信息点
+        handleClickUpdate() {
+            tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
+            this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
+            this.updateInputShow = false
+            this.myDialog.update = false
+            this.updateInput = ''
+        },
+        //获取被筛选掉的行号
+        trimmedRows() {
+            var plugin = this.hot.getPlugin("trimRows").trimmedRows;
+            let dataLength = this.tableData.length;
+            let dataArr = new Array();
+            for (let i = 0; i < dataLength; i++) {
+                dataArr.push(i);
             }
-            return false
-          //供应合同编号
-          case 'LedgerParam.SupplyPurchase.SupplierContractID':
-            if (!this.onlyRead) {
-              let ContractIDflag = null;
-              let DPSdata = this.tableData[row.row].DPSupplierID;
-              if (DPSdata) {
-                ContractIDflag = DPSdata.split("-")[0];
-              }
-              if (!!ContractIDflag) {
-                this.id = ContractIDflag;
-                this.myDialog.supply = true;
-              } else {
-                this.$message("请先选择供应商");
-              }
+            if (plugin.length <= 0) {
+                dataArr = undefined;
+            } else {
+                dataArr = this.array_diff(dataArr, plugin);
             }
-            return false
-          //保险单号
-          case 'LedgerParam.InsuranceDoc.InsuranceNum':
-            if (!this.onlyRead) {
-              let DPInsurerIDflag = null;
-              let DPIdata = this.tableData[row.row].DPInsurerID;
-              if (DPIdata) {
-                DPInsurerIDflag = DPIdata.split("-")[0];
-              }
-              if (!!DPInsurerIDflag) {
-                this.id = DPInsurerIDflag;
-                this.myDialog.guarantee = true;
-              } else {
-                this.$message("请先选择保险商");
-              }
+            return dataArr || [];
+        },
+        //去除数组中相同的元素
+        array_diff(a, b) {
+            for (var i = 0; i < b.length; i++) {
+                for (var j = 0; j < a.length; j++) {
+                    if (a[j] == b[i]) {
+                        a.splice(j, 1);
+                        j = j - 1;
+                    }
+                }
             }
-            return false
-          //保险文件--设备文档--安装质检报告
-          case 'LedgerParam.InsuranceDoc.InsuranceFile':
-          case 'LedgerParam.PhotoDoc.Archive':
-          case 'LedgerParam.Siteinstall.CheckReport':
-            let IPSdata = tools.dataForKey(this.tableData[row.row], val);
-            this.filesArr = IPSdata ? IPSdata : [];
-            this.myDialog.uploadFiles = true;
-            return false
-          //安装照片--安装图纸--设备铭牌照片--设备图纸
-          case 'LedgerParam.Siteinstall.InstallPic':
-          case 'LedgerParam.Siteinstall.InstallDrawing':
-          case 'LedgerParam.PhotoDoc.Nameplate':
-          case 'LedgerParam.PhotoDoc.Drawing':
-            let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
-            this.imgsArr = SSPPdata ? SSPPdata : [];
-            this.myDialog.uploadImgs = true;
-            return false
-          //设备照片
-          case 'LedgerParam.PhotoDoc.Pic':
-            let Pdata = tools.dataForKey(this.tableData[row.row], val);
-            this.picsArr = Pdata ? Pdata : [];
-            this.myDialog.pic = true;
-            return false
-          //包含的部件字段
-          case 'Count':
-            if (this.onlyRead) {
-              this.$router.push({path: '/ledger/parts', query: {deviceId: infos.EquipID}});
+            return a;
+        },
+        //如果选择供应商之后
+        supplierChange(data, type) {
+            if (type === 'dialog') {
+                let firm = {...data, num: 8}
+                this.firmName = firm
             } else {
-              this.$router.push({
-                path: '/ledger/partsmanage',
-                query: {deviceId: infos.EquipID, typeId: this.mess.deviceId}
-              });
+                tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
+                tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
+                this.handleUpdataTable(
+                    [
+                        [this.row, "DPSupplierID", null, data.venderId],
+                        [this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]
+                    ],
+                    "edit"
+                )
+                // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
             }
-            return false
-          default:
-            break;
-        }
-        if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
-          this.updateInfoPoint = val
-          this.updateInput = tools.dataForKey(this.tableData[row.row], val)
-          this.myDialog.update = true
-        }
-      },
-      //关闭临时维护弹窗回调
-      handleCloseUpdate() {
-        this.updateInputShow = false
-        this.updateInfoPoint = ''
-        this.updateInput = ''
-      },
-      //更新临时维护信息点
-      handleClickUpdate() {
-        tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
-        this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
-        this.updateInputShow = false
-        this.myDialog.update = false
-        this.updateInput = ''
-      },
-      //获取被筛选掉的行号
-      trimmedRows() {
-        var plugin = this.hot.getPlugin("trimRows").trimmedRows;
-        let dataLength = this.tableData.length;
-        let dataArr = new Array();
-        for (let i = 0; i < dataLength; i++) {
-          dataArr.push(i);
-        }
-        if (plugin.length <= 0) {
-          dataArr = undefined;
-        } else {
-          dataArr = this.array_diff(dataArr, plugin);
-        }
-        return dataArr || [];
-      },
-      //去除数组中相同的元素
-      array_diff(a, b) {
-        for (var i = 0; i < b.length; i++) {
-          for (var j = 0; j < a.length; j++) {
-            if (a[j] == b[i]) {
-              a.splice(j, 1);
-              j = j - 1;
-            }
-          }
-        }
-        return a;
-      },
-      //如果选择供应商之后
-      supplierChange(data, type) {
-        if (type === 'dialog') {
-          let firm = {...data, num: 8}
-          this.firmName = firm
-        } else {
-          tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
-          tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
-          this.handleUpdataTable(
-            [
-              [this.row, "DPSupplierID", null, data.venderId],
-              [this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]
-            ],
-            "edit"
-          )
-          // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
-        }
 
       },
       //供应合同编号

+ 56 - 7
src/components/model/file/versionDialog.vue

@@ -7,18 +7,18 @@
         <p style="marginTop:15px;">更新内容:</p>
         <el-divider>新增设备概要内容</el-divider>
         <p style="marginBottom:10px;">于【{{versionData.acceptTime}}】上传模型文件,新增设备实例如下:</p>
-        <p v-for="(item, key) in versionData.createData" :key="key">【{{key}}设备类名称】:【{{item.length}}】个</p>
+        <p v-for="(item, key) in versionData.createData" :key="'C'+key">【{{mapType[key]}}】:【{{item.length}}】个</p>
         <el-divider>删除设备概要内容</el-divider>
         <p style="marginBottom:10px;">于【{{versionData.acceptTime}}】上传模型文件,删除设备实例如下:</p>
-        <p v-for="(item, key) in versionData.deleteData" :key="key">【{{key}}设备类名称】:【{{item.length}}】个</p>
+        <p v-for="(item, key) in versionData.deleteData" :key="'D'+key">【{{mapType[key]}}】:【{{item.length}}】个</p>
         <el-divider>新增设备</el-divider>
-        <div v-for="(item, key) in versionData.createData" :key="key">
-          <p>【{{key}}设备类名称】</p>
+        <div v-for="(item, key) in versionData.createData" :key="'CL'+key">
+          <p>【{{mapType[key]}}】</p>
           <p v-for="(obj, i) in item" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;设备全局id:【{{obj.ObjId || "无"}}】;BIMID:【{{obj.BimId || "无"}}】;设备本地编码:【{{obj.LocalId || "无"}}】;设备本地名称:【{{obj.LocalName || "无"}}】;CADID:【{{obj.CadId || "无"}}】;</p>
         </div>
         <el-divider>删除设备</el-divider>
-        <div v-for="(item, key) in versionData.deleteData" :key="key">
-          <p>【{{key}}设备类名称】</p>
+        <div v-for="(item, key) in versionData.deleteData" :key="'DL'+key">
+          <p>【{{mapType[key]}}】</p>
           <p v-for="(obj, i) in item" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;设备全局id:【{{obj.ObjId || "无"}}】;BIMID:【{{obj.BimId || "无"}}】;设备本地编码:【{{obj.LocalId || "无"}}】;设备本地名称:【{{obj.LocalName || "无"}}】;CADID:【{{obj.CadId || "无"}}】;</p>
         </div>
       </el-scrollbar>
@@ -33,6 +33,7 @@
 <script>
 import { mapGetters } from "vuex";
 import { querySyncLogCount } from "@/api/model/file.js";
+import { getAllEqPaType } from "@/api/scan/request";
 export default {
   components: {
 
@@ -56,6 +57,7 @@ export default {
         createData: {},
         deleteData:{}
       },
+      mapType: { },
     }
   },
   mounted() { },
@@ -65,6 +67,49 @@ export default {
       this.$emit("update:dialogVisible", false);
     },
     // 获取版本信息
+    getData() {
+      if(this.modelFile.Id || this.modelFile.CurrentModelId){
+        this.versionData.userName = this.modelFile.UserName;
+        this.versionData.acceptTime = this.modelFile.AcceptTime;
+        let promise1 = new Promise((resolve, reject) => {
+            querySyncLogCount({Filters: `ModelId='${this.modelFile.CurrentModelId?this.modelFile.CurrentModelId:this.modelFile.Id}'`}, res => {
+                resolve(res)
+            })
+        })
+        let promise2 = new Promise((resolve, reject) => {
+            getAllEqPaType({}, res => {
+                resolve(res)
+            })
+        })
+        Promise.all([promise1, promise2]).then(values => {
+          let versionData = values[0].Content, typeList = values[1].Content;
+          typeList.forEach(item => {
+            this.mapType[item.Code] = item.Name;
+          });
+          console.log(this.mapType)
+          versionData.forEach(item => {
+            if(item.Operation){
+              if(this.versionData.createData[item.Type]){
+                this.versionData.createData[item.Type].push(item);
+              } else {
+                this.versionData.createData[item.Type] = [];
+                this.versionData.createData[item.Type].push(item);
+              }
+            } else {
+              if(this.versionData.deleteData[item.Type]){
+                this.versionData.deleteData[item.Type].push(item);
+              } else {
+                this.versionData.deleteData[item.Type] = [];
+                this.versionData.deleteData[item.Type].push(item);
+              }
+            }
+          });
+          this.$forceUpdate();
+        })
+        console.log(this.versionData)
+      }
+    },
+    // 获取版本信息
     getVersionData() {
       if(this.modelFile.Id || this.modelFile.CurrentModelId){
         this.versionData.userName = this.modelFile.UserName;
@@ -103,7 +148,11 @@ export default {
             createData: {},
             deleteData:{}
           };
-          this.getVersionData();
+          if(Object.keys(this.mapType).length) {
+            this.getVersionData();
+          } else {
+            this.getData();
+          }
         }
       },
       immediate: true

+ 4 - 3
src/utils/handsontable/mainText.js

@@ -1,5 +1,6 @@
 const text = {
-
+    // 只读模式 or 编辑模式
+    readOnly: false,
     //图片类型
     picType: (instance, td, row, col, prop, value, cellProperties) => {
         td.style.color = "#409EFF";
@@ -13,7 +14,7 @@ const text = {
             })
             td.innerHTML = "已上传:" + i;
         } else {
-            td.innerHTML = "点击上传"
+            td.innerHTML = text.readOnly?'':'点击上传'
         }
         return td;
     },
@@ -24,7 +25,7 @@ const text = {
         if (value instanceof Array && value.length > 0) {
             td.innerHTML = "已上传:" + value.length;
         } else {
-            td.innerHTML = "点击上传"
+            td.innerHTML = text.readOnly?'':'点击上传'
         }
         return td;
     },

+ 1 - 0
src/utils/handsontable/notShow.js

@@ -933,6 +933,7 @@ const showTools = {
         if (taizhang && !onlyRead) {
             arr = this.arrToArr(arr, showType)
         }
+        text.readOnly = onlyRead;
         let data = arr.map(item => {
             // if (type == "property" && item.FirstTag == "RunParam") { //资产台账不显示运行参数
             //     return undefined