zhangyu před 5 roky
rodič
revize
9a972ebd59

+ 6 - 0
src/api/model/file.js

@@ -323,4 +323,10 @@ export function countSyncLogCount(param, success) {
 export function querySyncLogCount(param, success) {
     let url = `${baseUrl}/sync-log/query`;
     httputils.postJson(url, param, success)
+}
+
+// 查询模型文件
+export function queryFileByModelId(param, success) {
+    let url = `${baseUrl}/model-file/query`;
+    httputils.postJson(url, param, success)
 }

+ 9 - 8
src/components/business_space/business/handsontable.vue

@@ -195,9 +195,10 @@ export default {
         this.getZoneMessage(this.zoneParam)
       } else {
         // 其他分区类型查询表数据接口
-        if (localStorage.getItem('otherZone')) {
-          this.OtherValue = (localStorage.getItem('otherZone'))
-        }
+        // if (localStorage.getItem('otherZone')) {
+        //   // this.OtherValue = (localStorage.getItem('otherZone'))
+        //   localStorage.removeItem('otherZone')
+        // }
         if (this.OtherValue) {
           this.zoneParam.ZoneType = this.OtherValue;
           this.getZoneMessage(this.zoneParam)
@@ -827,11 +828,11 @@ export default {
     changeOtherZone(val) {
       this.zoneParam.ZoneType = val;
       this.getZoneMessage(this.zoneParam);
-      if (localStorage.getItem('otherZone')) {
-        localStorage.setItem('otherZone', val)
-      } else {
-        localStorage.setItem('otherZone', val)
-      }
+      // if (localStorage.getItem('otherZone')) {
+      //   localStorage.setItem('otherZone', val)
+      // } else {
+      //   localStorage.setItem('otherZone', val)
+      // }
       console.log(val)
     },
   },

+ 2 - 2
src/components/business_space/newGraphy/graphy.vue

@@ -295,7 +295,7 @@ export default {
         // 其他分区
         this.showOtherFlag = true
         this.getOtherType();
-        this.OtherValue = (localStorage.getItem('otherZone')) || ''
+        // this.OtherValue = (localStorage.getItem('otherZone')) || ''
       } else {
         this.showOtherFlag = false;
       }
@@ -322,7 +322,7 @@ export default {
     // 其他类型下拉change
     changeOtherZone(val) {
       this.init(2);
-      localStorage.setItem('otherZone', val)
+      // localStorage.setItem('otherZone', val)
     },
     // 获取未绑定业务空间的元空间
     getISPSPUnrelaBSP() {

+ 1 - 0
src/utils/scan/tools.js

@@ -555,6 +555,7 @@ tools.setDataForKey = function (data, key, value) {
   }
 }
 tools.flattenKeys = function (obj) {
+  if(obj == undefined) return
   let res = {}
 
   function isObject(val) {

+ 3 - 3
src/views/ledger/facility/details/index.vue

@@ -164,9 +164,9 @@
           list: []
         },
         instance: {},//实例信息处理
-        isShowImage: true,
-        isShowVideo: true,
-        isShowFile: true,
+        isShowImage: false,
+        isShowVideo: false,
+        isShowFile: false,
       }
     },
     methods: {

+ 19 - 19
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -42,9 +42,9 @@
                 <exhibitionMaintain :exhibitionMaintain="exhibitionMaintain"/>
               </div>
               <div class="content-media">
-                <exhibitionImage :exhibitionImage="exhibitionImage" v-show="isShowImage"/>
-                <exhibitionVideo :exhibitionVideo="exhibitionVideo" v-show="isShowVideo"/>
-                <exhibitionFile :exhibitionFile="exhibitionFile" v-show="isShowFile"/>
+                <exhibitionImage :exhibitionImage="exhibitionImage" v-if="isShowImage"/>
+                <exhibitionVideo :exhibitionVideo="exhibitionVideo" v-if="isShowVideo"/>
+                <exhibitionFile :exhibitionFile="exhibitionFile" v-if="isShowFile"/>
               </div>
             </div>
           </div>
@@ -140,9 +140,9 @@
           title: '视频',
           list: {}
         },
-        isShowImage: true,
-        isShowVideo: true,
-        isShowFile: true,
+        isShowImage: false,
+        isShowVideo: false,
+        isShowFile: false,
       }
   },
   computed: {
@@ -210,8 +210,8 @@
       Promise.all([promise1, promise2]).then(values => {
         this.pointData = values[0].Content;
         this.exampleData = values[1].Content[0];
+        let obj = values[1].Content[0] ? this.deepCopy(values[1].Content[0]) :values[1].Content[0];
 
-        let obj = this.deepCopy(values[1].Content[0]);
         obj = tools.flattenKeys(obj);
         this.instance = obj;
         this.handleRadios(this.currentRadio)
@@ -262,7 +262,7 @@
       let isList = this.pointData
       let isArr = []
       isList.map(j => {
-        if (this.instance.hasOwnProperty(j.Path)) {
+        if (this.instance &&this.instance.hasOwnProperty(j.Path)) {
           j.value = this.instance[j.Path]
           return j
         }
@@ -276,7 +276,7 @@
       //关键信息点
       this.exhibitionCrux.cruxArray = this.pointData.filter(i => i.KeyWord)
       this.exhibitionCrux.cruxArray.map(i => {
-        if (this.instance.hasOwnProperty(i.Path)) {
+        if (this.instance &&this.instance.hasOwnProperty(i.Path)) {
           return {
             ...i,
             value: this.instance[i.Path]
@@ -293,7 +293,7 @@
       } else if (val == 2) { //有值信息点
         let list = this.pointData
         list.map(j => {
-          if (this.instance.hasOwnProperty(j.Path)) {
+          if (this.instance && this.instance.hasOwnProperty(j.Path)) {
             return {
               ...j,
               value: this.instance[j.Path]
@@ -323,7 +323,7 @@
             case 'LedgerParam.PhotoDoc.Nameplate':
             case 'Pic' :
 
-              if (this.instance.hasOwnProperty(i.Path)) {
+              if (this.instance &&this.instance.hasOwnProperty(i.Path)) {
                 i.PicList = this.instance[i.Path]
 
               }
@@ -343,7 +343,6 @@
       })
       //展示图片
       this.exhibitionImage.list = picObject
-
       let isArray = [] //获取图片数组
       for (let i in picObject) {
         if (Array.isArray(picObject[i])) {
@@ -358,8 +357,10 @@
       this.exhibitionImage.arr = isArray
       let video = isArray.filter(i => i.Type != 'image' &&i.type != 'image' )
       this.exhibitionVideo.list = video
+
       //判断是否显示图片组件
-      this.isShowImage = isArray.length ? true : false
+      this.isShowImage = isArray.length  ? true : false
+
       //判断是否显示video组件
       this.isShowVideo = video.length ? true : false
     },
@@ -372,7 +373,7 @@
             case 'LedgerParam.InsuranceDoc.InsuranceFile':
             case 'LedgerParam.PhotoDoc.Archive':
             case 'LedgerParam.Siteinstall.CheckReport':
-              if (this.instance.hasOwnProperty(i.Path)) {
+              if (this.instance &&this.instance.hasOwnProperty(i.Path)) {
                 i.fileList = this.instance[i.Path]
               }
               if (picObject[i.InfoPointName]) {
@@ -423,11 +424,11 @@
     displayData(arr) {//对数据进行处理传给组件展示
       const result = {}
       arr.forEach(i => {
-        if (this.instance.hasOwnProperty(i.Path) && this.currentRadio != 2) {
+        if (this.instance && this.instance.hasOwnProperty(i.Path) && this.currentRadio != 2) {
           i.value = this.instance[i.Path]
         }
         if (i.InputMode == 'C5') {
-          if (this.instance.hasOwnProperty(i.Path)) {
+          if (this.instance && this.instance.hasOwnProperty(i.Path)) {
             let time = this.instance[i.Path]
             i.value = this.formatDate(time)
           }
@@ -443,7 +444,7 @@
               }
             })
           } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
-            if (this.instance.hasOwnProperty(i.Path)) {
+            if (this.instance &&this.instance.hasOwnProperty(i.Path)) {
               if (!Array.isArray(this.instance[i.Path])) {
                 let transArray = this.instance[i.Path].split(',')
                 i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
@@ -451,8 +452,7 @@
             }
           }
           source.forEach(j => {
-            if (j.Code == this.instance[i.Path]) {
-              console.log(j.Name, '===name===')
+            if (this.instance && j.Code == this.instance[i.Path]) {
               i.value = j.Name
             }
           })

+ 4 - 3
src/views/ready/buildfloor/index.vue

@@ -365,14 +365,13 @@
         this.buildDisabled = true
         if (this.delText == "楼层") {
           let delParam = [{FloorID: this.curFloorId}];
+          this.$message.success("删除成功");
+          this.delDialogVis = false;
           manageDeleteFloor(delParam, res => {
-            this.$message.success("删除成功");
             this.buildDisabled = false
-            this.delDialogVis = false;
             this.init();
           });
         } else {
-          //todo
           // 删除建筑
           if (this.tableData && this.tableData.length) {
             this.$message.error("当前建筑中包含楼层,不可删除");
@@ -380,6 +379,8 @@
             this.buildDisabled = false
           } else {
             let param = [{BuildId: this.curBuildId}];
+            this.$message.success("删除成功");
+            this.delDialogVis = false;
             objectDeleteBuild(param, res => {
               this.$message.success("删除成功");
               this.buildDisabled = false

+ 8 - 4
src/views/screen/splitscreen/equipledger/index.vue

@@ -22,7 +22,7 @@
 
 <script>
 import { LocationPointScene, FloorView } from "@saga-web/cad-engine";
-import { getFileNameById } from "@/api/model/file";
+import { getFileNameById, queryFileByModelId } from "@/api/model/file";
 
 export default {
   data() {
@@ -48,7 +48,11 @@ export default {
       if (this.equip.ModelId && this.equip.BIMLocation) {
         this.showCanvas = true;
         this.getGraphy();
-        this.getFileName();
+        queryFileByModelId({ Filters: `Id='${this.equip.ModelId}'` }, res => {
+          if (res.Content.length) {
+            this.getFileName(res.Content[0].FloorModelId);
+          }
+        });
       } else {
         this.showCanvas = false;
       }
@@ -77,8 +81,8 @@ export default {
       return new Date().getTime();
     },
     // 获取文件夹及文件名称
-    getFileName() {
-      let pa = { Id: this.equip.ModelId }
+    getFileName(id) {
+      let pa = { Id: id }
       getFileNameById(pa, res => {
         this.file = res
       })