fix: ele改回使用账号选择组件

This commit is contained in:
hw
2025-11-20 11:05:18 +08:00
parent cf14806b6f
commit 0ea99e5aa8
10 changed files with 49 additions and 42 deletions

View File

@@ -10,6 +10,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { deleteDraft, getDraftPage } from '#/api/mp/draft';
import * as MpFreePublishApi from '#/api/mp/freePublish';
import { WxAccountSelect } from '#/views/mp/components';
import { createEmptyNewsItem } from '#/views/mp/draft/modules/types';
import { useGridColumns, useGridFormSchema } from './data';
@@ -28,10 +29,15 @@ function handleRefresh() {
gridApi.query();
}
/** 公众号变化时查询数据 */
function handleAccountChange(accountId: number) {
gridApi.formApi.setValues({ accountId });
gridApi.formApi.submitForm();
}
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
submitOnChange: true,
},
gridOptions: {
columns: useGridColumns(),
@@ -60,6 +66,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
};
},
},
autoLoad: false,
},
rowConfig: {
keyField: 'mediaId',
@@ -175,6 +182,9 @@ async function handleDelete(row: Article) {
<FormModal @success="handleRefresh" />
<Grid table-title="草稿列表">
<template #form-accountId>
<WxAccountSelect @change="handleAccountChange" />
</template>
<template #toolbar-tools>
<TableAction
:actions="[