Quellcode durchsuchen

修改会员界面切换个人发表界面时,数据不刷新的问题

Alex vor 4 Jahren
Ursprung
Commit
334aa35645

+ 3 - 1
src/views/system/appUser/detail/publish.vue

@@ -1,4 +1,5 @@
 <template>
+<keep-alive>
   <div class="app-container">
     <span><i class="el-icon-user"></i> 个人发表 - {{nickName}}</span>
     <el-divider></el-divider>
@@ -150,6 +151,7 @@
       </div>
     </el-dialog>
   </div>
+</keep-alive>
 </template>
 
 <script>
@@ -203,7 +205,7 @@ export default {
       }
     };
   },
-  created() {
+  activated() {
     this.baseUrl = process.env.VUE_APP_BASE_API;
     const uid = this.$route.query.uid;
     this.queryParams.appUserId = uid;

+ 5 - 0
src/views/system/family/detail/treeList.vue

@@ -164,6 +164,8 @@ export default {
       // 是否显示弹出层
       open: false,
       readonly: false,
+      // 父代数
+      parentGeneration: 0,
       // 成员
       memberOptions:[],
       treeMemberOptions:[],
@@ -305,13 +307,16 @@ export default {
       if(selection.length===1){
         this.parentId = selection.map(item => item.memberId)[0]
         this.father = selection.map(item => item.name)[0]
+        this.parentGeneration = selection.map(item => item.generation)[0]
       }
     },
     /** 新增按钮操作 */
     handleAdd(row) {
       this.reset();
+      debugger
       this.form.parentId = this.parentId;
       this.form.father = this.father;
+      this.form.generation = this.parentGeneration + 1;
       this.open = true;
       this.title = "添加成员至家族树";
       this.enableFather = true;