页面整合

This commit is contained in:
aixianling
2022-06-24 20:50:47 +08:00
parent d979943852
commit 9292429c8c
3 changed files with 222 additions and 220 deletions

View File

@@ -1,7 +1,7 @@
<template>
<section class="AppMassNotification">
<keep-alive :include="['List']">
<component ref="component" :is="component" :instance="instance" :params="params" :dict="dict" @change="onChange"/>
<component ref="component" :is="currentPage" :instance="instance" :params="params" :dict="dict" @change="onChange"/>
</keep-alive>
</section>
</template>
@@ -25,22 +25,18 @@ export default {
include: [],
}
},
computed: {
currentPage() {
const {hash} = this.$route
return hash == "#add" ? Add : List
},
},
methods: {
onChange(data) {
if (data.type === "Add") {
this.component = "Add";
this.params = data.params;
}
if (data.type === "List") {
this.component = "List";
this.params = data.params;
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getTableData();
}
});
this.$router.push({hash: "#add", query: data.params})
} else {
this.$router.push({})
}
},
},