修复项目管理问题
This commit is contained in:
1 parent
be2662d579
commit
e72012cfc2
15 files changed
+941
-249
No files matched your search
@@ -245,6 +245,19 @@ export const toScaleProNum = (row: ScaleMethodRowLike): number => {
|
||||
return parsed.proNum > 0 ? parsed.proNum : 1
|
||||
}
|
||||
|
||||
const dedupeScaleMethodRows = (rows: ScaleMethodRowLike[] | undefined): ScaleMethodRowLike[] => {
|
||||
if (!Array.isArray(rows) || rows.length === 0) return []
|
||||
const deduped = new Map<string, ScaleMethodRowLike>()
|
||||
for (const row of rows) {
|
||||
const major = toScaleMajorId(row)
|
||||
if (major == null) continue
|
||||
const proNum = toScaleProNum(row)
|
||||
// 同一项目+专业出现重复行时,以最后一条为准,兜底旧浏览器内存态重复污染。
|
||||
deduped.set(`${proNum}::${major}`, row)
|
||||
}
|
||||
return Array.from(deduped.values())
|
||||
}
|
||||
|
||||
export const normalizeTaskText = (value: unknown): string => String(value || '').trim()
|
||||
|
||||
export const resolveTaskRowServiceId = (row: WorkContentRowLike): number | null =>
|
||||
@@ -392,10 +405,11 @@ export const toExportScaleRows = (rows: ScaleRowLike[] | undefined) => {
|
||||
}
|
||||
|
||||
export const buildMethod1 = (rows: ScaleMethodRowLike[] | undefined) => {
|
||||
if (!Array.isArray(rows)) return null
|
||||
const normalizedRows = dedupeScaleMethodRows(rows)
|
||||
if (normalizedRows.length === 0) return null
|
||||
let hasTotalValue = false
|
||||
const proSet = new Set<number>()
|
||||
const det = rows
|
||||
const det = normalizedRows
|
||||
.map(row => {
|
||||
const major = toScaleMajorId(row)
|
||||
if (major == null) return null
|
||||
@@ -441,10 +455,11 @@ export const buildMethod1 = (rows: ScaleMethodRowLike[] | undefined) => {
|
||||
}
|
||||
|
||||
export const buildMethod2 = (rows: ScaleMethodRowLike[] | undefined) => {
|
||||
if (!Array.isArray(rows)) return null
|
||||
const normalizedRows = dedupeScaleMethodRows(rows)
|
||||
if (normalizedRows.length === 0) return null
|
||||
let hasTotalValue = false
|
||||
const proSet = new Set<number>()
|
||||
const det = rows
|
||||
const det = normalizedRows
|
||||
.map(row => {
|
||||
const major = toScaleMajorId(row)
|
||||
if (major == null) return null
|
||||
|
||||
Reference in new issue
Block a user