Merge remote-tracking branch 'yudao/dev' into dev
This commit is contained in:
@@ -43,6 +43,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
// 打开时,进行 loading 加载。后续 CropperImage 组件加载完毕,会自动关闭 loading(通过 handleReady)
|
// 打开时,进行 loading 加载。后续 CropperImage 组件加载完毕,会自动关闭 loading(通过 handleReady)
|
||||||
modalLoading(true);
|
modalLoading(true);
|
||||||
|
// TODO @puhui999:这里比 ele 多了,是符合预期的哇?
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
img.src = src.value;
|
img.src = src.value;
|
||||||
img.addEventListener('load', () => {
|
img.addEventListener('load', () => {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ const apiSelectRule = [
|
|||||||
field: 'data',
|
field: 'data',
|
||||||
title: '请求参数 JSON 格式',
|
title: '请求参数 JSON 格式',
|
||||||
props: {
|
props: {
|
||||||
autoSize: true,
|
autoSize: true, // 特殊:ele 里是 autosize,antd 里是 autoSize
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
placeholder: '{"type": 1}',
|
placeholder: '{"type": 1}',
|
||||||
},
|
},
|
||||||
@@ -155,7 +155,7 @@ const apiSelectRule = [
|
|||||||
info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表
|
info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表
|
||||||
(data: any)=>{ label: string; value: any }[]`,
|
(data: any)=>{ label: string; value: any }[]`,
|
||||||
props: {
|
props: {
|
||||||
autoSize: true,
|
autoSize: true, // 特殊:ele 里是 autosize,antd 里是 autoSize
|
||||||
rows: { minRows: 2, maxRows: 6 },
|
rows: { minRows: 2, maxRows: 6 },
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
placeholder: `
|
placeholder: `
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export function useDictSelectRule() {
|
|||||||
title: label,
|
title: label,
|
||||||
info: '',
|
info: '',
|
||||||
$required: false,
|
$required: false,
|
||||||
modelField: 'value',
|
modelField: 'value', // 特殊:ele 里是 model-value,antd 里是 value
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props(_: any, { t }: any) {
|
props(_: any, { t }: any) {
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ defineExpose({
|
|||||||
class="duration-400 absolute inset-0 flex cursor-pointer items-center justify-center rounded-full bg-black bg-opacity-40 opacity-0 transition-opacity group-hover:opacity-100"
|
class="duration-400 absolute inset-0 flex cursor-pointer items-center justify-center rounded-full bg-black bg-opacity-40 opacity-0 transition-opacity group-hover:opacity-100"
|
||||||
:style="getImageWrapperStyle"
|
:style="getImageWrapperStyle"
|
||||||
>
|
>
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-avatar.vue 里的 Icon 么? -->
|
||||||
<span
|
<span
|
||||||
:style="{
|
:style="{
|
||||||
...getImageWrapperStyle,
|
...getImageWrapperStyle,
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ async function handleOk() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<!-- TODO @puhui999:antd 版本里是 2/3 宽度,两边要对齐么? -->
|
||||||
<Modal
|
<Modal
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:confirm-text="$t('ui.cropper.okText')"
|
:confirm-text="$t('ui.cropper.okText')"
|
||||||
@@ -119,10 +120,13 @@ async function handleOk() {
|
|||||||
:title="$t('ui.cropper.modalTitle')"
|
:title="$t('ui.cropper.modalTitle')"
|
||||||
class="w-[800px]"
|
class="w-[800px]"
|
||||||
>
|
>
|
||||||
|
<!-- TODO @puhui999:antd 版本有个 h-96,两边要对齐么? -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<!-- 左侧区域 -->
|
<!-- 左侧区域 -->
|
||||||
|
<!-- TODO @puhui999:antd 版本是 h-full w-3/5 两边要对齐么? -->
|
||||||
<div class="h-[340px] w-[55%]">
|
<div class="h-[340px] w-[55%]">
|
||||||
<!-- 裁剪器容器 -->
|
<!-- 裁剪器容器 -->
|
||||||
|
<!-- TODO @puhui999:antd class 简单一点,看看要不要对齐 -->
|
||||||
<div
|
<div
|
||||||
class="h-[300px] bg-[#eee]"
|
class="h-[300px] bg-[#eee]"
|
||||||
style="
|
style="
|
||||||
@@ -158,6 +162,7 @@ async function handleOk() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 工具栏 -->
|
<!-- 工具栏 -->
|
||||||
|
<!-- TODO @puhui999:antd 是 mt-4,看看两边要不要对齐 -->
|
||||||
<div class="mt-2.5 flex items-center justify-between">
|
<div class="mt-2.5 flex items-center justify-between">
|
||||||
<ElUpload
|
<ElUpload
|
||||||
:before-upload="handleBeforeUpload"
|
:before-upload="handleBeforeUpload"
|
||||||
@@ -169,6 +174,7 @@ async function handleOk() {
|
|||||||
placement="bottom"
|
placement="bottom"
|
||||||
>
|
>
|
||||||
<ElButton size="small" type="primary">
|
<ElButton size="small" type="primary">
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span class="icon-[ant-design--upload-outlined]"></span>
|
<span class="icon-[ant-design--upload-outlined]"></span>
|
||||||
@@ -186,6 +192,7 @@ async function handleOk() {
|
|||||||
@click="handlerToolbar('reset')"
|
@click="handlerToolbar('reset')"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span class="icon-[ant-design--reload-outlined]"></span>
|
<span class="icon-[ant-design--reload-outlined]"></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -204,6 +211,7 @@ async function handleOk() {
|
|||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<span
|
<span
|
||||||
class="icon-[ant-design--rotate-left-outlined]"
|
class="icon-[ant-design--rotate-left-outlined]"
|
||||||
></span>
|
></span>
|
||||||
@@ -222,6 +230,7 @@ async function handleOk() {
|
|||||||
@click="handlerToolbar('rotate', 45)"
|
@click="handlerToolbar('rotate', 45)"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span
|
<span
|
||||||
class="icon-[ant-design--rotate-right-outlined]"
|
class="icon-[ant-design--rotate-right-outlined]"
|
||||||
@@ -241,6 +250,7 @@ async function handleOk() {
|
|||||||
@click="handlerToolbar('scaleX')"
|
@click="handlerToolbar('scaleX')"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span class="icon-[vaadin--arrows-long-h]"></span>
|
<span class="icon-[vaadin--arrows-long-h]"></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -258,6 +268,7 @@ async function handleOk() {
|
|||||||
@click="handlerToolbar('scaleY')"
|
@click="handlerToolbar('scaleY')"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span class="icon-[vaadin--arrows-long-v]"></span>
|
<span class="icon-[vaadin--arrows-long-v]"></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -275,6 +286,7 @@ async function handleOk() {
|
|||||||
@click="handlerToolbar('zoom', 0.1)"
|
@click="handlerToolbar('zoom', 0.1)"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span class="icon-[ant-design--zoom-in-outlined]"></span>
|
<span class="icon-[ant-design--zoom-in-outlined]"></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -292,6 +304,7 @@ async function handleOk() {
|
|||||||
@click="handlerToolbar('zoom', -0.1)"
|
@click="handlerToolbar('zoom', -0.1)"
|
||||||
>
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
<!-- TODO @puhui999:可以改成类似 /Users/yunai/Java/yudao-ui-admin-vben-v5/apps/web-antd/src/components/cropper/cropper-modal.vue 里的 Icon 么? -->
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span class="icon-[ant-design--zoom-out-outlined]"></span>
|
<span class="icon-[ant-design--zoom-out-outlined]"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ const apiSelectRule = [
|
|||||||
field: 'data',
|
field: 'data',
|
||||||
title: '请求参数 JSON 格式',
|
title: '请求参数 JSON 格式',
|
||||||
props: {
|
props: {
|
||||||
autosize: true,
|
autosize: true, // 特殊:ele 里是 autosize,antd 里是 autoSize
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
placeholder: '{"type": 1}',
|
placeholder: '{"type": 1}',
|
||||||
},
|
},
|
||||||
@@ -155,7 +155,7 @@ const apiSelectRule = [
|
|||||||
info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表
|
info: `data 为接口返回值,需要写一个匿名函数解析返回值为选择器 options 列表
|
||||||
(data: any)=>{ label: string; value: any }[]`,
|
(data: any)=>{ label: string; value: any }[]`,
|
||||||
props: {
|
props: {
|
||||||
autosize: true,
|
autosize: true, // 特殊:ele 里是 autosize,antd 里是 autoSize
|
||||||
rows: { minRows: 2, maxRows: 6 },
|
rows: { minRows: 2, maxRows: 6 },
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
placeholder: `
|
placeholder: `
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export function useDictSelectRule() {
|
|||||||
title: label,
|
title: label,
|
||||||
info: '',
|
info: '',
|
||||||
$required: false,
|
$required: false,
|
||||||
modelField: 'model-value',
|
modelField: 'model-value', // 特殊:ele 里是 model-value,antd 里是 value
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props(_: any, { t }: any) {
|
props(_: any, { t }: any) {
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ async function handleSubmit(values: Recordable<any>) {
|
|||||||
await smsResetPassword({ mobile, code, password });
|
await smsResetPassword({ mobile, code, password });
|
||||||
ElMessage.success($t('authentication.resetPasswordSuccess'));
|
ElMessage.success($t('authentication.resetPasswordSuccess'));
|
||||||
// 重置成功后跳转到首页
|
// 重置成功后跳转到首页
|
||||||
router.push('/');
|
await router.push('/');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('重置密码失败:', error);
|
console.error('重置密码失败:', error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -23,11 +23,7 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
const [Form, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
componentProps: {
|
labelWidth: 70,
|
||||||
class: 'w-full',
|
|
||||||
},
|
|
||||||
formItemClass: 'col-span-2',
|
|
||||||
labelWidth: 80,
|
|
||||||
},
|
},
|
||||||
schema: [
|
schema: [
|
||||||
{
|
{
|
||||||
@@ -104,7 +100,7 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mt-16px md:w-full lg:w-1/2 2xl:w-2/5">
|
<div class="mt-4 md:w-full lg:w-1/2 2xl:w-2/5">
|
||||||
<Form />
|
<Form />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -36,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 res = await httpRequest(fileObj);
|
const avatar = await httpRequest(fileObj);
|
||||||
// 2. 更新用户头像(httpRequest 返回 { url: string })
|
// 2. 更新用户头像
|
||||||
await updateUserProfile({ avatar: res.url });
|
await updateUserProfile({ avatar });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ async function handleSubmit(values: Recordable<any>) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="mt-[16px] md:w-full lg:w-1/2 2xl:w-2/5">
|
<div class="mt-4 md:w-full lg:w-1/2 2xl:w-2/5">
|
||||||
<Form />
|
<Form />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ onMounted(async () => {
|
|||||||
<ElCard class="h-full w-full" v-loading="formLoading">
|
<ElCard class="h-full w-full" v-loading="formLoading">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
|
<!-- @puhui999:idea 这边会有告警 -->
|
||||||
<ElTabs v-model="activeTabName" @tab-change="handleTabChange">
|
<ElTabs v-model="activeTabName" @tab-change="handleTabChange">
|
||||||
<ElTabPane label="基础设置" name="info" />
|
<ElTabPane label="基础设置" name="info" />
|
||||||
<ElTabPane label="价格库存" name="sku" />
|
<ElTabPane label="价格库存" name="sku" />
|
||||||
|
|||||||
Reference in New Issue
Block a user