feat:【ele/antd】profile todo 优化

This commit is contained in:
puhui999
2025-12-28 18:55:07 +08:00
parent 6353f0a8e9
commit aa95d0e87c
4 changed files with 20 additions and 15 deletions

View File

@@ -100,7 +100,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
} as VxeTableGridOptions<SystemSocialUserApi.SocialUser>,
},
});
/** 解绑账号 */

View File

@@ -21,10 +21,13 @@ const emit = defineEmits<{
(e: 'success'): void;
}>();
// TODO @puhui999展示貌似不太对应该是左右不是上下哈
const [Form, formApi] = useVbenForm({
commonConfig: {
labelWidth: 70,
componentProps: {
class: 'w-full',
},
formItemClass: 'col-span-2',
labelWidth: 80,
},
schema: [
{

View File

@@ -25,7 +25,6 @@ const avatar = computed(
() => props.profile?.avatar || preferences.app.defaultAvatar,
);
// TODO @puhui999头像上传没跑通
async function handelUpload({
file,
filename,
@@ -37,9 +36,9 @@ async function handelUpload({
const { httpRequest } = useUpload();
// 将 Blob 转换为 File
const fileObj = new File([file], filename, { type: file.type });
const avatar = await httpRequest(fileObj);
// 2. 更新用户头像
await updateUserProfile({ avatar });
const res = await httpRequest(fileObj);
// 2. 更新用户头像httpRequest 返回 { url: string }
await updateUserProfile({ avatar: res.url });
}
</script>
@@ -57,8 +56,8 @@ async function handelUpload({
</ElTooltip>
</div>
<div class="mt-8">
<ElDescriptions :column="2">
<ElDescriptionsItem>
<ElDescriptions :column="2" border>
<ElDescriptionsItem label="用户账号">
<template #label>
<div class="flex items-center">
<IconifyIcon icon="ant-design:user-outlined" class="mr-1" />
@@ -116,7 +115,11 @@ async function handelUpload({
所属岗位
</div>
</template>
{{ profile.posts.map((post) => post.name).join(',') }}
{{
profile.posts && profile.posts.length > 0
? profile.posts.map((post) => post.name).join(',')
: '-'
}}
</ElDescriptionsItem>
<ElDescriptionsItem>
<template #label>

View File

@@ -100,7 +100,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
} as VxeTableGridOptions<SystemSocialUserApi.SocialUser>,
},
});
/** 解绑账号 */
@@ -167,13 +167,12 @@ onMounted(() => {
>
<ElCard v-for="item in allBindList" :key="item.type" class="!mb-2">
<div class="flex w-full items-center gap-4">
<!-- TODO @puhui999图片大小不太对 -->
<ElImage
:src="item.img"
:width="40"
:height="40"
style="width: 40px; height: 40px"
:alt="item.title"
:preview="false"
:preview-disabled="true"
fit="contain"
/>
<div class="flex flex-1 items-center justify-between">
<div class="flex flex-col">