mirror of https://github.com/Fabio286/antares.git
fix: loss of precision updating BIGINT values, fixes #467
This commit is contained in:
parent
d8a298fd20
commit
d190a2dd61
|
@ -47,6 +47,12 @@ export const FLOAT = [
|
||||||
'MONEY'
|
'MONEY'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const IS_BIGINT = [
|
||||||
|
'BIGINT',
|
||||||
|
'BIGSERIAL',
|
||||||
|
'DOUBLE PRECISION'
|
||||||
|
];
|
||||||
|
|
||||||
export const BOOLEAN = [
|
export const BOOLEAN = [
|
||||||
'BOOL',
|
'BOOL',
|
||||||
'BOOLEAN'
|
'BOOLEAN'
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
:option-label="(opt: any) => opt.name === 'manual' ? t('message.manualValue') : t(`faker.${opt.name}`)"
|
:option-label="(opt: any) => opt.name === 'manual' ? t('message.manualValue') : t(`faker.${opt.name}`)"
|
||||||
option-track-by="name"
|
option-track-by="name"
|
||||||
:disabled="!isChecked"
|
:disabled="!isChecked"
|
||||||
style="flex-grow: 0;"
|
:style="'flex-grow: 0;'"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, PropType, Ref, ref, watch } from 'vue';
|
import { computed, PropType, Ref, ref, watch } from 'vue';
|
||||||
import { TEXT, LONG_TEXT, NUMBER, FLOAT, DATE, TIME, DATETIME, BLOB, BIT, UUID } from 'common/fieldTypes';
|
import { TEXT, LONG_TEXT, NUMBER, FLOAT, DATE, TIME, DATETIME, BLOB, BIT, UUID, IS_BIGINT } from 'common/fieldTypes';
|
||||||
import BaseUploadInput from '@/components/BaseUploadInput.vue';
|
import BaseUploadInput from '@/components/BaseUploadInput.vue';
|
||||||
import ForeignKeySelect from '@/components/ForeignKeySelect.vue';
|
import ForeignKeySelect from '@/components/ForeignKeySelect.vue';
|
||||||
import FakerMethods from 'common/FakerMethods';
|
import FakerMethods from 'common/FakerMethods';
|
||||||
|
@ -146,8 +146,12 @@ const inputProps = () => {
|
||||||
if ([...TEXT, ...LONG_TEXT].includes(props.type))
|
if ([...TEXT, ...LONG_TEXT].includes(props.type))
|
||||||
return { type: 'text', mask: false };
|
return { type: 'text', mask: false };
|
||||||
|
|
||||||
if ([...NUMBER, ...FLOAT].includes(props.type))
|
if ([...NUMBER, ...FLOAT].includes(props.type)) {
|
||||||
return { type: 'number', mask: false };
|
if (IS_BIGINT.includes(props.type))
|
||||||
|
return { type: 'text', mask: false };
|
||||||
|
else
|
||||||
|
return { type: 'number', mask: false };
|
||||||
|
}
|
||||||
|
|
||||||
if (TIME.includes(props.type)) {
|
if (TIME.includes(props.type)) {
|
||||||
let timeMask = '##:##:##';
|
let timeMask = '##:##:##';
|
||||||
|
|
|
@ -220,7 +220,8 @@ import {
|
||||||
BINARY,
|
BINARY,
|
||||||
HAS_TIMEZONE,
|
HAS_TIMEZONE,
|
||||||
SPATIAL,
|
SPATIAL,
|
||||||
IS_MULTI_SPATIAL
|
IS_MULTI_SPATIAL,
|
||||||
|
IS_BIGINT
|
||||||
} from 'common/fieldTypes';
|
} from 'common/fieldTypes';
|
||||||
import ConfirmModal from '@/components/BaseConfirmModal.vue';
|
import ConfirmModal from '@/components/BaseConfirmModal.vue';
|
||||||
import TextEditor from '@/components/BaseTextEditor.vue';
|
import TextEditor from '@/components/BaseTextEditor.vue';
|
||||||
|
@ -281,8 +282,12 @@ const inputProps = computed(() => {
|
||||||
if ([...TEXT, ...LONG_TEXT].includes(editingType.value))
|
if ([...TEXT, ...LONG_TEXT].includes(editingType.value))
|
||||||
return { type: 'text', mask: false };
|
return { type: 'text', mask: false };
|
||||||
|
|
||||||
if ([...NUMBER, ...FLOAT].includes(editingType.value))
|
if ([...NUMBER, ...FLOAT].includes(editingType.value)) {
|
||||||
return { type: 'number', mask: false };
|
if (IS_BIGINT.includes(editingType.value))
|
||||||
|
return { type: 'text', mask: false };
|
||||||
|
else
|
||||||
|
return { type: 'number', mask: false };
|
||||||
|
}
|
||||||
|
|
||||||
if (TIME.includes(editingType.value)) {
|
if (TIME.includes(editingType.value)) {
|
||||||
let timeMask = '##:##:##';
|
let timeMask = '##:##:##';
|
||||||
|
|
Loading…
Reference in New Issue