bug修复
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled

This commit is contained in:
FengHui
2026-05-26 17:06:53 +08:00
parent b7d7437c21
commit 7b38f5b96a
14 changed files with 20726 additions and 121 deletions

View File

@@ -1,69 +1,29 @@
import React, { Fragment, useEffect, useRef, useState } from 'react';
import { FormattedMessage, useAccess } from '@umijs/max';
import { Button, FormInstance, message, Modal, Descriptions } from 'antd';
import { Button, FormInstance, message, Modal } from 'antd';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { DeleteOutlined, FormOutlined, PlusOutlined, EyeOutlined, AlignLeftOutlined, AuditOutlined } from '@ant-design/icons';
import EditCompanyListRow from './edit';
import { DeleteOutlined, FormOutlined, PlusOutlined, AlignLeftOutlined, AuditOutlined } from '@ant-design/icons';
import EditCompanyListRow, { CompanyDetailView } from './edit';
import {
addCmsCompanyList,
delCmsCompanyList,
exportCmsCompanyList,
getCmsCompanyList,
getCmsCompanyDetail,
parseCmsCompanyDetailResponse,
putCmsCompanyList,
} from '@/services/company/list';
import { getCmsCompanyDetail } from '@/services/company/list';
import { getDictValueEnum } from '@/services/system/dict';
import DictTag from '@/components/DictTag';
import { postCompanyApproval } from '@/services/company/review';
// 详情查看组件
const CompanyDetailModal = ({
visible,
onCancel,
record,
scaleEnum
}: {
visible: boolean;
onCancel: () => void;
record?: API.CompanyList.Company;
scaleEnum: Record<string, any>;
}) => {
return (
<Modal
title="公司详情"
open={visible}
width={600}
onCancel={onCancel}
footer={[
<Button key="back" onClick={onCancel}>
</Button>,
]}
>
<Descriptions column={1} bordered>
<Descriptions.Item label="公司名称">{record?.name}</Descriptions.Item>
<Descriptions.Item label="公司行业">{record?.industry}</Descriptions.Item>
<Descriptions.Item label="公司规模">
<DictTag enums={scaleEnum} value={record?.scale} />
</Descriptions.Item>
<Descriptions.Item label="公司位置">{record?.location}</Descriptions.Item>
<Descriptions.Item label="企业联系人">
{record?.companyContactList && record.companyContactList.length > 0 ? (
<div>
{record.companyContactList.map((contact, index) => (
<div key={index} style={{ marginBottom: 8 }}>
<div><strong></strong>{contact.contactPerson}</div>
<div><strong></strong>{contact.contactPersonPhone}</div>
</div>
))}
</div>
) : (
<span></span>
)}
</Descriptions.Item>
</Descriptions>
</Modal>
);
const loadCompanyDetail = async (record: API.CompanyList.Company) => {
const resp = await getCmsCompanyDetail(record.companyId);
const detail = parseCmsCompanyDetailResponse(resp);
if (!detail) {
return { ...record };
}
return { ...record, ...detail };
};
function ManagementList() {
@@ -203,12 +163,12 @@ function ManagementList() {
icon={<AlignLeftOutlined />}
hidden={!access.hasPerms('area:business:List.view')}
onClick={async () => {
setCurrentRow(record);
setDetailData({ ...record });
setDetailVisible(true);
setDetailLoading(true);
try {
const resp = await getCmsCompanyDetail(record.companyId);
setDetailData(resp?.data);
setDetailVisible(true);
const merged = await loadCompanyDetail(record);
setDetailData(merged);
} catch (e) {
message.error('获取详情失败');
} finally {
@@ -227,9 +187,8 @@ function ManagementList() {
onClick={async () => {
const hide = message.loading('正在加载详情');
try {
const resp = await getCmsCompanyDetail(record.companyId);
const detail = resp?.data || {};
setCurrentRow({ ...record, ...detail });
const merged = await loadCompanyDetail(record);
setCurrentRow(merged);
setModalVisible(true);
} catch (e) {
message.error('获取详情失败');
@@ -354,11 +313,11 @@ function ManagementList() {
scaleEnum={scaleEnum}
/>
<CompanyDetailModal
visible={detailVisible}
<CompanyDetailView
open={detailVisible}
loading={detailLoading}
onCancel={() => {
setDetailVisible(false);
setCurrentRow(undefined);
setDetailData(undefined);
}}
record={detailData}