Преглед на файлове

三个场景上传文件优化

zhangliang2 преди 3 години
родител
ревизия
56a0888d34
променени са 1 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. 6 4
      src/views/sceneLibrary/components/fileDialog.vue

+ 6 - 4
src/views/sceneLibrary/components/fileDialog.vue

@@ -84,17 +84,19 @@ export default {
                         type
                 );
 
-                if (!item) {
+                if (type === "xml" && !item) {
                     item = this.attachmentList.find(
                         (i) =>
                             i.fileName.slice(
                                 i.fileName.lastIndexOf(".") + 1
                             ) === "xosc"
                     );
-                    if (!item) {
-                        item = {};
-                    }
                 }
+
+                if (!item) {
+                    item = {};
+                }
+
                 data[type + "Address"] = item.fileName || "";
             }
         },