feat(优化):年培训计划:已确认行的删除按钮、勾选框、批量删除均仅超级管理员可见/可用;提示文案随角色变化
deploy-hxtesting / build-and-deploy (push) Successful in 1m14s
deploy-hxtesting / build-and-deploy (push) Successful in 1m14s
课程管理:canDeleteCourse 超管不限状态/部门(已审核/已发布行可删,确认弹窗文案区分);批量删除按钮超管可见 月培训计划:已发布行的「删除」仅超管可见(普通维护角色仍只能删未发布计划),行内确认弹窗替代原 window.confirm,失败时透出后端文案 Training.vue:canManageTabs 加入 super_admin,纯超管(未兼其他角色)也能进入这三个页面执行删除
This commit is contained in:
1 parent
a448598df5
commit
2f1cda34da
19 files changed
+589
-278
No files matched your search
@@ -21,14 +21,17 @@
|
||||
<span class="panel-box__title">部门</span>
|
||||
<t-button theme="primary" @click="openCreateDept">新增部门</t-button>
|
||||
</div>
|
||||
<t-table :data="pagedDepts" :columns="deptColumns" row-key="id" size="small">
|
||||
<template #op="{ row }">
|
||||
<div class="op-group">
|
||||
<t-button variant="text" theme="primary" size="small" @click="onEditDept(row)">修改</t-button>
|
||||
<t-button variant="text" theme="danger" size="small" @click="onDeleteDept(row)">删除</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-table>
|
||||
<!-- 表格滚动区:面板满屏,表头/分页固定,仅数据行滚动(height=100% 启用固定表头) -->
|
||||
<div class="table-scroll">
|
||||
<t-table :data="pagedDepts" :columns="deptColumns" row-key="id" size="small" height="100%">
|
||||
<template #op="{ row }">
|
||||
<div class="op-group">
|
||||
<t-button variant="text" theme="primary" size="small" @click="onEditDept(row)">修改</t-button>
|
||||
<t-button variant="text" theme="danger" size="small" @click="onDeleteDept(row)">删除</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-table>
|
||||
</div>
|
||||
<!-- 共用分页(000164):默认每页 15 条 -->
|
||||
<TrainingPagination v-model:current="deptPage" v-model:page-size="deptPageSize" :total="deptTotal" />
|
||||
</div>
|
||||
@@ -66,32 +69,35 @@
|
||||
<t-button theme="primary" @click="importVisible = true">批量导入</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<t-table :data="pagedEmployees" :columns="employeeColumns" row-key="id" size="small" :loading="loading">
|
||||
<template #user_name="{ row }">
|
||||
<t-tooltip :content="employeeName(row)" :disabled="!employeeName(row)">
|
||||
<span class="employee-name">{{ employeeName(row) || '-' }}</span>
|
||||
</t-tooltip>
|
||||
</template>
|
||||
<template #dept_name="{ row }">{{ row.dept_name || '-' }}</template>
|
||||
<template #wecom_userid="{ row }">
|
||||
<span :class="row.wecom_userid ? '' : 'wecom-missing'">{{ row.wecom_userid || '未绑定' }}</span>
|
||||
</template>
|
||||
<template #roles="{ row }">
|
||||
<t-tag v-for="r in row.roles || []" :key="r" variant="light" size="small" class="role-tag">{{ roleText(r) }}</t-tag>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<t-tag v-if="row.status === 'active'" theme="success" variant="light" size="small">在职</t-tag>
|
||||
<t-tag v-else-if="row.status === 'inactive'" theme="danger" variant="light" size="small">离职</t-tag>
|
||||
<t-tag v-else theme="default" variant="light" size="small">{{ row.status || '-' }}</t-tag>
|
||||
</template>
|
||||
<template #op="{ row }">
|
||||
<div class="op-group">
|
||||
<t-button variant="text" theme="primary" size="small" @click="onEditEmployee(row)">修改</t-button>
|
||||
<t-button v-if="canManage" variant="text" theme="primary" size="small" @click="openWecom(row)">企微账号</t-button>
|
||||
<t-button v-if="canManage" variant="text" theme="primary" size="small" @click="openRoles(row)">设置角色</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-table>
|
||||
<!-- 表格滚动区:面板满屏,表头/分页固定,仅数据行滚动(height=100% 启用固定表头) -->
|
||||
<div class="table-scroll">
|
||||
<t-table :data="pagedEmployees" :columns="employeeColumns" row-key="id" size="small" height="100%" :loading="loading">
|
||||
<template #user_name="{ row }">
|
||||
<t-tooltip :content="employeeName(row)" :disabled="!employeeName(row)">
|
||||
<span class="employee-name">{{ employeeName(row) || '-' }}</span>
|
||||
</t-tooltip>
|
||||
</template>
|
||||
<template #dept_name="{ row }">{{ row.dept_name || '-' }}</template>
|
||||
<template #wecom_userid="{ row }">
|
||||
<span :class="row.wecom_userid ? '' : 'wecom-missing'">{{ row.wecom_userid || '未绑定' }}</span>
|
||||
</template>
|
||||
<template #roles="{ row }">
|
||||
<t-tag v-for="r in row.roles || []" :key="r" variant="light" size="small" class="role-tag">{{ roleText(r) }}</t-tag>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<t-tag v-if="row.status === 'active'" theme="success" variant="light" size="small">在职</t-tag>
|
||||
<t-tag v-else-if="row.status === 'inactive'" theme="danger" variant="light" size="small">离职</t-tag>
|
||||
<t-tag v-else theme="default" variant="light" size="small">{{ row.status || '-' }}</t-tag>
|
||||
</template>
|
||||
<template #op="{ row }">
|
||||
<div class="op-group">
|
||||
<t-button variant="text" theme="primary" size="small" @click="onEditEmployee(row)">修改</t-button>
|
||||
<t-button v-if="canManage" variant="text" theme="primary" size="small" @click="openWecom(row)">企微账号</t-button>
|
||||
<t-button v-if="canManage" variant="text" theme="primary" size="small" @click="openRoles(row)">设置角色</t-button>
|
||||
</div>
|
||||
</template>
|
||||
</t-table>
|
||||
</div>
|
||||
<!-- 共用分页(000164):默认每页 15 条 -->
|
||||
<TrainingPagination v-model:current="employeePage" v-model:page-size="employeePageSize" :total="employeeTotal" />
|
||||
</div>
|
||||
@@ -854,15 +860,23 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
// 分栏:部门列收窄为固定宽度(000164,原 3fr 过宽且编码列留白明显),
|
||||
// 员工档案占剩余全部宽度;窄屏退化为单列
|
||||
// 员工档案占剩余全部宽度;窄屏退化为单列。
|
||||
// 满屏布局(000164 布局诉求):栅格占满页身剩余高度,两面板各自内部滚动 ——
|
||||
// 面板头(标题/操作/查找)/表头/分页固定,仅表格数据区滚动;窄屏单列回退整页滚动
|
||||
.org-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 280px minmax(0, 1fr);
|
||||
// 满屏关键:行高锁定为容器高(grid 行默认 auto 会被内容撑开,面板 height:100%
|
||||
// 的百分比链随之失效,表头/分页固定就不生效了)
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
gap: 12px;
|
||||
align-items: start;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
|
||||
@media (max-width: 900px) {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: none;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
// 000164 栅格子项收敛:员工档案表格/工具行较宽,缺省 min-width 会把
|
||||
@@ -875,6 +889,31 @@ onMounted(() => {
|
||||
|
||||
.panel-box {
|
||||
.training-panel-box();
|
||||
|
||||
.org-layout & {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
@media (max-width: 900px) {
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// 面板头固定,表格滚动区撑满剩余高度(表格 height=100% 启用 TDesign 固定表头;
|
||||
// .t-table 根也要撑满 100%,否则百分比退化为内容高、表头固定不生效)
|
||||
.org-layout & > .table-scroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
|
||||
> .t-table {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.org-layout & > .training-pagination {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.form-hint {
|
||||
|
||||
Reference in new issue
Block a user