mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 02:08:43 +08:00 
			
		
		
		
	refactor: button
This commit is contained in:
		| @@ -6,9 +6,13 @@ | |||||||
|   <ContentWrap> |   <ContentWrap> | ||||||
|     <!-- 操作工具栏 --> |     <!-- 操作工具栏 --> | ||||||
|     <div class="mb-10px"> |     <div class="mb-10px"> | ||||||
|       <el-button type="primary" v-hasPermi="['system:sms-channel:create']" @click="handleCreate"> |       <XButton | ||||||
|         <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }} |         type="primary" | ||||||
|       </el-button> |         preIcon="ep:zoom-in" | ||||||
|  |         :title="t('action.add')" | ||||||
|  |         v-hasPermi="['system:sms-channel:create']" | ||||||
|  |         @click="handleCreate()" | ||||||
|  |       /> | ||||||
|     </div> |     </div> | ||||||
|     <!-- 列表 --> |     <!-- 列表 --> | ||||||
|     <Table |     <Table | ||||||
|   | |||||||
| @@ -6,9 +6,12 @@ | |||||||
|   <ContentWrap> |   <ContentWrap> | ||||||
|     <!-- 操作工具栏 --> |     <!-- 操作工具栏 --> | ||||||
|     <div class="mb-10px"> |     <div class="mb-10px"> | ||||||
|       <el-button type="primary" @click="handleCreate"> |       <XButton | ||||||
|         <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }} |         type="primary" | ||||||
|       </el-button> |         preIcon="ep:zoom-in" | ||||||
|  |         :title="t('action.add')" | ||||||
|  |         @click="handleCreate()" | ||||||
|  |       /> | ||||||
|     </div> |     </div> | ||||||
|     <!-- 列表 --> |     <!-- 列表 --> | ||||||
|     <Table |     <Table | ||||||
| @@ -30,12 +33,8 @@ | |||||||
|         <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> |         <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> | ||||||
|       </template> |       </template> | ||||||
|       <template #action="{ row }"> |       <template #action="{ row }"> | ||||||
|         <el-button link type="primary" @click="handleUpdate(row)"> |         <XTextButton preIcon="ep:edit" :title="t('action.edit')" @click="handleUpdate(row)" /> | ||||||
|           <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }} |         <XTextButton preIcon="ep:delete" :title="t('action.del')" @click="delList(row.id, false)" /> | ||||||
|         </el-button> |  | ||||||
|         <el-button link type="primary" @click="delList(row.id, false)"> |  | ||||||
|           <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }} |  | ||||||
|         </el-button> |  | ||||||
|       </template> |       </template> | ||||||
|     </Table> |     </Table> | ||||||
|   </ContentWrap> |   </ContentWrap> | ||||||
|   | |||||||
| @@ -4,9 +4,7 @@ | |||||||
|       <template #header> |       <template #header> | ||||||
|         <div class="card-header"> |         <div class="card-header"> | ||||||
|           <span>部门列表</span> |           <span>部门列表</span> | ||||||
|           <el-button link class="button" type="primary" @click="handleDeptEdit"> |           <XTextButton title="修改部门" @click="handleDeptEdit()" /> | ||||||
|             修改部门 |  | ||||||
|           </el-button> |  | ||||||
|         </div> |         </div> | ||||||
|       </template> |       </template> | ||||||
|       <el-input v-model="filterText" placeholder="搜索部门" /> |       <el-input v-model="filterText" placeholder="搜索部门" /> | ||||||
| @@ -37,23 +35,27 @@ | |||||||
|       /> |       /> | ||||||
|       <!-- 操作工具栏 --> |       <!-- 操作工具栏 --> | ||||||
|       <div class="mb-10px"> |       <div class="mb-10px"> | ||||||
|         <el-button type="primary" v-hasPermi="['system:user:create']" @click="handleAdd"> |         <XButton | ||||||
|           <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }} |           type="primary" | ||||||
|         </el-button> |           preIcon="ep:zoom-in" | ||||||
|         <el-button |           :title="t('action.add')" | ||||||
|           type="info" |           v-hasPermi="['system:user:create']" | ||||||
|  |           @click="handleCreate()" | ||||||
|  |         /> | ||||||
|  |         <XButton | ||||||
|  |           type="warning" | ||||||
|  |           preIcon="ep:upload" | ||||||
|  |           :title="t('action.import')" | ||||||
|           v-hasPermi="['system:user:import']" |           v-hasPermi="['system:user:import']" | ||||||
|           @click="importDialogVisible = true" |           @click="importDialogVisible = true" | ||||||
|         > |         /> | ||||||
|           <Icon icon="ep:upload" class="mr-5px" /> {{ t('action.import') }} |         <XButton | ||||||
|         </el-button> |  | ||||||
|         <el-button |  | ||||||
|           type="warning" |           type="warning" | ||||||
|  |           preIcon="ep:download" | ||||||
|  |           :title="t('action.export')" | ||||||
|           v-hasPermi="['system:user:export']" |           v-hasPermi="['system:user:export']" | ||||||
|           @click="exportList('用户数据.xls')" |           @click="exportList('用户数据.xls')" | ||||||
|         > |         /> | ||||||
|           <Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }} |  | ||||||
|         </el-button> |  | ||||||
|       </div> |       </div> | ||||||
|       <!-- 列表 --> |       <!-- 列表 --> | ||||||
|       <Table |       <Table | ||||||
| @@ -80,46 +82,38 @@ | |||||||
|           <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> |           <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> | ||||||
|         </template> |         </template> | ||||||
|         <template #action="{ row }"> |         <template #action="{ row }"> | ||||||
|           <el-button |           <XTextButton | ||||||
|             link |             preIcon="ep:edit" | ||||||
|             type="primary" |             :title="t('action.edit')" | ||||||
|             v-hasPermi="['system:user:update']" |             v-hasPermi="['system:user:update']" | ||||||
|             @click="handleUpdate(row)" |             @click="handleUpdate(row.id)" | ||||||
|           > |           /> | ||||||
|             <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }} |           <!-- 操作:详情 --> | ||||||
|           </el-button> |           <XTextButton | ||||||
|           <el-button |             preIcon="ep:view" | ||||||
|             link |             :title="t('action.detail')" | ||||||
|             type="primary" |  | ||||||
|             v-hasPermi="['system:user:update']" |             v-hasPermi="['system:user:update']" | ||||||
|             @click="handleDetail(row)" |             @click="handleDetail(row)" | ||||||
|           > |           /> | ||||||
|             <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }} |           <XTextButton | ||||||
|           </el-button> |             preIcon="ep:key" | ||||||
|           <el-button |             title="重置密码" | ||||||
|             link |  | ||||||
|             type="primary" |  | ||||||
|             v-hasPermi="['system:user:update-password']" |             v-hasPermi="['system:user:update-password']" | ||||||
|             @click="handleResetPwd(row)" |             @click="handleResetPwd(row)" | ||||||
|           > |           /> | ||||||
|             <Icon icon="ep:key" class="mr-1px" /> 重置密码 |           <XTextButton | ||||||
|           </el-button> |             preIcon="ep:key" | ||||||
|           <el-button |             title="分配角色" | ||||||
|             link |  | ||||||
|             type="primary" |  | ||||||
|             v-hasPermi="['system:permission:assign-user-role']" |             v-hasPermi="['system:permission:assign-user-role']" | ||||||
|             @click="handleRole(row)" |             @click="handleRole(row)" | ||||||
|           > |           /> | ||||||
|             <Icon icon="ep:key" class="mr-1px" /> 分配角色 |           <!-- 操作:删除 --> | ||||||
|           </el-button> |           <XTextButton | ||||||
|           <el-button |             preIcon="ep:delete" | ||||||
|             link |             :title="t('action.del')" | ||||||
|             type="primary" |  | ||||||
|             v-hasPermi="['system:user:delete']" |             v-hasPermi="['system:user:delete']" | ||||||
|             @click="delList(row.id, false)" |             @click="delList(row.id, false)" | ||||||
|           > |           /> | ||||||
|             <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }} |  | ||||||
|           </el-button> |  | ||||||
|         </template> |         </template> | ||||||
|       </Table> |       </Table> | ||||||
|     </el-card> |     </el-card> | ||||||
| @@ -296,6 +290,7 @@ import { useRouter } from 'vue-router' | |||||||
| import { CommonStatusEnum } from '@/utils/constants' | import { CommonStatusEnum } from '@/utils/constants' | ||||||
| import { getAccessToken, getTenantId } from '@/utils/auth' | import { getAccessToken, getTenantId } from '@/utils/auth' | ||||||
| import { useMessage } from '@/hooks/web/useMessage' | import { useMessage } from '@/hooks/web/useMessage' | ||||||
|  | import { nextTick } from 'process' | ||||||
|  |  | ||||||
| const message = useMessage() | const message = useMessage() | ||||||
|  |  | ||||||
| @@ -365,23 +360,24 @@ const setDialogTile = async (type: string) => { | |||||||
| } | } | ||||||
|  |  | ||||||
| // 新增操作 | // 新增操作 | ||||||
| const handleAdd = async () => { | const handleCreate = async () => { | ||||||
|   // 重置表单 |   // 重置表单 | ||||||
|   deptId.value = null |   deptId.value = null | ||||||
|   postIds.value = [] |   postIds.value = [] | ||||||
|   dialogVisible.value = true |   dialogVisible.value = true | ||||||
|   dialogTitle.value = t('action.create') |   dialogTitle.value = t('action.create') | ||||||
|   actionType.value = 'create' |   actionType.value = 'create' | ||||||
|   await unref(formRef)?.getElFormRef().resetFields() |   await nextTick() | ||||||
|  |   unref(formRef)?.getElFormRef().resetFields() | ||||||
| } | } | ||||||
|  |  | ||||||
| // 修改操作 | // 修改操作 | ||||||
| const handleUpdate = async (row: UserVO) => { | const handleUpdate = async (rowId: number) => { | ||||||
|   await setDialogTile('update') |   await setDialogTile('update') | ||||||
|   unref(formRef)?.delSchema('username') |   unref(formRef)?.delSchema('username') | ||||||
|   unref(formRef)?.delSchema('password') |   unref(formRef)?.delSchema('password') | ||||||
|   // 设置数据 |   // 设置数据 | ||||||
|   const res = await UserApi.getUserApi(row.id) |   const res = await UserApi.getUserApi(rowId) | ||||||
|   deptId.value = res.deptId |   deptId.value = res.deptId | ||||||
|   postIds.value = res.postIds |   postIds.value = res.postIds | ||||||
|   unref(formRef)?.setValues(res) |   unref(formRef)?.setValues(res) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 xingyu4j
					xingyu4j