|
|
@ -109,20 +109,22 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (column.value?.uidt === UITypes.Currency) { |
|
|
|
// keep length and scale for same datatype
|
|
|
|
|
|
|
|
if (column.value && formState.value.uidt === column.value?.uidt) { |
|
|
|
formState.value.dtxp = column.value.dtxp |
|
|
|
formState.value.dtxp = column.value.dtxp |
|
|
|
formState.value.dtxs = column.value.dtxs |
|
|
|
formState.value.dtxs = column.value.dtxs |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
formState.value.dtxp = 19 |
|
|
|
// default length and scale for currency
|
|
|
|
formState.value.dtxs = 2 |
|
|
|
if (formState.value?.uidt === UITypes.Currency) { |
|
|
|
|
|
|
|
formState.value.dtxp = 19 |
|
|
|
|
|
|
|
formState.value.dtxs = 2 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
formState.value.altered = formState.value.altered || 2 |
|
|
|
formState.value.altered = formState.value.altered || 2 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const onDataTypeChange = () => { |
|
|
|
const onDataTypeChange = () => { |
|
|
|
const { isCurrency } = useColumn(ref(formState.value as ColumnType)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formState.value.rqd = false |
|
|
|
formState.value.rqd = false |
|
|
|
if (formState.value.uidt !== UITypes.ID) { |
|
|
|
if (formState.value.uidt !== UITypes.ID) { |
|
|
|
formState.value.primaryKey = false |
|
|
|
formState.value.primaryKey = false |
|
|
@ -135,16 +137,19 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState |
|
|
|
|
|
|
|
|
|
|
|
formState.value.dtx = 'specificType' |
|
|
|
formState.value.dtx = 'specificType' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// use enum response as dtxp for select columns
|
|
|
|
const selectTypes = [UITypes.MultiSelect, UITypes.SingleSelect] |
|
|
|
const selectTypes = [UITypes.MultiSelect, UITypes.SingleSelect] |
|
|
|
if (column.value && selectTypes.includes(formState.value.uidt) && selectTypes.includes(column.value.uidt as UITypes)) { |
|
|
|
if (column.value && selectTypes.includes(formState.value.uidt) && selectTypes.includes(column.value.uidt as UITypes)) { |
|
|
|
formState.value.dtxp = column.value.dtxp |
|
|
|
formState.value.dtxp = column.value.dtxp |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isCurrency.value) { |
|
|
|
// keep length and scale for same datatype
|
|
|
|
if (column.value?.uidt === UITypes.Currency) { |
|
|
|
if (column.value && formState.value.uidt === column.value?.uidt) { |
|
|
|
formState.value.dtxp = column.value.dtxp |
|
|
|
formState.value.dtxp = column.value.dtxp |
|
|
|
formState.value.dtxs = column.value.dtxs |
|
|
|
formState.value.dtxs = column.value.dtxs |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
// default length and scale for currency
|
|
|
|
|
|
|
|
if (formState.value?.uidt === UITypes.Currency) { |
|
|
|
formState.value.dtxp = 19 |
|
|
|
formState.value.dtxp = 19 |
|
|
|
formState.value.dtxs = 2 |
|
|
|
formState.value.dtxs = 2 |
|
|
|
} |
|
|
|
} |
|
|
|