|
|
@ -13,6 +13,7 @@ import { |
|
|
|
createEventHook, |
|
|
|
createEventHook, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
fieldRequiredValidator, |
|
|
|
fieldRequiredValidator, |
|
|
|
|
|
|
|
fieldLengthValidator, |
|
|
|
getDateFormat, |
|
|
|
getDateFormat, |
|
|
|
getDateTimeFormat, |
|
|
|
getDateTimeFormat, |
|
|
|
getUIDTIcon, |
|
|
|
getUIDTIcon, |
|
|
@ -110,12 +111,12 @@ const data = reactive<{ |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const validators = computed(() => |
|
|
|
const validators = computed(() => |
|
|
|
data.tables.reduce<Record<string, [ReturnType<typeof fieldRequiredValidator>]>>((acc, table, tableIdx) => { |
|
|
|
data.tables.reduce<Record<string, [ReturnType<typeof fieldRequiredValidator>]>>((acc: Record<string, any>, table, tableIdx) => { |
|
|
|
acc[`tables.${tableIdx}.table_name`] = [fieldRequiredValidator()] |
|
|
|
acc[`tables.${tableIdx}.table_name`] = [fieldRequiredValidator()] |
|
|
|
hasSelectColumn.value[tableIdx] = false |
|
|
|
hasSelectColumn.value[tableIdx] = false |
|
|
|
|
|
|
|
|
|
|
|
table.columns?.forEach((column, columnIdx) => { |
|
|
|
table.columns?.forEach((column, columnIdx) => { |
|
|
|
acc[`tables.${tableIdx}.columns.${columnIdx}.column_name`] = [fieldRequiredValidator()] |
|
|
|
acc[`tables.${tableIdx}.columns.${columnIdx}.column_name`] = [fieldRequiredValidator(), fieldLengthValidator()] |
|
|
|
acc[`tables.${tableIdx}.columns.${columnIdx}.uidt`] = [fieldRequiredValidator()] |
|
|
|
acc[`tables.${tableIdx}.columns.${columnIdx}.uidt`] = [fieldRequiredValidator()] |
|
|
|
if (isSelect(column)) { |
|
|
|
if (isSelect(column)) { |
|
|
|
hasSelectColumn.value[tableIdx] = true |
|
|
|
hasSelectColumn.value[tableIdx] = true |
|
|
|