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: "所有人员均已添加" }}
+ />
+
+
-
+