🐛 短信消息模板保存

pull/90/head
xiuchen 2024-05-22 16:44:09 +08:00
parent 8352af67b6
commit 541a88ad0c
1 changed files with 5 additions and 5 deletions

View File

@ -345,13 +345,13 @@ export default (props: { visible: boolean }) => {
}, },
}} }}
onFinish={async (values) => { onFinish={async (values) => {
const fieldsValue = editorFormRef.current?.getFieldsValue();
const templates: { type: string; code: string }[] = []; const templates: { type: string; code: string }[] = [];
editableKeys?.forEach((i, index) => { editableKeys?.forEach((key) => {
if (fieldsValue?.[index]?.code !== undefined) { const fieldValue = editorFormRef.current?.getFieldValue(key);
if (fieldValue !== undefined) {
const config: { type: string; code: string } = { const config: { type: string; code: string } = {
type: `${i}`, type: `${key}`,
code: fieldsValue[index].code, code: fieldValue?.code,
}; };
templates.push(config); templates.push(config);
} }