fix
This commit is contained in:
1 parent
757de9a43f
commit
3950057707
17 files changed
+2681
-202
No files matched your search
@@ -45,6 +45,7 @@ const PRICING_FORCE_DEFAULT_PREFIX = 'pricing-force-default:'
|
||||
const pricingPaneReloadStore = usePricingPaneReloadStore()
|
||||
const consultCategoryFactorMap = ref<Map<string, number | null>>(new Map())
|
||||
let factorDefaultsLoaded = false
|
||||
const paneInstanceCreatedAt = Date.now()
|
||||
|
||||
const getDefaultConsultCategoryFactor = () =>
|
||||
consultCategoryFactorMap.value.get(String(props.serviceId)) ?? null
|
||||
@@ -59,8 +60,21 @@ const shouldSkipPersist = () => {
|
||||
const storageKey = `${PRICING_CLEAR_SKIP_PREFIX}${DB_KEY.value}`
|
||||
const raw = sessionStorage.getItem(storageKey)
|
||||
if (!raw) return false
|
||||
const now = Date.now()
|
||||
|
||||
if (raw.includes(':')) {
|
||||
const [issuedRaw, untilRaw] = raw.split(':')
|
||||
const issuedAt = Number(issuedRaw)
|
||||
const skipUntil = Number(untilRaw)
|
||||
if (Number.isFinite(issuedAt) && Number.isFinite(skipUntil) && now <= skipUntil) {
|
||||
return paneInstanceCreatedAt <= issuedAt
|
||||
}
|
||||
sessionStorage.removeItem(storageKey)
|
||||
return false
|
||||
}
|
||||
|
||||
const skipUntil = Number(raw)
|
||||
if (Number.isFinite(skipUntil) && Date.now() <= skipUntil) return true
|
||||
if (Number.isFinite(skipUntil) && now <= skipUntil) return true
|
||||
sessionStorage.removeItem(storageKey)
|
||||
return false
|
||||
}
|
||||
@@ -78,7 +92,8 @@ const detailRows = ref<DetailRow[]>([])
|
||||
|
||||
type taskLite = {
|
||||
serviceID: number
|
||||
code: string
|
||||
code?: string
|
||||
ref?: string
|
||||
name: string
|
||||
basicParam: string
|
||||
unit: string
|
||||
@@ -116,11 +131,12 @@ const buildDefaultRows = (): DetailRow[] => {
|
||||
|
||||
for (const [order, taskId] of sourceTaskIds.entries()) {
|
||||
const task = (taskList as Record<string, taskLite | undefined>)[String(taskId)]
|
||||
if (!task?.code || !task?.name) continue
|
||||
const taskCode = task?.code || task?.ref || ''
|
||||
if (!taskCode || !task?.name) continue
|
||||
const rowId = `task-${taskId}-${order}`
|
||||
rows.push({
|
||||
id: rowId,
|
||||
taskCode: task.code,
|
||||
taskCode,
|
||||
taskName: task.name,
|
||||
unit: task.unit || '',
|
||||
conversion: typeof task.conversion === 'number' && Number.isFinite(task.conversion) ? task.conversion : null,
|
||||
|
||||
Reference in new issue
Block a user