From dacae8af480904a3dd058bb0582d2b4c6be00cdd Mon Sep 17 00:00:00 2001
From: tangjie <122778500@qq.com>
Date: Thu, 16 Jul 2026 11:27:49 +0800
Subject: [PATCH] feat
---
jjb.config.js | 3 +-
src/api/qualReview/index.js | 6 +
src/api/riskCenter/index.js | 7 ++
src/enumerate/constant/index.js | 16 ++-
src/enumerate/namespace/index.js | 1 +
.../PersonnelInfo/Certificate/index.js | 21 ++--
.../MonitorManage/QualMonitor/index.js | 25 ++--
.../MonitorManage/RiskCenter/index.js | 110 ++++++------------
8 files changed, 85 insertions(+), 104 deletions(-)
create mode 100644 src/api/riskCenter/index.js
diff --git a/jjb.config.js b/jjb.config.js
index d135c11..af85a59 100644
--- a/jjb.config.js
+++ b/jjb.config.js
@@ -11,7 +11,8 @@ module.exports = {
// 本地联调 safetyEval-service(context-path: /safetyEval,默认端口 8095)
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
//API_HOST: "https://gbs-gateway.qhdsafety.com",
- API_HOST: "http://192.168.0.150",
+ //API_HOST: "http://192.168.0.150",太浅
+ API_HOST: "http://192.168.0.152",
},
production: {
// 应用后端分支名称,部署上线需要
diff --git a/src/api/qualReview/index.js b/src/api/qualReview/index.js
index 10321cb..8b9e887 100644
--- a/src/api/qualReview/index.js
+++ b/src/api/qualReview/index.js
@@ -75,4 +75,10 @@ export const queryQualMonitorCondition = declareRequest(
"qualReviewLoading",
"Get > /safetyEval/qual-monitor/condition-detail",
'qualMonitorCondition: {} | res.data || {}',
+);
+
+export const queryQualMonitoringPageStatistics = declareRequest(
+ "qualReviewLoading",
+ "Get > /safetyEval/qual-filing/qualificationMonitoringPageStatistics",
+ "monitorStats: {} | res.data || {}",
);
\ No newline at end of file
diff --git a/src/api/riskCenter/index.js b/src/api/riskCenter/index.js
new file mode 100644
index 0000000..def9c5b
--- /dev/null
+++ b/src/api/riskCenter/index.js
@@ -0,0 +1,7 @@
+import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
+
+export const queryRiskOverviewAction = declareRequest(
+ "riskOverviewLoading",
+ "Get > /safetyEval/regulator/risk-center/overview",
+ "overviewStats: [] | res.data.stats || [] & processGuide: '' | res.data.processGuide || ''",
+);
diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js
index c9ac7de..6a0c050 100644
--- a/src/enumerate/constant/index.js
+++ b/src/enumerate/constant/index.js
@@ -117,4 +117,18 @@ export const QUAL_MONITOR_CONDITION_ITEMS = [
export const QUAL_MONITOR_STATUS_OPTIONS = [
{ value: "normal", label: "正常" },
{ value: "person_rate", label: "人员比例预警" },
-];
\ No newline at end of file
+];
+
+/** 证书类型选项 */
+export const CERT_TYPE_OPTIONS = [
+ { value: "registered_safety_engineer", label: "注册安全工程师" },
+ { value: "senior_engineer", label: "高工" },
+ { value: "evaluator", label: "评价师" },
+];
+
+/** 证书类型 value → label 映射 */
+export const CERT_TYPE_MAP = {
+ registered_safety_engineer: "注册安全工程师",
+ senior_engineer: "高工",
+ evaluator: "评价师",
+};
\ No newline at end of file
diff --git a/src/enumerate/namespace/index.js b/src/enumerate/namespace/index.js
index 70aef9e..5d741e1 100644
--- a/src/enumerate/namespace/index.js
+++ b/src/enumerate/namespace/index.js
@@ -21,3 +21,4 @@ export const NS_QUAL_FILING = defineNamespace("qualFiling");
export const NS_QUAL_REVIEW = defineNamespace("qualReview");
export const NS_QUAL_EXPERT = defineNamespace("qualExpert");
export const NS_DRIVER = defineNamespace("driver");
+export const NS_RISK_CENTER = defineNamespace("riskCenter");
diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/Certificate/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/Certificate/index.js
index 1706c3b..1ed7d80 100644
--- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/Certificate/index.js
+++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/Certificate/index.js
@@ -13,6 +13,7 @@ import { NS_STAFF_CERTIFICATE } from "~/enumerate/namespace";
import CertPreviewImg from "~/components/CertPreviewImg";
import AttachmentUpload from "~/components/AttachmentUpload";
import { dateRangeRule } from "~/utils/validators";
+import { CERT_TYPE_OPTIONS, CERT_TYPE_MAP } from "~/enumerate/constant";
const { router } = tools;
@@ -115,8 +116,8 @@ function StaffCertificatePage(props) {
CERT_TYPE_MAP[v] || v },
{ title: "证书类别", dataIndex: "certCategoryName" },
{ title: "证书作业类别", dataIndex: "operationCategoryName" },
{ title: "证书编号", dataIndex: "certNo" },
@@ -332,17 +333,10 @@ function CertModal({
-
-
-
-
+
{info.certName}
- {info.certTypeCode}
- {info.certTypeName}
+ {CERT_TYPE_MAP[info.certTypeCode] || info.certTypeCode}
{info.certCategoryCode}
{info.certCategoryName}
{info.operationCategoryCode}
diff --git a/src/pages/Container/MonitorManage/QualMonitor/index.js b/src/pages/Container/MonitorManage/QualMonitor/index.js
index d3f4ab8..0deb97a 100644
--- a/src/pages/Container/MonitorManage/QualMonitor/index.js
+++ b/src/pages/Container/MonitorManage/QualMonitor/index.js
@@ -108,26 +108,21 @@ function buildConditionDetails(record) {
};
}
-/** 统计卡片数据 */
-function computeStats(list) {
- return {
- total: list.length,
- normal: list.filter((i) => i.alertStatus === "normal").length,
- warning: list.filter((i) => i.alertStatus === "person_rate").length,
- };
-}
-
const QualMonitor = (props) => {
const [form] = Form.useForm();
const [detailVisible, setDetailVisible] = useState(false);
const [detailRecord, setDetailRecord] = useState(null);
const [data, setData] = useState([]);
- const { qualReview, queryQualMonitorPage, queryQualMonitorCondition } = props;
- const { qualMonitorList, qualMonitorTotal, qualReviewLoading } =
+ const { qualReview, queryQualMonitorPage, queryQualMonitorCondition, queryQualMonitoringPageStatistics } = props;
+ const { qualMonitorList, qualMonitorTotal, qualReviewLoading, monitorStats = {} } =
qualReview || {};
- const stats = computeStats(data);
+ const stats = {
+ total: monitorStats.orgInfoSum ?? 0,
+ normal: monitorStats.normalSum ?? 0,
+ warning: monitorStats.earlyWarningSum ?? 0,
+ };
/** model 数据回填时同步到本地 data */
useEffect(() => {
@@ -145,10 +140,7 @@ const QualMonitor = (props) => {
/** 调用接口 */
const handleSearch = () => {
const params = { ...router.query };
- if (params.keyword) {
- params.unitName = params.keyword;
- delete params.keyword;
- }
+
queryQualMonitorPage(params);
};
@@ -160,6 +152,7 @@ const QualMonitor = (props) => {
useEffect(() => {
form.setFieldsValue(router.query);
handleSearch();
+ queryQualMonitoringPageStatistics();
}, []);
const openDetail = (record) => {
diff --git a/src/pages/Container/MonitorManage/RiskCenter/index.js b/src/pages/Container/MonitorManage/RiskCenter/index.js
index cdb0cb6..628c007 100644
--- a/src/pages/Container/MonitorManage/RiskCenter/index.js
+++ b/src/pages/Container/MonitorManage/RiskCenter/index.js
@@ -1,10 +1,12 @@
-import React, { useState } from "react";
+import React, { useState, useEffect } from "react";
import { Button, Form, Table, Tag } from "antd";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
import { tools } from "@cqsjjb/jjb-common-lib";
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { NS_RISK_CENTER } from "~/enumerate/namespace";
import "./index.less";
const { router } = tools;
@@ -129,17 +131,24 @@ const MOCK_DATA = [
},
];
+/** 统计卡片样式主题 */
+const CARD_THEMES = [
+ { bg: "#fee2e2", color: "#dc2626" },
+ { bg: "#fef3c7", color: "#d97706" },
+ { bg: "#dbeafe", color: "#2563eb" },
+ { bg: "#d1fae5", color: "#059669" },
+];
+
const RiskCenter = (props) => {
const [form] = Form.useForm();
const [data] = useState(MOCK_DATA);
- /** 统计卡片数据 */
- const stats = {
- qualRisk: data.filter((i) => i.type === "qual").length,
- projRisk: data.filter((i) => i.type === "proj").length,
- pendingFeedback: data.filter((i) => i.orgStatus === "submitted").length,
- todayClosed: data.filter((i) => i.stage === "closed").length,
- };
+ const { riskCenter, queryRiskOverviewAction } = props;
+ const { overviewStats = [], riskOverviewLoading } = riskCenter || {};
+
+ useEffect(() => {
+ queryRiskOverviewAction();
+ }, []);
const handleSearch = () => {
// 接口搜索
@@ -232,70 +241,24 @@ const RiskCenter = (props) => {
{/* 统计卡片 */}
-
-
-
资质预警
-
- {stats.qualRisk}
+ {overviewStats.map((stat, idx) => {
+ const theme = CARD_THEMES[idx % CARD_THEMES.length];
+ return (
+
+
+
{stat.label}
+
{stat.value}
+
{stat.hint}
+
+
+ {stat.label.charAt(0)}
+
-
- 条件保持、人员比例、属地材料
-
-
-
- 资
-
-
-
-
-
项目预警
-
- {stats.projRisk}
-
-
- 进度、人员、告知、勘查、质控
-
-
-
- 项
-
-
-
-
-
待机构反馈
-
- {stats.pendingFeedback}
-
-
整改说明或证明材料
-
-
- 反
-
-
-
-
-
今日闭环
-
- {stats.todayClosed}
-
-
监管复核已完成
-
-
- 结
-
-
+ );
+ })}
{/* 项目预警规则提示 */}
@@ -397,4 +360,7 @@ const RiskCenter = (props) => {
);
};
-export default AntdTableFuncControl(RiskCenter);
+export default Connect(
+ [NS_RISK_CENTER],
+ true,
+)(AntdTableFuncControl(RiskCenter));