页面整合
This commit is contained in:
@@ -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({})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user