!87 czh-20260707-增加完成状态行显示颜色
* czh-20260707-增加完成状态行显示颜色 * czh-20260707-所务、党委、把把脉反馈信息增加具体类别个数
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
export interface FeedbackStatusCount {
|
||||
notStarted: number;
|
||||
inProgress: number;
|
||||
completed: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function countFeedbackStatus(
|
||||
list: Recordable[] | undefined | null,
|
||||
statusField: string,
|
||||
): FeedbackStatusCount {
|
||||
const result: FeedbackStatusCount = { notStarted: 0, inProgress: 0, completed: 0, total: 0 };
|
||||
if (!Array.isArray(list)) return result;
|
||||
result.total = list.length;
|
||||
for (const item of list) {
|
||||
const v = String(item?.[statusField] ?? '');
|
||||
if (v === '1') result.notStarted++;
|
||||
else if (v === '2') result.inProgress++;
|
||||
else if (v === '3') result.completed++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user