From 77596d716b3fb57f250989649d6b3636070767b6 Mon Sep 17 00:00:00 2001 From: jawe <532159638@qq.com> Date: Mon, 24 Nov 2025 11:04:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20[mp]=20=E5=9B=BE=E6=96=87=E5=8F=91?= =?UTF-8?q?=E8=A1=A8=E8=AE=B0=E5=BD=95=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-antd/src/views/mp/freePublish/data.ts | 59 ++++++ .../src/views/mp/freePublish/index.vue | 183 +++++++++++++++--- apps/web-ele/src/views/mp/freePublish/data.ts | 59 ++++++ .../src/views/mp/freePublish/index.vue | 170 ++++++++++++++++ 4 files changed, 449 insertions(+), 22 deletions(-) create mode 100644 apps/web-antd/src/views/mp/freePublish/data.ts create mode 100644 apps/web-ele/src/views/mp/freePublish/data.ts create mode 100644 apps/web-ele/src/views/mp/freePublish/index.vue diff --git a/apps/web-antd/src/views/mp/freePublish/data.ts b/apps/web-antd/src/views/mp/freePublish/data.ts new file mode 100644 index 000000000..cfcac30be --- /dev/null +++ b/apps/web-antd/src/views/mp/freePublish/data.ts @@ -0,0 +1,59 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeGridPropTypes } from '#/adapter/vxe-table'; +import type { MpAccountApi } from '#/api/mp/account'; + +import { formatDateTime } from '@vben/utils'; + +import { getSimpleAccountList } from '#/api/mp/account'; + +let accountList: MpAccountApi.AccountSimple[] = []; +getSimpleAccountList().then((data) => (accountList = data)); + +/** 搜索表单配置 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'accountId', + label: '公众号', + component: 'Select', + componentProps: { + options: accountList.map((item) => ({ + label: item.name, + value: item.id, + })), + placeholder: '请选择公众号', + clearable: true, + }, + }, + ]; +} + +/** 表格列配置 */ +export function useGridColumns(): VxeGridPropTypes.Columns { + return [ + { + field: 'cover', + title: '图片', + width: 360, + slots: { default: 'cover' }, + }, + { + field: 'title', + title: '标题', + slots: { default: 'title' }, + }, + { + field: 'updateTime', + title: '修改时间', + formatter: ({ row }) => { + return formatDateTime(row.updateTime * 1000); + }, + }, + { + title: '操作', + width: 120, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/mp/freePublish/index.vue b/apps/web-antd/src/views/mp/freePublish/index.vue index 89f457302..d2d033d9b 100644 --- a/apps/web-antd/src/views/mp/freePublish/index.vue +++ b/apps/web-antd/src/views/mp/freePublish/index.vue @@ -1,29 +1,168 @@ + + diff --git a/apps/web-ele/src/views/mp/freePublish/data.ts b/apps/web-ele/src/views/mp/freePublish/data.ts new file mode 100644 index 000000000..cfcac30be --- /dev/null +++ b/apps/web-ele/src/views/mp/freePublish/data.ts @@ -0,0 +1,59 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeGridPropTypes } from '#/adapter/vxe-table'; +import type { MpAccountApi } from '#/api/mp/account'; + +import { formatDateTime } from '@vben/utils'; + +import { getSimpleAccountList } from '#/api/mp/account'; + +let accountList: MpAccountApi.AccountSimple[] = []; +getSimpleAccountList().then((data) => (accountList = data)); + +/** 搜索表单配置 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'accountId', + label: '公众号', + component: 'Select', + componentProps: { + options: accountList.map((item) => ({ + label: item.name, + value: item.id, + })), + placeholder: '请选择公众号', + clearable: true, + }, + }, + ]; +} + +/** 表格列配置 */ +export function useGridColumns(): VxeGridPropTypes.Columns { + return [ + { + field: 'cover', + title: '图片', + width: 360, + slots: { default: 'cover' }, + }, + { + field: 'title', + title: '标题', + slots: { default: 'title' }, + }, + { + field: 'updateTime', + title: '修改时间', + formatter: ({ row }) => { + return formatDateTime(row.updateTime * 1000); + }, + }, + { + title: '操作', + width: 120, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/mp/freePublish/index.vue b/apps/web-ele/src/views/mp/freePublish/index.vue new file mode 100644 index 000000000..7a8cdbfa1 --- /dev/null +++ b/apps/web-ele/src/views/mp/freePublish/index.vue @@ -0,0 +1,170 @@ + + + + + From 2926a8aa365b26097537465ce18f56867fd089fc Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 24 Nov 2025 11:47:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd/ele=E3=80=91?= =?UTF-8?q?=E3=80=90mp=E3=80=91freePublish=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/views/mp/draft/index.vue | 4 +-- .../src/views/mp/freePublish/index.vue | 21 ++++++++++------ apps/web-ele/src/views/mp/draft/index.vue | 4 +-- .../src/views/mp/freePublish/index.vue | 25 +++++++++++-------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/apps/web-antd/src/views/mp/draft/index.vue b/apps/web-antd/src/views/mp/draft/index.vue index cce7fdddc..ea3a87094 100644 --- a/apps/web-antd/src/views/mp/draft/index.vue +++ b/apps/web-antd/src/views/mp/draft/index.vue @@ -72,12 +72,12 @@ async function handleDelete(row: MpDraftApi.DraftArticle) { return; } const hideLoading = message.loading({ - content: '删除中...', + content: $t('ui.actionMessage.deleting'), duration: 0, }); try { await deleteDraft(accountId, row.mediaId); - message.success('删除成功'); + message.success($t('ui.actionMessage.deleteSuccess')); handleRefresh(); } finally { hideLoading(); diff --git a/apps/web-antd/src/views/mp/freePublish/index.vue b/apps/web-antd/src/views/mp/freePublish/index.vue index d2d033d9b..77c46e070 100644 --- a/apps/web-antd/src/views/mp/freePublish/index.vue +++ b/apps/web-antd/src/views/mp/freePublish/index.vue @@ -1,7 +1,8 @@