This commit is contained in:
zlwu committed 2026-05-26 19:04:27 +08:00
1 parent 4a00f21bfb
commit edf88dc016
1503 files changed
+329728 -41987

No files matched your search

+69 -23
View File
@@ -22,8 +22,12 @@
<div class="filter-actions-row">
<span class="filter-hint">按职位名称、编码模糊查询。</span>
<div class="filter-actions-end">
<el-button class="btn-ghost" @click="handleReset"><el-icon><RefreshLeft /></el-icon>重置</el-button>
<el-button class="btn-main" type="primary" @click="handleSearch"><el-icon><Search /></el-icon>搜索</el-button>
<el-button class="btn-ghost" @click="handleReset"
><el-icon><RefreshLeft /></el-icon>重置</el-button
>
<el-button class="btn-main" type="primary" @click="handleSearch"
><el-icon><Search /></el-icon>搜索</el-button
>
</div>
</div>
</el-form>
@@ -68,19 +72,51 @@
header-align="center"
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
/>
<el-table-column prop="postName" label="职位名称" min-width="140" align="center" header-align="center" />
<el-table-column prop="postCode" label="职位编码" min-width="120" align="center" header-align="center" />
<el-table-column prop="status" label="状态" min-width="80" align="center" header-align="center">
<el-table-column
prop="postName"
label="职位名称"
min-width="140"
align="center"
header-align="center"
/>
<el-table-column
prop="postCode"
label="职位编码"
min-width="120"
align="center"
header-align="center"
/>
<el-table-column
prop="status"
label="状态"
min-width="80"
align="center"
header-align="center"
>
<template #default="{ row }">
<el-tag :type="row.status === '1' ? 'success' : 'info'" size="small">
{{ row.status === '1' ? '正常' : '停用' }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="180" align="center" header-align="center" />
<el-table-column label="操作" min-width="480" fixed="right" align="center" header-align="center">
<el-table-column
prop="createTime"
label="创建时间"
min-width="180"
align="center"
header-align="center"
/>
<el-table-column
label="操作"
min-width="480"
fixed="right"
align="center"
header-align="center"
>
<template #default="{ row }">
<el-button class="btn-op-item" @click="handleView(row)"><el-icon><View /></el-icon>查看</el-button>
<el-button class="btn-op-item" @click="handleView(row)"
><el-icon><View /></el-icon>查看</el-button
>
<el-button class="btn-op-item primary" @click="handlePostBindUsers(row)">
<el-icon><User /></el-icon>
关联用户
@@ -165,10 +201,7 @@
destroy-on-close
:close-on-click-modal="false"
>
<DialogFormBody
:loading="postBindLoading"
body-class="post-bind-dialog-body"
>
<DialogFormBody :loading="postBindLoading" body-class="post-bind-dialog-body">
<p v-if="postBindPostName" class="post-bind-subtitle">
职位:<strong>{{ postBindPostName }}</strong>
</p>
@@ -275,7 +308,16 @@
<script setup lang="ts">
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Plus, Close, Check, User, View, Briefcase, RefreshLeft, Search } from '@element-plus/icons-vue'
import {
Plus,
Close,
Check,
User,
View,
Briefcase,
RefreshLeft,
Search
} from '@element-plus/icons-vue'
import DialogFormBody from '@/components/business/dialog-form-body/index.vue'
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import { MAX_ADMIN_LIST_PAGE_SIZE } from '@/utils/fetch-paged-list'
@@ -334,7 +376,11 @@
fields: [
{ label: '职位名称', value: row.postName },
{ label: '职位编码', value: row.postCode },
{ label: '状态', value: row.status === '1' ? '正常' : '停用', tagType: row.status === '1' ? 'success' : 'info' },
{
label: '状态',
value: row.status === '1' ? '正常' : '停用',
tagType: row.status === '1' ? 'success' : 'info'
},
{ label: '创建时间', value: row.createTime },
{ label: '备注', value: row.remark, span: true }
]
@@ -343,9 +389,7 @@
if (viewBoundUserNames.value.length > 0) {
sections.push({
title: '关联用户',
fields: [
{ label: '已关联用户', value: viewBoundUserNames.value.join('、'), span: true }
]
fields: [{ label: '已关联用户', value: viewBoundUserNames.value.join('、'), span: true }]
})
}
return sections
@@ -355,10 +399,7 @@
viewBoundUserNames.value = []
viewVisible.value = true
try {
const [boundRes] = await Promise.all([
fetchPostBoundUserIds(row.id),
fetchDeptTree()
])
const [boundRes] = await Promise.all([fetchPostBoundUserIds(row.id), fetchDeptTree()])
const boundIds = boundRes?.userIds || []
if (boundIds.length === 0) return
const users = await fetchAllUsersForPostBind()
@@ -384,7 +425,10 @@
const postBindUserFilterDeptId = ref<string | null>(null)
const postBindUserKeyword = ref('')
function findPostBindDeptNodeById(nodes: Api.Dept.DeptItem[], id: string): Api.Dept.DeptItem | null {
function findPostBindDeptNodeById(
nodes: Api.Dept.DeptItem[],
id: string
): Api.Dept.DeptItem | null {
for (const n of nodes) {
if (n.id === id) return n
if (n.children?.length) {
@@ -641,7 +685,9 @@
async function handleBatchDelete() {
const ids = selectedRows.value.map((r) => r.id)
if (!ids.length) return
await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 个职位吗?`, '提示', { type: 'warning' })
await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 个职位吗?`, '提示', {
type: 'warning'
})
await withFullscreenLoading(async () => {
for (const id of ids) {
await fetchDeletePost(id)