76 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			76 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <div class="AppNewSociety">
 | |
|     <keep-alive :include="['List']">
 | |
|       <component
 | |
|         ref="component"
 | |
|         :is="component"
 | |
|         @change="onChange"
 | |
|         :params="params"
 | |
|         :instance="instance"
 | |
|         :dict="dict"
 | |
|       ></component>
 | |
|     </keep-alive>
 | |
|   </div>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
| import List from "./components/List";
 | |
| import Add from "./components/Add";
 | |
| 
 | |
| export default {
 | |
|   label: "新社会组织管理",
 | |
|   name: "AppNewSociety",
 | |
|   // 组件
 | |
|   components: { Add, List },
 | |
|   props: {
 | |
|     instance: Function,
 | |
|     dict: Object,
 | |
|     permissions: Function
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       component: "List",
 | |
|       params: {},
 | |
|       include: []
 | |
|     };
 | |
|   },
 | |
|   // 计算
 | |
|   computed: {},
 | |
|   // 监听
 | |
|   watch: {},
 | |
|   // 实例创建后
 | |
|   created() {},
 | |
|   // 实例创建后
 | |
|   onShow() {},
 | |
|   // 实例渲染后
 | |
|   mounted() {},
 | |
|   // 方法
 | |
|   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.getList();
 | |
|           }
 | |
|         });
 | |
|       }
 | |
|     }
 | |
|   }
 | |
| };
 | |
| </script>
 | |
| 
 | |
| <style scoped lang="scss">
 | |
| .AppNewSociety {
 | |
|   width: 100%;
 | |
|   height: 100%;
 | |
| }
 | |
| </style>
 |