feat: tagEditor
Some checks failed
coverage CI / build (push) Has been cancelled

This commit is contained in:
2025-09-24 11:09:02 +08:00
parent 67b9a74212
commit 12495b6d85
11 changed files with 461 additions and 87 deletions

View File

@@ -1,6 +1,5 @@
import type {
ProColumns,
ProDescriptionsItemProps,
ProFormColumnsType,
} from '@ant-design/pro-components';
import dayjs from 'dayjs';
@@ -160,7 +159,7 @@ export const formColumns = (): ProFormColumnsType[] => [
},
];
export const formTestColumns = (type: string): ProFormColumnsType[] => [
export const formTestColumns = (): ProFormColumnsType[] => [
{
title: '模板内容',
dataIndex: 'content',

View File

@@ -15,18 +15,17 @@ import { formStatusType } from '@/constants';
import {
createMailAccount,
deleteMailAccount,
getMailAccount,
getMailAccountPage,
type MailAccountVO,
updateMailAccount,
} from '@/services/system/message/mail/account';
import { baseTenantColumns, formColumns, formTestColumns } from './config';
import { baseTenantColumns, formColumns } from './config';
const SyStemMessageSmsTemplate = () => {
const tableRef = useRef<ActionType>(null);
const configurableDrawerRef = useRef<ConfigurableDrawerFormRef>(null);
const [type, setType] = useState<'create' | 'update' | 'test'>('create');
const testRef = useRef<ConfigurableDrawerFormRef>(null);
// const testRef = useRef<ConfigurableDrawerFormRef>(null);
const [currentItem, setCurrentItem] = useState<MailAccountVO>();
const onFetch = async (
params: MailAccountVO & {
@@ -46,11 +45,11 @@ const SyStemMessageSmsTemplate = () => {
};
};
const handleSend = async (record: MailAccountVO) => {
setType('test');
setCurrentItem(record);
testRef.current?.open(record);
};
// const handleSend = async (record: MailAccountVO) => {
// setType("test");
// setCurrentItem(record);
// testRef.current?.open(record);
// };
const handleEdit = (record: MailAccountVO) => {
setType('update');
@@ -68,10 +67,10 @@ const SyStemMessageSmsTemplate = () => {
if (type === 'create') {
await createMailAccount(values);
message.success('创建成功');
} else {
} else if (currentItem?.id) {
await updateMailAccount({
...values,
id: currentItem!.id,
id: currentItem.id,
});
message.success('编辑成功');
}
@@ -97,7 +96,7 @@ const SyStemMessageSmsTemplate = () => {
fixed: 'right',
width: 120,
render: (
text: React.ReactNode,
_text: React.ReactNode,
record: MailAccountVO,
_: number,
action: ProCoreActionType | undefined,