Selaa lähdekoodia

内墙设计回显修改

yanym 2 viikkoa sitten
vanhempi
commit
f5e4fb2d78
1 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 9 5
      src/views/AIDesign/insideDesign.vue

+ 9 - 5
src/views/AIDesign/insideDesign.vue

@@ -484,6 +484,7 @@ export default class extends Vue {
   }
 
   GetEntityData(F_id) {
+      let that = this;
     const formData = new FormData();
     formData.append('F_id', F_id);
     insideGetEntity(formData).then(response => {
@@ -501,15 +502,18 @@ export default class extends Vue {
           const F_TextureCodeWithColor = response.Data.F_TextureCodeWithColor;
           // 处理纹理
           if (F_TextureCodeWithColor) {
-            this.textureCode_selValue = F_TextureCodeWithColor.split("-")[1];
+            // this.textureCode_selValue = F_TextureCodeWithColor.split("-")[1];
             // 找到选中的纹理项和索引
             let selectedItem = null;
             let selectedIndex = -1;
             this.textureCode_options.forEach((item, index) => {
-              if (item.text === this.textureCode_selValue) {
-                selectedItem = item;
-                selectedIndex = index;
-              }
+                item.subitems.forEach((childItem,childIndex) => {
+                    if (childItem.value === F_TextureCodeWithColor) {
+                        that.textureCode_selValue = item.text;
+                        selectedItem = item;
+                        selectedIndex = index;
+                    }
+                })
             });
             this.textureCode_selItem_index = selectedIndex;
             // 找到选中的纹理颜色