无等级网格版合并
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
<template>
|
||||
<div class="AppGridBlock">
|
||||
<keep-alive include="List">
|
||||
<component
|
||||
ref="component"
|
||||
:is="component"
|
||||
@change="onChange"
|
||||
:params="params"
|
||||
:instance="instance"
|
||||
:dict="dict"
|
||||
:isEdit="isEdit"
|
||||
></component>
|
||||
</keep-alive>
|
||||
<component :is="currentPage" :instance="instance" :dict="dict"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -26,44 +16,17 @@ export default {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
},
|
||||
|
||||
computed: {
|
||||
currentPage() {
|
||||
return this.$route.hash == "#add" ? Add : List
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
component: "List",
|
||||
params: {},
|
||||
include: [],
|
||||
isEdit: false
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
Add,
|
||||
List,
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
|
||||
methods: {
|
||||
onChange(data) {
|
||||
if (data.type === "Add") {
|
||||
this.component = "Add";
|
||||
this.params = data.params;
|
||||
this.isEdit = data.isEdit
|
||||
}
|
||||
|
||||
if (data.type === "list") {
|
||||
this.component = "List";
|
||||
this.params = data.params;
|
||||
|
||||
this.$nextTick(() => {
|
||||
if (data.isRefresh) {
|
||||
this.$refs.component.getList()
|
||||
this.$refs.component.getTreeList()
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {Add, List},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user