From 93a6c55b10198564029e91de035512ebcb0c952b Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 27 Jul 2026 11:54:30 +0800 Subject: [PATCH] feat --- .../spec.json | 45 +++ .../type.d.ts | 21 ++ .../spec.json | 70 +++++ .../type.d.ts | 29 ++ jjb.config.js | 4 +- src/api/safetyEvalBusiness/index.js | 13 + src/enumerate/constant/index.js | 12 + src/pages/Container/Layout/menuConfig.js | 5 + .../MonitorManage/EvalProjectMonitor/index.js | 271 ++++++++++++++++++ .../EvalProjectMonitor/index.less | 3 + .../EvalProject/Create/index.js | 48 +++- .../ProjectFlow/ContractContent.js | 47 ++- .../ProjectFlow/TeamContent.js | 2 +- 13 files changed, 559 insertions(+), 11 deletions(-) create mode 100644 .api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/spec.json create mode 100644 .api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/type.d.ts create mode 100644 .api/safetyEval-regulator-eval-project-monitor-realtime-page-get/spec.json create mode 100644 .api/safetyEval-regulator-eval-project-monitor-realtime-page-get/type.d.ts create mode 100644 src/pages/Container/MonitorManage/EvalProjectMonitor/index.js create mode 100644 src/pages/Container/MonitorManage/EvalProjectMonitor/index.less diff --git a/.api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/spec.json b/.api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/spec.json new file mode 100644 index 0000000..90531c9 --- /dev/null +++ b/.api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/spec.json @@ -0,0 +1,45 @@ +{ + "openapi": "3.0.1", + "info": { "title": "实时监控统计", "version": "1.0.0" }, + "paths": { + "/safetyEval/regulator/eval-project-monitor/monitor-realtime-stat": { + "get": { + "summary": "实时监控统计", + "tags": ["监管端-安评项目"], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SingleResponseRegulatorEvalProjectMonitorStatCO" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SingleResponseRegulatorEvalProjectMonitorStatCO": { + "type": "object", + "properties": { + "success": { "type": "boolean" }, + "code": { "type": "string" }, + "message": { "type": "string" }, + "errMessage": { "type": "string" }, + "data": { "$ref": "#/components/schemas/RegulatorEvalProjectMonitorStatCO" } + } + }, + "RegulatorEvalProjectMonitorStatCO": { + "type": "object", + "properties": { + "monitoringCount": { "type": "integer", "description": "在监项目数" }, + "normalCount": { "type": "integer", "description": "正常执行数(未归档)" }, + "warningCount": { "type": "integer", "description": "进度/人员预警数" }, + "monthPlanCompleteCount": { "type": "integer", "description": "本月计划完成数" } + } + } + } + } +} diff --git a/.api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/type.d.ts b/.api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/type.d.ts new file mode 100644 index 0000000..1886c86 --- /dev/null +++ b/.api/safetyEval-regulator-eval-project-monitor-monitor-realtime-stat-get/type.d.ts @@ -0,0 +1,21 @@ +// GET /safetyEval/regulator/eval-project-monitor/monitor-realtime-stat +// See ./spec.json + +export interface RegulatorEvalProjectMonitorStatCO { + /** 在监项目数 */ + monitoringCount: number; + /** 正常执行数(未归档) */ + normalCount: number; + /** 进度/人员预警数 */ + warningCount: number; + /** 本月计划完成数 */ + monthPlanCompleteCount: number; +} + +export interface SingleResponseRegulatorEvalProjectMonitorStatCO { + success: boolean; + code: string; + message: string; + errMessage: string; + data: RegulatorEvalProjectMonitorStatCO; +} diff --git a/.api/safetyEval-regulator-eval-project-monitor-realtime-page-get/spec.json b/.api/safetyEval-regulator-eval-project-monitor-realtime-page-get/spec.json new file mode 100644 index 0000000..ae99a4e --- /dev/null +++ b/.api/safetyEval-regulator-eval-project-monitor-realtime-page-get/spec.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.0.1", + "info": { "title": "实时监控分页", "version": "1.0.0" }, + "paths": { + "/safetyEval/regulator/eval-project-monitor/realtime-page": { + "get": { + "summary": "实时监控分页", + "tags": ["监管端-安评项目"], + "parameters": [ + { "name": "current", "in": "query", "schema": { "type": "integer", "default": 1 } }, + { "name": "size", "in": "query", "schema": { "type": "integer", "default": 10 } }, + { "name": "projectNameOrNo", "in": "query", "schema": { "type": "string" }, "description": "项目名称/编号" }, + { "name": "evalTypeCode", "in": "query", "schema": { "type": "string" }, "description": "评价类型编码:PRE/ACCEPT/STATUS" }, + { "name": "industryCode", "in": "query", "schema": { "type": "string" }, "description": "行业类别编码" }, + { "name": "leaderName", "in": "query", "schema": { "type": "string" }, "description": "项目负责人" }, + { "name": "planEndDateStart", "in": "query", "schema": { "type": "string" }, "description": "计划完成日期-起" }, + { "name": "planEndDateEnd", "in": "query", "schema": { "type": "string" }, "description": "计划完成日期-止" }, + { "name": "waringStatus", "in": "query", "schema": { "type": "string" }, "description": "监管状态:normal正常;PERSONNEL_ABNORMAL人员异常" } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/PageResponseRegulatorEvalProjectMonitorPageCO" } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PageResponseRegulatorEvalProjectMonitorPageCO": { + "type": "object", + "properties": { + "success": { "type": "boolean" }, + "code": { "type": "string" }, + "message": { "type": "string" }, + "errMessage": { "type": "string" }, + "data": { + "type": "array", + "items": { "$ref": "#/components/schemas/RegulatorEvalProjectMonitorPageCO" } + }, + "total": { "type": "integer", "format": "int64" } + } + }, + "RegulatorEvalProjectMonitorPageCO": { + "type": "object", + "properties": { + "id": { "type": "string", "description": "项目ID" }, + "orgId": { "type": "string", "description": "机构ID" }, + "projectNo": { "type": "string", "description": "项目编号" }, + "projectName": { "type": "string", "description": "项目名称" }, + "orgName": { "type": "string", "description": "评价机构" }, + "evalTypeCode": { "type": "string", "description": "评价类型编码" }, + "industryCode": { "type": "string", "description": "行业编码" }, + "leaderName": { "type": "string", "description": "负责人" }, + "planEndDate": { "type": "string", "description": "计划完成日期" }, + "waringStatus": { "type": "string", "description": "预警状态:normal正常;abnormal异常" }, + "processWaringStatus": { "type": "string", "description": "过程预警状态" }, + "processWaringMsg": { "type": "string", "description": "过程预警信息" }, + "personnelWaringStatus": { "type": "string", "description": "人员预警状态" }, + "personnelWaringMsg": { "type": "string", "description": "人员预警信息" } + } + } + } + } +} diff --git a/.api/safetyEval-regulator-eval-project-monitor-realtime-page-get/type.d.ts b/.api/safetyEval-regulator-eval-project-monitor-realtime-page-get/type.d.ts new file mode 100644 index 0000000..3610bde --- /dev/null +++ b/.api/safetyEval-regulator-eval-project-monitor-realtime-page-get/type.d.ts @@ -0,0 +1,29 @@ +// GET /safetyEval/regulator/eval-project-monitor/realtime-page +// See ./spec.json + +export interface RegulatorEvalProjectMonitorPageCO { + id: string; + orgId: string; + projectNo: string; + projectName: string; + orgName: string; + evalTypeCode: string; + industryCode: string; + leaderName: string; + planEndDate: string; + /** 预警状态:normal正常;abnormal异常 */ + waringStatus: string; + processWaringStatus: string; + processWaringMsg: string; + personnelWaringStatus: string; + personnelWaringMsg: string; +} + +export interface PageResponseRegulatorEvalProjectMonitorPageCO { + success: boolean; + code: string; + message: string; + errMessage: string; + data: RegulatorEvalProjectMonitorPageCO[]; + total: number; +} diff --git a/jjb.config.js b/jjb.config.js index 1df0572..956c00a 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -13,8 +13,8 @@ module.exports = { //API_HOST: "https://gbs-gateway.qhdsafety.com", //API_HOST: "http://192.168.0.152", - //API_HOST: "http://192.168.0.150", //太浅 - API_HOST: "http://192.168.0.152", + API_HOST: "http://192.168.0.150", //太浅 + // API_HOST: "http://192.168.0.152", //API_HOST: "http://192.168.0.103", //huwei }, production: { diff --git a/src/api/safetyEvalBusiness/index.js b/src/api/safetyEvalBusiness/index.js index 0df7ad6..f064acb 100644 --- a/src/api/safetyEvalBusiness/index.js +++ b/src/api/safetyEvalBusiness/index.js @@ -250,4 +250,17 @@ export const evalProcessControlFiles = declareRequest( "processControlFilesLoading", "Get > /safetyEval/institution/eval-process-control/process-files", "processControlFiles: [] | res.data || []", +); + +// ===== 监管端-安评项目实时监控 ===== + +export const evalProjectMonitorStat = declareRequest( + "evalProjectMonitorStatLoading", + "Get > /safetyEval/regulator/eval-project-monitor/monitor-realtime-stat", + "evalProjectMonitorStat: {} | res.data || {}", +); + +export const evalProjectMonitorPage = declareRequest( + "evalProjectMonitorPageLoading", + "Get > /safetyEval/regulator/eval-project-monitor/realtime-page", ); \ No newline at end of file diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 683bd27..48ee0f4 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -399,6 +399,18 @@ export const NODE_LABELS = { PROCESS_CONTROL: "过程控制", }; +/** 监管端-安评项目实时监控 - 监管状态映射 */ +export const MONITOR_WARING_STATUS_MAP = { + normal: { color: "success", text: "正常" }, + PERSONNEL_ABNORMAL: { color: "warning", text: "异常" }, +}; + +/** 监管端-安评项目实时监控 - 监管状态筛选选项 */ +export const MONITOR_WARING_STATUS_OPTIONS = [ + { label: "正常", value: "normal" }, + { label: "人员异常", value: "PERSONNEL_ABNORMAL" }, +]; + export const ROLE_DEFINITIONS = [ { value: "MARKETING_BUSINESS_REP", name: "市场部业务员", unique: false, summary: "获取项目基础信息,形成风险分析记录;风险通过后签订合同并下达任务通知单。" }, diff --git a/src/pages/Container/Layout/menuConfig.js b/src/pages/Container/Layout/menuConfig.js index f524110..d4fea86 100644 --- a/src/pages/Container/Layout/menuConfig.js +++ b/src/pages/Container/Layout/menuConfig.js @@ -195,6 +195,11 @@ const menuItems = [ label: "资质保持监控", icon: , }, + { + key: "/safetyEval/container/MonitorManage/EvalProjectMonitor", + label: "安评项目实时监控", + icon: , + }, ], }, { diff --git a/src/pages/Container/MonitorManage/EvalProjectMonitor/index.js b/src/pages/Container/MonitorManage/EvalProjectMonitor/index.js new file mode 100644 index 0000000..d65d9b4 --- /dev/null +++ b/src/pages/Container/MonitorManage/EvalProjectMonitor/index.js @@ -0,0 +1,271 @@ +import React, { useState, useEffect } from "react"; +import { + Row, + Col, + Card, + Statistic, + Table, + Tag, + Form, + Space, + Tooltip, +} from "antd"; +import dayjs from "dayjs"; +import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/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 { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; +import { tools } from "@cqsjjb/jjb-common-lib"; +import { + EVAL_TYPE_OPTIONS, + EVAL_TYPE_MAP, + MONITOR_WARING_STATUS_OPTIONS, +} from "~/enumerate/constant"; +import { + QUALIFICATION_INDUSTRY_OPTIONS, + QUALIFICATION_INDUSTRY_OPTIONS_MAP, +} from "~/enumerate/enterpriseOptions"; +import "./index.less"; + +const { router } = tools; + +const STAT_ITEMS = [ + { key: "monitoringCount", title: "在监项目", color: "#1677ff" }, + { key: "normalCount", title: "正常执行", color: "#52c41a" }, + { key: "warningCount", title: "进度/人员预警", color: "#faad14" }, + { key: "monthPlanCompleteCount", title: "本月计划完成", color: "#722ed1" }, +]; + +const EvalProjectMonitor = (props) => { + const [searchForm] = Form.useForm(); + const [dataSource, setDataSource] = useState([]); + const [total, setTotal] = useState(0); + + const { safetyEvalBusiness, evalProjectMonitorStat, evalProjectMonitorPage } = + props; + const { evalProjectMonitorStatLoading, evalProjectMonitorPageLoading } = + safetyEvalBusiness || {}; + const statData = safetyEvalBusiness?.evalProjectMonitorStat || {}; + + const getStat = async () => { + evalProjectMonitorStat(); + }; + + const getData = async () => { + const params = { + ...router.query, + current: router.query.current || 1, + size: router.query.size || 10, + }; + const res = await evalProjectMonitorPage(params); + if (res?.success !== false) { + setDataSource(res?.data || []); + setTotal(res?.total || 0); + } + }; + + useEffect(() => { + searchForm.setFieldsValue({ + ...router.query, + planEndDateRange: + router.query.planEndDateStart && router.query.planEndDateEnd + ? [ + dayjs(router.query.planEndDateStart), + dayjs(router.query.planEndDateEnd), + ] + : undefined, + }); + getStat(); + getData(); + }, []); + + const handleSearch = (values) => { + const { planEndDateRange, ...rest } = values; + router.query = { + ...rest, + planEndDateStart: + planEndDateRange?.[0]?.format?.("YYYY-MM-DD") || undefined, + planEndDateEnd: + planEndDateRange?.[1]?.format?.("YYYY-MM-DD") || undefined, + current: 1, + size: 10, + }; + getData(); + }; + + const handleReset = (values) => { + searchForm.resetFields(); + values.planEndDateStart = undefined; + values.planEndDateEnd = undefined; + router.query = { ...values, current: 1, size: 10 }; + getData(); + }; + + const handlePageChange = (pagination) => { + router.query = { + ...router.query, + current: pagination.current, + size: pagination.pageSize, + }; + getData(); + }; + + const renderWaringStatus = (_, record) => { + if (record.waringStatus === "NORMAL") { + return 正常; + } + const tags = []; + if (record.processWaringMsg) { + tags.push( + + 进度预警 + , + ); + } + if (record.personnelWaringMsg) { + tags.push( + + 人员异常 + , + ); + } + + return {tags}; + }; + + const columns = [ + { title: "项目编号", dataIndex: "projectNo", width: 140 }, + { title: "项目名称", dataIndex: "projectName", ellipsis: true, width: 220 }, + { title: "评价机构", dataIndex: "orgName", ellipsis: true, width: 200 }, + { + title: "评价类型", + dataIndex: "evalTypeCode", + width: 120, + render: (code) => EVAL_TYPE_MAP[code] || code, + }, + { + title: "行业", + dataIndex: "industryCode", + width: 140, + ellipsis: true, + render: (code) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[code] || code, + }, + { title: "负责人", dataIndex: "leaderName", width: 90 }, + { title: "计划完成", dataIndex: "planEndDate", width: 120 }, + { + title: "状态", + width: 100, + render: renderWaringStatus, + }, + { + title: "操作", + width: 180, + fixed: "right", + render: (_, record) => ( + + + + ), + } + ]; + + return ( + + + {STAT_ITEMS.map((item) => ( + + + + + + ))} + + + + + , + + + , + + + , + + + , + + + , + + + , + ]} + onFinish={handleSearch} + onReset={handleReset} + /> + + `共 ${t} 条`, + }} + onChange={handlePageChange} + /> + + ); +}; + +export default Connect( + [NS_SAFETY_EVAL_BUSINESS], + true, +)(AntdTableFuncControl(EvalProjectMonitor)); diff --git a/src/pages/Container/MonitorManage/EvalProjectMonitor/index.less b/src/pages/Container/MonitorManage/EvalProjectMonitor/index.less new file mode 100644 index 0000000..79db1fd --- /dev/null +++ b/src/pages/Container/MonitorManage/EvalProjectMonitor/index.less @@ -0,0 +1,3 @@ +.epm-stat-row { + margin-bottom: 16px; +} diff --git a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js index 61b08af..271d8dc 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js +++ b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js @@ -249,13 +249,53 @@ const EvalProjectCreate = (props) => { - - + { + const end = form.getFieldValue("planEndDate"); + if (value && end && value.isAfter(end)) { + return Promise.reject("项目开始时间不能晚于项目完成时间"); + } + return Promise.resolve(); + }, + }, + ]} + > + form.validateFields(["planEndDate"])} + /> - - + { + const start = form.getFieldValue("planStartDate"); + if (value && start && value.isBefore(start)) { + return Promise.reject("项目完成时间不能早于项目开始时间"); + } + return Promise.resolve(); + }, + }, + ]} + > + form.validateFields(["planStartDate"])} + /> diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js index 0365c36..23b295c 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js @@ -270,18 +270,57 @@ const ContractContent = (props) => { { + const end = form.getFieldValue("contractEndDate"); + if (value && end && value.isAfter(end)) { + return Promise.reject( + "合同开始时间不能晚于合同结束时间", + ); + } + return Promise.resolve(); + }, + }, + ]} > - + + form.validateFields(["contractEndDate"]) + } + /> { + const start = + form.getFieldValue("contractStartDate"); + if (value && start && value.isBefore(start)) { + return Promise.reject( + "合同结束时间不能早于合同开始时间", + ); + } + return Promise.resolve(); + }, + }, + ]} > - + + form.validateFields(["contractStartDate"]) + } + /> diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js index f2d410d..812fc2e 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js @@ -228,7 +228,7 @@ const TeamContent = (props) => { - +