mirror of
https://gitee.com/yudaocode/yudao-ui-admin-vben.git
synced 2025-12-30 10:32:25 +00:00
feat:【ele/antd】profile todo 优化
This commit is contained in:
@@ -100,7 +100,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemSocialUserApi.SocialUser>,
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 解绑账号 */
|
/** 解绑账号 */
|
||||||
|
|||||||
@@ -21,10 +21,13 @@ const emit = defineEmits<{
|
|||||||
(e: 'success'): void;
|
(e: 'success'): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// TODO @puhui999:展示貌似不太对;应该是左右,不是上下哈
|
|
||||||
const [Form, formApi] = useVbenForm({
|
const [Form, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
labelWidth: 70,
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
},
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
labelWidth: 80,
|
||||||
},
|
},
|
||||||
schema: [
|
schema: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const avatar = computed(
|
|||||||
() => props.profile?.avatar || preferences.app.defaultAvatar,
|
() => props.profile?.avatar || preferences.app.defaultAvatar,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO @puhui999:头像上传没跑通
|
|
||||||
async function handelUpload({
|
async function handelUpload({
|
||||||
file,
|
file,
|
||||||
filename,
|
filename,
|
||||||
@@ -37,9 +36,9 @@ async function handelUpload({
|
|||||||
const { httpRequest } = useUpload();
|
const { httpRequest } = useUpload();
|
||||||
// 将 Blob 转换为 File
|
// 将 Blob 转换为 File
|
||||||
const fileObj = new File([file], filename, { type: file.type });
|
const fileObj = new File([file], filename, { type: file.type });
|
||||||
const avatar = await httpRequest(fileObj);
|
const res = await httpRequest(fileObj);
|
||||||
// 2. 更新用户头像
|
// 2. 更新用户头像(httpRequest 返回 { url: string })
|
||||||
await updateUserProfile({ avatar });
|
await updateUserProfile({ avatar: res.url });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -57,8 +56,8 @@ async function handelUpload({
|
|||||||
</ElTooltip>
|
</ElTooltip>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<ElDescriptions :column="2">
|
<ElDescriptions :column="2" border>
|
||||||
<ElDescriptionsItem>
|
<ElDescriptionsItem label="用户账号">
|
||||||
<template #label>
|
<template #label>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<IconifyIcon icon="ant-design:user-outlined" class="mr-1" />
|
<IconifyIcon icon="ant-design:user-outlined" class="mr-1" />
|
||||||
@@ -116,7 +115,11 @@ async function handelUpload({
|
|||||||
所属岗位
|
所属岗位
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
{{ profile.posts.map((post) => post.name).join(',') }}
|
{{
|
||||||
|
profile.posts && profile.posts.length > 0
|
||||||
|
? profile.posts.map((post) => post.name).join(',')
|
||||||
|
: '-'
|
||||||
|
}}
|
||||||
</ElDescriptionsItem>
|
</ElDescriptionsItem>
|
||||||
<ElDescriptionsItem>
|
<ElDescriptionsItem>
|
||||||
<template #label>
|
<template #label>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
} as VxeTableGridOptions<SystemSocialUserApi.SocialUser>,
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 解绑账号 */
|
/** 解绑账号 */
|
||||||
@@ -167,13 +167,12 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<ElCard v-for="item in allBindList" :key="item.type" class="!mb-2">
|
<ElCard v-for="item in allBindList" :key="item.type" class="!mb-2">
|
||||||
<div class="flex w-full items-center gap-4">
|
<div class="flex w-full items-center gap-4">
|
||||||
<!-- TODO @puhui999:图片大小不太对 -->
|
|
||||||
<ElImage
|
<ElImage
|
||||||
:src="item.img"
|
:src="item.img"
|
||||||
:width="40"
|
style="width: 40px; height: 40px"
|
||||||
:height="40"
|
|
||||||
:alt="item.title"
|
:alt="item.title"
|
||||||
:preview="false"
|
:preview-disabled="true"
|
||||||
|
fit="contain"
|
||||||
/>
|
/>
|
||||||
<div class="flex flex-1 items-center justify-between">
|
<div class="flex flex-1 items-center justify-between">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
|
|||||||
Reference in New Issue
Block a user