Files
dvcp_v2_webapp/project/sass/apps/AppGridBlock/AppGridBlock.vue

77 lines
1.3 KiB
Vue
Raw Normal View History

2022-02-08 14:50:36 +08:00
<template>
2022-02-09 17:07:39 +08:00
<div class="AppGridBlock">
<keep-alive include="List">
2022-02-08 14:50:36 +08:00
<component
ref="component"
:is="component"
@change="onChange"
:params="params"
:instance="instance"
:dict="dict"
2022-02-09 17:07:39 +08:00
:isEdit="isEdit"
2022-02-08 14:50:36 +08:00
></component>
</keep-alive>
</div>
</template>
<script>
import List from "./components/list";
import Add from "./components/add";
export default {
2022-02-09 17:07:39 +08:00
name: "AppGridBlock",
label: "网格区块",
2022-02-08 14:50:36 +08:00
props: {
instance: Function,
dict: Object,
},
data() {
return {
component: "List",
params: {},
include: [],
2022-02-09 17:07:39 +08:00
isEdit: false
2022-02-08 14:50:36 +08:00
};
},
components: {
Add,
List,
},
mounted() {},
methods: {
onChange(data) {
if (data.type === "Add") {
this.component = "Add";
this.params = data.params;
2022-02-09 17:07:39 +08:00
this.isEdit = data.isEdit
2022-02-08 14:50:36 +08:00
}
if (data.type === "list") {
this.component = "List";
this.params = data.params;
this.$nextTick(() => {
if (data.isRefresh) {
2022-02-10 14:10:47 +08:00
this.$refs.component.getTreeList();
2022-02-08 14:50:36 +08:00
this.$refs.component.getList();
}
});
}
},
},
};
</script>
<style lang="scss">
2022-02-09 17:07:39 +08:00
.AppGridBlock {
2022-02-08 14:50:36 +08:00
height: 100%;
background: #f3f6f9;
overflow: auto;
}
</style>