Ver Fonte

自定义模型绑定图层数组调整

Bella há 2 anos atrás
pai
commit
c339b8af8a

+ 10 - 5
src/components/common/BottomForm/CustomModelDialog.vue

@@ -209,12 +209,14 @@ export default {
   },
   created() {
     this.checkedKeysArr = [];
-    this.getColumnList();
     // DMS - 任务类型
     // 水资源审计 - 2;林地资源审计 - 3;生态资源审计 - 4; 土地资源审计 - 1
     this.classDictQuery("0", "c_task_type", "任务类型");
     // DMS - 浦东行政区划
     this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
+    setTimeout(() => {
+      this.getColumnList();
+    }, 500);
   },
   mounted() {
     // 监听自定义模型
@@ -392,9 +394,14 @@ export default {
                                               `${item4.title}_${item4.id}`,
                                               {
                                                 townId: item2.id,
-                                                townType: item2.title,
+                                                townType: this.classTextToIndex[
+                                                  "浦东新区行政区划"
+                                                ].get(item2.title),
                                                 sourceId: item3.id,
-                                                sourceType: item3.title,
+                                                sourceType:
+                                                  this.classTextToIndex[
+                                                    "任务类型"
+                                                  ].get(item3.title),
                                                 layerId: item4.id,
                                                 layerName: item4.title,
                                               }
@@ -458,7 +465,6 @@ export default {
         this.createModelParams.title = this.inputName;
         this.createModelParams.content = this.inputName;
         this.createModelParams.c_user_id = localStorage.getItem("USER_ID") || 4;
-        console.log(this.customTreeMap);
         // 获取数组对象
         let treeArr = [];
         this.customTreeMap.forEach((v, i) => {
@@ -497,7 +503,6 @@ export default {
     },
     // 修改模型 -- 直接调用修改模型接口
     modifyModel(type, bindData) {
-      debugger;
       let obj = {
         id: this.currentModifiedModelId,
         title: this.inputName,

+ 9 - 12
src/views/ComprehensiveAnalysis.vue

@@ -1115,15 +1115,6 @@ export default {
           this.showRightBox = true;
           // 第一级菜单是所有图层
           if (data.mainType === "所有图层") {
-            this.$store.state.treeDataCollection.set(data.id, {
-              // mainType: data.mainType,
-              townId: data.townId,
-              townType: data.townType,
-              sourceId: data.sourceId,
-              sourceType: data.sourceType,
-              layerId: data.id,
-              layerName: data.label,
-            });
             this.rightPanelTitle = data.id;
             let searchParam = [];
 
@@ -1134,6 +1125,15 @@ export default {
             let targetType = this.classTextToIndex["任务类型"].get(
               data.sourceType
             );
+            this.$store.state.treeDataCollection.set(data.id, {
+              // mainType: data.mainType,
+              townId: data.townId,
+              townType: data.townType,
+              sourceId: data.sourceId,
+              sourceType: data.sourceType,
+              layerId: data.id,
+              layerName: data.label,
+            });
 
             let paramUser = {
               field: "c_user_id",
@@ -1241,10 +1241,8 @@ export default {
       }
     },
     displayMyModelData(data) {
-      debugger;
       // 如果有叠置分析文件 -- 呈现叠置分析内容
       if (data.c_dzfx_file) {
-        debugger;
         this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
           (response) => {
             if (response.features.length > 0) {
@@ -1269,7 +1267,6 @@ export default {
               this.$message.info("暂无数据!");
             }
             if (res.code === 200 && res.content.length > 0) {
-              debugger;
               console.log(res.content, "查看我的模型图层数据");
               let uniqueId = `${data.label}_${data.id}`;
               map2DViewer.analysisGroups[uniqueId] = L.featureGroup();