-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
📷 复现步骤
🏞 期望结果
💻 复现代码
const editable = useMemo<RowEditableConfig<T>>(
() => ({
actionRender: (
_row: any,
_config: any,
defaultDoms: { save: any; cancel: any }
) => [defaultDoms.save, defaultDoms.cancel],
onSave: async (key, record, origin, newLineConfig) => {
if (!isEqual(record, origin)) {
const exclude = ['id', 'create_time', 'index']
if (options?.modifyExclude?.length) {
exclude.push(...options?.modifyExclude)
}
try {
const { msg } = await request<Response>(
options?.url?.update || '',
{
method: 'POST',
params: { id: record.id },
data: omit(record, exclude)
}
)
tableRef.current?.reload()
notification.success({
description: msg,
message: '操作提示'
})
} catch (error) {
console.error('保存数据错误:', error)
}
}
}
}),
[options]
)© 版本信息
- ProComponents 版本: 3.1.0-0
- umi 版本:4.6.20
- antd 版本:6.1.4
- 浏览器环境 Chrome
- 开发环境 [e.g. mac OS]
🚑 其他信息
Metadata
Metadata
Assignees
Labels
No labels