mirror of https://github.com/Fabio286/antares.git
fix: app stuck inserting a random value if field length high
This commit is contained in:
parent
24edc82b1b
commit
440f74dfc1
|
@ -466,12 +466,15 @@ const copyRow = (format: string) => {
|
|||
};
|
||||
|
||||
const fillCell = (event: { name: string; group: string; type: string }) => {
|
||||
console.log(event);
|
||||
const row = localResults.value.find((row: any) => selectedRows.value.includes(row._antares_id));
|
||||
let fakeValue;
|
||||
let datePrecision = '';
|
||||
|
||||
if (['datetime', 'time'].includes(event.group)) {
|
||||
for (let i = 0; i < selectedCell.value.length; i++)
|
||||
datePrecision += i === 0 ? '.S' : 'S';
|
||||
}
|
||||
|
||||
if (event.group === 'custom') {
|
||||
if (event.type === 'time' && event.name === 'now')
|
||||
|
@ -488,7 +491,7 @@ const fillCell = (event: { name: string; group: string; type: string }) => {
|
|||
fakeValue = String(fakeValue);
|
||||
|
||||
if (selectedCell.value.length)
|
||||
fakeValue = fakeValue.substring(0, selectedCell.value.length);
|
||||
fakeValue = fakeValue.substring(0, selectedCell.value.length < 1024 ? Number(selectedCell.value.length) : 1024);
|
||||
}
|
||||
else if ([...DATE, ...DATETIME].includes(selectedCell.value.type))
|
||||
fakeValue = moment(fakeValue).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`);
|
||||
|
|
Loading…
Reference in New Issue