chore: awesome

This commit is contained in:
lencx
2023-01-20 21:28:57 +08:00
parent 1af173cb24
commit 5f1c33d750
18 changed files with 359 additions and 46 deletions

View File

@@ -96,13 +96,16 @@ export default function SyncCustom() {
const handleOk = () => {
formRef.current?.form?.validateFields()
.then((vals: Record<string, any>) => {
let data = [];
switch (opInfo.opType) {
case 'new': data = opAdd(vals); break;
case 'edit': data = opReplace(opInfo?.opRecord?.[opSafeKey], vals); break;
default: break;
if (opInfo.opType === 'new') {
const data = opAdd(vals);
modelSet(data);
message.success('Data added successfully');
}
if (opInfo.opType === 'edit') {
const data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);
modelSet(data);
message.success('Data updated successfully');
}
modelSet(data);
hide();
})
};