!87 czh-20260707-增加完成状态行显示颜色

* czh-20260707-增加完成状态行显示颜色
* czh-20260707-所务、党委、把把脉反馈信息增加具体类别个数
This commit is contained in:
陈志浩
2026-07-09 00:24:44 +00:00
parent 7895c7e56c
commit f2ea322693
3 changed files with 76 additions and 8 deletions
@@ -46,7 +46,7 @@
</div>
<div class="content">
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand">
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" :rowClassName="(r) => r.bpmStatus ? 'status-row-' + r.bpmStatus : ''">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="actionAuth.add" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
@@ -92,9 +92,15 @@
<Icon icon="ant-design:message-outlined" />
</span>
<span>办理情况</span>
<a-tag class="feedback-expand-count" color="processing">
{{ getFeedbackTableLoading(record) ? '加载中' : `${getFeedbackCount(record)}` }}
</a-tag>
<template v-if="getFeedbackTableLoading(record)">
<a-tag class="feedback-expand-count" color="processing">加载中</a-tag>
</template>
<template v-else>
<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="success">已完成 {{ getFeedbackStatusCount(record).completed }}</a-tag>
<a-tag class="feedback-expand-count">( {{ getFeedbackStatusCount(record).total }} )</a-tag>
</template>
</div>
<div class="feedback-expand-desc">当前事项的责任部门办理情况记录</div>
</div>
@@ -158,6 +164,7 @@
import { defHttp } from '/@/utils/http/axios';
import { showImportValidationErrors } from '/@/utils/helper/importError';
import { useMessage } from '/@/hooks/web/useMessage';
import { countFeedbackStatus } from '/@/views/bg/utils/feedbackStatusCount';
const props = withDefaults(
defineProps<{
@@ -319,6 +326,10 @@
return !!feedbackTableLoading[getFeedbackKey(record)];
}
function getFeedbackStatusCount(record: Recordable) {
return countFeedbackStatus(getFeedbackTableData(record), 'bpmStatus');
}
function clearFeedbackTableData() {
Object.keys(feedbackTableData).forEach((key) => {
delete feedbackTableData[key];
@@ -863,3 +874,15 @@
}
}
</style>
<style lang="less">
.status-row-1 td {
background: #fffbe6 !important;
}
.status-row-2 td {
background: #fff1f0 !important;
}
.status-row-3 td {
background: #f6ffed !important;
}
</style>
+27 -4
View File
@@ -52,7 +52,7 @@
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand">
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" :rowClassName="(r) => r.bpmStatus ? 'status-row-' + r.bpmStatus : ''">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'bqtakepulse:bg_takepulse:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
@@ -92,9 +92,15 @@
<Icon icon="ant-design:message-outlined" />
</span>
<span>办理情况</span>
<a-tag class="feedback-expand-count" color="processing">
{{ getFeedbackTableLoading(record) ? '加载中' : `${getFeedbackCount(record)}` }}
</a-tag>
<template v-if="getFeedbackTableLoading(record)">
<a-tag class="feedback-expand-count" color="processing">加载中</a-tag>
</template>
<template v-else>
<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="success">已完成 {{ getFeedbackStatusCount(record).completed }}</a-tag>
<a-tag class="feedback-expand-count">( {{ getFeedbackStatusCount(record).total }} )</a-tag>
</template>
</div>
<div class="feedback-expand-desc">当前事项的执行情况办理情况记录</div>
</div>
@@ -149,6 +155,7 @@
import { defHttp } from '/@/utils/http/axios';
import { showImportValidationErrors } from '/@/utils/helper/importError';
import { useMessage } from '/@/hooks/web/useMessage';
import { countFeedbackStatus } from '/@/views/bg/utils/feedbackStatusCount';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import SzSelectDept from '/@/components/Form/src/jeecg/components/SzSelectDept.vue';
import Icon from '/@/components/Icon/index';
@@ -267,6 +274,10 @@
return !!feedbackTableLoading[getFeedbackKey(record)];
}
function getFeedbackStatusCount(record: Recordable) {
return countFeedbackStatus(getFeedbackTableData(record), 'bpmStatus');
}
function clearFeedbackTableData() {
Object.keys(feedbackTableData).forEach((key) => {
delete feedbackTableData[key];
@@ -796,3 +807,15 @@
}
}
</style>
<style lang="less">
.status-row-1 td {
background: #fffbe6 !important;
}
.status-row-2 td {
background: #fff1f0 !important;
}
.status-row-3 td {
background: #f6ffed !important;
}
</style>
+22
View File
@@ -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;
}