mirror of
				https://github.com/nsnail/NetAdmin.git
				synced 2025-10-31 11:25:27 +08:00 
			
		
		
		
	feat: ✨ naColId组件 (#118)
This commit is contained in:
		
							
								
								
									
										33
									
								
								src/frontend/admin/src/components/naColId/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								src/frontend/admin/src/components/naColId/index.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | |||||||
|  | <template> | ||||||
|  |     <el-table-column v-bind="$attrs"> | ||||||
|  |         <template #default="scope"> | ||||||
|  |             <el-text @click="click(scope.row)" style="cursor: pointer" tag="ins"> | ||||||
|  |                 {{ tool.getNestedProperty(scope.row, $attrs.prop) }} | ||||||
|  |             </el-text> | ||||||
|  |         </template> | ||||||
|  |     </el-table-column> | ||||||
|  | </template> | ||||||
|  | <script> | ||||||
|  | import tool from '@/utils/tool' | ||||||
|  | export default { | ||||||
|  |     emits: ['click'], | ||||||
|  |     props: {}, | ||||||
|  |     data() { | ||||||
|  |         return {} | ||||||
|  |     }, | ||||||
|  |     mounted() {}, | ||||||
|  |     created() {}, | ||||||
|  |     components: {}, | ||||||
|  |     computed: { | ||||||
|  |         tool() { | ||||||
|  |             return tool | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|  |     methods: { | ||||||
|  |         async click(row) { | ||||||
|  |             this.$emit('click', row) | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | <style scoped></style> | ||||||
| @@ -49,6 +49,7 @@ import naArea from '@/components/naArea/index.vue' | |||||||
| import naButtonAdd from '@/components/naButtonAdd/index.vue' | import naButtonAdd from '@/components/naButtonAdd/index.vue' | ||||||
| import naButtonBatchDel from '@/components/naButtonBatchDel/index.vue' | import naButtonBatchDel from '@/components/naButtonBatchDel/index.vue' | ||||||
| import naColAvatar from '@/components/naColAvatar' | import naColAvatar from '@/components/naColAvatar' | ||||||
|  | import naColId from '@/components/naColId/index.vue' | ||||||
| import naColIndicator from '@/components/naColIndicator/index.vue' | import naColIndicator from '@/components/naColIndicator/index.vue' | ||||||
| import naColOperation from '@/components/naColOperation' | import naColOperation from '@/components/naColOperation' | ||||||
| import naColTags from '@/components/naColTags/index.vue' | import naColTags from '@/components/naColTags/index.vue' | ||||||
| @@ -89,6 +90,7 @@ export default { | |||||||
|         app.component('naButtonAdd', naButtonAdd) |         app.component('naButtonAdd', naButtonAdd) | ||||||
|         app.component('naButtonBatchDel', naButtonBatchDel) |         app.component('naButtonBatchDel', naButtonBatchDel) | ||||||
|         app.component('naColAvatar', naColAvatar) |         app.component('naColAvatar', naColAvatar) | ||||||
|  |         app.component('naColId', naColId) | ||||||
|         app.component('naColIndicator', naColIndicator) |         app.component('naColIndicator', naColIndicator) | ||||||
|         app.component('naColOperation', naColOperation) |         app.component('naColOperation', naColOperation) | ||||||
|         app.component('naColTags', naColTags) |         app.component('naColTags', naColTags) | ||||||
|   | |||||||
| @@ -39,23 +39,22 @@ | |||||||
|                 row-key="id" |                 row-key="id" | ||||||
|                 stripe> |                 stripe> | ||||||
|                 <el-table-column align="center" type="selection"></el-table-column> |                 <el-table-column align="center" type="selection"></el-table-column> | ||||||
|                 <el-table-column :label="$t('配置编号')" align="center" prop="id"></el-table-column> |                 <el-table-column :label="$t('配置编号')" align="center" prop="id" width="170"></el-table-column> | ||||||
|                 <el-table-column :label="$t('用户注册')" align="center"> |                 <el-table-column :label="$t('用户注册')" align="center"> | ||||||
|                     <el-table-column :label="$t('默认部门')" align="center" prop="userRegisterDept.name"></el-table-column> |                     <el-table-column :label="$t('默认部门')" align="center" prop="userRegisterDept.name" width="150"></el-table-column> | ||||||
|                     <el-table-column :label="$t('默认角色')" align="center" prop="userRegisterRole.name"></el-table-column> |                     <el-table-column :label="$t('默认角色')" align="center" prop="userRegisterRole.name" width="150"></el-table-column> | ||||||
|                     <el-table-column :label="$t('人工审核')" align="center" prop="userRegisterConfirm"> |                     <el-table-column :label="$t('人工审核')" align="center" prop="userRegisterConfirm" width="100"> | ||||||
|                         <template #default="scope"> |                         <template #default="scope"> | ||||||
|                             <el-switch v-model="scope.row.userRegisterConfirm" @change="changeSwitch($event, scope.row)"></el-switch> |                             <el-switch v-model="scope.row.userRegisterConfirm" @change="changeSwitch($event, scope.row)"></el-switch> | ||||||
|                         </template> |                         </template> | ||||||
|                     </el-table-column> |                     </el-table-column> | ||||||
|                 </el-table-column> |                 </el-table-column> | ||||||
|  |                 <el-table-column :label="$t('启用')" align="center" prop="enabled" width="100"> | ||||||
|                 <el-table-column :label="$t('启用')" align="center" prop="enabled"> |  | ||||||
|                     <template #default="scope"> |                     <template #default="scope"> | ||||||
|                         <el-switch v-model="scope.row.enabled" @change="changeSwitch($event, scope.row)"></el-switch> |                         <el-switch v-model="scope.row.enabled" @change="changeSwitch($event, scope.row)"></el-switch> | ||||||
|                     </template> |                     </template> | ||||||
|                 </el-table-column> |                 </el-table-column> | ||||||
|                 <el-table-column :label="$t('创建时间')" align="center" prop="createdTime"></el-table-column> |                 <el-table-column :label="$t('创建时间')" align="center" prop="createdTime" width="170"></el-table-column> | ||||||
|                 <na-col-operation |                 <na-col-operation | ||||||
|                     :buttons=" |                     :buttons=" | ||||||
|                         naColOperation.buttons.concat({ |                         naColOperation.buttons.concat({ | ||||||
| @@ -66,7 +65,8 @@ | |||||||
|                             type: 'danger', |                             type: 'danger', | ||||||
|                         }) |                         }) | ||||||
|                     " |                     " | ||||||
|                     :vue="this" /> |                     :vue="this" | ||||||
|  |                     width="170" /> | ||||||
|             </sc-table> |             </sc-table> | ||||||
|         </el-main> |         </el-main> | ||||||
|     </el-container> |     </el-container> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 GitHub
						GitHub