Compare commits

...

12 Commits

Author SHA1 Message Date
wxy 1307eaf651 Revert "Merge remote-tracking branch 'origin/jgqweb'"
This reverts commit 1648f3df96, reversing
changes made to c76d6beeb0.
2025-08-04 17:10:11 +08:00
wxy d25a34e579 Revert "add:添加了岗位信息,实现了通过岗位查询到该岗位的角色的功能"
This reverts commit a72aaafdfb.
2025-08-04 17:07:06 +08:00
wxy fcd9604272 Revert "Merge branch 'ljy/master'"
This reverts commit 2492a57b88, reversing
changes made to 1648f3df96.
2025-08-04 16:59:54 +08:00
wxy 4ca2696896 Revert "信息检索、爬虫设置相关组件提交"
This reverts commit 11c9d33f94.
2025-08-04 16:57:59 +08:00
wxy 11c9d33f94 信息检索、爬虫设置相关组件提交 2025-08-04 16:25:43 +08:00
Maple 2492a57b88 Merge branch 'ljy/master'
# Conflicts:
#	src/apis/system/post.ts
2025-08-04 14:55:23 +08:00
Mr.j 1648f3df96 Merge remote-tracking branch 'origin/jgqweb' 2025-08-04 11:54:12 +08:00
Mr.j 7246e8dc99 页面美化,隐藏搜索字段成弹窗形式 2025-08-01 17:59:51 +08:00
Mr.j eaec8547aa 优化分页查询无法绑定数据模型问题 2025-08-01 16:24:33 +08:00
Mr.j 543ab3d027 实现设备中心模块编辑,删除,查看详情,查看 2025-08-01 15:14:24 +08:00
Mr.j 1d16db937c 实现设备中心模块的页面搭建和分页查询以及手动新增弹窗页面 2025-07-31 17:32:21 +08:00
Mr.j 7fe24ac2cf 培训计划实现查询 2025-07-30 09:13:52 +08:00
2 changed files with 2 additions and 196 deletions

View File

@ -42,12 +42,4 @@ export function updatePost(postId: string, data: T.PostUpdateReq) {
*
*/
export function deletePost(postId: string) {
return http.del<any>(`${BASE_URL}/${postId}`);
}
/**
*
*/
export function getPostUsers(postId: string) {
return http.get<T.UserNewResp[]>(`${BASE_URL}/${postId}/user`);
}

View File

@ -24,50 +24,6 @@
{{ Number(record.status) === 1 ? '正常' : '停用' }}
</a-tag>
</template>
<template #postName="{ record }">
<a-dropdown trigger="hover" @visible-change="(visible) => onDropdownVisibleChange(visible, record)">
<a-link type="primary" :title="`点击查询 ${record.postName} 岗位下的用户信息`" @click="onPostClick(record)">
{{ record.postName }}
<template #icon>
<icon-user style="margin-right: 4px; font-size: 12px; color: #666;" />
<icon-down />
</template>
</a-link>
<template #content>
<a-doption
:value="record.postId"
:disabled="userLoadingMap[record.postId]"
>
<div v-if="userLoadingMap[record.postId]" class="loading-container">
<a-spin size="mini" />
<span style="margin-left: 8px;">加载中...</span>
</div>
<div v-else-if="postUsersMap[record.postId]?.length">
<div class="user-list">
<div class="user-list-header">
<span class="user-count">该岗位下有 {{ postUsersMap[record.postId].length }} 个用户</span>
</div>
<div class="user-item" v-for="user in postUsersMap[record.postId]" :key="user.userId">
<a-avatar :size="24" :src="user.avatar">
{{ user.name?.charAt(0) || user.account?.charAt(0) || 'U' }}
</a-avatar>
<div class="user-info">
<div class="user-name clickable" @click="onUserClick(user)" :title="`点击查看 ${user.name || user.account} 的详细信息`">{{ user.name || user.account }}</div>
<div class="user-detail">
<span v-if="user.mobile">手机: {{ user.mobile }}</span>
<span v-if="user.email">邮箱: {{ user.email }}</span>
</div>
</div>
</div>
</div>
</div>
<div v-else class="no-users">
该岗位暂无用户
</div>
</a-doption>
</template>
</a-dropdown>
</template>
<template #action="{ record }">
<a-space>
<a-link v-permission="['system:post:query']" title="详情" @click="onDetail(record)">详情</a-link>
@ -86,7 +42,6 @@
<PostAddModal ref="PostAddModalRef" @save-success="search" />
<PostDetailDrawer ref="PostDetailDrawerRef" />
<UserDetailDrawer ref="UserDetailDrawerRef" />
</GiPageLayout>
</template>
@ -94,10 +49,8 @@
import type { TableColumnData } from '@arco-design/web-vue'
import PostAddModal from './PostAddModal.vue'
import PostDetailDrawer from './PostDetailDrawer.vue'
import UserDetailDrawer from '../user/UserDetailDrawer.vue'
import { deletePost, listPost, getPostUsers } from '@/apis/system/post'
import { deletePost, listPost } from '@/apis/system/post'
import type { PostVO } from '@/apis/system/type'
import type { UserNewResp } from '@/apis/system/type'
import { useResetReactive, useTable } from '@/hooks'
import { isMobile } from '@/utils'
import has from '@/utils/has'
@ -145,10 +98,6 @@ const {
...queryForm,
}), { immediate: true })
//
const postUsersMap = ref<Record<string, UserNewResp[]>>({})
const userLoadingMap = ref<Record<string, boolean>>({})
const tableColumns = ref<TableColumnData[]>([
{
title: '序号',
@ -160,7 +109,6 @@ const tableColumns = ref<TableColumnData[]>([
{
title: '岗位名称',
dataIndex: 'postName',
slotName: 'postName',
minWidth: 140,
ellipsis: true,
tooltip: true,
@ -221,66 +169,8 @@ const onDelete = (record: PostVO) => {
})
}
//
const onDropdownVisibleChange = async (visible: boolean, record: PostVO) => {
if (visible && !postUsersMap.value[record.postId] && !userLoadingMap.value[record.postId]) {
//
userLoadingMap.value[record.postId] = true
try {
const response = await getPostUsers(record.postId)
if (response.success && response.data) {
postUsersMap.value[record.postId] = response.data
} else {
postUsersMap.value[record.postId] = []
}
} catch (error) {
console.error('获取岗位用户信息失败:', error)
postUsersMap.value[record.postId] = []
} finally {
userLoadingMap.value[record.postId] = false
}
}
}
//
const onPostClick = async (record: PostVO) => {
//
if (postUsersMap.value[record.postId]) {
return
}
//
userLoadingMap.value[record.postId] = true
try {
const response = await getPostUsers(record.postId)
if (response.success && response.data) {
postUsersMap.value[record.postId] = response.data
} else {
postUsersMap.value[record.postId] = []
}
} catch (error) {
console.error('获取岗位用户信息失败:', error)
postUsersMap.value[record.postId] = []
} finally {
userLoadingMap.value[record.postId] = false
}
}
//
const onUserClick = (user: UserNewResp) => {
UserDetailDrawerRef.value?.onOpen(user.userId)
}
const PostAddModalRef = ref<InstanceType<typeof PostAddModal>>()
const PostDetailDrawerRef = ref<InstanceType<typeof PostDetailDrawer>>()
const UserDetailDrawerRef = ref<InstanceType<typeof UserDetailDrawer>>()
//
const onAdd = () => {
@ -298,80 +188,4 @@ const onDetail = (record: PostVO) => {
}
</script>
<style scoped lang="scss">
.loading-container {
display: flex;
align-items: center;
padding: 8px;
}
.user-list {
min-width: 300px;
max-width: 400px;
.user-list-header {
padding: 8px 12px;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 8px;
.user-count {
font-size: 12px;
color: #666;
}
}
.user-item {
display: flex;
align-items: center;
padding: 8px 12px;
border-bottom: 1px solid #f5f5f5;
&:last-child {
border-bottom: none;
}
.user-info {
margin-left: 8px;
flex: 1;
.user-name {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 2px;
&.clickable {
cursor: pointer;
color: #165dff;
transition: color 0.2s ease;
&:hover {
color: #0e42d2;
text-decoration: underline;
}
}
}
.user-detail {
font-size: 12px;
color: #666;
span {
margin-right: 8px;
&:last-child {
margin-right: 0;
}
}
}
}
}
}
.no-users {
padding: 16px;
text-align: center;
color: #999;
font-size: 14px;
}
</style>
<style scoped lang="scss"></style>