fix
parent
4a3a1aba76
commit
5991b95195
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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}秒`;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -213,6 +213,11 @@ const menuItems = [
|
|||
label: "项目踏勘监管",
|
||||
icon: <EnvironmentOutlined />,
|
||||
},
|
||||
{
|
||||
key: "/safetyEval/container/Supervision/EvalProjectDatabase",
|
||||
label: "归档项目档案库",
|
||||
icon: <FileProtectOutlined />,
|
||||
},
|
||||
{
|
||||
key: "/safetyEval/container/Supervision/EvalReportDatabase",
|
||||
label: "历史报告数据库",
|
||||
|
|
|
|||
|
|
@ -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 <TableAction>
|
||||
<a onClick={() => {
|
||||
props.history.push(`/container/MonitorManage/EvalProjectMonitor/Detail?id=${record.id}`)
|
||||
}}>项目过程</a>
|
||||
</TableAction>
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageLayout title="项目档案监管">
|
||||
<StatCardGroup
|
||||
items={STAT_ITEMS.map((item) => ({ ...item, value: statData[item.key] }))}
|
||||
loading={evalProjectArchiveStatLoading}
|
||||
/>
|
||||
|
||||
<div className="epd-note">
|
||||
<strong>数据范围:</strong>
|
||||
仅展示通过本系统执行项目形成的过程文档和机构补充文件;历史正式报告仍在「历史报告数据库」中管理和抽检。
|
||||
</div>
|
||||
|
||||
<SearchForm
|
||||
form={searchForm}
|
||||
loading={false}
|
||||
style={{ marginBottom: 16 }}
|
||||
formLine={[
|
||||
<Form.Item key="keyword" name="keyword">
|
||||
<ControlWrapper.Input
|
||||
label="项目名称/编号"
|
||||
placeholder="输入项目名称或编号"
|
||||
allowClear
|
||||
/>
|
||||
</Form.Item>,
|
||||
<Form.Item key="orgName" name="orgName">
|
||||
<ControlWrapper.Input
|
||||
label="评价机构"
|
||||
placeholder="输入评价机构"
|
||||
allowClear
|
||||
/>
|
||||
</Form.Item>,
|
||||
<Form.Item key="evalTypeCode" name="evalTypeCode">
|
||||
<ControlWrapper.Select
|
||||
label="评价类型"
|
||||
placeholder="全部"
|
||||
allowClear
|
||||
options={EVAL_TYPE_OPTIONS}
|
||||
/>
|
||||
</Form.Item>,
|
||||
]}
|
||||
onFinish={handleSearch}
|
||||
onReset={handleReset}
|
||||
/>
|
||||
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
loading={evalProjectArchivePageLoading}
|
||||
scroll={{ y: props.scrollY, x: 1100 }}
|
||||
pagination={{
|
||||
total,
|
||||
current: Number(router.query.current) || 1,
|
||||
pageSize: Number(router.query.size) || 10,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
}}
|
||||
onChange={handlePageChange}
|
||||
/>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_SAFETY_EVAL_BUSINESS], true)(
|
||||
AntdTableFuncControl(EvalProjectDatabase),
|
||||
);
|
||||
|
|
@ -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;
|
||||
}
|
||||
Loading…
Reference in New Issue