Skip to content

Commit e493db5

Browse files
committed
fix: reorder condition when format the update data
1 parent d3d7ab3 commit e493db5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/renderer/components/WorkspaceTabQueryTable.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,14 +697,14 @@ const fillCell = (event: { name: string; group: string; type: string }) => {
697697
698698
fakeValue = (fakerCustom as any)[event.group][event.name]();
699699
const isDateType = [...DATE, ...DATETIME].includes(selectedCell.value.type);
700-
if (['string', 'number'].includes(typeof fakeValue)) {
700+
if (isDateType)
701+
fakeValue = moment(fakeValue).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`);
702+
else if (['string', 'number'].includes(typeof fakeValue)) {
701703
if (typeof fakeValue === 'number')
702704
fakeValue = String(fakeValue);
703-
if (selectedCell.value.length && !isDateType)
705+
if (selectedCell.value.length)
704706
fakeValue = fakeValue.substring(0, selectedCell.value.length < 1024 ? Number(selectedCell.value.length) : 1024);
705707
}
706-
else if (isDateType)
707-
fakeValue = moment(fakeValue).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`);
708708
else if (TIME.includes(selectedCell.value.type))
709709
fakeValue = moment(fakeValue).format(`HH:mm:ss${datePrecision}`);
710710

0 commit comments

Comments
 (0)