Ver código fonte

修改bug2738

haojianlong 4 anos atrás
pai
commit
aac12afe9c

+ 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)
 }

+ 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
       })