From 0ea99e5aa86ed77035bce4ee450410b556b58dcd Mon Sep 17 00:00:00 2001 From: hw Date: Thu, 20 Nov 2025 11:05:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ele=E6=94=B9=E5=9B=9E=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-ele/src/views/mp/autoReply/data.ts | 4 ++-- apps/web-ele/src/views/mp/autoReply/index.vue | 13 +++++++++++-- .../src/views/mp/autoReply/modules/content.vue | 15 ++++++++++----- apps/web-ele/src/views/mp/components/index.ts | 16 +++++++--------- .../mp/components/wx-material-select/index.ts | 4 ++-- .../src/views/mp/components/wx-msg/index.ts | 4 ++-- .../src/views/mp/components/wx-news/wx-news.vue | 4 ++-- apps/web-ele/src/views/mp/draft/data.ts | 17 +---------------- apps/web-ele/src/views/mp/draft/index.vue | 12 +++++++++++- packages/constants/src/biz-infra-enum.ts | 2 +- 10 files changed, 49 insertions(+), 42 deletions(-) diff --git a/apps/web-ele/src/views/mp/autoReply/data.ts b/apps/web-ele/src/views/mp/autoReply/data.ts index 4a9bf03ee..d72fa9643 100644 --- a/apps/web-ele/src/views/mp/autoReply/data.ts +++ b/apps/web-ele/src/views/mp/autoReply/data.ts @@ -8,7 +8,7 @@ import { DICT_TYPE } from '@vben/constants'; import { getDictObj, getDictOptions } from '@vben/hooks'; import { getSimpleAccountList } from '#/api/mp/account'; -import { ReplySelect } from '#/views/mp/components'; +import { WxReplySelect } from '#/views/mp/components'; import { MsgType } from './modules/types'; @@ -143,7 +143,7 @@ export function useFormSchema(msgType: MsgType): VbenFormSchema[] { schema.push({ fieldName: 'reply', label: '回复消息', - component: markRaw(ReplySelect), + component: markRaw(WxReplySelect), }); return schema; } diff --git a/apps/web-ele/src/views/mp/autoReply/index.vue b/apps/web-ele/src/views/mp/autoReply/index.vue index e548829ef..f3938b595 100644 --- a/apps/web-ele/src/views/mp/autoReply/index.vue +++ b/apps/web-ele/src/views/mp/autoReply/index.vue @@ -18,6 +18,7 @@ import { import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import * as MpAutoReplyApi from '#/api/mp/autoReply'; import { $t } from '#/locales'; +import { WxAccountSelect } from '#/views/mp/components'; import { useGridColumns, useGridFormSchema } from './data'; import Content from './modules/content.vue'; @@ -27,6 +28,12 @@ import { MsgType } from './modules/types'; defineOptions({ name: 'MpAutoReply' }); const msgType = ref(String(MsgType.Keyword)); // 消息类型 + +/** 公众号变化时查询数据 */ +function handleAccountChange(accountId: number) { + gridApi.formApi.setValues({ accountId }); + gridApi.formApi.submitForm(); +} /** 切换回复类型 */ async function onTabChange(tabName: string) { msgType.value = tabName; @@ -91,8 +98,6 @@ const [FormModal, formModalApi] = useVbenModal({ const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { schema: useGridFormSchema(), - // 表单值变化时自动提交,这样 accountId 会被正确传递到查询函数 - submitOnChange: true, }, gridOptions: { columns: useGridColumns(Number(msgType.value) as MsgType), @@ -109,6 +114,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }); }, }, + autoLoad: false, }, rowConfig: { keyField: 'id', @@ -148,6 +154,9 @@ const showCreateButton = computed(() => { +