fix: mp tag
This commit is contained in:
@@ -3,10 +3,8 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { MpTagApi } from '#/api/mp/tag';
|
||||
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { useTabs } from '@vben/hooks';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
@@ -18,9 +16,6 @@ import { $t } from '#/locales';
|
||||
import { useGridColumns } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const { push } = useRouter(); // 路由
|
||||
const tabs = useTabs();
|
||||
|
||||
const accountId = ref(-1);
|
||||
const accountOptions = ref<{ label: string; value: number }[]>([]);
|
||||
|
||||
@@ -37,28 +32,28 @@ async function getAccountList() {
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
gridApi.setState({
|
||||
formOptions: {
|
||||
schema: [
|
||||
{
|
||||
fieldName: 'accountId',
|
||||
label: '公众号',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: accountOptions,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
gridApi.formApi.setValues({
|
||||
accountId: accountId.value,
|
||||
});
|
||||
} else {
|
||||
message.error('未配置公众号,请在【公众号管理 -> 账号管理】菜单,进行配置');
|
||||
await push({ name: 'MpAccount' });
|
||||
tabs.closeCurrentTab();
|
||||
// await push({ name: 'MpAccount' });
|
||||
// tabs.closeCurrentTab();
|
||||
}
|
||||
gridApi.setState({
|
||||
formOptions: {
|
||||
schema: [
|
||||
{
|
||||
fieldName: 'accountId',
|
||||
label: '公众号',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: accountOptions.value || [],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
}
|
||||
/** 刷新表格 */
|
||||
function onRefresh() {
|
||||
@@ -146,12 +141,12 @@ onMounted(async () => {
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="onRefresh" />
|
||||
<Grid table-title="公众号账号列表">
|
||||
<Grid table-title="公众号标签列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['公众号账号']),
|
||||
label: $t('ui.actionTitle.create', ['公众号标签']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['mp:tag:create'],
|
||||
|
||||
Reference in New Issue
Block a user