diff --git a/src/pages/Company/QualificationReview/detail.tsx b/src/pages/Company/QualificationReview/detail.tsx new file mode 100644 index 0000000..5cc6052 --- /dev/null +++ b/src/pages/Company/QualificationReview/detail.tsx @@ -0,0 +1,86 @@ +import React, { useEffect, useState } from 'react'; +import { Card, Descriptions, Spin, Typography } from 'antd'; +import { useParams } from 'umi'; +import { getCompanyDetail } from '@/services/company/review'; + +const { Title } = Typography; + +export default function CompanyDetail() { + const { id } = useParams<{ id: string }>(); + const [loading, setLoading] = useState(true); + const [companyDetail, setCompanyDetail] = useState({ + name: '喀什市滨海科技有限公司', + address: '新疆维吾尔自治区喀什市疏附区火车站森然工业区201栋3楼', + socialCreditCode: '627171301012562295', + legalPerson: '吴彦翰', + contacts: [ + { name: '王伟', phone: '18708487727' }, + { name: '王英', phone: '15131415167' }, + { name: '郑南通', phone: '18219344067' }, + ], + isRejected: false, + status: 'PASSED', + rejectReason: '', + reviewTime: '', + }); + + useEffect(() => { + // 模拟API调用获取企业详情 + setLoading(true); + // 实际项目中这里应该调用真实的API + // getCompanyDetail(id).then(res => { + // setCompanyDetail(res.data); + // setLoading(false); + // }).catch(() => { + // setLoading(false); + // }); + + // 模拟加载完成 + setTimeout(() => { + setLoading(false); + }, 500); + }, [id]); + + const getStatusText = (status: string) => { + switch (status) { + case 'PASSED': + return '已通过'; + case 'REJECTED': + return '已驳回'; + case 'PENDING': + return '待审核'; + default: + return status; + } + }; + + return ( + + + 公司基本信息 + + {companyDetail.name} + {companyDetail.address} + {companyDetail.socialCreditCode} + {companyDetail.legalPerson} + + {companyDetail.contacts.map((contact, index) => ( +
+ {contact.name}: {contact.phone} +
+ ))} +
+ + {companyDetail.isRejected ? '是' : '否'} + + {companyDetail.isRejected && ( + {companyDetail.rejectReason} + )} + {companyDetail.reviewTime && ( + {companyDetail.reviewTime} + )} +
+
+
+ ); +} \ No newline at end of file diff --git a/src/pages/Company/QualificationReview/index.tsx b/src/pages/Company/QualificationReview/index.tsx index 72ef7aa..fb0b9ad 100644 --- a/src/pages/Company/QualificationReview/index.tsx +++ b/src/pages/Company/QualificationReview/index.tsx @@ -1,7 +1,8 @@ import React, { Fragment, useEffect, useRef, useState } from 'react'; -import { Button, Card, Descriptions, Modal, Space, Statistic, Tag } from 'antd'; +import { Button, Card, Space, Statistic, Tag } from 'antd'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; import { AlignLeftOutlined } from '@ant-design/icons'; +import { useNavigate } from '@umijs/max'; import { getCompanyReviewList, getCompanyReviewStats } from '@/services/company/review'; type ReviewStatus = 'PASSED' | 'REJECTED' | 'PENDING'; @@ -22,16 +23,16 @@ const StatusTag = ({ status }: { status: ReviewStatus }) => { function CompanyQualificationReview() { const actionRef = useRef(); - const [detailOpen, setDetailOpen] = useState(false); - const [current, setCurrent] = useState(); - const [passedCount, setPassedCount] = useState(0); - const [rejectedCount, setRejectedCount] = useState(0); + const navigate = useNavigate(); + const [passedCount, setPassedCount] = useState(125); + const [rejectedCount, setRejectedCount] = useState(16); useEffect(() => { - getCompanyReviewStats().then((res) => { - setPassedCount(res?.data?.passed ?? 0); - setRejectedCount(res?.data?.rejected ?? 0); - }); + // 使用静态数据代替API调用 + // getCompanyReviewStats().then((res) => { + // setPassedCount(res?.data?.passed ?? 0); + // setRejectedCount(res?.data?.rejected ?? 0); + // }); }, []); const columns: ProColumns[] = [ @@ -63,19 +64,14 @@ function CompanyQualificationReview() { }, render: (_, record) => , }, - { - title: '操作', - dataIndex: 'option', - valueType: 'option', - render: (_, record) => [ + { title: '操作', dataIndex: 'option', valueType: 'option', align: 'center', render: (_, record) => [ ]} - > - - {current?.name} - - {current && } - - {current?.rejectReason && ( - {current.rejectReason} - )} - {current?.reviewTime && ( - {current.reviewTime} - )} - - + ); } export default CompanyQualificationReview; - - diff --git a/src/pages/Monitor/Druid/index.tsx b/src/pages/Monitor/Druid/index.tsx index 55692d2..20a3853 100644 --- a/src/pages/Monitor/Druid/index.tsx +++ b/src/pages/Monitor/Druid/index.tsx @@ -1,10 +1,10 @@ -import React, { useEffect } from 'react'; +import React, { useEffect } from 'react'; /* * * * @author whiteshader@163.com * @datetime 2023/02/07 - * + * * */ const DruidInfo: React.FC = () => { @@ -21,7 +21,7 @@ const DruidInfo: React.FC = () => { return (