This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user