!88 czh-20260709-增加进行中逾期任务数量显示
Merge pull request !88 from 陈志浩/feature/feedback-20260709
This commit is contained in:
@@ -97,7 +97,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<a-tag class="feedback-expand-count" color="warning">未开始 {{ getFeedbackStatusCount(record).notStarted }}</a-tag>
|
<a-tag class="feedback-expand-count" color="warning">未开始 {{ getFeedbackStatusCount(record).notStarted }}</a-tag>
|
||||||
<a-tag class="feedback-expand-count" color="error">进行中 {{ getFeedbackStatusCount(record).inProgress }}</a-tag>
|
<a-tag class="feedback-expand-count" color="error">进行中 {{ getFeedbackStatusCount(record).inProgress }}(已逾期 {{ getFeedbackStatusCount(record).overdue }})</a-tag>
|
||||||
<a-tag class="feedback-expand-count" color="success">已完成 {{ getFeedbackStatusCount(record).completed }}</a-tag>
|
<a-tag class="feedback-expand-count" color="success">已完成 {{ getFeedbackStatusCount(record).completed }}</a-tag>
|
||||||
<a-tag class="feedback-expand-count">(共 {{ getFeedbackStatusCount(record).total }} 条)</a-tag>
|
<a-tag class="feedback-expand-count">(共 {{ getFeedbackStatusCount(record).total }} 条)</a-tag>
|
||||||
</template>
|
</template>
|
||||||
@@ -327,7 +327,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFeedbackStatusCount(record: Recordable) {
|
function getFeedbackStatusCount(record: Recordable) {
|
||||||
return countFeedbackStatus(getFeedbackTableData(record), 'bpmStatus');
|
return countFeedbackStatus(getFeedbackTableData(record), 'bpmStatus', 'planTime');
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearFeedbackTableData() {
|
function clearFeedbackTableData() {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<a-tag class="feedback-expand-count" color="warning">未开始 {{ getFeedbackStatusCount(record).notStarted }}</a-tag>
|
<a-tag class="feedback-expand-count" color="warning">未开始 {{ getFeedbackStatusCount(record).notStarted }}</a-tag>
|
||||||
<a-tag class="feedback-expand-count" color="error">进行中 {{ getFeedbackStatusCount(record).inProgress }}</a-tag>
|
<a-tag class="feedback-expand-count" color="error">进行中 {{ getFeedbackStatusCount(record).inProgress }}(已逾期 {{ getFeedbackStatusCount(record).overdue }})</a-tag>
|
||||||
<a-tag class="feedback-expand-count" color="success">已完成 {{ getFeedbackStatusCount(record).completed }}</a-tag>
|
<a-tag class="feedback-expand-count" color="success">已完成 {{ getFeedbackStatusCount(record).completed }}</a-tag>
|
||||||
<a-tag class="feedback-expand-count">(共 {{ getFeedbackStatusCount(record).total }} 条)</a-tag>
|
<a-tag class="feedback-expand-count">(共 {{ getFeedbackStatusCount(record).total }} 条)</a-tag>
|
||||||
</template>
|
</template>
|
||||||
@@ -275,7 +275,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getFeedbackStatusCount(record: Recordable) {
|
function getFeedbackStatusCount(record: Recordable) {
|
||||||
return countFeedbackStatus(getFeedbackTableData(record), 'bpmStatus');
|
return countFeedbackStatus(getFeedbackTableData(record), 'bpmStatus', 'planTime');
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearFeedbackTableData() {
|
function clearFeedbackTableData() {
|
||||||
|
|||||||
@@ -3,20 +3,31 @@ export interface FeedbackStatusCount {
|
|||||||
inProgress: number;
|
inProgress: number;
|
||||||
completed: number;
|
completed: number;
|
||||||
total: number;
|
total: number;
|
||||||
|
overdue: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function countFeedbackStatus(
|
export function countFeedbackStatus(
|
||||||
list: Recordable[] | undefined | null,
|
list: Recordable[] | undefined | null,
|
||||||
statusField: string,
|
statusField: string,
|
||||||
|
dateField?: string,
|
||||||
): FeedbackStatusCount {
|
): FeedbackStatusCount {
|
||||||
const result: FeedbackStatusCount = { notStarted: 0, inProgress: 0, completed: 0, total: 0 };
|
const result: FeedbackStatusCount = { notStarted: 0, inProgress: 0, completed: 0, total: 0, overdue: 0 };
|
||||||
if (!Array.isArray(list)) return result;
|
if (!Array.isArray(list)) return result;
|
||||||
result.total = list.length;
|
result.total = list.length;
|
||||||
|
const today = new Date();
|
||||||
|
today.setHours(0, 0, 0, 0);
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
const v = String(item?.[statusField] ?? '');
|
const v = String(item?.[statusField] ?? '');
|
||||||
if (v === '1') result.notStarted++;
|
if (v === '1') result.notStarted++;
|
||||||
else if (v === '2') result.inProgress++;
|
else if (v === '2') {
|
||||||
else if (v === '3') result.completed++;
|
result.inProgress++;
|
||||||
|
if (dateField) {
|
||||||
|
const planTime = item?.[dateField];
|
||||||
|
if (planTime && new Date(planTime) < today) {
|
||||||
|
result.overdue++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (v === '3') result.completed++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user