duy 2 жил өмнө
parent
commit
919ebf1997

+ 8 - 6
src/views/exctab/excelmodel/excelmodel.vue

@@ -8,10 +8,10 @@
           <el-button size="small" class="mg-l-10" @click="treeFilter">搜索</el-button>
         </div>
         <!-- 树结构 -->
-        <div style="overflow: auto;flex:1">
+        <div style="overflow: auto;flex:1" v-if="isShowTree">
           <el-tree style="display: inline-block;min-width: 100%;" ref="trees" :loading="loading" :load="treeLoad" lazy
             :data="data" :props="defaultProps" @node-click="nodeClick" node-key="id" :expand-on-click-node="false"
-            v-show="!allTreeShow" :default-expanded-keys="expandedKeys">
+            v-show="!allTreeShow" :default-expanded-keys="expandedKeys" auto-expand-parent>
             <span class="custom-tree-node" slot-scope="{ data ,node }" @mouseover.stop="mouseOver(data)"
               @mouseleave.stop="mouseLeave(data)" style="box-sizing: border-box;padding-right:70px!important;;">
               <div style="width:100%;">
@@ -361,6 +361,7 @@ export default {
       curTreeData: {},
       defaultExpandKey: [],
       exceldialogVisible: false,
+      isShowTree:true,
       uploadId:'',
       excelfileList: [],
       dataList: [],
@@ -1017,6 +1018,7 @@ export default {
     uploadMoudle(data) {
       console.log('上传');
       this.uploadId=data.id
+      this.curTreeData = data;
       this.exceldialogVisible = true
     },
 
@@ -1034,8 +1036,6 @@ export default {
     aumbitexcelmoudel() {
       let formData = new FormData()
       this.dataList.forEach((item) => {
-        // formData.append(`filList[${index}].file`, item.raw)
-        // formData.append(`filList[${index}].fileName`, item.name)
         formData.append('file', item.raw,item.name)
       })
       formData.append('id',this.uploadId)
@@ -1052,7 +1052,9 @@ export default {
             message: '上传文件成功',
             type: 'success'
           })
-          this.refreshTree() 
+          this.exceldialogVisible=false
+          this.refreshTree()
+       
           loading.close();
         }).catch(() => {
           loading.close();
@@ -1061,8 +1063,8 @@ export default {
        
     },
     cancleexceldialog(){
+     
       this.exceldialogVisible=false
-      this.refreshTree()
     }
   },
   created() {