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