设备管理
This commit is contained in:
		
							
								
								
									
										87
									
								
								packages/conv/AppDeviceConfig/AppDeviceConfig.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								packages/conv/AppDeviceConfig/AppDeviceConfig.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,87 @@ | ||||
| <template> | ||||
|   <ai-list class="AppDeviceConfig"> | ||||
|     <template slot="title"> | ||||
|       <ai-title title="设备管理" :isShowBottomBorder="false" :fullname.sync="areaName" v-model="areaId" :instance="instance" @change="onAreaChange"></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 :areaId="areaId" :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/> | ||||
|         </el-tab-pane> | ||||
|       </el-tabs> | ||||
|     </template> | ||||
|   </ai-list> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
|   import eyeList from './components/eyeList.vue' | ||||
|   import videoList from './components/videoList.vue' | ||||
|   import { mapState } from 'vuex' | ||||
|  | ||||
|   export default { | ||||
|     name: 'AppDeviceConfig', | ||||
|     label: '设备管理', | ||||
|  | ||||
|     components: { | ||||
|       eyeList, | ||||
|       videoList, | ||||
|     }, | ||||
|  | ||||
|     props: { | ||||
|       instance: Function, | ||||
|       dict: Object, | ||||
|       permissions: Function | ||||
|     }, | ||||
|  | ||||
|     computed: { | ||||
|       ...mapState(['user']), | ||||
|  | ||||
|       tabs () { | ||||
|         const tabList = [ | ||||
|           {label: '千里眼', name: 'eyeList', comp: eyeList, permission: ''}, | ||||
|           {label: '视联网', name: 'videoList', comp: videoList, permission: ''} | ||||
|         ] | ||||
|  | ||||
|         return tabList | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     data () { | ||||
|       return { | ||||
|         currIndex: '0', | ||||
|         component: 'eyeList', | ||||
|         params: {}, | ||||
|         areaId: '', | ||||
|         areaName: '' | ||||
|       } | ||||
|     }, | ||||
|  | ||||
|     created () { | ||||
|       this.areaId = this.user.info.areaId | ||||
|     }, | ||||
|  | ||||
|     methods: { | ||||
|       onChange (data) { | ||||
|         this.component = data.type | ||||
|         this.params = data.params | ||||
|  | ||||
|         this.$nextTick(() => { | ||||
|           if (data.isRefresh) { | ||||
|             this.$refs.component.getList() | ||||
|           } | ||||
|         }) | ||||
|          | ||||
|       }, | ||||
|  | ||||
|       onAreaChange () { | ||||
|         this.$refs[this.currIndex][0].changeArea() | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| </script> | ||||
|  | ||||
| <style lang="scss" scoped> | ||||
|   .AppDeviceConfig { | ||||
|     height: 100%; | ||||
|   } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user