60 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <section class="AppOrganizationChange">
 | |
|     <keep-alive :include="['List']">
 | |
|       <component ref="component" :is="component" :instance="instance" :selected.sync="selected" :params="params" :dict="dict" @change="onChange"/>
 | |
|     </keep-alive>
 | |
|   </section>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
| import addChange from "./components/addChange.vue";
 | |
| import List from "./components/List.vue";
 | |
| 
 | |
| export default {
 | |
|   name: "AppOrganizationChange",
 | |
|   label: "组织换届",
 | |
|   props: {
 | |
|     instance: Function,
 | |
|     dict: Object,
 | |
|   },
 | |
|   components: {List, addChange},
 | |
|   data() {
 | |
|     return {
 | |
|       component: "List",
 | |
|       params: {},
 | |
|       include: [],
 | |
|       selected: {},
 | |
|     }
 | |
|   },
 | |
|   methods: {
 | |
|     onChange(data) {
 | |
|       if (data.type === "List") {
 | |
|         this.component = "List";
 | |
|         this.params = data.params;
 | |
|       }
 | |
| 
 | |
|       if (data.type === "addChange") {
 | |
|         this.component = "addChange";
 | |
|         this.params = data.params;
 | |
| 
 | |
|         this.$nextTick(() => {
 | |
|           if (data.isRefresh) {
 | |
|             this.$refs.component.getList();
 | |
|           }
 | |
|         });
 | |
|       }
 | |
|     },
 | |
|   },
 | |
|   created() {
 | |
|     let {organizationId: id, organizationName: name} = this.user.info
 | |
|     this.selected = {id, name}
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| 
 | |
| <style lang="scss" scoped>
 | |
| .AppOrganizationChange {
 | |
|   height: 100%;
 | |
| }
 | |
| </style>
 |