Browse Source

中图addBiillboardModel文件修改

lkk 6 tháng trước cách đây
mục cha
commit
10e8458b78

+ 32 - 18
src/views/ConstructionApplication3D/billboard/addBiillboardModel.vue

@@ -99,6 +99,7 @@
               selectbillboardModelRule.templateTopType == 'model'
             " -->
           <el-upload
+            v-if="isShowUpload"
             class="upload-demo"
             ref="upload"
             :action="uploadUrl"
@@ -769,6 +770,7 @@ export default {
       uploadUrl: window.ZTaxiosURI + "/uploadFile/uploadZipFile",
       thisfileurl: "",
       fileList: [],
+      isShowUpload: true,
     };
   },
   watch: {},
@@ -788,13 +790,12 @@ export default {
 
       //校验添加文件完整性
       let gltffile = this.fileList.find((c) => c.name.includes(".gltf"));
-      
+
       if (gltffile) {
         try {
           var reader = new FileReader();
           reader.onload = function () {
             if (reader.result) {
-    
               //打印文件内容
               if (reader.result) {
                 let contentJson = JSON.parse(reader.result);
@@ -918,7 +919,6 @@ export default {
 
       if (that.thisfileurl) {
         that.billboardModel.template.isImportModel = "true";
-        
       }
       viewer._container.style.cursor = "pointer";
       that.GUID = uuidv4();
@@ -935,7 +935,7 @@ export default {
         //   Cesium.defined(pickedObject) &&
         //   pickedObject.primitive
         // ) {
-        //   
+        //
 
         // }
 
@@ -991,7 +991,7 @@ export default {
                   that.selectbillboardModelRule.templateTopUrl =
                     that.thisfileurl;
                 }
-      
+
                 var entity = viewer.entities.add({
                   id: "top_billboard_" + that.GUID,
                   name: "gltf",
@@ -1102,7 +1102,7 @@ export default {
                   that.selectbillboardModelRule.templateTopUrl =
                     that.thisfileurl;
                 }
-      
+
                 var topentity = viewer.entities.add({
                   id: "top_billboard_" + that.GUID,
                   name: "gltf",
@@ -1270,7 +1270,7 @@ export default {
                   that.selectbillboardModelRule.templateTopUrl =
                     that.thisfileurl;
                 }
-      
+
                 var entity = viewer.entities.add({
                   id: "top_billboard_" + that.GUID,
                   name: "gltf",
@@ -1331,7 +1331,7 @@ export default {
                 url = window.ZTaxiosURI + that.thisfileurl;
                 that.selectbillboardModelRule.templateTopUrl = that.thisfileurl;
               }
-    
+
               var entity = viewer.entities.add({
                 id: "top_billboard_" + that.GUID,
                 name: "gltf",
@@ -1453,7 +1453,7 @@ export default {
                   that.selectbillboardModelRule.templateTopUrl =
                     that.thisfileurl;
                 }
-      
+
                 var entity = viewer.entities.add({
                   id: "top_billboard_" + that.GUID,
                   name: "gltf",
@@ -1511,7 +1511,7 @@ export default {
     handleChange() {
       this.$forceUpdate(); //解决点击计数器失效问题
       var that = this;
-      
+
       // modelList.forEach(model => {
 
       // });
@@ -1934,10 +1934,26 @@ export default {
      * 类型修改时触发
      */
     changeBillboardType() {
-      
-
       let sds = this.$refs["billboardTypeCascader"].getCheckedNodes()[0].data;
       this.billboardReview = JSON.parse(JSON.stringify(sds));
+      //这些不显示导入模型
+      var codes = [
+        "00301",
+        "00302",
+        "0030201",
+        "0030202",
+        "0030203",
+        "0050203",
+        "0050204",
+        "005020401",
+        "005020402",
+        "005020403",
+      ];
+      if (codes.find((c) => c == this.billboardReview.code) != undefined) {
+        this.isShowUpload = false;
+      } else {
+        this.isShowUpload = true;
+      }
 
       if (this.billboardReview.isAddModel) {
         this.billboardModel.isAddModel = this.billboardReview.isAddModel;
@@ -1963,7 +1979,6 @@ export default {
     },
     //模板默认值
     TemplateDefaultValues(ModelType) {
-      
       this.billboardModel.AttachedData = {};
       this.billboardModel.rotateX = 0;
       this.billboardModel.rotateY = 0;
@@ -2067,7 +2082,6 @@ export default {
      * 保存编辑
      */
     async saveMode() {
-      
       let that = this;
       if (that.billboardReview.AttachedData) {
         for (
@@ -2109,7 +2123,7 @@ export default {
           return;
         }
       }
-      
+
       let data = JSON.parse(JSON.stringify(that.billboardModel));
       data.id = uuidv4();
       data.billboardInfoId = that.project.id;
@@ -2161,9 +2175,9 @@ export default {
           roll: viewer.camera.roll,
         },
       });
-      
+
       let result = await addBillboardModelList(data);
-      
+
       if (result.code) {
         that.$message({
           message: "添加成功",
@@ -2172,7 +2186,7 @@ export default {
         viewer.entities.removeAll();
         // that.lyoption.cancel();
         //添加截图提醒
-        
+
         if (
           that.billboardReview.isAddModel &&
           that.lyoption.content.parent.jttx