From 80bb508e78ba47405ca0f84fa29d35a8db8e21d7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 13 Nov 2025 13:57:17 +0800 Subject: [PATCH] =?UTF-8?q?review=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90m?= =?UTF-8?q?p=E3=80=91material=E3=80=81message=20=E7=9A=84=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=20v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/mp/account/index.ts | 1 + .../mp/components/wx-account-select/index.ts | 1 + .../mp/components/wx-account-select/main.vue | 16 ++++++---------- .../views/mp/components/wx-location/main.vue | 1 + .../mp/components/wx-material-select/main.vue | 19 ++++++++++--------- .../mp/components/wx-msg/components/Msg.vue | 2 ++ .../components/wx-msg/components/MsgEvent.vue | 2 ++ .../components/wx-msg/components/MsgList.vue | 5 +++++ .../src/views/mp/components/wx-msg/main.vue | 8 +++----- .../src/views/mp/components/wx-music/main.vue | 2 ++ .../src/views/mp/components/wx-news/main.vue | 2 ++ .../wx-reply/components/TabImage.vue | 5 ++++- .../wx-reply/components/TabMusic.vue | 5 ++++- .../wx-reply/components/TabNews.vue | 3 +++ .../wx-reply/components/TabText.vue | 2 ++ .../wx-reply/components/TabVideo.vue | 5 ++++- .../wx-reply/components/TabVoice.vue | 5 ++++- .../src/views/mp/components/wx-reply/main.vue | 9 +++++---- .../mp/components/wx-voice-play/main.vue | 4 ++-- .../mp/material/components/ImageTable.vue | 4 ++++ .../mp/material/components/UploadVideo.vue | 8 ++------ .../mp/material/components/VideoTable.vue | 6 ++++-- .../mp/material/components/VoiceTable.vue | 6 ++++-- apps/web-antd/src/views/mp/material/index.vue | 3 +-- .../src/views/mp/message/MessageTable.vue | 16 ++++++++++------ apps/web-antd/src/views/mp/message/index.vue | 5 ++--- 26 files changed, 90 insertions(+), 55 deletions(-) diff --git a/apps/web-antd/src/api/mp/account/index.ts b/apps/web-antd/src/api/mp/account/index.ts index ec156eca2..5bd402230 100644 --- a/apps/web-antd/src/api/mp/account/index.ts +++ b/apps/web-antd/src/api/mp/account/index.ts @@ -17,6 +17,7 @@ export namespace MpAccountApi { createTime?: Date; } + // TODO @dylan:这个直接使用 Account,简化一点; export interface AccountSimple { id: number; name: string; diff --git a/apps/web-antd/src/views/mp/components/wx-account-select/index.ts b/apps/web-antd/src/views/mp/components/wx-account-select/index.ts index 038205bef..0272e5beb 100644 --- a/apps/web-antd/src/views/mp/components/wx-account-select/index.ts +++ b/apps/web-antd/src/views/mp/components/wx-account-select/index.ts @@ -1 +1,2 @@ +// TODO @dylan:yudao-ui-admin-vben-v5/apps/web-antd/src/views/mp/components 要不加个 index.ts,统一 export 所有的组件 export { default as WxAccountSelect } from './main.vue'; diff --git a/apps/web-antd/src/views/mp/components/wx-account-select/main.vue b/apps/web-antd/src/views/mp/components/wx-account-select/main.vue index 3ee327338..96514a1db 100644 --- a/apps/web-antd/src/views/mp/components/wx-account-select/main.vue +++ b/apps/web-antd/src/views/mp/components/wx-account-select/main.vue @@ -12,23 +12,19 @@ import { getSimpleAccountList } from '#/api/mp/account'; defineOptions({ name: 'WxAccountSelect' }); -// 定义事件 const emit = defineEmits<{ (e: 'change', id: number, name: string): void; }>(); -// 消息弹窗 + const { push } = useRouter(); -// 当前选中的公众号 const account: MpAccountApi.Account = reactive({ id: -1, name: '', -}); +}); // 当前选中的公众号 +const accountList = ref([]); // 公众号列表 -// 公众号列表 -const accountList = ref([]); - -// 查询公众号列表 +/** 查询公众号列表 */ async function handleQuery() { accountList.value = await getSimpleAccountList(); if (accountList.value.length === 0) { @@ -46,7 +42,7 @@ async function handleQuery() { } } -// 切换选中公众号 +/** 切换选中公众号 */ function onChanged(id: SelectValue) { const found = accountList.value.find((v) => v.id === id); if (found) { @@ -55,7 +51,7 @@ function onChanged(id: SelectValue) { } } -// 初始化 +/** 初始化 */ onMounted(handleQuery); diff --git a/apps/web-antd/src/views/mp/components/wx-location/main.vue b/apps/web-antd/src/views/mp/components/wx-location/main.vue index eac33c164..89fc1e605 100644 --- a/apps/web-antd/src/views/mp/components/wx-location/main.vue +++ b/apps/web-antd/src/views/mp/components/wx-location/main.vue @@ -7,6 +7,7 @@ import { Col, Row } from 'ant-design-vue'; defineOptions({ name: 'WxLocation' }); +// TODO @dylan:apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/form.vue 参考这个,从后端拿 key 哈 const props = withDefaults( defineProps<{ label: string; diff --git a/apps/web-antd/src/views/mp/components/wx-material-select/main.vue b/apps/web-antd/src/views/mp/components/wx-material-select/main.vue index 0f81fd24b..5c1e2fa17 100644 --- a/apps/web-antd/src/views/mp/components/wx-material-select/main.vue +++ b/apps/web-antd/src/views/mp/components/wx-material-select/main.vue @@ -35,20 +35,17 @@ const emit = defineEmits<{ (e: 'selectMaterial', item: any): void; }>(); -// 遮罩层 -const loading = ref(false); -// 总条数 -const total = ref(0); -// 数据列表 -const list = ref([]); -// 查询参数 +const loading = ref(false); // 遮罩层 +const total = ref(0); // 总条数 +const list = ref([]); // 数据列表 const queryParams = reactive({ accountId: props.accountId, pageNo: 1, pageSize: 10, -}); +}); // 查询参数 const voiceGridColumns: VxeTableGridOptions['columns'] = [ + // TODO @dylan:any 有 linter 告警;看看别的模块哈 { field: 'mediaId', title: '编号', @@ -83,6 +80,7 @@ const voiceGridColumns: VxeTableGridOptions['columns'] = [ ]; const videoGridColumns: VxeTableGridOptions['columns'] = [ + // TODO @dylan:any 有 linter 告警;看看别的模块哈 { field: 'mediaId', title: '编号', @@ -139,9 +137,11 @@ const [VoiceGrid, voiceGridApi] = useVbenVxeGrid({ ajax: { query: async ({ page }, { accountId }) => { const finalAccountId = accountId ?? queryParams.accountId; + // TODO @dylan 这里简化成 !finalAccountId 是不是可以哈。 if (finalAccountId === undefined || finalAccountId === null) { return { list: [], total: 0 }; } + // TODO @dylan:不要带 MpMaterialApi; return await MpMaterialApi.getMaterialPage({ pageNo: page.currentPage, pageSize: page.pageSize, @@ -158,7 +158,7 @@ const [VoiceGrid, voiceGridApi] = useVbenVxeGrid({ toolbarConfig: { refresh: true, }, - } as VxeTableGridOptions, + } as VxeTableGridOptions, // TODO @dylan:这里有 linter 告警;看看别的模块哈 }); const [VideoGrid, videoGridApi] = useVbenVxeGrid({ @@ -383,6 +383,7 @@ watch(