|
|
|
@ -277,6 +277,11 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
|
|
|
|
|
return c |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const preFillValue = getPreFillValue(c, (route.query?.[c.title] as string).trim()) |
|
|
|
|
if (preFillValue !== undefined) { |
|
|
|
|
// Prefill form state
|
|
|
|
|
formState.value[c.title] = preFillValue |
|
|
|
|
|
|
|
|
|
// Update column
|
|
|
|
|
switch (sharedViewMeta.value.preFilledMode) { |
|
|
|
|
case PreFilledMode.Hidden: { |
|
|
|
@ -288,11 +293,6 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
|
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Prefill form state
|
|
|
|
|
const preFillValue = getPreFillValue(c, (route.query?.[c.title] as string).trim()) |
|
|
|
|
if (preFillValue !== undefined) { |
|
|
|
|
formState.value[c.title] = preFillValue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return c |
|
|
|
@ -398,19 +398,22 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
|
|
|
|
|
} |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
case UITypes.Date: |
|
|
|
|
case UITypes.Date: { |
|
|
|
|
const parsedDate = dayjs(value, 'YYYY-MM-DD') |
|
|
|
|
if (parsedDate.isValid()) { |
|
|
|
|
preFillValue = parsedDate.format('YYYY-MM-DD') |
|
|
|
|
} |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
case UITypes.DateTime: { |
|
|
|
|
let parsedDateOrDateTime = dayjs(value, getDateTimeFormat(value)) |
|
|
|
|
let parsedDateTime = dayjs(value, 'YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
|
|
|
|
if (!parsedDateOrDateTime.isValid()) { |
|
|
|
|
parsedDateOrDateTime = dayjs(value, getDateFormat(value)) |
|
|
|
|
if (parsedDateTime.isValid()) { |
|
|
|
|
preFillValue = parsedDateTime.utc().format('YYYY-MM-DD HH:mm:ssZ') |
|
|
|
|
} else if (dayjs(value).toISOString() === value) { |
|
|
|
|
if (parsedDateTime.isValid() && parsedDateTime.toISOString() === value) { |
|
|
|
|
preFillValue = dayjs(value).format('YYYY-MM-DD HH:mm:ssZ') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (parsedDateOrDateTime.isValid()) { |
|
|
|
|
preFillValue = |
|
|
|
|
c.uidt === UITypes.Date |
|
|
|
|
? parsedDateOrDateTime.format('YYYY-MM-DD') |
|
|
|
|
: parsedDateOrDateTime.utc().format('YYYY-MM-DD HH:mm:ssZ') |
|
|
|
|
} |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|