111
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
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:
@@ -206,12 +206,14 @@ export const CompanyDetailView = ({
|
|||||||
onCancel,
|
onCancel,
|
||||||
record,
|
record,
|
||||||
scaleEnum,
|
scaleEnum,
|
||||||
|
industryEnum,
|
||||||
loading,
|
loading,
|
||||||
}: {
|
}: {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
record?: API.CompanyList.Company;
|
record?: API.CompanyList.Company;
|
||||||
scaleEnum?: DictValueEnumObj;
|
scaleEnum?: DictValueEnumObj;
|
||||||
|
industryEnum?: DictValueEnumObj;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const contacts = record?.companyContactList?.filter(
|
const contacts = record?.companyContactList?.filter(
|
||||||
@@ -253,8 +255,8 @@ export const CompanyDetailView = ({
|
|||||||
<DictTag enums={scaleEnum} value={record.scale} />
|
<DictTag enums={scaleEnum} value={record.scale} />
|
||||||
)}
|
)}
|
||||||
{statusTag}
|
{statusTag}
|
||||||
{record?.industry ? (
|
{record?.industry != null && record.industry !== '' ? (
|
||||||
<span className="company-detail__industry">{record.industry}</span>
|
<DictTag enums={industryEnum} value={record.industry} />
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import {
|
|||||||
putCmsCompanyList,
|
putCmsCompanyList,
|
||||||
} from '@/services/company/list';
|
} from '@/services/company/list';
|
||||||
import { getDictValueEnum } from '@/services/system/dict';
|
import { getDictValueEnum } from '@/services/system/dict';
|
||||||
import DictTag from '@/components/DictTag';
|
import { getCmsIndustryTreeList } from '@/services/classify/industry';
|
||||||
|
import DictTag, { DictValueEnumObj } from '@/components/DictTag';
|
||||||
import { postCompanyApproval } from '@/services/company/review';
|
import { postCompanyApproval } from '@/services/company/review';
|
||||||
|
|
||||||
const buildListSearchParams = (values: Record<string, any>): API.CompanyList.Params => {
|
const buildListSearchParams = (values: Record<string, any>): API.CompanyList.Params => {
|
||||||
@@ -36,6 +37,25 @@ const loadCompanyDetail = async (record: API.CompanyList.Company) => {
|
|||||||
return { ...record, ...detail };
|
return { ...record, ...detail };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 将行业树数据展平为 DictValueEnumObj */
|
||||||
|
const flattenIndustryTree = (tree: { id: number; label: string; children?: any[] }[]): DictValueEnumObj => {
|
||||||
|
const map: DictValueEnumObj = {};
|
||||||
|
const walk = (nodes: { id: number; label: string; children?: any[] }[]) => {
|
||||||
|
nodes?.forEach((node) => {
|
||||||
|
map[node.id] = {
|
||||||
|
text: node.label,
|
||||||
|
label: node.label,
|
||||||
|
value: node.id,
|
||||||
|
};
|
||||||
|
if (node.children?.length) {
|
||||||
|
walk(node.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
walk(tree);
|
||||||
|
return map;
|
||||||
|
};
|
||||||
|
|
||||||
function ManagementList() {
|
function ManagementList() {
|
||||||
const access = useAccess();
|
const access = useAccess();
|
||||||
|
|
||||||
@@ -48,6 +68,7 @@ function ManagementList() {
|
|||||||
const [detailLoading, setDetailLoading] = useState<boolean>(false);
|
const [detailLoading, setDetailLoading] = useState<boolean>(false);
|
||||||
const [detailData, setDetailData] = useState<API.CompanyList.Company | undefined>();
|
const [detailData, setDetailData] = useState<API.CompanyList.Company | undefined>();
|
||||||
const [scaleEnum, setScaleEnum] = useState<Record<string, any>>({});
|
const [scaleEnum, setScaleEnum] = useState<Record<string, any>>({});
|
||||||
|
const [industryEnum, setIndustryEnum] = useState<DictValueEnumObj>({});
|
||||||
const [approvalVisible, setApprovalVisible] = useState<boolean>(false);
|
const [approvalVisible, setApprovalVisible] = useState<boolean>(false);
|
||||||
const [approvalStatus, setApprovalStatus] = useState<1 | 2>(1);
|
const [approvalStatus, setApprovalStatus] = useState<1 | 2>(1);
|
||||||
const [approvalReason, setApprovalReason] = useState<string>('');
|
const [approvalReason, setApprovalReason] = useState<string>('');
|
||||||
@@ -89,6 +110,11 @@ function ManagementList() {
|
|||||||
getDictValueEnum('scale', true, true).then((data) => {
|
getDictValueEnum('scale', true, true).then((data) => {
|
||||||
setScaleEnum(data);
|
setScaleEnum(data);
|
||||||
});
|
});
|
||||||
|
getCmsIndustryTreeList().then((res) => {
|
||||||
|
if (res?.data) {
|
||||||
|
setIndustryEnum(flattenIndustryTree(res.data));
|
||||||
|
}
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const columns: ProColumns<API.CompanyList.Company>[] = [
|
const columns: ProColumns<API.CompanyList.Company>[] = [
|
||||||
@@ -118,6 +144,9 @@ function ManagementList() {
|
|||||||
dataIndex: 'industry',
|
dataIndex: 'industry',
|
||||||
valueType: 'text',
|
valueType: 'text',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
render: (_, record) => {
|
||||||
|
return <DictTag enums={industryEnum} value={record.industry} />;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '公司规模',
|
title: '公司规模',
|
||||||
@@ -187,7 +216,7 @@ function ManagementList() {
|
|||||||
size="small"
|
size="small"
|
||||||
key="detail"
|
key="detail"
|
||||||
icon={<AlignLeftOutlined />}
|
icon={<AlignLeftOutlined />}
|
||||||
hidden={!access.hasPerms('area:business:List.view')}
|
hidden={!access.hasPerms('cms:company:query')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setDetailData({ ...record });
|
setDetailData({ ...record });
|
||||||
setDetailVisible(true);
|
setDetailVisible(true);
|
||||||
@@ -209,7 +238,7 @@ function ManagementList() {
|
|||||||
size="small"
|
size="small"
|
||||||
key="edit"
|
key="edit"
|
||||||
icon={<FormOutlined />}
|
icon={<FormOutlined />}
|
||||||
hidden={!access.hasPerms('area:business:List.update')}
|
hidden={!access.hasPerms('cms:company:edit')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const hide = message.loading('正在加载详情');
|
const hide = message.loading('正在加载详情');
|
||||||
try {
|
try {
|
||||||
@@ -229,6 +258,7 @@ function ManagementList() {
|
|||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
key="approval"
|
key="approval"
|
||||||
|
hidden={!access.hasPerms('sys:company:approval')}
|
||||||
icon={<AuditOutlined />}
|
icon={<AuditOutlined />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
@@ -245,7 +275,7 @@ function ManagementList() {
|
|||||||
danger
|
danger
|
||||||
key="batchRemove"
|
key="batchRemove"
|
||||||
icon={<DeleteOutlined />}
|
icon={<DeleteOutlined />}
|
||||||
hidden={!access.hasPerms('area:subway:List')}
|
hidden={!access.hasPerms('cms:company:remove')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '删除',
|
title: '删除',
|
||||||
@@ -291,7 +321,7 @@ function ManagementList() {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="add"
|
key="add"
|
||||||
hidden={!access.hasPerms('manage:List:add')}
|
hidden={!access.hasPerms('cms:company:add')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
setModalVisible(true);
|
setModalVisible(true);
|
||||||
@@ -302,7 +332,7 @@ function ManagementList() {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="export"
|
key="export"
|
||||||
hidden={!access.hasPerms('system:user:export')}
|
hidden={!access.hasPerms('cms:company:export')}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const searchVal = formTableRef.current?.getFieldsValue();
|
const searchVal = formTableRef.current?.getFieldsValue();
|
||||||
handleExport(buildListSearchParams(searchVal || {}));
|
handleExport(buildListSearchParams(searchVal || {}));
|
||||||
@@ -348,6 +378,7 @@ function ManagementList() {
|
|||||||
}}
|
}}
|
||||||
record={detailData}
|
record={detailData}
|
||||||
scaleEnum={scaleEnum}
|
scaleEnum={scaleEnum}
|
||||||
|
industryEnum={industryEnum}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
|
|||||||
Reference in New Issue
Block a user