目录代码整合
This commit is contained in:
		
							
								
								
									
										134
									
								
								packages/publicity/AppVillageInfo/AppVillageInfo.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										134
									
								
								packages/publicity/AppVillageInfo/AppVillageInfo.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,134 @@ | ||||
| <template> | ||||
|   <ai-list v-if="!isShowDetail"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="村务公开" :isShowBottomBorder="false" :hideLevel="hideLelev - 1" :instance="instance" :isShowArea="true" @change="areaChange" v-model="areaId"> | ||||
|       </ai-title> | ||||
|     </template> | ||||
|     <template slot="tabs"> | ||||
|       <el-tabs v-model="currIndex"> | ||||
|         <el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label"> | ||||
|           <component :ref="String(i)" :areaId="areaId" :is="tab.comp" v-if="currIndex === String(i)" @change="onChange" :instance="instance" :dict="dict" :permissions="permissions"/> | ||||
|         </el-tab-pane> | ||||
|       </el-tabs> | ||||
|     </template> | ||||
|   </ai-list> | ||||
|   <Detail v-else-if="isShowDetail && componentName === 'Detail'" :areaId="areaId" @change="onChange" :params="params" :instance="instance" :dict="dict" :permissions="permissions" /> | ||||
|   <Add v-else-if="isShowDetail && componentName === 'Add'" :areaId="areaId" @change="onChange" :params="params" :instance="instance" :dict="dict" :permissions="permissions" /> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import Event from './components/Event' | ||||
|   import Comments from './components/Comments' | ||||
|   import Add from './components/Add' | ||||
|   import Detail from './components/Detail' | ||||
|   import { mapState } from 'vuex' | ||||
|  | ||||
|   export default { | ||||
|     name: 'AppVillageInfo', | ||||
|     label: '村务公开', | ||||
|  | ||||
|     components: { | ||||
|       Add, | ||||
|       Detail, | ||||
|       Event, | ||||
|       Comments | ||||
|     }, | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       permissions: Function | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       ...mapState(['user']), | ||||
|  | ||||
|       tabs () { | ||||
|         const tabList = [ | ||||
|           {label: '事项管理', name: 'Event', comp: Event, permission: 'app_appvillageinfo'}, | ||||
|           {label: '评论管理', name: 'Comments', comp: Comments, permission: 'app_appvillageinfocomment'} | ||||
|         ].filter(item => { | ||||
|           return this.permissions(item.permission) | ||||
|         }) | ||||
|  | ||||
|         return tabList | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         activeName: 'Event', | ||||
|         currIndex: '0', | ||||
|         componentName: '', | ||||
|         params: {}, | ||||
|         areaId: '', | ||||
|         isHasPermiss: true, | ||||
|         isShowDetail: false | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.areaId = this.user.info.areaId | ||||
|       this.hideLelev = this.user.info.areaMap[this.user.info.areaId].length | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       areaChange () { | ||||
|         console.log(this.$refs[this.currIndex]) | ||||
|         this.$refs[this.currIndex][0].getList() | ||||
|       }, | ||||
|        | ||||
|       onChange (data) { | ||||
|         if (data.type === 'detail') { | ||||
|           this.componentName = 'Detail' | ||||
|           this.isShowDetail = true | ||||
|           this.params = data.params | ||||
|         } | ||||
|  | ||||
|         if (data.type === 'add') { | ||||
|           this.componentName = 'Add' | ||||
|           this.isShowDetail = true | ||||
|           this.params = data.params | ||||
|         } | ||||
|  | ||||
|         if (data.type === 'list') { | ||||
|           this.isShowDetail = false | ||||
|  | ||||
|           this.$nextTick(() => { | ||||
|             if (data.isRefresh) { | ||||
|               // this.$refs[this.currIndex].getList() | ||||
|             } | ||||
|           }) | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
|   .no-permission__wrapper { | ||||
|     display: flex; | ||||
|     align-items: center; | ||||
|     justify-content: center; | ||||
|     flex-direction: column; | ||||
|     height: 100%; | ||||
|     padding-bottom: 100px; | ||||
|     font-size: 16px; | ||||
|     color: #333; | ||||
|  | ||||
|     h2 { | ||||
|       font-size: 16px; | ||||
|       color: #333; | ||||
|     } | ||||
|  | ||||
|     i { | ||||
|       font-style: normal; | ||||
|       color: #2771ff; | ||||
|     } | ||||
|  | ||||
|     .no-permission { | ||||
|       width: 120px; | ||||
|       margin-top: 0; | ||||
|     } | ||||
|   } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user