feat: harden ai agent admin workflow experience

This commit is contained in:
2026-06-22 04:50:11 +08:00
parent ae29c24529
commit 4ec846a702
385 changed files with 61461 additions and 5886 deletions
@@ -3,14 +3,20 @@ import type { User } from '#/api/core/user';
import { computed, onMounted, ref, watch } from 'vue';
import { ElAvatar, ElPopover } from 'element-plus';
import { Network } from '@vben/icons';
import { ElAvatar, ElPopover, ElTooltip } from 'element-plus';
import { getUserDetailApi } from '#/api/core/user';
import DeptTag from '#/components/dept-tag/index.vue';
import PostTag from '#/components/post-tag/index.vue';
import RoleTag from '#/components/role-tag/index.vue';
import { getFileUrl } from '#/composables/useFileUrl';
import { $t } from '#/locales';
import { generateAvatarGradient, generateAvatarText } from '#/utils/avatar';
import UserProfileDialog from './UserProfileDialog.vue';
defineOptions({
name: 'UserAvatar',
});
@@ -92,6 +98,14 @@ const userDetail = ref<User>();
const loading = ref(false);
const hasLoaded = ref(false);
// 用户详情 Dialog
const profileDialogVisible = ref(false);
function openProfileDialog() {
popoverVisible.value = false;
profileDialogVisible.value = true;
}
// 获取有效的 ID
const effectiveUserId = computed(() => {
return props.userId || props.user?.id;
@@ -319,6 +333,18 @@ watch(
<div class="user-name">{{ userDetail.name }}</div>
<div class="user-username">@{{ userDetail.username }}</div>
</div>
<!-- 操作按钮 -->
<div class="user-actions">
<ElTooltip
:content="$t('user-avatar.profile.organization')"
placement="top"
>
<button class="action-btn" @click="openProfileDialog">
<Network :size="15" />
</button>
</ElTooltip>
</div>
</div>
<!-- 详细信息 -->
@@ -344,7 +370,7 @@ watch(
<div v-if="userDetail.post_id" class="detail-item">
<span class="detail-label">岗位</span>
<span class="detail-value">
{{ userDetail.post_name || userDetail.post_id }}
<PostTag :post-id="userDetail.post_id" />
</span>
</div>
<div
@@ -391,6 +417,13 @@ watch(
</div>
</ElPopover>
<!-- 用户详情 Dialog -->
<UserProfileDialog
v-if="effectiveUserId"
v-model="profileDialogVisible"
:user-id="effectiveUserId"
/>
<!-- Popover -->
<div
v-if="!(showPopover && effectiveUserId)"
@@ -705,6 +738,32 @@ watch(
}
}
.user-actions {
display: flex;
gap: 6px;
padding: 8px 0;
.action-btn {
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
padding: 0;
color: var(--el-text-color-secondary);
// background: var(--el-fill-color-light);
border: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: var(--el-color-primary);
background: var(--el-color-primary-light-9);
}
}
}
.user-details {
padding-top: 12px;