review:【antd/ele】代码迁移的 review

This commit is contained in:
YunaiV
2025-11-25 21:13:46 +08:00
parent b4a679dd08
commit eb27bd5c6d
22 changed files with 52 additions and 44 deletions

View File

@@ -20,6 +20,8 @@ import {
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
defineOptions({ name: 'TabImage' });
const props = defineProps<{
modelValue: Reply;
}>();

View File

@@ -21,6 +21,8 @@ import {
import { UploadType, useBeforeUpload } from '#/utils/useUpload';
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
defineOptions({ name: 'TabMusic' });
const props = defineProps<{
modelValue: Reply;
}>();
@@ -69,7 +71,6 @@ function onUploadSuccess(res: any) {
/** 选择素材 */
function selectMaterial(item: any) {
showDialog.value = false;
reply.value.thumbMediaId = item.mediaId;
reply.value.thumbMediaUrl = item.url;
}

View File

@@ -55,6 +55,7 @@ function onDelete() {
</ElButton>
</ElCol>
</div>
<!-- 选择素材 -->
<ElCol :span="24" v-if="!reply.content">
<ElRow class="text-center" align="middle">

View File

@@ -31,6 +31,7 @@ const props = defineProps<{
const emit = defineEmits<{
(e: 'update:modelValue', v: Reply): void;
}>();
const accessStore = useAccessStore();
const UPLOAD_URL = `${import.meta.env.VITE_BASE_URL}/admin-api/mp/material/upload-temporary`;
const HEADERS = { Authorization: `Bearer ${accessStore.accessToken}` };

View File

@@ -22,21 +22,21 @@ export interface Reply {
}
/** 利用旧的 reply[accountId, type] 初始化新的 Reply */
export const createEmptyReply = (old: Ref<Reply> | Reply): Reply => {
export function createEmptyReply(old: Ref<Reply> | Reply): Reply {
return {
accountId: unref(old).accountId,
type: unref(old).type,
name: null,
articles: [],
content: null,
mediaId: null,
url: null,
title: null,
description: null,
thumbMediaId: null,
thumbMediaUrl: null,
musicUrl: null,
hqMusicUrl: null,
introduction: null,
articles: [],
mediaId: null,
musicUrl: null,
name: null,
thumbMediaId: null,
thumbMediaUrl: null,
title: null,
type: unref(old).type,
url: null,
};
};
}