删除log 二级页面不传权限 修改默认密码

dev
853931625@qq.com 2025-12-09 16:50:49 +08:00
parent e03fb16dc7
commit 20ee40b6f2
47 changed files with 468 additions and 363 deletions

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.141" "zy-react-library": "^1.0.152"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^5.4.1", "@antfu/eslint-config": "^5.4.1",

View File

@ -27,7 +27,7 @@ export const userGetInfo = declareRequest(
); );
export const corpDepartlist = declareRequest( export const corpDepartlist = declareRequest(
"departmentLoading", "departmentLoading",
"Post > @/basic-info/corpInfo/corpDepartlist", "Post > @/basicInfo/corpInfo/corpDepartlist",
); );

View File

@ -9,9 +9,9 @@ const ExpandAnimation = (departmentData) => {
const graphOptions = { const graphOptions = {
layout: { layout: {
layoutName: "tree", layoutName: "tree",
min_per_width: 80, min_per_width: 150,
max_per_width: 150, max_per_width: 200,
min_per_height: 200, min_per_height: 230,
}, },
defaultNodeShape: 1, defaultNodeShape: 1,
defaultNodeWidth: 130, defaultNodeWidth: 130,

View File

@ -131,26 +131,26 @@ function Info(props) {
children: info.lrName, children: info.lrName,
}, },
{ {
label: "法人手机号", label: "法定代表人手机号",
children: ( children: (
<div> <div>
{info.lrMobile && info.lrMobile.label} {info.lrMobile }
{ (info.lrMobile && info.lrMobile.label) {/* { (info.lrMobile && info.lrMobile.label) */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("lrMobile"); {/* setViewType("lrMobile"); */}
setViewData(""); {/* setViewData(""); */}
setEncrypted(info.lrMobile); {/* setEncrypted(info.lrMobile); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -164,22 +164,22 @@ function Info(props) {
children: ( children: (
<div> <div>
{ info.contactsPhone && info.contactsPhone.label} { 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>
), ),
@ -193,23 +193,23 @@ function Info(props) {
label: "安全负责人手机号", label: "安全负责人手机号",
children: ( children: (
<div> <div>
{info.lrMobile && info.lrMobile.label}
{info.safetyPhone && info.safetyPhone.label} {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"); */}
setViewData(""); {/* setViewData(""); */}
setEncrypted(info.safetyPhone); {/* setEncrypted(info.safetyPhone); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -329,7 +329,7 @@ function Info(props) {
{viewData} {viewData}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="法人手机号码" label="法定代表人手机号码"
hidden={!(viewType === "lrMobile" && viewData)} hidden={!(viewType === "lrMobile" && viewData)}
> >
{viewData} {viewData}

View File

@ -83,9 +83,9 @@ function Update(props) {
const { data } = await props["corpInfoDetails"]({ const { data } = await props["corpInfoDetails"]({
id: queryParams["id"], id: queryParams["id"],
}); });
data.lrMobile = data.lrMobile && data.lrMobile.label; // data.lrMobile = data.lrMobile && data.lrMobile.label;
data.contactsPhone = data.contactsPhone && data.contactsPhone.label; // data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
data.safetyPhone = data.safetyPhone && data.safetyPhone.label; // data.safetyPhone = data.safetyPhone && data.safetyPhone.label;
setKeyId(data.corpinfoId); setKeyId(data.corpinfoId);
data.region = data.village || data.street || data.country || data.city || data.province; data.region = data.village || data.street || data.country || data.city || data.province;
const licenseFile = await getFile({ const licenseFile = await getFile({
@ -120,7 +120,7 @@ function Update(props) {
fetchData(); fetchData();
}, []); }, []);
// 校验社会统一信用代码重复 // 校验统一社会信用代码重复
useEffect(() => { useEffect(() => {
if (!debouncedCode) { if (!debouncedCode) {
form.setFields([ form.setFields([
@ -139,7 +139,7 @@ function Update(props) {
form.setFields([ form.setFields([
{ {
name: "code", name: "code",
errors: ["该社会统一信用代码已被其他企业使用"], errors: ["该统一社会信用代码已被其他企业使用"],
}, },
]); ]);
} }
@ -303,7 +303,7 @@ function Update(props) {
}, },
}, },
{ {
label: "社会统一信用代码", label: "统一社会信用代码",
name: "code", name: "code",
required: false, required: false,
componentProps: { componentProps: {
@ -313,7 +313,7 @@ function Update(props) {
rules: [ rules: [
{ {
pattern: UNIFIED_SOCIAL_CREDIT_CODE, pattern: UNIFIED_SOCIAL_CREDIT_CODE,
message: "请输入正确的社会统一信用代码", message: "请输入正确的统一社会信用代码",
}, },
], ],
@ -412,7 +412,6 @@ function Update(props) {
render: ( render: (
<IndustrySelect <IndustrySelect
onGetNodePaths={(data) => { onGetNodePaths={(data) => {
console.log(data);
setIndustryData(data); setIndustryData(data);
}} }}
/> />
@ -424,7 +423,7 @@ function Update(props) {
required: false, required: false,
}, },
{ {
label: "法人手机号", label: "法定代表人手机号",
name: "lrMobile", name: "lrMobile",
required: false, required: false,
rules: [ rules: [

View File

@ -26,6 +26,7 @@ function List(props) {
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
usePermission: false,
}; };
}, },
}); });

View File

@ -13,8 +13,10 @@ function ChangeView(props) {
useEffect(() => { useEffect(() => {
props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => { props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => {
console.log(res); if(res.data){
setInfo(res.data); setInfo(res.data);
}
}); });
}, []); }, []);

View File

@ -39,7 +39,6 @@ function List(props) {
}); });
const onTreeChange = (selectedKeys) => { const onTreeChange = (selectedKeys) => {
const key = selectedKeys[0] || null; const key = selectedKeys[0] || null;
console.log(selectedKeys);
setSelectedNodeId(key); setSelectedNodeId(key);
getData(); getData();
}; };
@ -125,6 +124,7 @@ function List(props) {
<Space> <Space>
<Button <Button
type="link" type="link"
hidden={true}
onClick={() => { onClick={() => {
setAddModalOpen(true); setAddModalOpen(true);
setCurrentId(record.id); setCurrentId(record.id);

View File

@ -7,8 +7,7 @@ import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
function Add() { function Add() {
const queryParams = useGetUrlQuery(); const queryParams = useGetUrlQuery();
const onSubmit = (values) => { const onSubmit = () => {
console.log(values);
}; };
return ( return (
<> <>

View File

@ -22,6 +22,7 @@ function OrganizationStructure(props) {
const [selectedNodeName, setSelectedNodeName] = useState(""); const [selectedNodeName, setSelectedNodeName] = useState("");
const [pathNodes, setPathNodes] = useState([]); // 仅由 LeftTree 更新 const [pathNodes, setPathNodes] = useState([]); // 仅由 LeftTree 更新
const { getUserInfo } = useGetUserInfo(); const { getUserInfo } = useGetUserInfo();
const [treeKey, setTreeKey] = useState(0);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["departmentList"], { const { tableProps, getData } = useTable(props["departmentList"], {
@ -62,6 +63,7 @@ function OrganizationStructure(props) {
if (res.success) { if (res.success) {
message.success("删除成功"); message.success("删除成功");
getData(); getData();
setTreeKey(prev => prev + 1);
} }
}); });
}, },
@ -107,7 +109,7 @@ function OrganizationStructure(props) {
return ( return (
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div style={{ display: "flex", gap: 20 }}> <div style={{ display: "flex", gap: 20 }}>
<LeftTree onGetNodePaths={onGetNodePaths} /> <LeftTree key={treeKey} onGetNodePaths={onGetNodePaths} />
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<Search <Search
form={form} form={form}
@ -134,7 +136,7 @@ function OrganizationStructure(props) {
新增 新增
</Button> </Button>
)} )}
<Button icon={<LeftOutlined />} onClick={fnReturn}> <Button icon={<LeftOutlined />} onClick={fnReturn} hidden={pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")}>
返回 返回
</Button> </Button>
</> </>
@ -199,7 +201,10 @@ function OrganizationStructure(props) {
requestAdd={props["departmentAdd"]} requestAdd={props["departmentAdd"]}
requestEdit={props["departmentEdit"]} requestEdit={props["departmentEdit"]}
requestDetails={props["departmentDetails"]} requestDetails={props["departmentDetails"]}
getData={getData} getData={() => {
getData();
setTreeKey(prev => prev + 1);
}}
selectedNodeName={selectedNodeName} selectedNodeName={selectedNodeName}
onCancel={() => { onCancel={() => {
setAddModalOpen(false); setAddModalOpen(false);

View File

@ -57,7 +57,7 @@ function List(props) {
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "是否重置密码为Aa12345678", content: "是否重置密码为Aa@12345678",
onOk: () => { onOk: () => {
props["corpInfoChangePassword"]({ props["corpInfoChangePassword"]({
id, id,
@ -191,7 +191,7 @@ function List(props) {
dataIndex: "accountContactName", dataIndex: "accountContactName",
}, },
{ {
title: "社会统一信用代码", title: "统一社会信用代码",
dataIndex: "code", dataIndex: "code",
width: 190, width: 190,
}, },
@ -346,7 +346,7 @@ function AddModalComponent(props) {
props.getData(); props.getData();
}; };
// 校验社会统一信用代码重复 // 校验统一社会信用代码重复
useEffect(() => { useEffect(() => {
if (!debouncedCode) { if (!debouncedCode) {
form.setFields([ form.setFields([
@ -367,7 +367,7 @@ function AddModalComponent(props) {
form.setFields([ form.setFields([
{ {
name: "code", name: "code",
errors: ["该社会统一信用代码已被其他企业使用"], errors: ["该统一社会信用代码已被其他企业使用"],
}, },
]); ]);
} }
@ -427,11 +427,11 @@ function AddModalComponent(props) {
}, },
{ {
name: "code", name: "code",
label: "社会统一信用代码", label: "统一社会信用代码",
rules: [ rules: [
{ {
pattern: UNIFIED_SOCIAL_CREDIT_CODE, pattern: UNIFIED_SOCIAL_CREDIT_CODE,
message: "请输入正确的社会统一信用代码", message: "请输入正确的统一社会信用代码",
}, },
], ],
}, },

View File

@ -135,26 +135,26 @@ function View(props) {
children: info.lrName, children: info.lrName,
}, },
{ {
label: "法人手机号", label: "法定代表人手机号",
children: ( children: (
<div> <div>
{info.lrMobile && info.lrMobile.label} {info.lrMobile }
{ (info.lrMobile && info.lrMobile.label) {/* { (info.lrMobile && info.lrMobile.label) */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("lrMobile"); {/* setViewType("lrMobile"); */}
setViewData(""); {/* setViewData(""); */}
setEncrypted(info.lrMobile); {/* setEncrypted(info.lrMobile); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -168,22 +168,22 @@ function View(props) {
children: ( children: (
<div> <div>
{ info.contactsPhone && info.contactsPhone.label} { 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>
), ),
@ -302,7 +302,7 @@ function View(props) {
{viewData} {viewData}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="法人手机号码" label="法定代表人手机号码"
hidden={!(viewType === "lrMobile" && viewData)} hidden={!(viewType === "lrMobile" && viewData)}
> >
{viewData} {viewData}

View File

@ -47,12 +47,10 @@ function List(props) {
}); });
const onFinish = async () => { const onFinish = async () => {
// 处理属地查询 // 处理属地查询
console.log(cityData);
const arr = []; const arr = [];
cityData.forEach((item) => { cityData.forEach((item) => {
arr.push(item.value); arr.push(item.value);
}); });
console.log(arr);
form.setFieldValue("cityRecord", arr); form.setFieldValue("cityRecord", arr);
getData(); getData();
}; };

View File

@ -39,13 +39,14 @@ function List(props) {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false,
}; };
}, },
}); });
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "确定要重置密码为Aa12345678吗", content: "确定要重置密码为Aa@12345678吗",
onOk: () => { onOk: () => {
props["userChangePassword"]({ props["userChangePassword"]({
id, id,
@ -60,7 +61,6 @@ function List(props) {
}; };
const onTreeChange = (selectedKeys) => { const onTreeChange = (selectedKeys) => {
const key = selectedKeys[0] || null; const key = selectedKeys[0] || null;
console.log(selectedKeys);
setSelectedNodeId(key); setSelectedNodeId(key);
getData(); getData();
}; };
@ -202,13 +202,10 @@ function AddModalComponent(props) {
}); });
res.data.userImg = userImg; res.data.userImg = userImg;
res.data.cardImg = cardImg; res.data.cardImg = cardImg;
console.log(res.data);
setInfo(res.data); setInfo(res.data);
}; };
fetchData(); fetchData();
console.log(info);
} }
}, [props.currentId]); }, [props.currentId]);
const onCancel = () => { const onCancel = () => {

View File

@ -58,8 +58,35 @@ function Add(props) {
const { data } = await props["userDetails"]({ const { data } = await props["userDetails"]({
id: queryParams["id"], 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.sex = data.sex === "男" ? "1" : "0"; data.sex = data.sex === "男" ? "1" : "0";
fnChoiceDepartment(
[
{
id: data.departmentId,
},
],
1,
);
// const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["13"], eqForeignKey: queryParams["id"] }); // const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["13"], eqForeignKey: queryParams["id"] });
const filepath const filepath
= data.userAvatarUrl = data.userAvatarUrl
@ -70,7 +97,6 @@ function Add(props) {
}, },
] ]
: []; : [];
console.log(filepath);
const values = { const values = {
filepath, filepath,
...data, ...data,
@ -97,7 +123,6 @@ function Add(props) {
appKey: "0bb989ecada5470c87635018ece9f327", appKey: "0bb989ecada5470c87635018ece9f327",
dictValue: "renyuanleixing", dictValue: "renyuanleixing",
}).then((res) => { }).then((res) => {
console.log(res);
setUserTypeData(res.data); setUserTypeData(res.data);
}); });
}, []); }, []);
@ -121,6 +146,9 @@ function Add(props) {
foreignKey: userID, foreignKey: userID,
}, },
}); });
if (values.userIdCard) {
values.userIdCard = btoa(values.userIdCard); // Base64 编码
}
values.userAvatarUrl = filePath; values.userAvatarUrl = filePath;
values.mainCorpFlag = 0; values.mainCorpFlag = 0;
values.userType = 2; values.userType = 2;
@ -144,7 +172,6 @@ function Add(props) {
} }
}; };
const fnChoiceDepartment = async (event) => { const fnChoiceDepartment = async (event) => {
console.log(event);
form.setFieldsValue({ form.setFieldsValue({
postId: undefined, postId: undefined,
}); });
@ -283,9 +310,11 @@ function Add(props) {
{ {
name: "postId", name: "postId",
label: "所属岗位", label: "所属岗位",
required: false,
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: postData, items: postData,
componentProps: {
disabled: queryParams["id"],
},
itemsField: { itemsField: {
labelKey: "postName", labelKey: "postName",
valueKey: "id", valueKey: "id",
@ -294,7 +323,7 @@ function Add(props) {
{ {
name: "phone", name: "phone",
label: "手机号", label: "手机号",
tip: "* 手机号为用户名修改手机号登录密码则会变成初始密码“Aa@123456789", tip: "* 手机号为用户名修改手机号登录密码则会变成初始密码“Aa@12345678",
rules: [ rules: [
{ {
pattern: PHONE, pattern: PHONE,

View File

@ -71,7 +71,7 @@ function List(props) {
content: "确定要导出到excel吗", content: "确定要导出到excel吗",
onOk: () => { onOk: () => {
downloadBlob( downloadBlob(
`/basic-info/user/exportUserTable?ids=${selectedRowKeys.length !== 0 ? selectedRowKeys.join(",") : ""}`, `/basicInfo/user/exportUserTable?ids=${selectedRowKeys.length !== 0 ? selectedRowKeys.join(",") : ""}`,
{ {
name: "用户", name: "用户",
}, },
@ -82,7 +82,7 @@ function List(props) {
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "确定要重置密码为Aa12345678吗", content: "确定要重置密码为Aa@12345678吗",
onOk: () => { onOk: () => {
props["userChangePassword"]({ props["userChangePassword"]({
id, id,
@ -96,8 +96,7 @@ function List(props) {
}); });
}; };
const onImportFileConfirm = (values) => { const onImportFileConfirm = (values) => {
console.log(values); importFile("/basicInfo/user/importUserTableByCorp2", {
importFile("/basic-info/user/importUserTable", {
files: values.file, files: values.file,
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
@ -108,7 +107,6 @@ function List(props) {
}; };
const onTreeChange = (selectedKeys) => { const onTreeChange = (selectedKeys) => {
const key = selectedKeys[0] || null; const key = selectedKeys[0] || null;
console.log(selectedKeys);
setSelectedNodeId(key); setSelectedNodeId(key);
getData(); getData();
}; };
@ -156,18 +154,18 @@ function List(props) {
toolBarRender={() => ( toolBarRender={() => (
<> <>
{ {
// props.permission("yhglqyd-add") props.permission("yhglqyd-add")
// && ( && (
<Button <Button
type="primary" type="primary"
icon={<AddIcon />} icon={<AddIcon />}
onClick={() => { onClick={() => {
props.history.push("./add"); props.history.push("./add");
}} }}
> >
新增 新增
</Button> </Button>
// ) )
} }
@ -274,8 +272,7 @@ function List(props) {
} }
{ {
(props.permission("yhglqyd-delete") (props.permission("yhglqyd-delete")) && (
&& record.flag === 1) && (
<Button <Button
danger danger
type="link" type="link"

View File

@ -171,7 +171,6 @@ function AddModalComponent(props) {
values.startValidityTime = values.startValidity[0]; values.startValidityTime = values.startValidity[0];
values.endValidityTime = values.startValidity[1]; values.endValidityTime = values.startValidity[1];
values.userQualificationinfoId = qualificationinfoId; values.userQualificationinfoId = qualificationinfoId;
console.log(values.startValidity);
delete values.startValidity; delete values.startValidity;
if (props.currentId) { if (props.currentId) {
values.id = props.currentId; values.id = props.currentId;

View File

@ -116,17 +116,12 @@ function Qualification() {
} }
function AddModalComponent(props) { function AddModalComponent(props) {
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => {
if (props.currentId) {
console.log(props.currentId);
}
}, [props.currentId]);
const onCancel = () => { const onCancel = () => {
form.resetFields(); form.resetFields();
props.onCancel(); props.onCancel();
}; };
const onSubmit = async (values) => { const onSubmit = async () => {
console.log(values);
onCancel(); onCancel();
props.getData(); props.getData();
}; };

View File

@ -124,8 +124,8 @@ function CorpInfo(props) {
const { data } = await props["corpInfoDetails"]({ const { data } = await props["corpInfoDetails"]({
id: res.data.corpinfoId, id: res.data.corpinfoId,
}); });
data.lrMobile = data.lrMobile && data.lrMobile.label; // data.lrMobile = data.lrMobile && data.lrMobile.label;
data.contactsPhone = data.contactsPhone && data.contactsPhone.label; // data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
data.region = data.village || data.street || data.country || data.city || data.province; data.region = data.village || data.street || data.country || data.city || data.province;
setInfoData(data); setInfoData(data);
@ -225,7 +225,7 @@ function CorpInfo(props) {
}); });
}; };
// 校验社会统一信用代码重复 // 校验统一社会信用代码重复
useEffect(() => { useEffect(() => {
if (!debouncedCode) { if (!debouncedCode) {
form.setFields([ form.setFields([
@ -244,7 +244,7 @@ function CorpInfo(props) {
form.setFields([ form.setFields([
{ {
name: "code", name: "code",
errors: ["该社会统一信用代码已被其他企业使用"], errors: ["该统一社会信用代码已被其他企业使用"],
}, },
]); ]);
} }
@ -319,12 +319,12 @@ function CorpInfo(props) {
}, },
}, },
{ {
label: "社会统一信用代码", label: "统一社会信用代码",
name: "code", name: "code",
rules: [ rules: [
{ {
pattern: UNIFIED_SOCIAL_CREDIT_CODE, pattern: UNIFIED_SOCIAL_CREDIT_CODE,
message: "请输入正确的社会统一信用代码", message: "请输入正确的统一社会信用代码",
}, },
], ],
componentProps: { componentProps: {
@ -406,7 +406,7 @@ function CorpInfo(props) {
}, },
{ {
label: "法人手机号", label: "法定代表人手机号",
name: "lrMobile", name: "lrMobile",
rules: [ rules: [

View File

@ -25,7 +25,7 @@ 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 { tableProps, getData } = useTable(props["departmentList"], { const { tableProps, getData } = useTable(props["departmentList"], {
form, form,
@ -56,6 +56,7 @@ function Department(props) {
if (res.success) { if (res.success) {
message.success("删除成功"); message.success("删除成功");
getData(); getData();
setTreeKey(prev => prev + 1);
} }
}); });
}, },
@ -121,7 +122,7 @@ function Department(props) {
gap: 20, gap: 20,
}} }}
> >
<LeftTree onGetNodePaths={onGetNodePaths} /> <LeftTree key={treeKey} onGetNodePaths={onGetNodePaths} />
<div <div
style={{ style={{
flex: 1, flex: 1,
@ -162,7 +163,7 @@ function Department(props) {
</Button> </Button>
) )
} }
<Button icon={<LeftOutlined />} onClick={fnReturn}> <Button icon={<LeftOutlined />} onClick={fnReturn} hidden={pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")}>
返回 返回
</Button> </Button>
</> </>
@ -233,7 +234,10 @@ function Department(props) {
<AddModal <AddModal
open={addModalOpen} open={addModalOpen}
loading={props.department.departmentLoading} loading={props.department.departmentLoading}
getData={getData} getData={() => {
getData();
setTreeKey(prev => prev + 1);
}}
parentId={selectedNodeId} parentId={selectedNodeId}
currentId={currentId} currentId={currentId}
requestAdd={props["departmentAdd"]} requestAdd={props["departmentAdd"]}

View File

@ -68,12 +68,29 @@ function Add(props) {
const debouncedUsernameValue = useDebounce(usernameValue, 600); const debouncedUsernameValue = useDebounce(usernameValue, 600);
const debouncedPhoneValueValue = useDebounce(phoneValue, 600); const debouncedPhoneValueValue = useDebounce(phoneValue, 600);
useEffect(() => { useEffect(() => {
console.log(queryParams["id"]);
if (queryParams["id"]) { if (queryParams["id"]) {
const fetchData = async () => { const fetchData = async () => {
const { data } = await props["userDetails"]({ const { data } = await props["userDetails"]({
id: queryParams["id"], 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.sex = data.sex === "男" ? "1" : "0"; data.sex = data.sex === "男" ? "1" : "0";
setUserID(data.userId); setUserID(data.userId);
const userImg = await getFile({ const userImg = await getFile({
@ -128,6 +145,9 @@ function Add(props) {
list: MARITAL_STATUS_ENUM, list: MARITAL_STATUS_ENUM,
}); });
if (values.userIdCard) {
values.userIdCard = btoa(values.userIdCard); // Base64 编码
}
const { id } = await uploadFile({ const { id } = await uploadFile({
single: false, single: false,
files: values.userImg, files: values.userImg,
@ -344,7 +364,7 @@ function Add(props) {
{ {
name: "phone", name: "phone",
label: "用户名", label: "用户名",
tip: "* 用户名为手机号修改手机号登录密码则会变成初始密码“Aa@123456789", tip: "* 用户名为手机号修改手机号登录密码则会变成初始密码“Aa@12345678",
rules: [ rules: [
{ {
pattern: PHONE, pattern: PHONE,

View File

@ -42,7 +42,7 @@ function List(props) {
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "确定要重置密码为Aa12345678吗", content: "确定要重置密码为Aa@12345678吗",
onOk: () => { onOk: () => {
props["userChangePassword"]({ props["userChangePassword"]({
id, id,
@ -320,11 +320,9 @@ function AddModalComponent(props) {
}); });
res.data.userImg = userImg; res.data.userImg = userImg;
res.data.cardImg = cardImg; res.data.cardImg = cardImg;
console.log(res.data);
setInfo(res.data); setInfo(res.data);
}; };
fetchData(); fetchData();
console.log(info);
} }
}, [props.currentId]); }, [props.currentId]);
const onCancel = () => { const onCancel = () => {

View File

@ -18,7 +18,6 @@ function ResignationReview(props) {
useEffect(() => { useEffect(() => {
props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => { props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => {
console.log(res);
setInfo(res.data); setInfo(res.data);
}); });
}, []); }, []);

View File

@ -70,7 +70,6 @@ function SecurityPersonnel(props) {
eqType: UPLOAD_FILE_TYPE_ENUM["6"], eqType: UPLOAD_FILE_TYPE_ENUM["6"],
eqForeignKey: userQualificationinfoId, eqForeignKey: userQualificationinfoId,
}); });
console.log(res);
setFileCache(prev => ({ setFileCache(prev => ({
...prev, ...prev,
[userQualificationinfoId]: res || [], [userQualificationinfoId]: res || [],
@ -234,7 +233,6 @@ function SecurityPersonnel(props) {
setCurrentId(""); setCurrentId("");
}} }}
onSuccess={(userQualificationinfoId) => { onSuccess={(userQualificationinfoId) => {
console.log(userQualificationinfoId);
// 清除该记录的图片缓存,强制下次 render 时重新加载 // 清除该记录的图片缓存,强制下次 render 时重新加载
setFileCache((prev) => { setFileCache((prev) => {
const newCache = { ...prev }; const newCache = { ...prev };

View File

@ -70,7 +70,6 @@ function SpecialPersonnel(props) {
eqType: UPLOAD_FILE_TYPE_ENUM["6"], eqType: UPLOAD_FILE_TYPE_ENUM["6"],
eqForeignKey: userQualificationinfoId, eqForeignKey: userQualificationinfoId,
}); });
console.log(res);
setFileCache(prev => ({ setFileCache(prev => ({
...prev, ...prev,
[userQualificationinfoId]: res || [], [userQualificationinfoId]: res || [],
@ -343,7 +342,6 @@ function AddModalComponent(props) {
form.setFieldsValue({ form.setFieldsValue({
operatingProject: undefined, operatingProject: undefined,
}); });
console.log(newIdCard);
} }
} }
}; };

View File

@ -75,7 +75,7 @@ function List(props) {
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "是否重置密码为Aa12345678", content: "是否重置密码为Aa@12345678",
onOk: () => { onOk: () => {
props["corpInfoChangePassword"]({ props["corpInfoChangePassword"]({
id, id,
@ -192,7 +192,7 @@ function List(props) {
dataIndex: "corpName", dataIndex: "corpName",
}, },
{ {
title: "社会统一信用代码", title: "统一社会信用代码",
dataIndex: "code", dataIndex: "code",
}, },
// { // {
@ -251,7 +251,7 @@ function List(props) {
) )
} }
{ {
props.permission("zhgl-editName") props.permission("zgszhgl-editName")
&& ( && (
<Button <Button
type="link" type="link"
@ -273,7 +273,7 @@ function List(props) {
) )
} }
{ {
props.permission("zhgl-info") props.permission("zgszhgl-info")
&& ( && (
<Button <Button
type="link" type="link"
@ -285,7 +285,7 @@ function List(props) {
} }
{ {
props.permission("zhgl-resetPassword") props.permission("zgszhgl-resetPassword")
&& ( && (
<Button <Button
type="link" type="link"
@ -297,7 +297,7 @@ function List(props) {
} }
{ {
props.permission("zhgl-editFlag") props.permission("zgszhgl-editFlag")
&& ( && (
<Button <Button
danger danger
@ -313,7 +313,7 @@ function List(props) {
) )
} }
{ {
props.permission("zhgl-delete") props.permission("zgszhgl-delete")
&& ( && (
<Button <Button
danger danger
@ -389,7 +389,7 @@ function AddModalComponent(props) {
onCancel(); onCancel();
props.getData(); props.getData();
}; };
// 校验社会统一信用代码重复 // 校验统一社会信用代码重复
useEffect(() => { useEffect(() => {
if (!debouncedCode) { if (!debouncedCode) {
form.setFields([ form.setFields([
@ -410,7 +410,7 @@ function AddModalComponent(props) {
form.setFields([ form.setFields([
{ {
name: "code", name: "code",
errors: ["该社会统一信用代码已被其他企业使用"], errors: ["该统一社会信用代码已被其他企业使用"],
}, },
]); ]);
} }
@ -445,7 +445,6 @@ function AddModalComponent(props) {
}); });
}, [debouncedCorpName]); }, [debouncedCorpName]);
const onValuesChange = (changed) => { const onValuesChange = (changed) => {
console.log(changed);
if ("code" in changed) if ("code" in changed)
setCodeValue(changed.code ?? ""); setCodeValue(changed.code ?? "");
if ("corpName" in changed) if ("corpName" in changed)
@ -470,11 +469,11 @@ function AddModalComponent(props) {
}, },
{ {
name: "code", name: "code",
label: "社会统一信用代码", label: "统一社会信用代码",
rules: [ rules: [
{ {
pattern: UNIFIED_SOCIAL_CREDIT_CODE, pattern: UNIFIED_SOCIAL_CREDIT_CODE,
message: "请输入正确的社会统一信用代码", message: "请输入正确的统一社会信用代码",
}, },
], ],
hidden: props.openType === "editName", hidden: props.openType === "editName",

View File

@ -64,7 +64,7 @@ function View(props) {
children: info.corpName && info.corpName, children: info.corpName && info.corpName,
}, },
{ {
label: "社会统一信用代码", label: "统一社会信用代码",
children: info.code, children: info.code,
width: 200, width: 200,
}, },

View File

@ -57,6 +57,7 @@ function List(props) {
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
enterpriseType: 2,
}; };
}, },
}); });

View File

@ -15,7 +15,7 @@ function View(props) {
const [addModalOpen, setAddModalOpen] = useState(false); const [addModalOpen, setAddModalOpen] = useState(false);
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const queryParams = useGetUrlQuery(); const queryParams = useGetUrlQuery();
const [selectedNodeId, setSelectedNodeId] = useState(null); const [selectedNodeId, setSelectedNodeId] = useState(queryParams["id"]);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { tableProps, getData } = useTable(props["departmentList"], { const { tableProps, getData } = useTable(props["departmentList"], {
form, form,
@ -24,6 +24,7 @@ function View(props) {
...formData, ...formData,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
eqParentId: selectedNodeId, eqParentId: selectedNodeId,
usePermission: false,
}; };
}, },
}); });

View File

@ -66,9 +66,6 @@ function List(props) {
setVisible(true); setVisible(true);
}; };
const handleConfirm = (lng, lat, extra) => { const handleConfirm = (lng, lat, extra) => {
console.log("选中的坐标:", lng, lat);
console.log(extra);
console.log(rowData);
rowData.latitude = lat; rowData.latitude = lat;
rowData.longitude = lng; rowData.longitude = lng;
rowData.areaCode = extra.area; rowData.areaCode = extra.area;

View File

@ -168,22 +168,22 @@ function View(props) {
children: ( children: (
<div> <div>
{info.lrMobile && info.lrMobile.label} {info.lrMobile }
{ (info.lrMobile && info.lrMobile.label) {/* { (info.lrMobile && info.lrMobile.label) */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("lrMobile"); {/* setViewType("lrMobile"); */}
setViewData(""); {/* setViewData(""); */}
setEncrypted(info.lrMobile); {/* setEncrypted(info.lrMobile); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -208,22 +208,22 @@ function View(props) {
children: ( children: (
<div> <div>
{ info.contactsPhone && info.contactsPhone.label} { 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>
), ),
@ -248,22 +248,22 @@ function View(props) {
children: ( children: (
<div> <div>
{info.safetyPhone && info.safetyPhone.label} {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>
), ),
@ -329,7 +329,7 @@ function View(props) {
{viewData} {viewData}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="法人手机号码" label="法定代表人手机号码"
hidden={!(viewType === "lrMobile" && viewData)} hidden={!(viewType === "lrMobile" && viewData)}
> >
{viewData} {viewData}

View File

@ -24,12 +24,12 @@ function List(props) {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false,
}; };
}, },
}); });
const onTreeChange = (selectedKeys) => { const onTreeChange = (selectedKeys) => {
const key = selectedKeys[0] || null; const key = selectedKeys[0] || null;
console.log(selectedKeys);
setSelectedNodeId(key); setSelectedNodeId(key);
getData(); getData();
}; };
@ -128,7 +128,6 @@ function AddModalComponent(props) {
setInfo(res.data); setInfo(res.data);
}; };
fetchData(); fetchData();
console.log(info);
} }
}, [props.currentId]); }, [props.currentId]);
const onCancel = () => { const onCancel = () => {

View File

@ -26,6 +26,7 @@ function List(props) {
transform: (formData) => { transform: (formData) => {
return { return {
...formData, ...formData,
usePermission: false,
}; };
}, },
}); });

View File

@ -13,8 +13,9 @@ function ChangeView(props) {
useEffect(() => { useEffect(() => {
props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => { props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => {
console.log(res); if (res.data) {
setInfo(res.data); setInfo(res.data);
}
}); });
}, []); }, []);

View File

@ -93,7 +93,7 @@ function List(props) {
{ {
title: "操作", title: "操作",
width: 200, width: 200,
hidden: !(props.permission("qyyhzt-info")), // hidden: !(props.permission("qyyhzt-info")),
render: (_, record) => ( render: (_, record) => (
<Space> <Space>

View File

@ -32,17 +32,18 @@ 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,
corpinfoId: queryParams["id"], corpinfoId: queryParams["id"],
}; };
}, },
}); });
const onTreeChange = (selectedKeys) => { const onTreeChange = (selectedKeys) => {
const key = selectedKeys[0] || null; const key = selectedKeys[0] || null;
console.log(selectedKeys);
setSelectedNodeId(key); setSelectedNodeId(key);
getData(); getData();
}; };
@ -129,6 +130,7 @@ function List(props) {
<Space> <Space>
<Button <Button
type="link" type="link"
hidden={true}
onClick={() => { onClick={() => {
setAddModalOpen(true); setAddModalOpen(true);
setCurrentId(record.id); setCurrentId(record.id);

View File

@ -52,13 +52,12 @@ function List(props) {
}; };
}, },
}); });
console.log(console.log(window.process.env.app.antd["ant-prefix"]));
const [addModalOpen, setAddModalOpen] = useState(false); const [addModalOpen, setAddModalOpen] = useState(false);
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "是否重置密码为Aa12345678", content: "是否重置密码为Aa@12345678",
onOk: () => { onOk: () => {
props["corpInfoChangePassword"]({ props["corpInfoChangePassword"]({
id, id,
@ -192,7 +191,7 @@ function List(props) {
dataIndex: "accountContactName", dataIndex: "accountContactName",
}, },
{ {
title: "社会统一信用代码", title: "统一社会信用代码",
dataIndex: "code", dataIndex: "code",
width: 190, width: 190,
}, },
@ -342,7 +341,7 @@ function AddModalComponent(props) {
props.getData(); props.getData();
}; };
// 校验社会统一信用代码重复 // 校验统一社会信用代码重复
useEffect(() => { useEffect(() => {
if (!debouncedCode) { if (!debouncedCode) {
form.setFields([ form.setFields([
@ -363,7 +362,7 @@ function AddModalComponent(props) {
form.setFields([ form.setFields([
{ {
name: "code", name: "code",
errors: ["该社会统一信用代码已被其他企业使用"], errors: ["该统一社会信用代码已被其他企业使用"],
}, },
]); ]);
} }
@ -421,11 +420,11 @@ function AddModalComponent(props) {
}, },
{ {
name: "code", name: "code",
label: "社会统一信用代码", label: "统一社会信用代码",
rules: [ rules: [
{ {
pattern: UNIFIED_SOCIAL_CREDIT_CODE, pattern: UNIFIED_SOCIAL_CREDIT_CODE,
message: "请输入正确的社会统一信用代码", message: "请输入正确的统一社会信用代码",
}, },
], ],
}, },
@ -460,7 +459,8 @@ function AddModalComponent(props) {
<DictionarySelect <DictionarySelect
mode="multiple" mode="multiple"
dictValue="select_from_List" dictValue="select_from_List"
idKey="dictValue"
nameKey="dictLabel"
onGetData={(data) => { onGetData={(data) => {
setSelectfromData(data); setSelectfromData(data);
}} }}

View File

@ -135,26 +135,26 @@ function View(props) {
children: info.lrName, children: info.lrName,
}, },
{ {
label: "法人手机号", label: "法定代表人手机号",
children: ( children: (
<div> <div>
{info.lrMobile && info.lrMobile.label} {info.lrMobile }
{ (info.lrMobile && info.lrMobile.label) {/* { (info.lrMobile && info.lrMobile.label) */}
&& ( {/* && ( */}
<Button {/* <Button */}
type="link" {/* type="link" */}
onClick={() => { {/* onClick={() => { */}
setIsModalOpen(true); {/* setIsModalOpen(true); */}
setViewType("lrMobile"); {/* setViewType("lrMobile"); */}
setViewData(""); {/* setViewData(""); */}
setEncrypted(info.lrMobile); {/* setEncrypted(info.lrMobile); */}
form.resetFields(); {/* form.resetFields(); */}
}} {/* }} */}
> {/* > */}
点击查看 {/* 点击查看 */}
</Button> {/* </Button> */}
)} {/* )} */}
</div> </div>
), ),
@ -168,22 +168,22 @@ function View(props) {
children: ( children: (
<div> <div>
{ info.contactsPhone && info.contactsPhone.label} { 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>
), ),
@ -302,7 +302,7 @@ function View(props) {
{viewData} {viewData}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="法人手机号码" label="法定代表人手机号码"
hidden={!(viewType === "lrMobile" && viewData)} hidden={!(viewType === "lrMobile" && viewData)}
> >
{viewData} {viewData}

View File

@ -11,8 +11,7 @@ function CertifiedUser() {
const { tableProps, getData } = useTable(() => {}, { const { tableProps, getData } = useTable(() => {}, {
form, form,
}); });
const fnSearch = (values) => { const fnSearch = () => {
console.log(values);
getData(); getData();
}; };
return ( return (

View File

@ -33,6 +33,7 @@ function Department(props) {
...formData, ...formData,
eqQualificationinfoType: 2, eqQualificationinfoType: 2,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false,
}; };
}, },
}); });
@ -64,7 +65,6 @@ function Department(props) {
eqType: UPLOAD_FILE_TYPE_ENUM["6"], eqType: UPLOAD_FILE_TYPE_ENUM["6"],
eqForeignKey: userQualificationinfoId, eqForeignKey: userQualificationinfoId,
}); });
console.log(res);
setFileCache(prev => ({ setFileCache(prev => ({
...prev, ...prev,
[userQualificationinfoId]: res || [], [userQualificationinfoId]: res || [],

View File

@ -35,6 +35,7 @@ function Department(props) {
...formData, ...formData,
eqQualificationinfoType: 1, eqQualificationinfoType: 1,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false,
}; };
}, },
}); });
@ -63,7 +64,6 @@ function Department(props) {
eqType: UPLOAD_FILE_TYPE_ENUM["6"], eqType: UPLOAD_FILE_TYPE_ENUM["6"],
eqForeignKey: userQualificationinfoId, eqForeignKey: userQualificationinfoId,
}); });
console.log(res);
setFileCache(prev => ({ setFileCache(prev => ({
...prev, ...prev,
[userQualificationinfoId]: res || [], [userQualificationinfoId]: res || [],
@ -309,7 +309,6 @@ function AddModalComponent(props) {
form.setFieldsValue({ form.setFieldsValue({
operatingProject: undefined, operatingProject: undefined,
}); });
console.log(newIdCard);
} }
} }
}; };

View File

@ -47,12 +47,10 @@ function List(props) {
}); });
const onFinish = async () => { const onFinish = async () => {
// 处理属地查询 // 处理属地查询
console.log(cityData);
const arr = []; const arr = [];
cityData.forEach((item) => { cityData.forEach((item) => {
arr.push(item.value); arr.push(item.value);
}); });
console.log(arr);
form.setFieldValue("cityRecord", arr); form.setFieldValue("cityRecord", arr);
getData(); getData();
}; };

View File

@ -29,6 +29,7 @@ function List(props) {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
eqCorpinfoId: queryParams["id"], eqCorpinfoId: queryParams["id"],
usePermission: false,
}; };
}, },
}); });
@ -45,7 +46,7 @@ function List(props) {
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "确定要重置密码为Aa12345678吗", content: "确定要重置密码为Aa@12345678吗",
onOk: () => { onOk: () => {
props["userChangePassword"]({ props["userChangePassword"]({
id, id,
@ -60,7 +61,6 @@ function List(props) {
}; };
const onTreeChange = (selectedKeys) => { const onTreeChange = (selectedKeys) => {
const key = selectedKeys[0] || null; const key = selectedKeys[0] || null;
console.log(selectedKeys);
setSelectedNodeId(key); setSelectedNodeId(key);
getData(); getData();
}; };
@ -198,13 +198,10 @@ function AddModalComponent(props) {
}); });
res.data.userImg = userImg; res.data.userImg = userImg;
res.data.cardImg = cardImg; res.data.cardImg = cardImg;
console.log(res.data);
setInfo(res.data); setInfo(res.data);
}; };
fetchData(); fetchData();
console.log(info);
} }
}, [props.currentId]); }, [props.currentId]);
const onCancel = () => { const onCancel = () => {

View File

@ -42,7 +42,7 @@ function Update(props) {
fetchData(); fetchData();
}, []); }, []);
// 校验社会统一信用代码重复 // 校验统一社会信用代码重复
useEffect(() => { useEffect(() => {
if (!debouncedCode) { if (!debouncedCode) {
form.setFields([ form.setFields([
@ -61,7 +61,7 @@ function Update(props) {
form.setFields([ form.setFields([
{ {
name: "code", name: "code",
errors: ["该社会统一信用代码已被其他企业使用"], errors: ["该统一社会信用代码已被其他企业使用"],
}, },
]); ]);
} }
@ -155,14 +155,14 @@ function Update(props) {
}, },
}, },
{ {
label: "社会统一信用代码", label: "统一社会信用代码",
name: "code", name: "code",
span: 24, span: 24,
rules: [ rules: [
{ {
pattern: UNIFIED_SOCIAL_CREDIT_CODE, pattern: UNIFIED_SOCIAL_CREDIT_CODE,
message: "请输入正确的社会统一信用代码", message: "请输入正确的统一社会信用代码",
}, },
], ],

View File

@ -1,3 +1,4 @@
import { LeftOutlined } from "@ant-design/icons";
import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, message, Modal, Space, Tag } from "antd"; import { Button, Form, message, Modal, Space, Tag } from "antd";
@ -5,8 +6,8 @@ import { useEffect, useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder"; import FormBuilder from "zy-react-library/components/FormBuilder";
import AddIcon from "zy-react-library/components/Icon/AddIcon"; import AddIcon from "zy-react-library/components/Icon/AddIcon";
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
import Search from "zy-react-library/components/Search";
import Search from "zy-react-library/components/Search";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo"; import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
@ -23,6 +24,9 @@ function Department(props) {
const [chartModalOpen, setChartModalOpen] = useState(false); const [chartModalOpen, setChartModalOpen] = useState(false);
const [departmentData, setDepartmentData] = useState(null); const [departmentData, setDepartmentData] = useState(null);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [pathNodes, setPathNodes] = useState([]);
const [treeKey, setTreeKey] = useState(0);
const { tableProps, getData } = useTable(props["departmentList"], { const { tableProps, getData } = useTable(props["departmentList"], {
form, form,
transform: (formData) => { transform: (formData) => {
@ -66,11 +70,59 @@ function Department(props) {
if (res.success) { if (res.success) {
message.success("删除成功"); message.success("删除成功");
getData(); getData();
setTreeKey(prev => prev + 1);
} }
}); });
}, },
}); });
}; };
const onGetNodePaths = (nodes) => {
if (!Array.isArray(nodes) || nodes.length === 0)
return;
const current = nodes[nodes.length - 1];
setPathNodes(nodes); // 记录完整路径
setSelectedNodeId(current.id);
setSelectedNodeName(current.name);
getData();
};
// 返回上一级
const fnReturn = () => {
if (pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")) {
message.warning("已是顶级部门,无法继续返回");
return;
}
// 移除当前节点
const parent = pathNodes[pathNodes.length - 1];
setSelectedNodeId(parent.parentId);
setSelectedNodeName(parent.name);
const newPaths = pathNodes.slice(0, -1);
setPathNodes(newPaths);
getData();
};
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();
}
};
return ( return (
<div <div
@ -84,7 +136,7 @@ function Department(props) {
gap: 20, gap: 20,
}} }}
> >
<LeftTree onSelect={onTreeChange} onGetData={data => setDepartmentData(data)} /> <LeftTree key={treeKey} onSelect={onTreeChange} onGetNodePaths={onGetNodePaths} onGetData={data => setDepartmentData(data)} />
<div <div
style={{ style={{
flex: 1, flex: 1,
@ -119,6 +171,9 @@ function Department(props) {
</Button> </Button>
) )
} }
<Button icon={<LeftOutlined />} onClick={fnReturn} hidden={pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")}>
返回
</Button>
<Button <Button
onClick={() => { onClick={() => {
handleChartClick(); handleChartClick();
@ -136,11 +191,7 @@ function Department(props) {
<Button <Button
block block
type="link" type="link"
onClick={() => { onClick={() => handleTableNodeClick(record)}
setSelectedNodeId(record.id);
getData();
setSelectedNodeName(record.name);
}}
> >
{`${record.name}>`} {`${record.name}>`}
</Button> </Button>
@ -198,7 +249,10 @@ function Department(props) {
<AddModal <AddModal
open={addModalOpen} open={addModalOpen}
loading={props.department.departmentLoading} loading={props.department.departmentLoading}
getData={getData} getData={() => {
getData();
setTreeKey(prev => prev + 1);
}}
parentId={selectedNodeId} parentId={selectedNodeId}
currentId={currentId} currentId={currentId}
requestAdd={props["departmentAdd"]} requestAdd={props["departmentAdd"]}

View File

@ -63,6 +63,24 @@ function Add(props) {
const { data } = await props["userDetails"]({ const { data } = await props["userDetails"]({
id: queryParams["id"], 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.sex = data.sex === "男" ? "1" : "0"; data.sex = data.sex === "男" ? "1" : "0";
fnChoiceDepartment( fnChoiceDepartment(
[ [
@ -83,7 +101,6 @@ function Add(props) {
}, },
] ]
: []; : [];
console.log(filepath);
const values = { const values = {
filepath, filepath,
...data, ...data,
@ -125,6 +142,9 @@ function Add(props) {
foreignKey: userID, foreignKey: userID,
}, },
}); });
if (values.userIdCard) {
values.userIdCard = btoa(values.userIdCard); // Base64 编码
}
values.userAvatarUrl = filePath; values.userAvatarUrl = filePath;
values.mainCorpFlag = 0; values.mainCorpFlag = 0;
values.userType = 1; values.userType = 1;
@ -148,7 +168,6 @@ function Add(props) {
} }
}; };
const fnChoiceDepartment = async (event) => { const fnChoiceDepartment = async (event) => {
console.log(event);
form.setFieldsValue({ form.setFieldsValue({
postId: undefined, postId: undefined,
}); });
@ -157,7 +176,6 @@ function Add(props) {
corpFlag: 1, corpFlag: 1,
departmentId: event[event.length - 1].id, departmentId: event[event.length - 1].id,
}).then((res) => { }).then((res) => {
console.log(res);
setPostData(res.data); setPostData(res.data);
}); });
}; };

View File

@ -19,7 +19,6 @@ 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 { maskPhone } from "~/utils";
function List(props) { function List(props) {
const [importOpen, setImportOpen] = useState(false); const [importOpen, setImportOpen] = useState(false);
@ -39,7 +38,7 @@ function List(props) {
return { return {
...formData, ...formData,
eqDepartmentId: selectedNodeId, eqDepartmentId: selectedNodeId,
menuPath: "/basicInfo/container/supervision/supervision/user/list", menuPath: "",
}; };
}, },
}); });
@ -73,7 +72,7 @@ function List(props) {
content: "确定要导出到excel吗", content: "确定要导出到excel吗",
onOk: async () => { onOk: async () => {
downloadBlob( downloadBlob(
`/basic-info/user/exportUserTable?ids=${selectedRowKeys.length !== 0 ? selectedRowKeys.join(",") : ""}`, `/basicInfo/user/exportUserTable?ids=${selectedRowKeys.length !== 0 ? selectedRowKeys.join(",") : ""}`,
{ {
name: "用户", name: "用户",
}, },
@ -84,7 +83,7 @@ function List(props) {
const onResetPassword = (id) => { const onResetPassword = (id) => {
Modal.confirm({ Modal.confirm({
title: "提示", title: "提示",
content: "确定要重置密码为Aa12345678吗", content: "确定要重置密码为Aa@12345678吗",
onOk: () => { onOk: () => {
props["userChangePassword"]({ props["userChangePassword"]({
id, id,
@ -98,13 +97,17 @@ function List(props) {
}); });
}; };
const onImportFileConfirm = (values) => { const onImportFileConfirm = (values) => {
importFile("/basic-info/user/importUserTable", { importFile("/basicInfo/user/importUserTable", {
files: values.file, files: values.file,
}).then((res) => {
if (res.success) {
message.success("导入成功");
getData();
}
}); });
// message.success("导入成功"); // message.success("导入成功");
}; };
const onTreeChange = (selectedKeys) => { const onTreeChange = (selectedKeys) => {
console.log(selectedKeys);
const key = selectedKeys[0] || null; const key = selectedKeys[0] || null;
setSelectedNodeId(key); setSelectedNodeId(key);
getData(); getData();
@ -216,18 +219,18 @@ function List(props) {
) )
} }
{ {
props.permission("zhgl-import") // props.permission("zhgl-import")
&& ( // && (
<Button <Button
type="primary" type="primary"
icon={<ImportIcon />} icon={<ImportIcon />}
onClick={() => { onClick={() => {
setImportOpen(true); setImportOpen(true);
}} }}
> >
导入 导入
</Button> </Button>
) // )
} }
{ {
props.permission("zhgl-export") props.permission("zhgl-export")
@ -268,9 +271,7 @@ function List(props) {
{ {
title: "手机号", title: "手机号",
dataIndex: "phone", dataIndex: "phone",
render: (text, record) => (
<div>{maskPhone(record.phone)}</div>
),
}, },
{ {
title: "所属部门", title: "所属部门",
@ -493,20 +494,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>
), ),
@ -520,20 +521,20 @@ function AddModalComponent(props) {
children: ( children: (
<div> <div>
{info.userIdCard} {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>
), ),