From 7955cc1595a782f93622a2333595d93dd5acc406 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Tue, 28 Jul 2026 09:44:10 +0800 Subject: [PATCH 1/5] feat --- src/pages/Container/Layout/index.jsx | 20 +++++++++++++++----- src/pages/Container/index.js | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/pages/Container/Layout/index.jsx b/src/pages/Container/Layout/index.jsx index 5c4b0a6..73e89ba 100644 --- a/src/pages/Container/Layout/index.jsx +++ b/src/pages/Container/Layout/index.jsx @@ -45,14 +45,22 @@ function saveState(tabs, activeKey) { export default function SimulatedLayout({ children, history }) { const [collapsed, setCollapsed] = useState(false); const [state, setState] = useState(loadState); - const currentPath = window.location.pathname; + const [currentPath, setCurrentPath] = useState(window.location.pathname); - // 页面加载时自动将当前路径加入标签 + // 监听路由变化,更新 currentPath + useEffect(() => { + const unlisten = history?.listen?.((location) => { + setCurrentPath(location.pathname || window.location.pathname); + }); + return () => unlisten?.(); + }, [history]); + + // 路由变化时自动将当前路径加入标签 useEffect(() => { if (currentPath && !currentPath.endsWith("/container/")) { addTab(currentPath); } - }, []); // 仅挂载时执行一次 + }, [currentPath]); /* ---- 标签操作 ---- */ const addTab = useCallback((path) => { @@ -73,9 +81,11 @@ export default function SimulatedLayout({ children, history }) { const navigateTo = useCallback((path) => { if (path !== currentPath) { - window.location.href = path; + history.replace(path.replace(/^\/safetyEval/, "")); + // history.listen 可能不存在,手动同步 currentPath + setCurrentPath(window.location.pathname); } - }, [currentPath]); + }, [currentPath, history]); const handleCloseTab = useCallback((targetKey) => { setState((prev) => { diff --git a/src/pages/Container/index.js b/src/pages/Container/index.js index 3c8a527..3c32105 100644 --- a/src/pages/Container/index.js +++ b/src/pages/Container/index.js @@ -61,7 +61,7 @@ export default class Container extends React.Component { function AppMiddle(props) { const content = process.env.NODE_ENV === "development" && !window.__POWERED_BY_QIANKUN__ && props.location.pathname !== "/container/Driver" - ? {props.children} + ? {props.children} : props.children; return ( From 7aa52f77fe1f929593a91b2b923630a00f0c2307 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Tue, 28 Jul 2026 11:17:10 +0800 Subject: [PATCH 2/5] feat --- src/components/AttachmentUpload/index.js | 7 +- .../EvalProject/Create/index.js | 2 +- .../ProjectFlow/ContractContent.js | 8 +- .../ProjectFlow/RiskAnalysisContent.js | 114 ++++++++++-------- 4 files changed, 73 insertions(+), 58 deletions(-) diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index 729fe00..1b1b507 100644 --- a/src/components/AttachmentUpload/index.js +++ b/src/components/AttachmentUpload/index.js @@ -4,7 +4,7 @@ import { PlusOutlined } from "@ant-design/icons"; const isImage = (url) => /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(url || ""); -export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept, extra ,rules }) { +export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept, extra ,rules, style }) { const [previewImage, setPreviewImage] = useState(""); return ( @@ -13,6 +13,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou name={name} label={label} extra={extra} + style={style} valuePropName="fileList" rules={rules} getValueProps={(value) => { @@ -90,7 +91,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou - + />} ); } diff --git a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js index 271d8dc..cb93079 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js +++ b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/index.js @@ -103,7 +103,7 @@ const EvalProjectCreate = (props) => { name: item.userName, deptName: item.deptName, posName: item.postName, - capacity: '龟派气功波', + capacity: '', })), }; if (isView) { diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js index a59e6c1..4259301 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js @@ -501,10 +501,12 @@ const ContractContent = (props) => { - diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js index 58d9acd..d7c228a 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js @@ -21,6 +21,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions"; import { tools } from "@cqsjjb/jjb-common-lib"; +import AttachmentUpload from "~/components/AttachmentUpload"; const { router } = tools; const { TextArea } = Input; @@ -64,6 +65,7 @@ const RiskAnalysisContent = (props) => { if (res?.success !== false && res?.data) { form.setFieldsValue({ ...res.data, + riskFileUrl: res.data.riskFileUrl? JSON.parse(res.data.riskFileUrl) :undefined, analysisDate: res.data.analysisDate ? dayjs(res.data.analysisDate) : undefined, @@ -96,6 +98,7 @@ const RiskAnalysisContent = (props) => { ...rest, projectId, statusCode, + riskFileUrl: rest.riskFileUrl? JSON.stringify(rest.riskFileUrl) :undefined, analysisDate: analysisDate ? analysisDate.format("YYYY-MM-DD") : undefined, @@ -325,7 +328,7 @@ const RiskAnalysisContent = (props) => { - + {(fields, { add, remove }) => { addParticipantRef.current = add; @@ -463,55 +466,14 @@ const RiskAnalysisContent = (props) => { - setParticipantModalOpen(false)} - onOk={() => { - const selected = ( - evalProjectDetailData?.participants || [] - ).filter((p) => selectedParticipantIds.includes(p.id)); - selected.forEach((p) => { - addParticipantRef.current?.({ - personnelId: p.id, - personnelName: p.name, - deptName: p.deptName, - opinion: "", - projectId, - }); - }); - setParticipantModalOpen(false); - }} - > - { - const existing = ( - form.getFieldValue("participants") || [] - ).map((p) => p.personnelName); - return (evalProjectDetailData?.participants || []).filter( - (p) => !existing.includes(p.name), - ); - })()} - rowKey="id" - rowSelection={{ - type: "checkbox", - selectedRowKeys: selectedParticipantIds, - onChange: (keys) => setSelectedParticipantIds(keys), - getCheckboxProps: (record) => ({ - disabled: false, - }), - }} - columns={[ - { title: "姓名", dataIndex: "name", width: 100 }, - { title: "部门", dataIndex: "deptName", width: 120 }, - { title: "岗位", dataIndex: "posName", width: 120 }, - { title: "能力", dataIndex: "capacity", width: 120 }, - ]} - pagination={false} - size="small" - locale={{ emptyText: "所有人员均已添加" }} - /> - + @@ -558,6 +520,56 @@ const RiskAnalysisContent = (props) => { + setParticipantModalOpen(false)} + onOk={() => { + const selected = (evalProjectDetailData?.participants || []).filter( + (p) => selectedParticipantIds.includes(p.id), + ); + selected.forEach((p) => { + addParticipantRef.current?.({ + personnelId: p.id, + personnelName: p.name, + deptName: p.deptName, + opinion: "", + projectId, + }); + }); + setParticipantModalOpen(false); + }} + > +
{ + const existing = (form.getFieldValue("participants") || []).map( + (p) => p.personnelName, + ); + return (evalProjectDetailData?.participants || []).filter( + (p) => !existing.includes(p.name), + ); + })()} + rowKey="id" + rowSelection={{ + type: "checkbox", + selectedRowKeys: selectedParticipantIds, + onChange: (keys) => setSelectedParticipantIds(keys), + getCheckboxProps: (record) => ({ + disabled: false, + }), + }} + columns={[ + { title: "姓名", dataIndex: "name", width: 100 }, + { title: "部门", dataIndex: "deptName", width: 120 }, + { title: "岗位", dataIndex: "posName", width: 120 }, + { title: "能力", dataIndex: "capacity", width: 120 }, + ]} + pagination={false} + size="small" + locale={{ emptyText: "所有人员均已添加" }} + /> + + - + - {QUALIFICATION_INDUSTRY_OPTIONS.map((opt) => ( {opt.label} @@ -314,6 +316,18 @@ const EvalProjectCreate = (props) => { + + + + + + + + From 23a6e3560483f579cc7cc2b87525636c400f7e68 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Tue, 28 Jul 2026 13:58:58 +0800 Subject: [PATCH 4/5] feat --- .../ProjectFlow/InternalReviewContent.js | 94 ++++++++------ .../ProjectFlow/SurveyContent.js | 115 ++++++++++++------ .../ProjectFlow/TechnicalReviewContent.js | 68 +++++++---- 3 files changed, 180 insertions(+), 97 deletions(-) diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js index 4b77263..b7cd5e5 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js @@ -71,7 +71,6 @@ const InternalReviewContent = (props) => { setRows(next); }; - const isDispatched = internalReview?.reviewerSignatureTaskStatus === "dispatched"; const problemCount = rows.filter( @@ -80,41 +79,51 @@ const InternalReviewContent = (props) => { const handleAssign = async () => { if (!projectId) return; - const res = await props.evalInternalReviewAssign({ projectId, signTaskPersonCmd:{ - signerPersonnelId: selectedReviewer, - signerName: reviewers.find((item) => item.personnelId === selectedReviewer)?.personnelName , - } }); + await handleConfirm("not_passed"); + const res = await props.evalInternalReviewAssign({ + projectId, + signTaskPersonCmd: { + signerPersonnelId: selectedReviewer, + signerName: reviewers.find( + (item) => item.personnelId === selectedReviewer, + )?.personnelName, + }, + }); if (res?.success !== false) { message.success("已下发签字任务"); - fetchDetail(); } }; const handleConfirm = async (resultCode) => { - if (!projectId) return; - const payload = { - id: internalReview?.id, - projectId, - resultCode, - opinionContent: overallOpinion, - reviewItems: rows.map((r) => ({ - bizType: "eval_internal_review", - bizId: internalReview?.id, - reviewDimensionCode: r.reviewDimensionCode, - reviewDimensionName: r.reviewDimensionName, - reviewFocus: r.reviewFocus, - reviewConclusion: r.reviewConclusion, - reviewOpinion: r.reviewOpinion, - })), - }; - const res = await props.evalInternalReviewConfirm(payload); - if (res?.success !== false) { - message.success( - resultCode === "passed" ? "已提交" : "已保存", - ); - fetchDetail(); - props.getDetail?.(); - } + return new Promise(async (resolve, reject) => { + if (!projectId) return; + const payload = { + id: internalReview?.id, + projectId, + resultCode, + opinionContent: overallOpinion, + reviewItems: rows.map((r) => ({ + bizType: "eval_internal_review", + bizId: internalReview?.id, + reviewDimensionCode: r.reviewDimensionCode, + reviewDimensionName: r.reviewDimensionName, + reviewFocus: r.reviewFocus, + reviewConclusion: r.reviewConclusion, + reviewOpinion: r.reviewOpinion, + })), + }; + const res = await props.evalInternalReviewConfirm(payload); + if (res?.success !== false) { + message.success(resultCode === "passed" ? "已提交" : "已保存"); + resolve(res); + if (resultCode === "passed") { + props.getDetail?.(); + } + } + else{ + reject(res); + } + }); }; const columns = [ @@ -128,7 +137,9 @@ const InternalReviewContent = (props) => {