Merge remote-tracking branch 'origin/dev-tmp1' into dev-tmp1
# Conflicts: # src/pages/Container/QualificationReview/FilingTabs/index.js # src/pages/Container/Supervision/BasicInfo/RegisteredOrg/Detail/index.jsdev-tmp1
commit
e33a72599d
|
|
@ -991,6 +991,8 @@ function StaffFormModal({
|
||||||
<Select
|
<Select
|
||||||
placeholder="请选择注安专业类别"
|
placeholder="请选择注安专业类别"
|
||||||
allowClear
|
allowClear
|
||||||
|
showSearch
|
||||||
|
optionFilterProp="label"
|
||||||
options={REGISTER_ENGINEER_CATEGORY_OPTIONS}
|
options={REGISTER_ENGINEER_CATEGORY_OPTIONS}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
@ -1170,6 +1172,8 @@ function StaffFormModal({
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
placeholder="请选择专业能力"
|
placeholder="请选择专业能力"
|
||||||
|
showSearch
|
||||||
|
optionFilterProp="label"
|
||||||
allowClear
|
allowClear
|
||||||
options={CAPABILITY_OPTIONS}
|
options={CAPABILITY_OPTIONS}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,26 @@ const { Text } = Typography;
|
||||||
const TABS_KEY = "sim_layout_tabs";
|
const TABS_KEY = "sim_layout_tabs";
|
||||||
const ACTIVE_KEY = "sim_layout_active";
|
const ACTIVE_KEY = "sim_layout_active";
|
||||||
|
|
||||||
|
/* ---- 路径规范化:统一补全 /safetyEval 前缀,避免同一路由生成多个标签 ---- */
|
||||||
|
const normalizePath = (path) => {
|
||||||
|
if (!path) return path;
|
||||||
|
return path.startsWith("/safetyEval") ? path : `/safetyEval${path}`;
|
||||||
|
};
|
||||||
|
|
||||||
/* ---- sessionStorage 持久化 ---- */
|
/* ---- sessionStorage 持久化 ---- */
|
||||||
function loadState() {
|
function loadState() {
|
||||||
try {
|
try {
|
||||||
const tabs = JSON.parse(sessionStorage.getItem(TABS_KEY) || "[]");
|
const rawTabs = JSON.parse(sessionStorage.getItem(TABS_KEY) || "[]");
|
||||||
const activeKey = sessionStorage.getItem(ACTIVE_KEY) || "";
|
const tabs = rawTabs.map((t) => ({ ...t, key: normalizePath(t.key) }));
|
||||||
return { tabs, activeKey };
|
// 路由去重:相同路由只保留一个标签
|
||||||
|
const seen = new Set();
|
||||||
|
const deduped = tabs.filter((t) => {
|
||||||
|
if (seen.has(t.key)) return false;
|
||||||
|
seen.add(t.key);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
const activeKey = normalizePath(sessionStorage.getItem(ACTIVE_KEY) || "");
|
||||||
|
return { tabs: deduped, activeKey };
|
||||||
} catch {
|
} catch {
|
||||||
return { tabs: [], activeKey: "" };
|
return { tabs: [], activeKey: "" };
|
||||||
}
|
}
|
||||||
|
|
@ -45,12 +59,12 @@ function saveState(tabs, activeKey) {
|
||||||
export default function SimulatedLayout({ children, history }) {
|
export default function SimulatedLayout({ children, history }) {
|
||||||
const [collapsed, setCollapsed] = useState(false);
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
const [state, setState] = useState(loadState);
|
const [state, setState] = useState(loadState);
|
||||||
const [currentPath, setCurrentPath] = useState(window.location.pathname);
|
const [currentPath, setCurrentPath] = useState(() => normalizePath(window.location.pathname));
|
||||||
|
|
||||||
// 监听路由变化,更新 currentPath
|
// 监听路由变化,更新 currentPath
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const unlisten = history?.listen?.((location) => {
|
const unlisten = history?.listen?.((location) => {
|
||||||
setCurrentPath(location.pathname || window.location.pathname);
|
setCurrentPath(normalizePath(location.pathname || window.location.pathname));
|
||||||
});
|
});
|
||||||
return () => unlisten?.();
|
return () => unlisten?.();
|
||||||
}, [history]);
|
}, [history]);
|
||||||
|
|
@ -80,10 +94,10 @@ export default function SimulatedLayout({ children, history }) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const navigateTo = useCallback((path) => {
|
const navigateTo = useCallback((path) => {
|
||||||
if (path !== currentPath) {
|
const normalized = normalizePath(path);
|
||||||
history.replace(path.replace(/^\/safetyEval/, ""));
|
if (normalized !== currentPath) {
|
||||||
// history.listen 可能不存在,手动同步 currentPath
|
history.replace(normalized.replace(/^\/safetyEval/, ""));
|
||||||
setCurrentPath(window.location.pathname);
|
setCurrentPath(normalized);
|
||||||
}
|
}
|
||||||
}, [currentPath, history]);
|
}, [currentPath, history]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { useMemo } from "react";
|
||||||
import { Form, Input, InputNumber, Row, Col, Select, Checkbox } from "antd";
|
import { Form, Input, InputNumber, Row, Col, Select, Checkbox } from "antd";
|
||||||
import {
|
import {
|
||||||
CHONGQING_DISTRICTS,
|
CHONGQING_DISTRICTS,
|
||||||
|
|
@ -7,6 +8,16 @@ import { FILING_UNIT_TYPE_OPTIONS } from "~/enumerate/qualFilingOptions";
|
||||||
import AttachmentUpload from "~/components/AttachmentUpload";
|
import AttachmentUpload from "~/components/AttachmentUpload";
|
||||||
|
|
||||||
export default function BasicInfoStep({ form, disabled, mode }) {
|
export default function BasicInfoStep({ form, disabled, mode }) {
|
||||||
|
const industryOptions = useMemo(() => {
|
||||||
|
const orgInfo = JSON.parse(sessionStorage.getItem("orgInfo") || "{}");
|
||||||
|
const codes = orgInfo?.safetyIndustryCategoryCode;
|
||||||
|
if (Array.isArray(codes) && codes.length > 0) {
|
||||||
|
return QUALIFICATION_INDUSTRY_OPTIONS.filter((item) =>
|
||||||
|
codes.includes(item.value),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return QUALIFICATION_INDUSTRY_OPTIONS;
|
||||||
|
}, []);
|
||||||
return (
|
return (
|
||||||
<Form form={form} layout="vertical" disabled={disabled}>
|
<Form form={form} layout="vertical" disabled={disabled}>
|
||||||
<Row gutter={16}>
|
<Row gutter={16}>
|
||||||
|
|
@ -17,7 +28,7 @@ export default function BasicInfoStep({ form, disabled, mode }) {
|
||||||
rules={[{ required: !disabled, message: "请选择业务范围" }]}
|
rules={[{ required: !disabled, message: "请选择业务范围" }]}
|
||||||
>
|
>
|
||||||
<Checkbox.Group
|
<Checkbox.Group
|
||||||
options={QUALIFICATION_INDUSTRY_OPTIONS}
|
options={industryOptions}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
@ -76,7 +87,7 @@ export default function BasicInfoStep({ form, disabled, mode }) {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
{mode!=='application' &&<Col span={12}>
|
{mode!=='application' &&<Col span={12}>
|
||||||
<Form.Item name="qualCertNo" label="资质证书编号" rules={[{ required: !disabled, message: "请输入资质证书编号" }]}>
|
<Form.Item name="filingNo" label="资质证书编号" rules={[{ required: !disabled, message: "请输入资质证书编号" }]}>
|
||||||
<Input placeholder="资质证书编号" maxLength={32} />
|
<Input placeholder="资质证书编号" maxLength={32} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>}
|
</Col>}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue