浏览代码

Merge branch 'master' of http://39.106.8.246:3003/web/persagy-plan-editer into master

yunxing 4 年之前
父节点
当前提交
1e715fb5e8
共有 3 个文件被更改,包括 16 次插入11 次删除
  1. 2 5
      src/components/homeView/createPlanarDialog.vue
  2. 3 3
      src/components/homeView/leftFolder.vue
  3. 11 3
      src/views/home.vue

+ 2 - 5
src/components/homeView/createPlanarDialog.vue

@@ -214,11 +214,8 @@ export default {
         },
     },
     watch: {
-        outerVisible: {
-            handler(n) {
-                if (n) this.getData();
-            },
-            immediate: true,
+        outerVisible(n) {
+            if (n) this.getData();
         },
     },
 };

+ 3 - 3
src/components/homeView/leftFolder.vue

@@ -79,7 +79,7 @@ export default {
     },
     methods: {
         // 获取文件夹数据
-        async getFolderData(folder) {
+        async getFolderData(folderId) {
             this.loading = true;
             const params = {
                 pageNumber: 1,
@@ -94,8 +94,8 @@ export default {
                 return folder;
             });
             // 如果参数传入文件夹,则选中对应的文件夹,否则默认选中第一个文件夹
-            if (folder) {
-                // this.handleCheckFolder(folder);
+            if (folderId) {
+                this.handleCheckFolder(folderId);
             } else {
                 this.handleCheckFolder(this.folderData[0].id);
             }

+ 11 - 3
src/views/home.vue

@@ -23,7 +23,7 @@
         <el-container class="bodys">
             <!-- 左侧树状导航栏部分 -->
             <el-aside class="aside" width="240px">
-                <left-folder @changeFolder="changeFolder"></left-folder>
+                <left-folder ref="leftFolder" @changeFolder="changeFolder"></left-folder>
                 <!-- <leftAsideTree ref="leftAsideTree" @changeNode="changeNode" @noTree="(noTreeFlag = false), (popVisible = true)"></leftAsideTree>
                 <div class="recycle" @click="showRecycleDialog">
                     <img :src="require('@/assets/images/recycle.png')" />
@@ -205,8 +205,16 @@ export default {
             this.$refs.createPlanarDialog.showDialog();
         },
         // 新建画布成功回调
-        createPlanarCallback({ folderId, folderName }) {
-            this.queryGraph(folderId);
+        createPlanarCallback(folder) {
+            if (folder.folderId) {
+                // 是否新建文件夹
+                if (folder.folderName) {
+                    // 新建文件夹
+                    this.$refs.leftFolder.getFolderData(folder.folderId);
+                } else {
+                    this.$refs.leftFolder.handleCheckFolder(folder.folderId);
+                }
+            }
         },
         // 批量新建画布
         batchCreateCanvas(val) {