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
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:
francis-fh
2026-07-24 13:58:59 +08:00
parent 4900040e6b
commit 970cbffe00
5 changed files with 58 additions and 9 deletions

View File

@@ -40,13 +40,15 @@ const ListEdit: React.FC<ListFormProps> = (props) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
useEffect(() => { useEffect(() => {
if (props.open) {
form.resetFields(); form.resetFields();
if (props.values) { if (props.values) {
form.setFieldsValue({ form.setFieldsValue({
...props.values, ...props.values,
}); });
} }
}, [form, props]); }
}, [form, props.values?.companyId, props.open]);
const handleCancel = () => { const handleCancel = () => {
props.onCancel(); props.onCancel();
@@ -55,6 +57,7 @@ const ListEdit: React.FC<ListFormProps> = (props) => {
const handleFinish = async (values: Record<string, any>) => { const handleFinish = async (values: Record<string, any>) => {
await props.onSubmit(values as API.CompanyList.Company); await props.onSubmit(values as API.CompanyList.Company);
return true;
}; };
return ( return (

View File

@@ -146,8 +146,19 @@ function ManagementList() {
{ {
title: '公司行业', title: '公司行业',
dataIndex: 'industry', dataIndex: 'industry',
valueType: 'text', valueType: 'treeSelect',
align: 'center', align: 'center',
fieldProps: {
fieldNames: { label: 'label', value: 'id', children: 'children' },
treeDefaultExpandAll: false,
showSearch: true,
allowClear: true,
placeholder: '请选择行业',
},
request: async () => {
const res = await getCmsIndustryTreeList();
return (res?.data || []) as any;
},
render: (_, record) => { render: (_, record) => {
return <DictTag enums={industryEnum} value={record.industry} />; return <DictTag enums={industryEnum} value={record.industry} />;
}, },
@@ -170,6 +181,24 @@ function ManagementList() {
valueEnum: companyNatureEnum, valueEnum: companyNatureEnum,
render: (_, record) => <DictTag enums={companyNatureEnum} value={record.companyNature} />, render: (_, record) => <DictTag enums={companyNatureEnum} value={record.companyNature} />,
}, },
{
title: '法定代表人',
dataIndex: 'legalPerson',
valueType: 'text',
align: 'center',
},
{
title: '联系人',
dataIndex: 'contactPerson',
valueType: 'text',
align: 'center',
},
{
title: '联系电话',
dataIndex: 'contactPersonPhone',
valueType: 'text',
align: 'center',
},
{ {
title: '公司位置', title: '公司位置',
dataIndex: 'location', dataIndex: 'location',
@@ -329,6 +358,9 @@ function ManagementList() {
}; };
}) })
} }
search={{
defaultCollapsed: false,
}}
toolBarRender={() => [ toolBarRender={() => [
<Button <Button
type="primary" type="primary"

View File

@@ -14,7 +14,7 @@ import { useModel } from '@umijs/max';
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { DictValueEnumObj } from '@/components/DictTag'; import { DictValueEnumObj } from '@/components/DictTag';
import { getCmsCompanyList } from '@/services/company/list'; import { getCmsCompanyList } from '@/services/company/list';
import { getCmsJobDetail } from '@/services/Management/list'; import { getCmsJobDetail, delCmsJobContact } from '@/services/Management/list';
import { getJobTitleTreeSelect } from '@/services/common/jobTitle'; import { getJobTitleTreeSelect } from '@/services/common/jobTitle';
import ProFromMap from '@/components/ProFromMap'; import ProFromMap from '@/components/ProFromMap';
import { parseCommaSeparatedTags, serializeCommaSeparatedTags } from '@/utils/jobDetailTags'; import { parseCommaSeparatedTags, serializeCommaSeparatedTags } from '@/utils/jobDetailTags';
@@ -262,6 +262,7 @@ const listEdit: React.FC<ListFormProps> = (props) => {
description: values.description, description: values.description,
jobContactList: (values.jobContactList ?? []).map( jobContactList: (values.jobContactList ?? []).map(
(item: API.ManagementList.ContactPerson) => ({ (item: API.ManagementList.ContactPerson) => ({
id: item.id,
contactPerson: item.contactPerson, contactPerson: item.contactPerson,
contactPersonPhone: item.contactPersonPhone, contactPersonPhone: item.contactPersonPhone,
position: item.position, position: item.position,
@@ -772,7 +773,13 @@ const listEdit: React.FC<ListFormProps> = (props) => {
type="text" type="text"
danger danger
icon={<MinusCircleOutlined />} icon={<MinusCircleOutlined />}
onClick={() => remove(name)} onClick={async () => {
const contactId = form.getFieldValue(['jobContactList', name, 'id']);
if (contactId) {
await delCmsJobContact(String(contactId));
}
remove(name);
}}
style={{ marginBottom: 0 }} style={{ marginBottom: 0 }}
/> />
</div> </div>

View File

@@ -40,6 +40,12 @@ export async function delCmsJobIds(ids: string) {
}); });
} }
export async function delCmsJobContact(ids: string) {
return request<API.ManagementList.ManagePageResult>(`/api/cms/jobcontact/${ids}`, {
method: 'DELETE',
});
}
export async function exportCmsJob(params?: API.ManagementList.ListParams) { export async function exportCmsJob(params?: API.ManagementList.ListParams) {
return downLoadXlsx(`/api/cms/job/export`, { params }, `job_data_${new Date().getTime()}.xlsx`); return downLoadXlsx(`/api/cms/job/export`, { params }, `job_data_${new Date().getTime()}.xlsx`);
} }

View File

@@ -1,5 +1,6 @@
declare namespace API.ManagementList { declare namespace API.ManagementList {
export interface ContactPerson { export interface ContactPerson {
id?: number;
contactPerson?: string; contactPerson?: string;
contactPersonPhone?: string; contactPersonPhone?: string;
position?: string; position?: string;