From 2d2b8966a74136b2fb93e9557f87e2b0eb8aff05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=99=AF=E5=AD=A6?= <5412262+sun_jing_xue@user.noreply.gitee.com> Date: Tue, 5 Aug 2025 17:13:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A3=80=E7=B4=A2=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=8E=E9=9B=86=E5=9B=A2=E6=A0=91=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groupQualifiedSupplierQuery/index.tsx | 47 +++++++++---------- .../personQualifiedSupplierQuery/index.tsx | 32 ++++++------- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx index d3ac2f0..05237a5 100644 --- a/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/groupQualifiedSupplierQuery/index.tsx @@ -62,41 +62,40 @@ function findFirstLeafKey(nodes: any[]): string | undefined { const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => { const [form] = Form.useForm(); - const [dataTree, setDataTree] = useState([]); - const [treeSelected, setTreeSelected] = useState([]); - const [selectedKeys, setSelectedKeys] = useState(''); - const [DeptId, setDeptId] = useState(''); - const [data, setData] = useState([]); + const [dataTree, setDataTree] = useState < TreeNode[] > ([]); + const [treeSelected, setTreeSelected] = useState < string[] > ([]); + const [selectedKeys, setSelectedKeys] = useState < string > (''); + const [DeptId, setDeptId] = useState < string > (''); + const [data, setData] = useState < Data[] > ([]); const [loading, setLoading] = useState(false); const [treeLoading, setTreeLoading] = useState(false); - const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); + const [pagination, setPagination] = useState < TablePaginationConfig > ({ current: 1, pageSize: 10, total: 0 }); const [viewVisible, setViewVisible] = useState(false); const [detailVisible, setDetailVisible] = useState(false); - const [currentRecord, setCurrentRecord] = useState(null); + const [currentRecord, setCurrentRecord] = useState < any > (null); const orgIdStr = sessionStorage.getItem('Userinfo'); const currentUser = orgIdStr ? JSON.parse(orgIdStr) : null; // 查询 const handleSearch = () => { setPagination(p => ({ ...p, current: 1 })); - getList(selectedKeys? selectedKeys:currentUser.organizationId); + getList(selectedKeys ? selectedKeys : currentUser.organizationId); }; const handleReset = () => { form.resetFields(); setPagination(p => ({ ...p, current: 1 })); - getList(selectedKeys? selectedKeys:currentUser.organizationId); + getList(selectedKeys ? selectedKeys : currentUser.organizationId); }; const handleTreeSelect = (keys: React.Key[]) => { const key = keys[0] as string; - if(key) { - setSelectedKeys(key); - setTreeSelected([key]); - getList(key); - } + setSelectedKeys(key); + setTreeSelected([key]); + getList(key); + }; // 懒加载节点 const onLoadTreeData = async (treeNode: any) => { console.log(1); - + if (treeNode.children && treeNode.children.length > 0) return; setTreeLoading(true); try { @@ -128,7 +127,7 @@ const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => { setLoading(false); } }; - const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({}); + const [enterpriseTypeMap, setEnterpriseTypeMap] = useState < { [code: string]: string } > ({}); // 初始化 useEffect(() => { getDictList('enterprise_type').then((res: any) => { @@ -151,7 +150,7 @@ const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => { if (firstLeafKey) { // setSelectedKeys(firstLeafKey); // setTreeSelected([firstLeafKey]); - + getList(currentUser.organizationId); } } @@ -227,14 +226,14 @@ const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => { width: 80, render: (record: any) => ( - { - dispatch({ + { + dispatch({ type: 'globalModal/show', payload: { id: record.id, }, }); - }}>查看 + }}>查看 {/* { setCurrentRecord(record.id); setDetailVisible(true); }}>准入明细 */} ), @@ -264,10 +263,10 @@ const groupQualifiedSupplierQuery: React.FC = ({ dispatch }) => {