feat: element plus UI组件库
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
041bb73b9a
commit
5f6fbcd76f
30 files changed
+3621
-1327
No files matched your search
@@ -1,24 +1,43 @@
|
||||
/**
|
||||
* features/admin/modules/users/UsersPage.vue
|
||||
* 用途:用户管理独立页面(服务端筛选分页、用户/部门列排序、批量操作)。
|
||||
* 依赖:useUsersAdmin、SortableTableHeader、PaginationBar、用户相关 Modal、adminRoleLabel、getUserAvatarLabel。
|
||||
* 逻辑:路由 /admin/users;列表经 listAdminUsersPage 按页拉取;权限组启用后只选角色、关闭按人授权。
|
||||
* 依赖:useUsersAdmin、useElementProvider、element-plus、用户相关 Modal、adminRoleLabel、getUserAvatarLabel。
|
||||
* 逻辑:路由 /admin/users;本页是 Element Plus 试点,筛选、表格、分页、工具栏和三个业务弹窗走组件库。
|
||||
* 删除和改角色用 Element 确认框。列表经 listAdminUsersPage 按页拉取。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue';
|
||||
import { computed, onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Edit, Plus, Trash2, Users } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import PaginationBar from '@/shared/components/PaginationBar.vue';
|
||||
import SortableTableHeader from '@/shared/components/SortableTableHeader.vue';
|
||||
import { Delete, Edit, Plus, User } from '@element-plus/icons-vue';
|
||||
import {
|
||||
ElButton,
|
||||
ElConfigProvider,
|
||||
ElInput,
|
||||
ElLoading,
|
||||
ElOption,
|
||||
ElPagination,
|
||||
ElSelect,
|
||||
ElSpace,
|
||||
ElTable,
|
||||
ElTableColumn,
|
||||
ElTag,
|
||||
} from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
import 'element-plus/theme-chalk/dark/css-vars.css';
|
||||
import '@/features/admin/styles/element-trial.css';
|
||||
import { adminRoleLabel } from '@/features/admin/utils/roleLabel';
|
||||
import { getUserAvatarLabel } from '@/shared/utils/user-avatar';
|
||||
import type { AdminUserRow } from '@/features/admin/types/admin.types';
|
||||
import { useElementProvider } from '@/features/admin/composables/useElementProvider';
|
||||
import BatchEditUserModal from './components/BatchEditUserModal.vue';
|
||||
import BatchPermissionModal from './components/BatchPermissionModal.vue';
|
||||
import UserFormModal from './components/UserFormModal.vue';
|
||||
import { useUsersAdmin } from './composables/useUsersAdmin';
|
||||
|
||||
const vLoading = ElLoading.directive;
|
||||
|
||||
const { t } = useI18n();
|
||||
const { elementLocale } = useElementProvider();
|
||||
|
||||
const {
|
||||
agents,
|
||||
@@ -31,290 +50,273 @@ const {
|
||||
userFilters,
|
||||
sortKey,
|
||||
sortDir,
|
||||
// hideRejected,
|
||||
selectedUserIds,
|
||||
users,
|
||||
usersTotal,
|
||||
userPage,
|
||||
userPageSize,
|
||||
userPageSizeOptions,
|
||||
usersPages,
|
||||
allPaginatedUsersSelected,
|
||||
showUserModal,
|
||||
editingUser,
|
||||
showBatchEditModal,
|
||||
batchEditForm,
|
||||
showBatchPermissionModal,
|
||||
batchPermissionForm,
|
||||
showDeleteConfirmDialog,
|
||||
deleteConfirmMessage,
|
||||
showRoleConfirm,
|
||||
roleConfirmMessage,
|
||||
loadAll,
|
||||
toggleSort,
|
||||
applyServerSort,
|
||||
openCreateUserModal,
|
||||
openEditUserModal,
|
||||
saveUser,
|
||||
// cleanRejectedUsers,
|
||||
batchDeleteUsers,
|
||||
toggleUserSelection,
|
||||
toggleAllUsers,
|
||||
openBatchEditModal,
|
||||
openBatchPermissionModal,
|
||||
submitBatchEdit,
|
||||
submitBatchPermission,
|
||||
closeDeleteConfirm,
|
||||
confirmDelete,
|
||||
confirmRoleChange,
|
||||
closeRoleConfirm,
|
||||
} = useUsersAdmin();
|
||||
|
||||
const pageSizes = computed(() => [...userPageSizeOptions]);
|
||||
|
||||
const defaultSort = computed(() => ({
|
||||
prop: sortKey.value || 'username',
|
||||
order: sortDir.value === 'desc' ? 'descending' as const : 'ascending' as const,
|
||||
}));
|
||||
|
||||
/**
|
||||
* 把 Element 表格的勾选结果写回已选用户 id。
|
||||
* @param rows - 当前保留的选中行
|
||||
*/
|
||||
function onSelectionChange(rows: AdminUserRow[]): void {
|
||||
selectedUserIds.value = rows.map((row) => row.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门筛选。清空时写回空字符串,列表接口仍按「全部部门」查询。
|
||||
* @param value - 选中的部门名;清空为 undefined
|
||||
*/
|
||||
function onDepartmentChange(value: string | undefined): void {
|
||||
userFilters.value.department = value ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 把 Element 表头排序交给服务端查询。
|
||||
* 核心逻辑:取消排序时保持当前方向;有效排序走 applyServerSort 并回到第一页。
|
||||
* @param payload.prop - 列字段
|
||||
* @param payload.order - ascending、descending 或空
|
||||
*/
|
||||
function onSortChange(payload: { prop: string | null; order: string | null }): void {
|
||||
const field = payload.prop;
|
||||
if ((field === 'username' || field === 'department') && payload.order) {
|
||||
applyServerSort(field, payload.order === 'descending' ? 'desc' : 'asc');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开编辑弹窗。表格插槽行类型较宽,这里收成用户行。
|
||||
* @param row - 当前表格行
|
||||
*/
|
||||
function editUser(row: AdminUserRow): void {
|
||||
openEditUserModal(row);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void loadAll();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="admin-table-section">
|
||||
<div v-if="isLoading" class="flex items-center justify-center py-20">
|
||||
<div class="animate-spin rounded-full h-10 w-10 border-b-2 border-brand-600" />
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div class="admin-table-header admin-table-header--stacked">
|
||||
<div>
|
||||
<h2 class="section-title">{{ t('admin.user.title') }}</h2>
|
||||
<p class="section-desc mt-1">{{ t('admin.user.subtitle') }}</p>
|
||||
<ElConfigProvider :locale="elementLocale">
|
||||
<section v-loading="isLoading" class="admin-table-section min-h-64">
|
||||
<template v-if="!isLoading">
|
||||
<div class="admin-table-header admin-table-header--stacked">
|
||||
<div>
|
||||
<h2 class="section-title">{{ t('admin.user.title') }}</h2>
|
||||
<p class="section-desc mt-1">{{ t('admin.user.subtitle') }}</p>
|
||||
</div>
|
||||
<ElSpace wrap>
|
||||
<ElButton
|
||||
v-if="selectedUserIds.length > 0"
|
||||
type="danger"
|
||||
:icon="Delete"
|
||||
@click="batchDeleteUsers"
|
||||
>
|
||||
{{ t('admin.user.batchDelete') }} ({{ selectedUserIds.length }})
|
||||
</ElButton>
|
||||
<ElButton v-if="selectedUserIds.length > 0" :icon="Edit" @click="openBatchEditModal">
|
||||
{{ t('admin.user.batchEdit') }} ({{ selectedUserIds.length }})
|
||||
</ElButton>
|
||||
<ElButton
|
||||
v-if="selectedUserIds.length > 0 && !rolesConfigured"
|
||||
:icon="User"
|
||||
@click="openBatchPermissionModal"
|
||||
>
|
||||
{{ t('admin.user.batchPermission') }} ({{ selectedUserIds.length }})
|
||||
</ElButton>
|
||||
<ElButton type="primary" :icon="Plus" @click="openCreateUserModal">
|
||||
{{ t('admin.user.addUser') }}
|
||||
</ElButton>
|
||||
</ElSpace>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<!-- 暂隐藏:清理已拒绝
|
||||
<button
|
||||
type="button"
|
||||
class="flex items-center gap-2 px-4 py-2 bg-red-50 text-red-600 rounded-xl hover:bg-red-100 transition-all border border-red-200 text-sm font-medium"
|
||||
@click="cleanRejectedUsers"
|
||||
>
|
||||
<Trash2 class="w-4 h-4" />
|
||||
<span>{{ t('admin.user.cleanRejected') }}</span>
|
||||
</button>
|
||||
-->
|
||||
<button
|
||||
v-if="selectedUserIds.length > 0"
|
||||
type="button"
|
||||
class="flex items-center gap-2 px-4 py-2 bg-red-600 text-white rounded-xl hover:bg-red-700 transition-all shadow-lg shadow-red-200 active:scale-95 text-sm font-medium"
|
||||
@click="batchDeleteUsers"
|
||||
>
|
||||
<Trash2 class="w-4 h-4" />
|
||||
<span>{{ t('admin.user.batchDelete') }} ({{ selectedUserIds.length }})</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="selectedUserIds.length > 0"
|
||||
type="button"
|
||||
class="flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-xl hover:bg-indigo-700 transition-all shadow-lg shadow-indigo-200 active:scale-95 text-sm font-medium"
|
||||
@click="openBatchEditModal"
|
||||
>
|
||||
<Edit class="w-4 h-4" />
|
||||
<span>{{ t('admin.user.batchEdit') }} ({{ selectedUserIds.length }})</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="selectedUserIds.length > 0 && !rolesConfigured"
|
||||
type="button"
|
||||
class="flex items-center gap-2 px-4 py-2 bg-purple-600 text-white rounded-xl hover:bg-purple-700 transition-all shadow-lg shadow-purple-200 active:scale-95 text-sm font-medium"
|
||||
@click="openBatchPermissionModal"
|
||||
>
|
||||
<Users class="w-4 h-4" />
|
||||
<span>{{ t('admin.user.batchPermission') }} ({{ selectedUserIds.length }})</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex items-center gap-2 px-4 py-2 bg-brand-600 text-white rounded-xl hover:bg-brand-700 transition-all shadow-lg shadow-brand-200 active:scale-95 text-sm font-medium"
|
||||
@click="openCreateUserModal"
|
||||
>
|
||||
<Plus class="w-4 h-4" />
|
||||
<span class="font-medium">{{ t('admin.user.addUser') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-table-filters--inline gap-3">
|
||||
<input v-model="userFilters.username" :placeholder="t('admin.user.filterUsername')" class="admin-table-filter-input w-40" />
|
||||
<input v-model="userFilters.real_name" :placeholder="t('admin.user.filterRealName')" class="admin-table-filter-input w-44" />
|
||||
<select v-model="userFilters.department" class="admin-table-filter-input w-40">
|
||||
<option value="">{{ t('admin.user.allDepts') }}</option>
|
||||
<option v-for="d in departments" :key="d.id" :value="d.name">{{ d.name }}</option>
|
||||
</select>
|
||||
<!-- 暂隐藏:隐藏已拒绝
|
||||
<div class="flex items-center gap-2">
|
||||
<input id="hideRejectedUsers" v-model="hideRejected" type="checkbox" class="w-4 h-4 rounded text-brand-600 focus:ring-brand-500 border-default" />
|
||||
<label for="hideRejectedUsers" class="text-sm text-secondary select-none">{{ t('admin.user.hideRejected') }}</label>
|
||||
<div class="users-element-filters">
|
||||
<ElInput
|
||||
v-model="userFilters.username"
|
||||
clearable
|
||||
class="users-filter-username"
|
||||
:placeholder="t('admin.user.filterUsername')"
|
||||
/>
|
||||
<ElInput
|
||||
v-model="userFilters.real_name"
|
||||
clearable
|
||||
class="users-filter-name"
|
||||
:placeholder="t('admin.user.filterRealName')"
|
||||
/>
|
||||
<ElSelect
|
||||
:model-value="userFilters.department || undefined"
|
||||
class="users-filter-dept"
|
||||
clearable
|
||||
:placeholder="t('admin.user.allDepts')"
|
||||
@update:model-value="onDepartmentChange"
|
||||
>
|
||||
<ElOption v-for="department in departments" :key="department.id" :label="department.name" :value="department.name" />
|
||||
</ElSelect>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<div class="admin-table-wrap relative">
|
||||
<div
|
||||
v-if="isListLoading"
|
||||
class="absolute inset-0 z-10 flex items-center justify-center rounded-2xl bg-surface/60"
|
||||
<ElTable
|
||||
v-loading="isListLoading"
|
||||
class="hx-admin-table"
|
||||
:data="users"
|
||||
row-key="id"
|
||||
:default-sort="defaultSort"
|
||||
:empty-text="t('admin.user.noUsers')"
|
||||
@selection-change="onSelectionChange"
|
||||
@sort-change="onSortChange"
|
||||
>
|
||||
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-brand-600" />
|
||||
</div>
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="px-6 py-4 w-12 text-center">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="w-4 h-4 rounded text-brand-600 focus:ring-brand-500 cursor-pointer border-default"
|
||||
:checked="allPaginatedUsersSelected"
|
||||
@change="toggleAllUsers(users)"
|
||||
/>
|
||||
</th>
|
||||
<th class="px-6 py-4 text-left text-xs">
|
||||
<SortableTableHeader
|
||||
column-key="username"
|
||||
:label="t('admin.user.headers.user')"
|
||||
:active-key="sortKey"
|
||||
:direction="sortDir"
|
||||
@sort="toggleSort"
|
||||
/>
|
||||
</th>
|
||||
<th class="px-6 py-4 text-left text-xs">{{ t('admin.user.fields.realName') }}</th>
|
||||
<th class="px-6 py-4 text-left text-xs">
|
||||
<SortableTableHeader
|
||||
column-key="department"
|
||||
:label="t('admin.user.headers.dept')"
|
||||
:active-key="sortKey"
|
||||
:direction="sortDir"
|
||||
@sort="toggleSort"
|
||||
/>
|
||||
</th>
|
||||
<th class="px-6 py-4 text-left text-xs">{{ t('admin.user.headers.role') }}</th>
|
||||
<th class="px-6 py-4 text-right text-xs">{{ t('admin.user.headers.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-if="usersTotal === 0 && !isListLoading">
|
||||
<td colspan="6" class="px-6 admin-table-empty">{{ t('admin.user.noUsers') }}</td>
|
||||
</tr>
|
||||
<tr v-for="user in users" :key="user.id" class="group">
|
||||
<td class="px-6 py-4 text-center">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="w-4 h-4 rounded text-brand-600 focus:ring-brand-500 cursor-pointer border-default"
|
||||
:checked="selectedUserIds.includes(user.id)"
|
||||
@change="toggleUserSelection(user.id)"
|
||||
/>
|
||||
</td>
|
||||
<td class="px-6 py-4">
|
||||
<div class="flex items-center">
|
||||
<div class="h-9 w-9 rounded-full bg-gradient-to-br from-brand-500 to-indigo-600 text-white flex items-center justify-center text-xs font-bold shadow-sm">
|
||||
{{ getUserAvatarLabel(user) }}
|
||||
</div>
|
||||
<div class="ml-3 text-sm font-medium text-primary">{{ user.username }}</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-primary">{{ user.real_name || '-' }}</td>
|
||||
<td class="px-6 py-4 text-sm text-muted">{{ user.department || '-' }}</td>
|
||||
<td class="px-6 py-4">
|
||||
<span
|
||||
class="px-2.5 py-0.5 rounded-full text-xs font-medium border"
|
||||
:class="user.is_platform_admin
|
||||
? 'bg-purple-50 text-purple-700 border-purple-100'
|
||||
: 'bg-blue-50 text-blue-700 border-blue-100'"
|
||||
>
|
||||
{{ adminRoleLabel(t, user.role, user.role_name) }}
|
||||
<ElTableColumn type="selection" width="64" reserve-selection />
|
||||
<ElTableColumn prop="username" :label="t('admin.user.headers.user')" sortable="custom" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<span class="inline-flex items-center gap-3">
|
||||
<span class="users-avatar">
|
||||
{{ getUserAvatarLabel(row) }}
|
||||
</span>
|
||||
<div
|
||||
v-if="user.feature_permissions?.training_hr_manage || user.feature_permissions?.['maintenance.ledger_write']"
|
||||
class="mt-2 flex flex-wrap gap-1.5"
|
||||
>
|
||||
<span
|
||||
v-if="user.feature_permissions?.training_hr_manage"
|
||||
class="inline-flex rounded-full border border-brand-100 bg-brand-50 px-2.5 py-0.5 text-xs font-medium text-brand-700"
|
||||
>
|
||||
{{ t('admin.user.fields.trainingHrManage') }}
|
||||
</span>
|
||||
<span
|
||||
v-if="user.feature_permissions?.['maintenance.ledger_write']"
|
||||
class="inline-flex rounded-full border border-brand-100 bg-brand-50 px-2.5 py-0.5 text-xs font-medium text-brand-700"
|
||||
>
|
||||
{{ t('admin.permRoles.features.maintenance_ledger_write') }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 text-right">
|
||||
<button
|
||||
type="button"
|
||||
class="text-brand-600 hover:text-brand-900 font-medium text-xs px-3 py-1.5 rounded-lg hover:bg-brand-50 transition-colors"
|
||||
@click="openEditUserModal(user)"
|
||||
>
|
||||
{{ t('admin.edit') }}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<span>{{ row.username }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn prop="real_name" :label="t('admin.user.fields.realName')" min-width="120">
|
||||
<template #default="{ row }">{{ row.real_name || '-' }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn prop="department" :label="t('admin.user.headers.dept')" sortable="custom" min-width="140">
|
||||
<template #default="{ row }">{{ row.department || '-' }}</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn :label="t('admin.user.headers.role')" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<ElTag :type="row.is_platform_admin ? 'warning' : 'primary'" effect="light">
|
||||
{{ adminRoleLabel(t, row.role, row.role_name) }}
|
||||
</ElTag>
|
||||
<div
|
||||
v-if="row.feature_permissions?.training_hr_manage || row.feature_permissions?.['maintenance.ledger_write']"
|
||||
class="mt-2 flex flex-wrap gap-1.5"
|
||||
>
|
||||
<ElTag v-if="row.feature_permissions?.training_hr_manage" size="small">
|
||||
{{ t('admin.user.fields.trainingHrManage') }}
|
||||
</ElTag>
|
||||
<ElTag v-if="row.feature_permissions?.['maintenance.ledger_write']" size="small">
|
||||
{{ t('admin.permRoles.features.maintenance_ledger_write') }}
|
||||
</ElTag>
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn :label="t('admin.user.headers.actions')" width="100" align="right">
|
||||
<template #default="{ row }">
|
||||
<ElButton link type="primary" @click="editUser(row as AdminUserRow)">{{ t('admin.edit') }}</ElButton>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
|
||||
<div class="px-4 pb-4 pt-2">
|
||||
<PaginationBar
|
||||
v-model:page="userPage"
|
||||
v-model:page-size="userPageSize"
|
||||
:total="usersTotal"
|
||||
:pages="usersPages"
|
||||
:page-size-options="[...userPageSizeOptions]"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<div class="hx-admin-pager">
|
||||
<ElPagination
|
||||
v-model:current-page="userPage"
|
||||
v-model:page-size="userPageSize"
|
||||
:total="usersTotal"
|
||||
:page-sizes="pageSizes"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
background
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<UserFormModal
|
||||
:visible="showUserModal"
|
||||
:form="editingUser"
|
||||
:agents="agents"
|
||||
:departments="departments"
|
||||
:roles="roles"
|
||||
:roles-configured="rolesConfigured"
|
||||
:is-saving="isSaving"
|
||||
@close="showUserModal = false"
|
||||
@save="saveUser"
|
||||
/>
|
||||
<UserFormModal
|
||||
:visible="showUserModal"
|
||||
:form="editingUser"
|
||||
:agents="agents"
|
||||
:departments="departments"
|
||||
:roles="roles"
|
||||
:roles-configured="rolesConfigured"
|
||||
:is-saving="isSaving"
|
||||
@close="showUserModal = false"
|
||||
@save="saveUser"
|
||||
/>
|
||||
|
||||
<BatchEditUserModal
|
||||
:visible="showBatchEditModal"
|
||||
:form="batchEditForm"
|
||||
:departments="departments"
|
||||
:roles="roles"
|
||||
:roles-configured="rolesConfigured"
|
||||
:selected-count="selectedUserIds.length"
|
||||
:is-saving="isSaving"
|
||||
@close="showBatchEditModal = false"
|
||||
@save="submitBatchEdit"
|
||||
/>
|
||||
<BatchEditUserModal
|
||||
:visible="showBatchEditModal"
|
||||
:form="batchEditForm"
|
||||
:departments="departments"
|
||||
:roles="roles"
|
||||
:roles-configured="rolesConfigured"
|
||||
:selected-count="selectedUserIds.length"
|
||||
:is-saving="isSaving"
|
||||
@close="showBatchEditModal = false"
|
||||
@save="submitBatchEdit"
|
||||
/>
|
||||
|
||||
<BatchPermissionModal
|
||||
:visible="showBatchPermissionModal"
|
||||
:form="batchPermissionForm"
|
||||
:agents="agents"
|
||||
:selected-count="selectedUserIds.length"
|
||||
:is-saving="isSaving"
|
||||
@close="showBatchPermissionModal = false"
|
||||
@save="submitBatchPermission"
|
||||
/>
|
||||
|
||||
<DeleteConfirmDialog
|
||||
v-model="showDeleteConfirmDialog"
|
||||
:message="deleteConfirmMessage"
|
||||
@confirm="confirmDelete"
|
||||
@cancel="closeDeleteConfirm"
|
||||
/>
|
||||
<DeleteConfirmDialog
|
||||
v-model="showRoleConfirm"
|
||||
:title="t('admin.permRoles.userRoleConfirmTitle')"
|
||||
:message="roleConfirmMessage"
|
||||
:confirm-text="t('admin.save')"
|
||||
confirm-tone="primary"
|
||||
:confirm-loading="isSaving"
|
||||
@confirm="confirmRoleChange"
|
||||
@cancel="closeRoleConfirm"
|
||||
/>
|
||||
</section>
|
||||
<BatchPermissionModal
|
||||
:visible="showBatchPermissionModal"
|
||||
:form="batchPermissionForm"
|
||||
:agents="agents"
|
||||
:selected-count="selectedUserIds.length"
|
||||
:is-saving="isSaving"
|
||||
@close="showBatchPermissionModal = false"
|
||||
@save="submitBatchPermission"
|
||||
/>
|
||||
</section>
|
||||
</ElConfigProvider>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.users-element-filters {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 16px 32px;
|
||||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||
}
|
||||
|
||||
.users-element-filters :deep(.el-input),
|
||||
.users-element-filters :deep(.el-select) {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.users-element-filters :deep(.users-filter-username) {
|
||||
width: 10rem;
|
||||
}
|
||||
|
||||
.users-element-filters :deep(.users-filter-name),
|
||||
.users-element-filters :deep(.users-filter-dept) {
|
||||
width: 11rem;
|
||||
}
|
||||
|
||||
.users-avatar {
|
||||
display: flex;
|
||||
height: 2.25rem;
|
||||
width: 2.25rem;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 9999px;
|
||||
background-image: linear-gradient(to bottom right, #0ea5e9, #4f46e5);
|
||||
font-size: var(--el-font-size-extra-small);
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user