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(() => { +