|
|
|
@ -47,7 +47,8 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
|
|
|
|
|
}, |
|
|
|
|
// validation for unique column name
|
|
|
|
|
{ |
|
|
|
|
validator: (rule: any, value: any, callback: (errMsg?: string) => void) => { |
|
|
|
|
validator: (rule: any, value: any) => { |
|
|
|
|
return new Promise<void>((resolve, reject) => { |
|
|
|
|
if ( |
|
|
|
|
meta.value?.columns?.some( |
|
|
|
|
(c) => |
|
|
|
@ -57,10 +58,10 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
|
|
|
|
|
(value || '').toLowerCase() === (c.title || '').toLowerCase()), |
|
|
|
|
) |
|
|
|
|
) { |
|
|
|
|
callback('Duplicate column name') |
|
|
|
|
return reject(new Error('Duplicate column name')) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
callback() |
|
|
|
|
resolve() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|