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>",
// 接口服务地址
API_HOST: "https://gbs-gateway.qhdsafety.com",
// API_HOST: "http://192.168.20.100:30140",
API_HOST: "",
},
},
// 应用唯一标识符
@ -26,8 +26,8 @@ module.exports = {
contextInject: {
// 应用Key
appKey: "",
// fileUrl: "http://192.168.20.240:9787/mnt/",
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
fileUrl: "http://192.168.20.240:9787/mnt/",
// fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
},
// public/index.html注入全局变量
windowInject: {

View File

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

View File

@ -38,11 +38,17 @@ export const postAll = declareRequest(
"userLoading",
"Post > @/basicInfo/post/listAll",
);
// 获取角色
// 股份端获取角色
export const rolesAll = declareRequest(
"userLoading",
"Get > /system/operation/roles",
);
// 获取角色
export const authRolesAll = declareRequest(
"userLoading",
"Get > /system/operation/roles/auth-role",
);
export const dictData = declareRequest(
"userLoading",
"Get > /config/dict-trees/list/by/dictValues?",
@ -82,5 +88,5 @@ export const reviewStatus = declareRequest(
// 用户变更详情
export const getChangerRecordInfoById = declareRequest(
"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";
const ExpandAnimation = (departmentData) => {
console.log(departmentData);
const graphRef = useRef(null);
const [relayout, setRelayout] = useState(true);

View File

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

View File

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

View File

@ -23,10 +23,11 @@ function List(props) {
const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userEmploymentLogAll"], {
form,
usePermission: false,
transform: (formData) => {
return {
...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 { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const USER_TYPE = [
{
@ -33,7 +34,7 @@ function List(props) {
return {
...formData,
eqDepartmentId: selectedNodeId,
noMain: 1,
};
},
});
@ -45,23 +46,24 @@ function List(props) {
return (
<div>
<div
style={{
padding: 20,
}}
>
<div
style={{
<div style={{ padding: "0 20px", height: "100%" }}>
<div style={{ display: "flex", height: "100%", minHeight: 0 }}>
<div style={{
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
form={form}
options={[
@ -95,6 +97,9 @@ function List(props) {
{
title: "身份证号",
dataIndex: "userIdCard",
render: (_, record) => (
<div>{UseDecodeIdCard(record.userIdCard)}</div>
),
},
{
title: "手机号",
@ -161,7 +166,7 @@ function List(props) {
getData={getData}
currentId={currentId}
requestDetails={props["userDetails"]}
requwstRolesAll={props["rolesAll"]}
requwstRolesAll={props["authRolesAll"]}
onCancel={() => {
setAddModalOpen(false);
setCurrentId("");
@ -202,6 +207,7 @@ function AddModalComponent(props) {
<Modal
open={props.open}
title="查看"
cancelText="关闭"
width={900}
okButtonProps={{
style: {

View File

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

View File

@ -58,23 +58,24 @@ function Post(props) {
};
return (
<div
style={{
padding: 20,
}}
>
<div
style={{
<div style={{ padding: "0 20px", height: "100%" }}>
<div style={{ display: "flex", height: "100%", minHeight: 0 }}>
<div style={{
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 */}
{/* form={form} */}
{/* options={[ */}

View File

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

View File

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

View File

@ -16,7 +16,7 @@ import { getAreaNamePath } from "~/utils";
// import { getLabelName } from "zy-react-library/utils";
const ENTERPRISE_TYPE = [
{ bianma: 3, name: "相关方企业" },
{ bianma: 3, name: "普通企业" },
{ bianma: 4, 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",
label: "属地",

View File

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

View File

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

View File

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

View File

@ -25,8 +25,8 @@ function Department(props) {
const [selectedNodeName, setSelectedNodeName] = useState("");
const { getUserInfo } = useGetUserInfo();
const [pathNodes, setPathNodes] = useState([]); // 仅由 LeftTree 更新
const [treeKey, setTreeKey] = useState(0);
const [form] = Form.useForm();
const [treeKey, setTreeKey] = useState(0); // 初始 key
const { tableProps, getData } = useTable(props["departmentList"], {
form,
transform: (formData) => {
@ -111,23 +111,26 @@ function Department(props) {
}
};
return (
<div
style={{
padding: 20,
}}
>
<div
style={{
<div style={{ padding: "0 20px", height: "100%" }}>
<div style={{ display: "flex", height: "100%", minHeight: 0 }}>
<div style={{
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
form={form}
options={[
@ -247,7 +250,6 @@ function Department(props) {
onCancel={() => {
setAddModalOpen(false);
setCurrentId("");
setSelectedNodeId("");
}}
/>
)}
@ -285,10 +287,7 @@ function AddModalComponent(props) {
nameKey: "dictLabel",
});
values.parentId = props.parentId;
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
message.error("部门排序请输入正整数!");
return;
}
if (props.currentId) {
values.parentId = props.parentId;
values.id = props.currentId;
@ -351,6 +350,20 @@ function AddModalComponent(props) {
name: "depOrder",
label: "部门排序",
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",

View File

@ -18,7 +18,7 @@ import { ID_NUMBER, PHONE } from "zy-react-library/regular";
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace";
import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce } from "~/utils";
import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce, UseDecodeIdCard } from "~/utils";
export const WHETHER_ENUM = [
{
@ -74,22 +74,7 @@ function Add(props) {
id: queryParams["id"],
});
let idCardToSet = 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.userIdCard = UseDecodeIdCard(data.userIdCard);
data.sex = data.sex === "男" ? "1" : "0";
setUserID(data.userId);
@ -169,6 +154,10 @@ function Add(props) {
message.error("年龄请输入正整数!");
return;
}
if (values.cardImg.length !== 2) {
message.error("身份证照片必须上传两张");
return;
}
values.userId = userID || id;
if (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 { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const JOB_STATUS = {
1: "在职",
@ -29,6 +30,7 @@ function List(props) {
const [currentId, setCurrentId] = useState("");
const [modalType, setModalType] = useState("");
const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userXgfList"], {
form,
transform: (formData) => {
@ -36,6 +38,7 @@ function List(props) {
...formData,
eqDepartmentId: selectedNodeId,
userType: 3,
noMain: 1,
};
},
});
@ -78,23 +81,22 @@ function List(props) {
getData();
};
return (
<div
style={{
padding: 20,
}}
>
<div
style={{
<div style={{ padding: "0 20px", height: "100%" }}>
<div style={{ display: "flex", height: "100%", minHeight: 0 }}>
<div style={{
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
form={form}
labelCol={{ span: 8 }}
@ -229,7 +231,7 @@ function List(props) {
{/* ) */}
{/* } */}
{
(props.permission("yhglxgf-lizhi") && record.employmentFlag === 1) && (
(record.employmentFlag === 1) && (
<Button
danger
@ -242,7 +244,7 @@ function List(props) {
)
}
{ (props.permission("yhglxgf-rzsh") && record.employmentFlag === 11)
{ (record.employmentFlag === 11)
&& (
<Button
danger
@ -256,7 +258,7 @@ function List(props) {
入职审核
</Button>
)}
{ (props.permission("yhglxgf-lzsh") && record.employmentFlag === 10)
{ (record.employmentFlag === 10)
&& (
<Button
danger
@ -398,7 +400,7 @@ function AddModalComponent(props) {
loading={getFileLoading}
footer={[
<Button key="return" onClick={onCancel}>
返回
关闭
</Button>,
<Button key="reject" onClick={handleReject} hidden={props.modalType === "see"}>
驳回
@ -415,10 +417,11 @@ function AddModalComponent(props) {
}}
>
<Descriptions
bordered
items={[
{
label: "人脸照片",
label: "用户照片",
children: <PreviewImg files={info.userImg} />,
},
{
@ -448,20 +451,20 @@ function AddModalComponent(props) {
<div>
{info.phone}
{info.phone
&& (
<Button
type="link"
onClick={() => {
setIsModalOpen(true);
setViewType("phone");
setViewData("");
form.resetFields();
}}
>
点击查看
</Button>
)}
{/* {info.phone */}
{/* && ( */}
{/* <Button */}
{/* type="link" */}
{/* onClick={() => { */}
{/* setIsModalOpen(true); */}
{/* setViewType("phone"); */}
{/* setViewData(""); */}
{/* form.resetFields(); */}
{/* }} */}
{/* > */}
{/* 点击查看 */}
{/* </Button> */}
{/* )} */}
</div>
),
@ -470,25 +473,30 @@ function AddModalComponent(props) {
label: "身份证号",
children: (
<div>
{info.userIdCard}
{ info.userIdCard
&& (
<Button
type="link"
onClick={() => {
setIsModalOpen(true);
setViewType("userIdCard");
form.resetFields();
setViewData("");
}}
>
点击查看
</Button>
)}
{UseDecodeIdCard(info.userIdCard) }
{/* { info.userIdCard */}
{/* && ( */}
{/* <Button */}
{/* type="link" */}
{/* onClick={() => { */}
{/* setIsModalOpen(true); */}
{/* setViewType("userIdCard"); */}
{/* form.resetFields(); */}
{/* setViewData(""); */}
{/* }} */}
{/* > */}
{/* 点击查看 */}
{/* </Button> */}
{/* )} */}
</div>
),
},
{
label: "电子邮箱",
children: info.email,
},
{
label: "民族",
children: info.nationName,

View File

@ -84,19 +84,19 @@ function ResignationReview(props) {
{
label: "企业名称",
// 离职取变更前 入职取变更后
children: queryParams["employmentFlag"] === 10 ? info.corpinfoNameBefore : info.corpinfoNameAfter,
children: info.corpinfoName,
},
{
label: "部门名称",
children: queryParams["employmentFlag"] === 10 ? info.departmentNameBefore : info.departmentNameAfter,
children: info.departmentName,
},
{
label: "岗位名称",
children: queryParams["employmentFlag"] === 10 ? info.postNameBefore : info.postNameAfter,
children: info.postName,
},
{
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={[
{
name: "likecorpName",
label: "公司名称",
label: "公司名称",
},
{
name: "eqCorpState",
label: "公司状态",
label: "公司状态",
render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_STATUS,
},
@ -172,23 +172,23 @@ function List(props) {
{
props.permission("zgszhgl-add")
&& (
<Button
type="primary"
icon={<AddIcon />}
onClick={() => {
setAddModalOpen(true);
setOpenType("add");
}}
>
新增
</Button>
<Button
type="primary"
icon={<AddIcon />}
onClick={() => {
setAddModalOpen(true);
setOpenType("add");
}}
>
新增
</Button>
)
}
</>
)}
columns={[
{
title: "公司名称",
title: "公司名称",
dataIndex: "corpName",
},
{
@ -212,7 +212,7 @@ function List(props) {
// dataIndex: "ecoTypeName",
// },
{
title: "公司状态",
title: "公司状态",
dataIndex: "corpStateName",
},
{
@ -230,7 +230,7 @@ function List(props) {
},
{
title: "操作",
width: 550,
width: 500,
render: (_, record) => (
<Space>
{" "}
@ -457,6 +457,8 @@ function AddModalComponent(props) {
width={800}
onOk={form.submit}
onCancel={onCancel}
okButtonProps={{ disabled: props.loading }}
cancelButtonProps={{ disabled: props.loading }}
>
<FormBuilder
form={form}
@ -465,7 +467,7 @@ function AddModalComponent(props) {
options={[
{
name: "corpName",
label: "公司名称",
label: "公司名称",
},
{
name: "code",
@ -509,6 +511,24 @@ function AddModalComponent(props) {
label: "列表排序",
render: FORM_ITEM_RENDER_ENUM.NUMBER,
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={{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,10 +23,11 @@ function List(props) {
const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["userEmploymentLogAll"], {
form,
usePermission: false,
transform: (formData) => {
return {
...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 { NS_USER } from "~/enumerate/namespace";
import { UseDecodeIdCard } from "~/utils";
const USER_TYPE = [
{
@ -38,6 +39,7 @@ function List(props) {
...formData,
eqDepartmentId: selectedNodeId,
corpinfoId: queryParams["id"],
noMain: 1,
};
},
@ -101,6 +103,9 @@ function List(props) {
{
title: "身份证号",
dataIndex: "userIdCard",
render: (_, record) => (
<div>{UseDecodeIdCard(record.userIdCard)}</div>
),
},
{
title: "手机号",
@ -208,6 +213,7 @@ function AddModalComponent(props) {
<Modal
open={props.open}
title="查看"
cancelText="关闭"
width={900}
okButtonProps={{
style: {

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@ import { getAreaNamePath } from "~/utils";
// import { getLabelName } from "zy-react-library/utils";
const ENTERPRISE_TYPE = [
{ bianma: 3, name: "相关方企业" },
{ bianma: 3, name: "普通企业" },
{ bianma: 4, 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",
label: "属地",

View File

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

View File

@ -125,23 +125,24 @@ function Department(props) {
};
return (
<div
style={{
padding: 20,
}}
>
<div
style={{
<div style={{ padding: "0 20px" }}>
<div style={{ display: "flex", height: "100%", minHeight: 0 }}>
<div style={{
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
form={form}
options={[
@ -362,6 +363,21 @@ function AddModalComponent(props) {
name: "depOrder",
label: "部门排序",
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 (
<div
style={{
padding: 20,
}}
>
<div
style={{
<div style={{ padding: "0 20px", height: "100%" }}>
<div style={{ display: "flex", height: "100%", minHeight: 0 }}>
<div style={{
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 */}
{/* form={form} */}
{/* 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 { NS_USER } from "~/enumerate/namespace";
import { useDebounce } from "~/utils";
import { useDebounce, UseDecodeIdCard } from "~/utils";
// import useGetFile from "zy-react-library/hooks/useGetFile";
@ -64,22 +64,7 @@ function Add(props) {
id: queryParams["id"],
});
let idCardToSet = 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.userIdCard = UseDecodeIdCard(data.userIdCard);
data.sex = data.sex === "男" ? "1" : "0";
fnChoiceDepartment(
@ -419,6 +404,21 @@ function Add(props) {
label: "部门排序",
required: false,
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",

View File

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

View File

@ -155,3 +155,20 @@ export const getCorpTypeNamePath = (item) => {
].filter(name => name != null && name !== "");
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
};