diff --git a/src/api/safetyEvalBusiness/index.js b/src/api/safetyEvalBusiness/index.js index c6cb027..dcff078 100644 --- a/src/api/safetyEvalBusiness/index.js +++ b/src/api/safetyEvalBusiness/index.js @@ -333,6 +333,19 @@ export const evalSurveyClockIn = declareRequest( "evalSurveyClockIn: [] | res.data || []", ); +// ===== 监管端-项目档案监管 ===== + +export const evalProjectArchiveStat = declareRequest( + "evalProjectArchiveStatLoading", + "Get > /safetyEval/institution/eval-project/archive-supervision-stat", + "evalProjectArchiveStat: {} | res.data || {}", +); + +export const evalProjectArchivePage = declareRequest( + "evalProjectArchivePageLoading", + "Get > /safetyEval/institution/eval-project/archive-supervision-page", +); + // ===== 机构端-安评报告库 ===== export const evalReportSummary = declareRequest( diff --git a/src/pages/Container/EduTraining/ClassManage/Add/CourseTab.js b/src/pages/Container/EduTraining/ClassManage/Add/CourseTab.js index b97531e..b72a6f5 100644 --- a/src/pages/Container/EduTraining/ClassManage/Add/CourseTab.js +++ b/src/pages/Container/EduTraining/ClassManage/Add/CourseTab.js @@ -8,10 +8,10 @@ import { NS_COURSEWARE } from "~/enumerate/namespace"; import { COURSEWARE_STATUS_MAP } from "~/enumerate/constant"; import ClassPaperConfig from "./PaperConfig"; -/** 视频累计时长(小时)→ “X分钟Y秒” */ -const formatVideoDuration = (hours) => { - if (hours == null) return "-"; - const totalSeconds = Math.round(hours * 3600); + +const formatVideoDuration = (min) => { + if (min == null) return "-"; + const totalSeconds = Math.round(min * 60); return `${Math.floor(totalSeconds / 60)}分钟${totalSeconds % 60}秒`; }; diff --git a/src/pages/Container/Layout/menuConfig.js b/src/pages/Container/Layout/menuConfig.js index 0c6f4b0..73e0087 100644 --- a/src/pages/Container/Layout/menuConfig.js +++ b/src/pages/Container/Layout/menuConfig.js @@ -213,6 +213,11 @@ const menuItems = [ label: "项目踏勘监管", icon: , }, + { + key: "/safetyEval/container/Supervision/EvalProjectDatabase", + label: "归档项目档案库", + icon: , + }, { key: "/safetyEval/container/Supervision/EvalReportDatabase", label: "历史报告数据库", diff --git a/src/pages/Container/Supervision/EvalProjectDatabase/index.js b/src/pages/Container/Supervision/EvalProjectDatabase/index.js index e69de29..065bd67 100644 --- a/src/pages/Container/Supervision/EvalProjectDatabase/index.js +++ b/src/pages/Container/Supervision/EvalProjectDatabase/index.js @@ -0,0 +1,198 @@ +import React, { useEffect, useState } from "react"; +import { Form, Table } from "antd"; +import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; +import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper"; +import SearchForm from "~/components/SearchForm"; +import StatCardGroup from "~/components/StatCardGroup"; +import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; +import { EVAL_TYPE_OPTIONS, EVAL_TYPE_MAP } from "~/enumerate/constant"; +import { tools } from "@cqsjjb/jjb-common-lib"; +import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; +import "./index.less"; + + +const { router } = tools; + +/** 统计卡片:字段对应 archive-supervision-stat 接口 */ +const STAT_ITEMS = [ + { key: "inLibraryArchiveCount", title: "在库项目档案", valueColor: "#1677ff" }, + { key: "processFileCount", title: "流程文档", valueColor: "#52c41a" }, + { key: "additionalFileCount", title: "机构补充文件", valueColor: "#fa8c16" }, +]; + + +function EvalProjectDatabase(props) { + const [searchForm] = Form.useForm(); + const [dataSource, setDataSource] = useState([]); + const [total, setTotal] = useState(0); + + const { + safetyEvalBusiness, + evalProjectArchiveStat, + evalProjectArchivePage, + } = props; + const { + evalProjectArchiveStatLoading, + evalProjectArchivePageLoading, + } = safetyEvalBusiness || {}; + const statData = safetyEvalBusiness?.evalProjectArchiveStat || {}; + + const getData = async () => { + const params = { + ...router.query, + current: Number(router.query.current) || 1, + size: Number(router.query.size) || 10, + }; + const res = await evalProjectArchivePage(params); + if (res?.success !== false) { + setDataSource(res?.data || []); + setTotal(res?.total || 0); + } + }; + + useEffect(() => { + searchForm.setFieldsValue({ ...router.query }); + evalProjectArchiveStat(); + getData(); + }, []); + + const handleSearch = (values) => { + router.query = { ...values, current: 1, size: 10 }; + getData(); + }; + + const handleReset = (value) => { + searchForm.resetFields(); + router.query = { ...value, current: 1, size: 10 }; + getData(); + }; + + const handlePageChange = (pagination) => { + router.query = { + ...router.query, + current: pagination.current, + size: pagination.pageSize, + }; + getData(); + }; + + const columns = [ + { title: "项目编号", dataIndex: "projectNo", width: 140 }, + { + title: "项目名称", + dataIndex: "projectName", + width: 260, + ellipsis: true, + }, + { + title: "评价机构", + dataIndex: "orgName", + width: 260, + ellipsis: true, + }, + { + title: "评价类型", + dataIndex: "evalTypeName", + width: 180, + render: (v, record) => v || EVAL_TYPE_MAP[record.evalTypeCode] || "-", + }, + { + title: "流程文档", + dataIndex: "processFileCount", + width: 110, + render: (v) => (v == null ? "-" : `${v}份`), + }, + { + title: "补充文件", + dataIndex: "additionalFileCount", + width: 110, + render: (v) => (v == null ? "-" : `${v}份`), + }, + { + title: "最近更新", + dataIndex: "updateTime", + }, + { + title: "操作", + dataIndex: "operate", + fix: 'right', + width: 200, + render: (_, record) => { + return + { + props.history.push(`/container/MonitorManage/EvalProjectMonitor/Detail?id=${record.id}`) + }}>项目过程 + + } + }, + ]; + + return ( + + ({ ...item, value: statData[item.key] }))} + loading={evalProjectArchiveStatLoading} + /> + +
+ 数据范围: + 仅展示通过本系统执行项目形成的过程文档和机构补充文件;历史正式报告仍在「历史报告数据库」中管理和抽检。 +
+ + + + , + + + , + + + , + ]} + onFinish={handleSearch} + onReset={handleReset} + /> + + `共 ${t} 条`, + }} + onChange={handlePageChange} + /> + + ); +} + +export default Connect([NS_SAFETY_EVAL_BUSINESS], true)( + AntdTableFuncControl(EvalProjectDatabase), +); diff --git a/src/pages/Container/Supervision/EvalProjectDatabase/index.less b/src/pages/Container/Supervision/EvalProjectDatabase/index.less new file mode 100644 index 0000000..ccdefbb --- /dev/null +++ b/src/pages/Container/Supervision/EvalProjectDatabase/index.less @@ -0,0 +1,11 @@ +/* EvalProjectDatabase — 项目档案监管(前缀 epd-) */ +.epd-note { + margin: 12px 0 16px; + padding: 10px 16px; + color: rgba(0, 0, 0, 65%); + font-size: 13px; + line-height: 1.6; + background: #fffbe6; + border: 1px solid #ffe58f; + border-radius: 6px; +}