fix(组织架构):1.部门列表收窄(固定280px),编码列140→64;2.修复员工档案面板溢出视口——栅格子项未收敛min-width导致右侧列与操作按钮被裁掉不可点;3.部门/员工档案列表接入共用分页组件默认每页15条
deploy-hxtesting / build-and-deploy (push) Successful in 1m4s
deploy-hxtesting / build-and-deploy (push) Successful in 1m4s
This commit is contained in:
1 parent
0acea0eeb9
commit
eb09f8235b
1 file changed
+43
-6
@@ -21,7 +21,7 @@
|
||||
<span class="panel-box__title">部门</span>
|
||||
<t-button theme="primary" @click="openCreateDept">新增部门</t-button>
|
||||
</div>
|
||||
<t-table :data="depts" :columns="deptColumns" row-key="id" size="small">
|
||||
<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>
|
||||
@@ -29,6 +29,8 @@
|
||||
</div>
|
||||
</template>
|
||||
</t-table>
|
||||
<!-- 共用分页(000164):默认每页 15 条 -->
|
||||
<TrainingPagination v-model:current="deptPage" v-model:page-size="deptPageSize" :total="deptTotal" />
|
||||
</div>
|
||||
|
||||
<div class="panel-box org-layout__employees">
|
||||
@@ -64,7 +66,7 @@
|
||||
<t-button theme="primary" @click="importVisible = true">批量导入</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<t-table :data="employees" :columns="employeeColumns" row-key="id" size="small" :loading="loading">
|
||||
<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>
|
||||
@@ -90,6 +92,8 @@
|
||||
</div>
|
||||
</template>
|
||||
</t-table>
|
||||
<!-- 共用分页(000164):默认每页 15 条 -->
|
||||
<TrainingPagination v-model:current="employeePage" v-model:page-size="employeePageSize" :total="employeeTotal" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -321,6 +325,8 @@ import {
|
||||
} from '@/api/training'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import ResourceIcon from '@/components/icons/ResourceIcon.vue'
|
||||
import TrainingPagination from '../training/components/TrainingPagination.vue'
|
||||
import { useTrainingPager } from '../training/components/useTrainingPager'
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const loading = ref(false)
|
||||
@@ -518,9 +524,10 @@ const roleText = (r: string) => roleLabelOf(r, roleDict.value, true)
|
||||
|
||||
const deptColumns = [
|
||||
{ colKey: 'name', title: '部门名称' },
|
||||
{ colKey: 'code', title: '编码', width: 140 },
|
||||
// 000164:编码列收窄(0001 等短编码无需过宽列,原 140px 留白明显)
|
||||
{ colKey: 'code', title: '编码', width: 64 },
|
||||
// 窄屏下列宽超出面板时操作列随滚动固定在右侧,保证可见可点
|
||||
{ colKey: 'op', title: '操作', width: 140, fixed: 'right' },
|
||||
{ colKey: 'op', title: '操作', width: 116, fixed: 'right' },
|
||||
]
|
||||
|
||||
// 管理角色额外有「企微账号/设置角色」操作,操作列随之加宽(computed 随权限就绪刷新)
|
||||
@@ -597,6 +604,28 @@ watch(keyword, () => {
|
||||
searchTimer = setTimeout(() => loadEmployees(), 300)
|
||||
})
|
||||
|
||||
// 共用分页(000164):部门/员工档案列表默认每页 15 条;
|
||||
// 查找或增删改刷新列表后回到第 1 页
|
||||
const {
|
||||
page: deptPage,
|
||||
pageSize: deptPageSize,
|
||||
total: deptTotal,
|
||||
paged: pagedDepts,
|
||||
reset: resetDeptPage,
|
||||
} = useTrainingPager(depts)
|
||||
const {
|
||||
page: employeePage,
|
||||
pageSize: employeePageSize,
|
||||
total: employeeTotal,
|
||||
paged: pagedEmployees,
|
||||
reset: resetEmployeePage,
|
||||
} = useTrainingPager(employees)
|
||||
|
||||
watch([depts, employees], () => {
|
||||
resetDeptPage()
|
||||
resetEmployeePage()
|
||||
})
|
||||
|
||||
const loadAll = async () => {
|
||||
// 平台用户一并拉取,用于姓名兜底联查(user_id → 用户名)。
|
||||
const [d, u] = await Promise.all([
|
||||
@@ -824,16 +853,24 @@ onMounted(() => {
|
||||
padding: var(--app-space-3) 0 var(--app-space-6);
|
||||
}
|
||||
|
||||
// 3/7 分栏:部门列占 3,员工档案列占 7;窄屏退化为单列
|
||||
// 分栏:部门列收窄为固定宽度(000164,原 3fr 过宽且编码列留白明显),
|
||||
// 员工档案占剩余全部宽度;窄屏退化为单列
|
||||
.org-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 3fr 7fr;
|
||||
grid-template-columns: 280px minmax(0, 1fr);
|
||||
gap: 12px;
|
||||
align-items: start;
|
||||
|
||||
@media (max-width: 900px) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
// 000164 栅格子项收敛:员工档案表格/工具行较宽,缺省 min-width 会把
|
||||
// 栅格轨道撑出视口,右侧列与操作按钮被裁掉不可见不可点;
|
||||
// 收敛后表格在面板内横向滚动,操作列 fixed:right 始终可见
|
||||
> .panel-box {
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.panel-box {
|
||||
|
||||
Reference in new issue
Block a user