no message

dev
853931625@qq.com 2025-12-17 18:01:18 +08:00
parent a13752b8bb
commit c61b34df0d
42 changed files with 680 additions and 561 deletions

View File

@ -16,8 +16,8 @@ module.exports = {
// 应用后端分支名称,部署上线需要 // 应用后端分支名称,部署上线需要
javaGitBranch: "<branch-name>", javaGitBranch: "<branch-name>",
// 接口服务地址 // 接口服务地址
API_HOST: "https://gbs-gateway.qhdsafety.com", API_HOST: "",
// API_HOST: "http://192.168.20.100:30140",
}, },
}, },
// 应用唯一标识符 // 应用唯一标识符
@ -26,8 +26,8 @@ module.exports = {
contextInject: { contextInject: {
// 应用Key // 应用Key
appKey: "", appKey: "",
// fileUrl: "http://192.168.20.240:9787/mnt/", fileUrl: "http://192.168.20.240:9787/mnt/",
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/", // fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
}, },
// public/index.html注入全局变量 // public/index.html注入全局变量
windowInject: { windowInject: {

View File

@ -32,7 +32,7 @@
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"relation-graph": "^2.2.11", "relation-graph": "^2.2.11",
"zy-react-library": "^1.0.152" "zy-react-library": "^1.0.153"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^5.4.1", "@antfu/eslint-config": "^5.4.1",

View File

@ -38,11 +38,17 @@ export const postAll = declareRequest(
"userLoading", "userLoading",
"Post > @/basicInfo/post/listAll", "Post > @/basicInfo/post/listAll",
); );
// 获取角色 // 股份端获取角色
export const rolesAll = declareRequest( export const rolesAll = declareRequest(
"userLoading", "userLoading",
"Get > /system/operation/roles", "Get > /system/operation/roles",
); );
// 获取角色
export const authRolesAll = declareRequest(
"userLoading",
"Get > /system/operation/roles/auth-role",
);
export const dictData = declareRequest( export const dictData = declareRequest(
"userLoading", "userLoading",
"Get > /config/dict-trees/list/by/dictValues?", "Get > /config/dict-trees/list/by/dictValues?",
@ -82,5 +88,5 @@ export const reviewStatus = declareRequest(
// 用户变更详情 // 用户变更详情
export const getChangerRecordInfoById = declareRequest( export const getChangerRecordInfoById = declareRequest(
"userLoading", "userLoading",
"Post > @/basicInfo/userChangeRecord/getChangerRecordInfoById", "Post > @/basicInfo/userCorpRecord/getUserCorpRecordById",
); );

View File

@ -3,6 +3,7 @@ import RelationGraph from "relation-graph/react";
import { MySwitch } from "./RGDemoComponents/MyUIComponents"; import { MySwitch } from "./RGDemoComponents/MyUIComponents";
const ExpandAnimation = (departmentData) => { const ExpandAnimation = (departmentData) => {
console.log(departmentData);
const graphRef = useRef(null); const graphRef = useRef(null);
const [relayout, setRelayout] = useState(true); const [relayout, setRelayout] = useState(true);

View File

@ -85,24 +85,13 @@ function Info(props) {
label: "规模", label: "规模",
children: info.scaleName, children: info.scaleName,
}, },
{
label: "是否规模以上",
children: (
<div>
{info.scaleType === 1
? "是"
: info.scaleType === 0
? "否"
: ""}
</div>
),
},
{ {
label: "经度/纬度", label: "经度/纬度",
children: info.longitude && `${info.longitude}/${info.latitude}`, children: info.longitude && `${info.longitude}/${info.latitude}`,
}, },
{ {
label: "职工人数", label: "职工人数(人)",
children: info.employees, children: info.employees,
}, },
{ {
@ -214,7 +203,18 @@ function Info(props) {
</div> </div>
), ),
}, },
{
label: "是否规模以上",
children: (
<div>
{info.scaleType === 1
? "是"
: info.scaleType === 0
? "否"
: ""}
</div>
),
},
{ {
label: "企事业单位经营地址", label: "企事业单位经营地址",
children: info.addressBusiness, children: info.addressBusiness,

View File

@ -374,7 +374,7 @@ function Update(props) {
span: 24, span: 24,
}, },
{ {
label: "职工人数", label: "职工人数(人)",
name: "employees", name: "employees",
required: false, required: false,
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,

View File

@ -23,10 +23,11 @@ function List(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userEmploymentLogAll"], { const { tableProps, getData } = useTable(props["userEmploymentLogAll"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
usePermission: false,
}; };
}, },
}); });

View File

@ -11,6 +11,7 @@ import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const USER_TYPE = [ const USER_TYPE = [
{ {
@ -33,7 +34,7 @@ function List(props) {
return { return {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
noMain: 1,
}; };
}, },
}); });
@ -45,23 +46,24 @@ function List(props) {
return ( return (
<div> <div>
<div <div style={{ padding: "0 20px", height: "100%" }}>
style={{
padding: 20, <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
}}
> <div style={{
<div
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree onSelect={onTreeChange} />
<div
style={{
flex: 1,
}}
> >
<LeftTree onSelect={onTreeChange} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
<Search <Search
form={form} form={form}
options={[ options={[
@ -95,6 +97,9 @@ function List(props) {
{ {
title: "身份证号", title: "身份证号",
dataIndex: "userIdCard", dataIndex: "userIdCard",
render: (_, record) => (
<div>{UseDecodeIdCard(record.userIdCard)}</div>
),
}, },
{ {
title: "手机号", title: "手机号",
@ -161,7 +166,7 @@ function List(props) {
getData={getData} getData={getData}
currentId={currentId} currentId={currentId}
requestDetails={props["userDetails"]} requestDetails={props["userDetails"]}
requwstRolesAll={props["rolesAll"]} requwstRolesAll={props["authRolesAll"]}
onCancel={() => { onCancel={() => {
setAddModalOpen(false); setAddModalOpen(false);
setCurrentId(""); setCurrentId("");
@ -202,6 +207,7 @@ function AddModalComponent(props) {
<Modal <Modal
open={props.open} open={props.open}
title="查看" title="查看"
cancelText="关闭"
width={900} width={900}
okButtonProps={{ okButtonProps={{
style: { style: {

View File

@ -47,7 +47,7 @@ function OrganizationStructure(props) {
return; return;
const current = nodes[nodes.length - 1]; const current = nodes[nodes.length - 1];
setPathNodes(nodes); // 记录完整路径 setPathNodes(nodes);
setSelectedNodeId(current.id); setSelectedNodeId(current.id);
setSelectedNodeName(current.name); setSelectedNodeName(current.name);
@ -76,9 +76,8 @@ function OrganizationStructure(props) {
message.warning("已是顶级部门,无法继续返回"); message.warning("已是顶级部门,无法继续返回");
return; return;
} }
// 移除当前节点 const parent = pathNodes[pathNodes.length - 2]; // 上一级节点
const parent = pathNodes[pathNodes.length - 1]; setSelectedNodeId(parent.id);
setSelectedNodeId(parent.parentId);
setSelectedNodeName(parent.name); setSelectedNodeName(parent.name);
const newPaths = pathNodes.slice(0, -1); const newPaths = pathNodes.slice(0, -1);
setPathNodes(newPaths); setPathNodes(newPaths);
@ -87,30 +86,35 @@ function OrganizationStructure(props) {
const handleTableNodeClick = (record) => { const handleTableNodeClick = (record) => {
const currentPath = pathNodes; const currentPath = pathNodes;
// 情况1当前路径为空如初始化状态
if (currentPath.length === 0) { if (currentPath.length === 0) {
setPathNodes([record]); setPathNodes([record]);
// 无法构建路径,只切换选中项
setSelectedNodeId(record.id);
setSelectedNodeName(record.name);
getData();
} }
else { else {
// 安全地扩展路径
const newPath = [...currentPath, { id: record.id, name: record.name, parentId: record.parentId }]; const newPath = [...currentPath, { id: record.id, name: record.name, parentId: record.parentId }];
setPathNodes(newPath); setPathNodes(newPath);
setSelectedNodeId(record.id);
setSelectedNodeName(record.name);
getData();
} }
setSelectedNodeId(record.id);
setSelectedNodeName(record.name);
getData();
}; };
return ( return (
<div style={{ padding: 20 }}> <div style={{ padding: "0 20px", height: "100%" }}>
<div style={{ display: "flex", gap: 20 }}> <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
<LeftTree key={treeKey} onGetNodePaths={onGetNodePaths} /> <div style={{
<div style={{ flex: 1 }}> display: "flex",
minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}}
>
<LeftTree key={treeKey} onGetNodePaths={onGetNodePaths} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
<Search <Search
form={form} form={form}
options={[ options={[
@ -123,11 +127,11 @@ function OrganizationStructure(props) {
]} ]}
onFinish={getData} onFinish={getData}
/> />
<Table <div style={{ flex: 1, minHeight: 0, marginTop: 16 }}>
toolBarRender={() => ( <Table
<> toolBarRender={() => (
{props.permission("zzjgqyd-add") <>
&& ( {props.permission("zzjgqyd-add") && (
<Button <Button
type="primary" type="primary"
icon={<AddIcon />} icon={<AddIcon />}
@ -136,36 +140,37 @@ function OrganizationStructure(props) {
新增 新增
</Button> </Button>
)} )}
<Button icon={<LeftOutlined />} onClick={fnReturn} hidden={pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")}>
返回
</Button>
</>
)}
columns={[
{
title: "部门名称",
dataIndex: "name",
render: (_, record) => (
<Button <Button
block icon={<LeftOutlined />}
type="link" onClick={fnReturn}
onClick={() => handleTableNodeClick(record)} hidden={pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")}
> >
{`${record.name}>`} 返回
</Button> </Button>
), </>
}, )}
{ title: "部门负责人", dataIndex: "departmentUserLeaderList" }, columns={[
{ title: "部门级别", dataIndex: "levelName" }, {
{ title: "部门名称",
title: "操作", dataIndex: "name",
width: 200, render: (_, record) => (
render: (_, record) => ( <Button
<Space> block
type="link"
{props.permission("zzjgqyd-edit") onClick={() => handleTableNodeClick(record)}
&& ( >
{`${record.name}>`}
</Button>
),
},
{ title: "部门负责人", dataIndex: "departmentUserLeaderList" },
{ title: "部门级别", dataIndex: "levelName" },
{
title: "操作",
width: 200,
render: (_, record) => (
<Space>
{props.permission("zzjgqyd-edit") && (
<Button <Button
type="link" type="link"
onClick={() => { onClick={() => {
@ -177,18 +182,18 @@ function OrganizationStructure(props) {
编辑 编辑
</Button> </Button>
)} )}
{props.permission("zzjgqyd-delete") {props.permission("zzjgqyd-delete") && (
&& (
<Button danger type="link" onClick={() => onDelete(record.id)}> <Button danger type="link" onClick={() => onDelete(record.id)}>
删除 删除
</Button> </Button>
)} )}
</Space> </Space>
), ),
}, },
]} ]}
{...tableProps} {...tableProps}
/> />
</div>
</div> </div>
</div> </div>
@ -209,7 +214,6 @@ function OrganizationStructure(props) {
onCancel={() => { onCancel={() => {
setAddModalOpen(false); setAddModalOpen(false);
setCurrentId(""); setCurrentId("");
// setSelectedNodeId("");
}} }}
/> />
)} )}
@ -217,7 +221,6 @@ function OrganizationStructure(props) {
); );
} }
// ====== AddModalComponent ======
function AddModalComponent(props) { function AddModalComponent(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [parentName, setParentName] = useState(null); const [parentName, setParentName] = useState(null);
@ -251,11 +254,6 @@ function AddModalComponent(props) {
}); });
values.parentId = props.parentId; values.parentId = props.parentId;
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
message.error("部门排序请输入正整数!");
return;
}
let res; let res;
if (props.currentId) { if (props.currentId) {
values.id = props.currentId; values.id = props.currentId;
@ -305,12 +303,26 @@ function AddModalComponent(props) {
/> />
), ),
}, },
{ name: "departmentFunction", label: "岗位职责", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false }, { name: "departmentFunction", label: "岗位职责", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
{ {
name: "depOrder", name: "depOrder",
label: "部门排序", label: "部门排序",
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,
rules: [
{
validator: (_, value) => {
if (value === undefined || value === null || value === "") {
return Promise.resolve(); // 如果非必填可移除 required这里允许空
}
const num = Number(value);
if (!Number.isInteger(num) || num <= 0) {
return Promise.reject(new Error("请输入大于0的正整数"));
}
return Promise.resolve();
},
},
],
}, },
]} ]}
labelCol={{ span: 10 }} labelCol={{ span: 10 }}

View File

@ -58,23 +58,24 @@ function Post(props) {
}; };
return ( return (
<div <div style={{ padding: "0 20px", height: "100%" }}>
style={{
padding: 20, <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
}}
> <div style={{
<div
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree onSelect={onTreeChange} />
<div
style={{
flex: 1,
}}
> >
<LeftTree onSelect={onTreeChange} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
{/* <Search */} {/* <Search */}
{/* form={form} */} {/* form={form} */}
{/* options={[ */} {/* options={[ */}

View File

@ -135,7 +135,7 @@ function List(props) {
}, },
{ {
name: "eqType", name: "eqType",
label: "相关方企业类型", label: "相关方类型",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_TYPE, items: ENTERPRISE_TYPE,
}, },
@ -304,6 +304,7 @@ function AddModalComponent(props) {
}) })
.then((res) => { .then((res) => {
const arr = []; const arr = [];
if (res.data.selectfromList && res.data.selectfromList.length > 0) { if (res.data.selectfromList && res.data.selectfromList.length > 0) {
res.data.selectfromList.forEach((item) => { res.data.selectfromList.forEach((item) => {
arr.push(item.itemCode); arr.push(item.itemCode);
@ -414,6 +415,8 @@ function AddModalComponent(props) {
width={800} width={800}
onOk={form.submit} onOk={form.submit}
onCancel={onCancel} onCancel={onCancel}
okButtonProps={{ disabled: props.loading }}
cancelButtonProps={{ disabled: props.loading }}
> >
<FormBuilder <FormBuilder
form={form} form={form}
@ -454,7 +457,7 @@ function AddModalComponent(props) {
}, },
{ {
name: "type", name: "type",
label: "相关方企业类型", label: "相关方类型",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_TYPE, items: ENTERPRISE_TYPE,
}, },

View File

@ -15,7 +15,7 @@ import { getAreaNamePath, getCorpTypeNamePath } from "~/utils";
const ENTERPRISE_TYPE = [ const ENTERPRISE_TYPE = [
{ {
bianma: 3, bianma: 3,
name: "相关方企业", name: "普通企业",
}, },
{ {
bianma: 4, bianma: 4,
@ -88,14 +88,15 @@ function View(props) {
{ {
label: "企业名称", label: "企业名称",
children: info.corpName && info.corpName, children: info.corpName && info.corpName,
span: 4,
}, },
{ // {
label: "企业状态", // label: "企业状态",
children: info.corpStateName, // children: info.corpStateName,
}, // },
{ {
label: "开户人", label: "开户人",
children: info.createName, children: info.accountContactName,
}, },
{ {
label: "统一社会信用代码", label: "统一社会信用代码",
@ -193,7 +194,7 @@ function View(props) {
children: info.createDate, children: info.createDate,
}, },
{ {
label: "职工人数", label: "职工人数(人)",
children: info.employees, children: info.employees,
}, },
// { // {

View File

@ -16,7 +16,7 @@ import { getAreaNamePath } from "~/utils";
// import { getLabelName } from "zy-react-library/utils"; // import { getLabelName } from "zy-react-library/utils";
const ENTERPRISE_TYPE = [ const ENTERPRISE_TYPE = [
{ bianma: 3, name: "相关方企业" }, { bianma: 3, name: "普通企业" },
{ bianma: 4, name: "货主单位" }, { bianma: 4, name: "货主单位" },
{ bianma: 5, name: "驻港单位" }, { bianma: 5, name: "驻港单位" },
]; ];
@ -85,7 +85,7 @@ function List(props) {
/> />
), ),
}, },
{ name: "eqType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE }, { name: "eqType", label: "相关方类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
{ {
name: "cityRecord", name: "cityRecord",
label: "属地", label: "属地",

View File

@ -15,6 +15,7 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const FLOW_USER_TYPE = [ const FLOW_USER_TYPE = [
{ {
@ -34,12 +35,13 @@ function List(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userList"], { const { tableProps, getData } = useTable(props["userList"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false, noMain: 1,
}; };
}, },
}); });
@ -165,7 +167,7 @@ function List(props) {
getData={getData} getData={getData}
currentId={currentId} currentId={currentId}
requestDetails={props["userDetails"]} requestDetails={props["userDetails"]}
requwstRolesAll={props["rolesAll"]} requwstRolesAll={props["authRolesAll"]}
requestGetEncryInfo={props["getEncryInfo"]} requestGetEncryInfo={props["getEncryInfo"]}
onCancel={() => { onCancel={() => {
setAddModalOpen(false); setAddModalOpen(false);
@ -205,7 +207,6 @@ function AddModalComponent(props) {
setInfo(res.data); setInfo(res.data);
}; };
fetchData(); fetchData();
} }
}, [props.currentId]); }, [props.currentId]);
const onCancel = () => { const onCancel = () => {
@ -231,6 +232,7 @@ function AddModalComponent(props) {
open={props.open} open={props.open}
title="查看" title="查看"
width={1200} width={1200}
cancelText="关闭"
okButtonProps={{ okButtonProps={{
style: { style: {
display: "none", display: "none",
@ -287,20 +289,20 @@ function AddModalComponent(props) {
<div> <div>
{info.phone} {info.phone}
{info.phone {/* {info.phone */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("phone"); {/* setViewType("phone"); */}
setViewData(""); {/* setViewData(""); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -309,21 +311,21 @@ function AddModalComponent(props) {
label: "身份证号", label: "身份证号",
children: ( children: (
<div> <div>
{info.userIdCard} {UseDecodeIdCard(info.userIdCard) }
{ info.userIdCard {/* { info.userIdCard */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("userIdCard"); {/* setViewType("userIdCard"); */}
form.resetFields(); {/* form.resetFields(); */}
setViewData(""); {/* setViewData(""); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),

View File

@ -15,7 +15,7 @@ import { ID_NUMBER, PHONE } from "zy-react-library/regular";
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils"; import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { useDebounce } from "~/utils"; import { useDebounce, UseDecodeIdCard } from "~/utils";
const WHETHER_ENUM = [ const WHETHER_ENUM = [
{ {
@ -59,22 +59,7 @@ function Add(props) {
id: queryParams["id"], id: queryParams["id"],
}); });
let idCardToSet = data.userIdCard; data.userIdCard = UseDecodeIdCard(data.userIdCard);
if (idCardToSet) {
// 判断是否是 Base64 格式(可选)
try {
// 尝试解码,如果成功且结果是合法身份证号,则使用
const decoded = atob(idCardToSet);
if (/^\d{17}[\dX]$/.test(decoded)) {
idCardToSet = decoded;
}
// 否则保留原值(兼容未加密数据)
}
catch {
console.warn("Not a valid Base64 string, keep as is:", idCardToSet);
}
}
data.userIdCard = idCardToSet;
data.sex = data.sex === "男" ? "1" : "0"; data.sex = data.sex === "男" ? "1" : "0";
@ -109,7 +94,7 @@ function Add(props) {
}; };
fetchData(); fetchData();
} }
props["rolesAll"]().then((res) => { props["authRolesAll"]().then((res) => {
setRolesData(res.data); setRolesData(res.data);
}); });
@ -410,6 +395,21 @@ function Add(props) {
label: "部门排序", label: "部门排序",
required: false, required: false,
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,
rules: [
{
validator: (_, value) => {
if (value === undefined || value === null || value === "") {
return Promise.resolve(); // 如果非必填可移除 required这里允许空
}
const num = Number(value);
if (!Number.isInteger(num) || num <= 0) {
return Promise.reject(new Error("请输入大于0的正整数"));
}
return Promise.resolve();
},
},
],
}, },
// { name: "rank_level", label: "人员职级", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rankData, itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } }, // { name: "rank_level", label: "人员职级", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rankData, itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } },
{ {

View File

@ -17,7 +17,9 @@ import useImportFile from "zy-react-library/hooks/useImportFile";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const WHETHER_ENUM = [ const WHETHER_ENUM = [
{ {
@ -45,6 +47,7 @@ function List(props) {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
userType: 2, userType: 2,
noMain: 1,
}; };
}, },
}); });
@ -111,37 +114,38 @@ function List(props) {
getData(); getData();
}; };
return ( return (
<div <div style={{ padding: "0 20px", height: "100%" }}>
style={{
padding: 20, <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
}}
> <div style={{
<div
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree onSelect={onTreeChange} />
<div
style={{
flex: 1,
}}
> >
<LeftTree onSelect={onTreeChange} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
<Search <Search
form={form} form={form}
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
options={[ options={[
{ {
name: "likeUsername", name: "likeName",
label: "用户名", label: "姓名",
},
{
name: "rzFlag",
label: "人资系统是否存在",
render: FORM_ITEM_RENDER_ENUM.SELECT,
items: WHETHER_ENUM,
}, },
// {
// name: "eqRzFlag",
// label: "人资系统是否存在",
// render: FORM_ITEM_RENDER_ENUM.SELECT,
// items: WHETHER_ENUM,
// },
]} ]}
onFinish={getData} onFinish={getData}
/> />
@ -214,19 +218,19 @@ function List(props) {
title: "岗位", title: "岗位",
dataIndex: "postName", dataIndex: "postName",
}, },
{ // {
title: "人资系统是否存在", // title: "人资系统是否存在",
dataIndex: "rzFlag", // dataIndex: "rzFlag",
render: (_, record) => ( // render: (_, record) => (
<div> // <div>
{record.rzFlag === 0 // {record.rzFlag === 0
? "否" // ? "否"
: record.rzFlag === 1 // : record.rzFlag === 1
? "是" // ? "是"
: ""} // : ""}
</div> // </div>
), // ),
}, // },
{ {
title: "操作", title: "操作",
width: 300, width: 300,
@ -306,7 +310,7 @@ function List(props) {
getData={getData} getData={getData}
currentId={currentId} currentId={currentId}
requestDetails={props["userDetails"]} requestDetails={props["userDetails"]}
requwstRolesAll={props["rolesAll"]} requwstRolesAll={props["authRolesAll"]}
requestGetEncryInfo={props["getEncryInfo"]} requestGetEncryInfo={props["getEncryInfo"]}
onCancel={() => { onCancel={() => {
setAddModalOpen(false); setAddModalOpen(false);
@ -367,6 +371,7 @@ function AddModalComponent(props) {
<Modal <Modal
open={props.open} open={props.open}
title="查看" title="查看"
cancelText="关闭"
width={1200} width={1200}
okButtonProps={{ okButtonProps={{
style: { style: {
@ -408,20 +413,20 @@ function AddModalComponent(props) {
<div> <div>
{info.phone} {info.phone}
{info.phone {/* {info.phone */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("phone"); {/* setViewType("phone"); */}
setViewData(""); {/* setViewData(""); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -439,21 +444,21 @@ function AddModalComponent(props) {
label: "身份证号", label: "身份证号",
children: ( children: (
<div> <div>
{info.userIdCard} {UseDecodeIdCard(info.userIdCard) }
{ info.userIdCard {/* { info.userIdCard */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("userIdCard"); {/* setViewType("userIdCard"); */}
form.resetFields(); {/* form.resetFields(); */}
setViewData(""); {/* setViewData(""); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),

View File

@ -290,6 +290,7 @@ function CorpInfo(props) {
}} }}
> >
<FormBuilder <FormBuilder
showCancelButton={false}
form={form} form={form}
loading={ loading={
deleteFileLoading deleteFileLoading
@ -297,6 +298,7 @@ function CorpInfo(props) {
|| getFileLoading || getFileLoading
|| props.enterprise.enterpriseLoading || props.enterprise.enterpriseLoading
} }
labelCol={{ span: 7 }}
options={[ options={[
{ {
label: "相关方单位基础信息", label: "相关方单位基础信息",
@ -438,7 +440,7 @@ function CorpInfo(props) {
}, },
{ {
label: "职工人数", label: "职工人数(人)",
name: "employees", name: "employees",
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,
}, },
@ -494,6 +496,7 @@ function CorpInfo(props) {
]} ]}
onFinish={onSubmit} onFinish={onSubmit}
onValuesChange={onValuesChange} onValuesChange={onValuesChange}
/> />
</div> </div>
{corpInfoQrCodeOpen && ( {corpInfoQrCodeOpen && (

View File

@ -25,8 +25,8 @@ function Department(props) {
const [selectedNodeName, setSelectedNodeName] = useState(""); const [selectedNodeName, setSelectedNodeName] = useState("");
const { getUserInfo } = useGetUserInfo(); const { getUserInfo } = useGetUserInfo();
const [pathNodes, setPathNodes] = useState([]); // 仅由 LeftTree 更新 const [pathNodes, setPathNodes] = useState([]); // 仅由 LeftTree 更新
const [treeKey, setTreeKey] = useState(0);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [treeKey, setTreeKey] = useState(0); // 初始 key
const { tableProps, getData } = useTable(props["departmentList"], { const { tableProps, getData } = useTable(props["departmentList"], {
form, form,
transform: (formData) => { transform: (formData) => {
@ -111,23 +111,26 @@ function Department(props) {
} }
}; };
return ( return (
<div
style={{ <div style={{ padding: "0 20px", height: "100%" }}>
padding: 20,
}} <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
>
<div <div style={{
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree key={treeKey} onGetNodePaths={onGetNodePaths} />
<div
style={{
flex: 1,
}}
> >
<LeftTree key={treeKey} onGetNodePaths={onGetNodePaths} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
<Search <Search
form={form} form={form}
options={[ options={[
@ -247,7 +250,6 @@ function Department(props) {
onCancel={() => { onCancel={() => {
setAddModalOpen(false); setAddModalOpen(false);
setCurrentId(""); setCurrentId("");
setSelectedNodeId("");
}} }}
/> />
)} )}
@ -285,10 +287,7 @@ function AddModalComponent(props) {
nameKey: "dictLabel", nameKey: "dictLabel",
}); });
values.parentId = props.parentId; values.parentId = props.parentId;
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
message.error("部门排序请输入正整数!");
return;
}
if (props.currentId) { if (props.currentId) {
values.parentId = props.parentId; values.parentId = props.parentId;
values.id = props.currentId; values.id = props.currentId;
@ -351,6 +350,20 @@ function AddModalComponent(props) {
name: "depOrder", name: "depOrder",
label: "部门排序", label: "部门排序",
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,
rules: [
{
validator: (_, value) => {
if (value === undefined || value === null || value === "") {
return Promise.resolve(); // 如果非必填可移除 required这里允许空
}
const num = Number(value);
if (!Number.isInteger(num) || num <= 0) {
return Promise.reject(new Error("请输入大于0的正整数"));
}
return Promise.resolve();
},
},
],
}, },
// { // {
// name: "securityFlag", // name: "securityFlag",

View File

@ -18,7 +18,7 @@ import { ID_NUMBER, PHONE } from "zy-react-library/regular";
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils"; import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce } from "~/utils"; import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce, UseDecodeIdCard } from "~/utils";
export const WHETHER_ENUM = [ export const WHETHER_ENUM = [
{ {
@ -74,22 +74,7 @@ function Add(props) {
id: queryParams["id"], id: queryParams["id"],
}); });
let idCardToSet = data.userIdCard; data.userIdCard = UseDecodeIdCard(data.userIdCard);
if (idCardToSet) {
// 判断是否是 Base64 格式(可选)
try {
// 尝试解码,如果成功且结果是合法身份证号,则使用
const decoded = atob(idCardToSet);
if (/^\d{17}[\dX]$/.test(decoded)) {
idCardToSet = decoded;
}
// 否则保留原值(兼容未加密数据)
}
catch {
console.warn("Not a valid Base64 string, keep as is:", idCardToSet);
}
}
data.userIdCard = idCardToSet;
data.sex = data.sex === "男" ? "1" : "0"; data.sex = data.sex === "男" ? "1" : "0";
setUserID(data.userId); setUserID(data.userId);
@ -169,6 +154,10 @@ function Add(props) {
message.error("年龄请输入正整数!"); message.error("年龄请输入正整数!");
return; return;
} }
if (values.cardImg.length !== 2) {
message.error("身份证照片必须上传两张");
return;
}
values.userId = userID || id; values.userId = userID || id;
if (queryParams["id"]) { if (queryParams["id"]) {
values.id = queryParams["id"]; values.id = queryParams["id"];

View File

@ -14,6 +14,7 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const JOB_STATUS = { const JOB_STATUS = {
1: "在职", 1: "在职",
@ -29,6 +30,7 @@ function List(props) {
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const [modalType, setModalType] = useState(""); const [modalType, setModalType] = useState("");
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userXgfList"], { const { tableProps, getData } = useTable(props["userXgfList"], {
form, form,
transform: (formData) => { transform: (formData) => {
@ -36,6 +38,7 @@ function List(props) {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
userType: 3, userType: 3,
noMain: 1,
}; };
}, },
}); });
@ -78,23 +81,22 @@ function List(props) {
getData(); getData();
}; };
return ( return (
<div <div style={{ padding: "0 20px", height: "100%" }}>
style={{
padding: 20, <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
}} <div style={{
>
<div
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree onSelect={onTreeChange} />
<div
style={{
flex: 1,
}}
> >
<LeftTree onSelect={onTreeChange} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
<Search <Search
form={form} form={form}
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
@ -229,7 +231,7 @@ function List(props) {
{/* ) */} {/* ) */}
{/* } */} {/* } */}
{ {
(props.permission("yhglxgf-lizhi") && record.employmentFlag === 1) && ( (record.employmentFlag === 1) && (
<Button <Button
danger danger
@ -242,7 +244,7 @@ function List(props) {
) )
} }
{ (props.permission("yhglxgf-rzsh") && record.employmentFlag === 11) { (record.employmentFlag === 11)
&& ( && (
<Button <Button
danger danger
@ -256,7 +258,7 @@ function List(props) {
入职审核 入职审核
</Button> </Button>
)} )}
{ (props.permission("yhglxgf-lzsh") && record.employmentFlag === 10) { (record.employmentFlag === 10)
&& ( && (
<Button <Button
danger danger
@ -398,7 +400,7 @@ function AddModalComponent(props) {
loading={getFileLoading} loading={getFileLoading}
footer={[ footer={[
<Button key="return" onClick={onCancel}> <Button key="return" onClick={onCancel}>
返回 关闭
</Button>, </Button>,
<Button key="reject" onClick={handleReject} hidden={props.modalType === "see"}> <Button key="reject" onClick={handleReject} hidden={props.modalType === "see"}>
驳回 驳回
@ -415,10 +417,11 @@ function AddModalComponent(props) {
}} }}
> >
<Descriptions <Descriptions
bordered bordered
items={[ items={[
{ {
label: "人脸照片", label: "用户照片",
children: <PreviewImg files={info.userImg} />, children: <PreviewImg files={info.userImg} />,
}, },
{ {
@ -448,20 +451,20 @@ function AddModalComponent(props) {
<div> <div>
{info.phone} {info.phone}
{info.phone {/* {info.phone */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("phone"); {/* setViewType("phone"); */}
setViewData(""); {/* setViewData(""); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -470,25 +473,30 @@ function AddModalComponent(props) {
label: "身份证号", label: "身份证号",
children: ( children: (
<div> <div>
{info.userIdCard} {UseDecodeIdCard(info.userIdCard) }
{ info.userIdCard {/* { info.userIdCard */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("userIdCard"); {/* setViewType("userIdCard"); */}
form.resetFields(); {/* form.resetFields(); */}
setViewData(""); {/* setViewData(""); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
}, },
{
label: "电子邮箱",
children: info.email,
},
{ {
label: "民族", label: "民族",
children: info.nationName, children: info.nationName,

View File

@ -84,19 +84,19 @@ function ResignationReview(props) {
{ {
label: "企业名称", label: "企业名称",
// 离职取变更前 入职取变更后 // 离职取变更前 入职取变更后
children: queryParams["employmentFlag"] === 10 ? info.corpinfoNameBefore : info.corpinfoNameAfter, children: info.corpinfoName,
}, },
{ {
label: "部门名称", label: "部门名称",
children: queryParams["employmentFlag"] === 10 ? info.departmentNameBefore : info.departmentNameAfter, children: info.departmentName,
}, },
{ {
label: "岗位名称", label: "岗位名称",
children: queryParams["employmentFlag"] === 10 ? info.postNameBefore : info.postNameAfter, children: info.postName,
}, },
{ {
label: "员工状态", label: "员工状态",
children: queryParams["employmentFlag"] === 10 ? JOB_STATUS[info.userStatusBefore] : JOB_STATUS[info.userStatusAfter], children: queryParams["employmentFlag"] === "10" ? "离职待审核" : "入职待审核",
}, },
{ {

View File

@ -144,11 +144,11 @@ function List(props) {
options={[ options={[
{ {
name: "likecorpName", name: "likecorpName",
label: "公司名称", label: "公司名称",
}, },
{ {
name: "eqCorpState", name: "eqCorpState",
label: "公司状态", label: "公司状态",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_STATUS, items: ENTERPRISE_STATUS,
}, },
@ -172,23 +172,23 @@ function List(props) {
{ {
props.permission("zgszhgl-add") props.permission("zgszhgl-add")
&& ( && (
<Button <Button
type="primary" type="primary"
icon={<AddIcon />} icon={<AddIcon />}
onClick={() => { onClick={() => {
setAddModalOpen(true); setAddModalOpen(true);
setOpenType("add"); setOpenType("add");
}} }}
> >
新增 新增
</Button> </Button>
) )
} }
</> </>
)} )}
columns={[ columns={[
{ {
title: "公司名称", title: "公司名称",
dataIndex: "corpName", dataIndex: "corpName",
}, },
{ {
@ -212,7 +212,7 @@ function List(props) {
// dataIndex: "ecoTypeName", // dataIndex: "ecoTypeName",
// }, // },
{ {
title: "公司状态", title: "公司状态",
dataIndex: "corpStateName", dataIndex: "corpStateName",
}, },
{ {
@ -230,7 +230,7 @@ function List(props) {
}, },
{ {
title: "操作", title: "操作",
width: 550, width: 500,
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
{" "} {" "}
@ -457,6 +457,8 @@ function AddModalComponent(props) {
width={800} width={800}
onOk={form.submit} onOk={form.submit}
onCancel={onCancel} onCancel={onCancel}
okButtonProps={{ disabled: props.loading }}
cancelButtonProps={{ disabled: props.loading }}
> >
<FormBuilder <FormBuilder
form={form} form={form}
@ -465,7 +467,7 @@ function AddModalComponent(props) {
options={[ options={[
{ {
name: "corpName", name: "corpName",
label: "公司名称", label: "公司名称",
}, },
{ {
name: "code", name: "code",
@ -509,6 +511,24 @@ function AddModalComponent(props) {
label: "列表排序", label: "列表排序",
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,
hidden: props.openType === "editName", hidden: props.openType === "editName",
rules: [
{
required: true,
message: "请输入列表排序",
},
{
validator: (_, value) => {
if (value === undefined || value === null || value === "") {
return Promise.resolve(); // 如果非必填可移除 required这里允许空
}
const num = Number(value);
if (!Number.isInteger(num) || num <= 0) {
return Promise.reject(new Error("请输入大于0的正整数"));
}
return Promise.resolve();
},
},
],
}, },
]} ]}
labelCol={{ labelCol={{

View File

@ -23,7 +23,7 @@ const ENTERPRISE_TYPE = [
}, },
{ {
bianma: 3, bianma: 3,
name: "相关方企业", name: "普通企业",
}, },
{ {
bianma: 4, bianma: 4,
@ -60,7 +60,7 @@ function View(props) {
bordered bordered
items={[ items={[
{ {
label: "公司名称", label: "公司名称",
children: info.corpName && info.corpName, children: info.corpName && info.corpName,
}, },
{ {

View File

@ -83,11 +83,11 @@ function List(props) {
options={[ options={[
{ {
name: "likecorpName", name: "likecorpName",
label: "公司名称", label: "公司名称",
}, },
{ {
name: "eqCorpState", name: "eqCorpState",
label: "公司状态", label: "公司状态",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: BRANCH_CONPANY_STATUS, items: BRANCH_CONPANY_STATUS,
}, },
@ -103,7 +103,7 @@ function List(props) {
<Table <Table
columns={[ columns={[
{ {
title: "公司名称", title: "公司名称",
dataIndex: "corpName", dataIndex: "corpName",
}, },

View File

@ -19,12 +19,13 @@ function View(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["departmentList"], { const { tableProps, getData } = useTable(props["departmentList"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
eqParentId: selectedNodeId, eqParentId: selectedNodeId,
usePermission: false,
}; };
}, },
}); });
@ -132,6 +133,7 @@ function AddModalComponent(props) {
open={props.open} open={props.open}
title="查看" title="查看"
width={800} width={800}
cancelText="关闭"
okButtonProps={{ okButtonProps={{
style: { style: {
display: "none", display: "none",

View File

@ -93,11 +93,11 @@ function List(props) {
options={[ options={[
{ {
name: "likecorpName", name: "likecorpName",
label: "公司名称", label: "公司名称",
}, },
{ {
label: "企业状态", label: "公司状态",
name: "corpState", name: "eqCorpState",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_STATUS, items: ENTERPRISE_STATUS,
}, },
@ -116,7 +116,7 @@ function List(props) {
// )} // )}
columns={[ columns={[
{ {
title: "公司名称", title: "公司名称",
dataIndex: "corpName", dataIndex: "corpName",
}, },
{ {

View File

@ -1,5 +1,5 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Descriptions, Divider, Form, Input, Modal } from "antd"; import { Descriptions, Divider, Form, Input, Modal } from "antd";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import HeaderBack from "zy-react-library/components/HeaderBack"; import HeaderBack from "zy-react-library/components/HeaderBack";
@ -59,7 +59,7 @@ function View(props) {
loading={getFileLoading} loading={getFileLoading}
items={[ items={[
{ {
label: "企业名称", label: "公司名称",
children: info.corpName && info.corpName, children: info.corpName && info.corpName,
}, },
{ {
@ -92,7 +92,7 @@ function View(props) {
}, },
{ {
label: "职工人数", label: "职工人数(人)",
children: info.employees, children: info.employees,
}, },
{ {
@ -209,21 +209,21 @@ function View(props) {
<div> <div>
{ info.contactsPhone } { info.contactsPhone }
{/*{ (info.contactsPhone && info.contactsPhone.label)*/} {/* { (info.contactsPhone && info.contactsPhone.label) */}
{/* && (*/} {/* && ( */}
{/* <Button*/} {/* <Button */}
{/* type="link"*/} {/* type="link" */}
{/* onClick={() => {*/} {/* onClick={() => { */}
{/* setIsModalOpen(true);*/} {/* setIsModalOpen(true); */}
{/* setViewType("contactsPhone");*/} {/* setViewType("contactsPhone"); */}
{/* setViewData("");*/} {/* setViewData(""); */}
{/* setEncrypted(info.contactsPhone);*/} {/* setEncrypted(info.contactsPhone); */}
{/* form.resetFields();*/} {/* form.resetFields(); */}
{/* }}*/} {/* }} */}
{/* >*/} {/* > */}
{/* 点击查看*/} {/* 点击查看 */}
{/* </Button>*/} {/* </Button> */}
{/* )}*/} {/* )} */}
</div> </div>
), ),
@ -249,21 +249,21 @@ function View(props) {
<div> <div>
{info.safetyPhone } {info.safetyPhone }
{/*{ (info.safetyPhone && info.safetyPhone.label)*/} {/* { (info.safetyPhone && info.safetyPhone.label) */}
{/* && (*/} {/* && ( */}
{/* <Button*/} {/* <Button */}
{/* type="link"*/} {/* type="link" */}
{/* onClick={() => {*/} {/* onClick={() => { */}
{/* setIsModalOpen(true);*/} {/* setIsModalOpen(true); */}
{/* setViewType("safetyPhone");*/} {/* setViewType("safetyPhone"); */}
{/* setEncrypted(info.safetyPhone);*/} {/* setEncrypted(info.safetyPhone); */}
{/* setViewData("");*/} {/* setViewData(""); */}
{/* form.resetFields();*/} {/* form.resetFields(); */}
{/* }}*/} {/* }} */}
{/* >*/} {/* > */}
{/* 点击查看*/} {/* 点击查看 */}
{/* </Button>*/} {/* </Button> */}
{/* )}*/} {/* )} */}
</div> </div>
), ),

View File

@ -63,7 +63,7 @@ function List(props) {
options={[ options={[
{ {
name: "likeCorpName", name: "likeCorpName",
label: "公司名称", label: "公司名称",
placeholder: "请输入分公司名称", placeholder: "请输入分公司名称",
}, },
{ {
@ -84,7 +84,7 @@ function List(props) {
<Table <Table
columns={[ columns={[
{ {
title: "公司名称", title: "公司名称",
dataIndex: "corpName", dataIndex: "corpName",
}, },
{ {

View File

@ -10,6 +10,7 @@ import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
function List(props) { function List(props) {
const queryParams = useGetUrlQuery(); const queryParams = useGetUrlQuery();
@ -19,12 +20,13 @@ function List(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userList"], { const { tableProps, getData } = useTable(props["userList"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false, noMain: 1,
}; };
}, },
}); });
@ -153,6 +155,7 @@ function AddModalComponent(props) {
open={props.open} open={props.open}
title="查看" title="查看"
width={1200} width={1200}
cancelText="关闭"
okButtonProps={{ okButtonProps={{
style: { style: {
display: "none", display: "none",
@ -200,20 +203,20 @@ function AddModalComponent(props) {
<div> <div>
{info.phone} {info.phone}
{info.phone {/* {info.phone */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("phone"); {/* setViewType("phone"); */}
setViewData(""); {/* setViewData(""); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -226,21 +229,21 @@ function AddModalComponent(props) {
label: "身份证号", label: "身份证号",
children: ( children: (
<div> <div>
{info.userIdCard} {UseDecodeIdCard(info.userIdCard) }
{ info.userIdCard {/* { info.userIdCard */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("userIdCard"); {/* setViewType("userIdCard"); */}
form.resetFields(); {/* form.resetFields(); */}
setViewData(""); {/* setViewData(""); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),

View File

@ -23,10 +23,11 @@ function List(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userEmploymentLogAll"], { const { tableProps, getData } = useTable(props["userEmploymentLogAll"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
usePermission: false,
}; };
}, },
}); });

View File

@ -13,6 +13,7 @@ import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const USER_TYPE = [ const USER_TYPE = [
{ {
@ -38,6 +39,7 @@ function List(props) {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
corpinfoId: queryParams["id"], corpinfoId: queryParams["id"],
noMain: 1,
}; };
}, },
@ -101,6 +103,9 @@ function List(props) {
{ {
title: "身份证号", title: "身份证号",
dataIndex: "userIdCard", dataIndex: "userIdCard",
render: (_, record) => (
<div>{UseDecodeIdCard(record.userIdCard)}</div>
),
}, },
{ {
title: "手机号", title: "手机号",
@ -208,6 +213,7 @@ function AddModalComponent(props) {
<Modal <Modal
open={props.open} open={props.open}
title="查看" title="查看"
cancelText="关闭"
width={900} width={900}
okButtonProps={{ okButtonProps={{
style: { style: {

View File

@ -116,7 +116,7 @@ function List(props) {
options={[ options={[
{ {
name: "likecorpName", name: "likecorpName",
label: "相关方名称", label: "企业名称",
}, },
{ {
name: "cityData", name: "cityData",
@ -135,7 +135,7 @@ function List(props) {
}, },
{ {
name: "eqType", name: "eqType",
label: "相关方企业类型", label: "相关方类型",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_TYPE, items: ENTERPRISE_TYPE,
}, },
@ -171,7 +171,7 @@ function List(props) {
)} )}
columns={[ columns={[
{ {
title: "相关方名称", title: "企业名称",
dataIndex: "corpName", dataIndex: "corpName",
}, },
{ {
@ -302,12 +302,13 @@ function AddModalComponent(props) {
id: props.currentId, id: props.currentId,
}) })
.then((res) => { .then((res) => {
const arr = []; if (res.data && res.data.selectfromList) {
const arr = [];
res.data.selectfromList.forEach((item) => { res.data.selectfromList.forEach((item) => {
arr.push(item.itemCode); arr.push(item.itemCode);
}); });
res.data.selectfromList = arr; res.data.selectfromList = arr;
}
form.setFieldsValue(res.data); form.setFieldsValue(res.data);
}); });
} }
@ -447,7 +448,7 @@ function AddModalComponent(props) {
}, },
{ {
name: "type", name: "type",
label: "相关方企业类型", label: "相关方类型",
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_TYPE, items: ENTERPRISE_TYPE,
}, },

View File

@ -15,7 +15,7 @@ import { getAreaNamePath, getCorpTypeNamePath } from "~/utils";
const ENTERPRISE_TYPE = [ const ENTERPRISE_TYPE = [
{ {
bianma: 3, bianma: 3,
name: "相关方企业", name: "普通企业",
}, },
{ {
bianma: 4, bianma: 4,
@ -88,11 +88,12 @@ function View(props) {
{ {
label: "企业名称", label: "企业名称",
children: info.corpName && info.corpName, children: info.corpName && info.corpName,
span: 4,
}, },
{ // {
label: "企业状态", // label: "企业状态",
children: info.corpStateName, // children: info.corpStateName,
}, // },
{ {
label: "开户人", label: "开户人",
children: info.createName, children: info.createName,
@ -193,7 +194,7 @@ function View(props) {
children: info.createDate, children: info.createDate,
}, },
{ {
label: "职工人数", label: "职工人数(人)",
children: info.employees, children: info.employees,
}, },
// { // {

View File

@ -28,12 +28,13 @@ function Department(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userQualificationInfoList"], { const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
eqQualificationinfoType: 2, eqQualificationinfoType: 2,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false,
}; };
}, },
}); });

View File

@ -30,12 +30,13 @@ function Department(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userQualificationInfoList"], { const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
eqQualificationinfoType: 1, eqQualificationinfoType: 1,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false,
}; };
}, },
}); });

View File

@ -16,7 +16,7 @@ import { getAreaNamePath } from "~/utils";
// import { getLabelName } from "zy-react-library/utils"; // import { getLabelName } from "zy-react-library/utils";
const ENTERPRISE_TYPE = [ const ENTERPRISE_TYPE = [
{ bianma: 3, name: "相关方企业" }, { bianma: 3, name: "普通企业" },
{ bianma: 4, name: "货主单位" }, { bianma: 4, name: "货主单位" },
{ bianma: 5, name: "驻港单位" }, { bianma: 5, name: "驻港单位" },
]; ];
@ -85,7 +85,7 @@ function List(props) {
/> />
), ),
}, },
{ name: "eqType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE }, { name: "eqType", label: "相关方类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
{ {
name: "cityRecord", name: "cityRecord",
label: "属地", label: "属地",

View File

@ -15,6 +15,7 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
function List(props) { function List(props) {
const [selectedNodeId, setSelectedNodeId] = useState(); const [selectedNodeId, setSelectedNodeId] = useState();
@ -24,12 +25,13 @@ function List(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userList"], { const { tableProps, getData } = useTable(props["userList"], {
form, form,
usePermission: false,
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false, noMain: 1,
}; };
}, },
}); });
@ -123,30 +125,24 @@ function List(props) {
title: "操作", title: "操作",
render: (_, record) => ( render: (_, record) => (
<Space> <Space>
{props.permission("ryxxgl-resetPassword")
&& (
<Button
type="link"
onClick={() => onResetPassword(record.id)}
>
重置密码
</Button>
)}
{
props.permission("ryxxgl-info")
&& (
<Button
type="link"
onClick={() => {
setAddModalOpen(true);
setCurrentId(record.id);
}}
>
查看
</Button>
) <Button
} type="link"
onClick={() => onResetPassword(record.id)}
>
重置密码
</Button>
<Button
type="link"
onClick={() => {
setAddModalOpen(true);
setCurrentId(record.id);
}}
>
查看
</Button>
</Space> </Space>
), ),
}, },
@ -226,6 +222,7 @@ function AddModalComponent(props) {
<Modal <Modal
open={props.open} open={props.open}
title="查看" title="查看"
cancelText="关闭"
width={1200} width={1200}
okButtonProps={{ okButtonProps={{
style: { style: {
@ -283,20 +280,20 @@ function AddModalComponent(props) {
<div> <div>
{info.phone} {info.phone}
{info.phone {/* {info.phone */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("phone"); {/* setViewType("phone"); */}
setViewData(""); {/* setViewData(""); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -305,21 +302,21 @@ function AddModalComponent(props) {
label: "身份证号", label: "身份证号",
children: ( children: (
<div> <div>
{info.userIdCard} {UseDecodeIdCard(info.userIdCard) }
{ info.userIdCard {/* { info.userIdCard */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("userIdCard"); {/* setViewType("userIdCard"); */}
form.resetFields(); {/* form.resetFields(); */}
setViewData(""); {/* setViewData(""); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),

View File

@ -125,23 +125,24 @@ function Department(props) {
}; };
return ( return (
<div <div style={{ padding: "0 20px" }}>
style={{
padding: 20, <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
}}
> <div style={{
<div
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree key={treeKey} onSelect={onTreeChange} onGetNodePaths={onGetNodePaths} onGetData={data => setDepartmentData(data)} />
<div
style={{
flex: 1,
}}
> >
<LeftTree key={treeKey} onSelect={onTreeChange} onGetNodePaths={onGetNodePaths} onGetData={data => setDepartmentData(data)} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
<Search <Search
form={form} form={form}
options={[ options={[
@ -362,6 +363,21 @@ function AddModalComponent(props) {
name: "depOrder", name: "depOrder",
label: "部门排序", label: "部门排序",
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,
rules: [
{
validator: (_, value) => {
if (value === undefined || value === null || value === "") {
return Promise.resolve(); // 如果非必填可移除 required这里允许空
}
const num = Number(value);
if (!Number.isInteger(num) || num <= 0) {
return Promise.reject(new Error("请输入大于0的正整数"));
}
return Promise.resolve();
},
},
],
}, },
]} ]}

View File

@ -54,23 +54,24 @@ function Post(props) {
}; };
return ( return (
<div <div style={{ padding: "0 20px", height: "100%" }}>
style={{
padding: 20, <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
}}
> <div style={{
<div
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree onSelect={onTreeChange} />
<div
style={{
flex: 1,
}}
> >
<LeftTree onSelect={onTreeChange} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
{/* <Search */} {/* <Search */}
{/* form={form} */} {/* form={form} */}
{/* options={[ */} {/* options={[ */}

View File

@ -16,7 +16,7 @@ import { ID_NUMBER, PHONE } from "zy-react-library/regular";
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils"; import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { useDebounce } from "~/utils"; import { useDebounce, UseDecodeIdCard } from "~/utils";
// import useGetFile from "zy-react-library/hooks/useGetFile"; // import useGetFile from "zy-react-library/hooks/useGetFile";
@ -64,22 +64,7 @@ function Add(props) {
id: queryParams["id"], id: queryParams["id"],
}); });
let idCardToSet = data.userIdCard; data.userIdCard = UseDecodeIdCard(data.userIdCard);
if (idCardToSet) {
// 判断是否是 Base64 格式(可选)
try {
// 尝试解码,如果成功且结果是合法身份证号,则使用
const decoded = atob(idCardToSet);
if (/^\d{17}[\dX]$/.test(decoded)) {
idCardToSet = decoded;
}
// 否则保留原值(兼容未加密数据)
}
catch {
console.warn("Not a valid Base64 string, keep as is:", idCardToSet);
}
}
data.userIdCard = idCardToSet;
data.sex = data.sex === "男" ? "1" : "0"; data.sex = data.sex === "男" ? "1" : "0";
fnChoiceDepartment( fnChoiceDepartment(
@ -419,6 +404,21 @@ function Add(props) {
label: "部门排序", label: "部门排序",
required: false, required: false,
render: FORM_ITEM_RENDER_ENUM.NUMBER, render: FORM_ITEM_RENDER_ENUM.NUMBER,
rules: [
{
validator: (_, value) => {
if (value === undefined || value === null || value === "") {
return Promise.resolve(); // 如果非必填可移除 required这里允许空
}
const num = Number(value);
if (!Number.isInteger(num) || num <= 0) {
return Promise.reject(new Error("请输入大于0的正整数"));
}
return Promise.resolve();
},
},
],
}, },
{ {
name: "rankLevel", name: "rankLevel",

View File

@ -19,6 +19,7 @@ import useImportFile from "zy-react-library/hooks/useImportFile";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import { getLabelName } from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace"; import { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
function List(props) { function List(props) {
const [importOpen, setImportOpen] = useState(false); const [importOpen, setImportOpen] = useState(false);
@ -38,7 +39,7 @@ function List(props) {
return { return {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
menuPath: "", noMain: 1,
}; };
}, },
}); });
@ -113,23 +114,22 @@ function List(props) {
getData(); getData();
}; };
return ( return (
<div <div style={{ padding: "0 20px", height: "100%" }}>
style={{
padding: 20, <div style={{ display: "flex", height: "100%", minHeight: 0 }}>
}} <div style={{
>
<div
style={{
display: "flex", display: "flex",
gap: 20, minWidth: 240,
padding: "20px 0",
borderRight: "10px solid #f1f1f2",
paddingRight: "10px",
marginRight: "10px",
height: "100vh",
}} }}
>
<LeftTree onSelect={onTreeChange} />
<div
style={{
flex: 1,
}}
> >
<LeftTree onSelect={onTreeChange} />
</div>
<div style={{ flex: 1, display: "flex", flexDirection: "column", minHeight: 0, padding: "20px 0" }}>
<Search <Search
form={form} form={form}
labelCol={{ span: 7 }} labelCol={{ span: 7 }}
@ -445,6 +445,7 @@ function AddModalComponent(props) {
display: "none", display: "none",
}, },
}} }}
cancelText="关闭"
onOk={form.submit} onOk={form.submit}
onCancel={onCancel} onCancel={onCancel}
> >
@ -520,7 +521,7 @@ function AddModalComponent(props) {
label: "身份证号", label: "身份证号",
children: ( children: (
<div> <div>
{info.userIdCard} {UseDecodeIdCard(info.userIdCard) }
{/* { info.userIdCard === "隐藏" */} {/* { info.userIdCard === "隐藏" */}
{/* && ( */} {/* && ( */}
{/* <Button */} {/* <Button */}

View File

@ -155,3 +155,20 @@ export const getCorpTypeNamePath = (item) => {
].filter(name => name != null && name !== ""); ].filter(name => name != null && name !== "");
return names.join("/"); return names.join("/");
}; };
// 身份证解码
export const UseDecodeIdCard = (userIdCard) => {
if (!userIdCard)
return userIdCard;
try {
const decoded = atob(userIdCard);
if (/^\d{17}[\dX]$/.test(decoded)) {
return decoded;
}
}
catch {
console.warn("Not a valid Base64 string, keep as is:", userIdCard);
}
return userIdCard; // fallback
};