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
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:
@@ -32,7 +32,7 @@ const toManageFormValues = (
|
|||||||
values: Partial<API.ManagementList.Manage>,
|
values: Partial<API.ManagementList.Manage>,
|
||||||
): Partial<ManageFormValues> => ({
|
): Partial<ManageFormValues> => ({
|
||||||
...values,
|
...values,
|
||||||
jobLocationAreaCode: String(values.jobLocationAreaCode || ''),
|
jobLocationAreaCode: values.jobLocationAreaCode != null ? String(values.jobLocationAreaCode) : undefined,
|
||||||
salaryComposition: parseCommaSeparatedTags(values.salaryComposition),
|
salaryComposition: parseCommaSeparatedTags(values.salaryComposition),
|
||||||
welfareBenefits: parseCommaSeparatedTags(values.welfareBenefits),
|
welfareBenefits: parseCommaSeparatedTags(values.welfareBenefits),
|
||||||
workSchedule: parseCommaSeparatedTags(values.workSchedule),
|
workSchedule: parseCommaSeparatedTags(values.workSchedule),
|
||||||
@@ -65,6 +65,7 @@ export type ListFormProps = {
|
|||||||
salaryCompositionEnum: DictValueEnumObj;
|
salaryCompositionEnum: DictValueEnumObj;
|
||||||
welfareBenefitsEnum: DictValueEnumObj;
|
welfareBenefitsEnum: DictValueEnumObj;
|
||||||
workScheduleEnum: DictValueEnumObj;
|
workScheduleEnum: DictValueEnumObj;
|
||||||
|
keyPopulationsEnum: DictValueEnumObj;
|
||||||
mode?: 'view' | 'edit' | 'create';
|
mode?: 'view' | 'edit' | 'create';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -81,6 +82,8 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
const isEnterprise = initialState?.currentUser?.userType === 'view';
|
const isEnterprise = initialState?.currentUser?.userType === 'view';
|
||||||
const [form] = Form.useForm<ManageFormValues>();
|
const [form] = Form.useForm<ManageFormValues>();
|
||||||
const companyNameMap = useRef<Record<number, string>>({});
|
const companyNameMap = useRef<Record<number, string>>({});
|
||||||
|
const [companyOptions, setCompanyOptions] = useState<{ label: string; value: number }[]>([]);
|
||||||
|
const [areaOptions, setAreaOptions] = useState<{ label: string; value: string }[]>([]);
|
||||||
const [jobDetail, setJobDetail] = useState<API.ManagementList.Manage | null>(null);
|
const [jobDetail, setJobDetail] = useState<API.ManagementList.Manage | null>(null);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [jobCategoryTreeData, setJobCategoryTreeData] = useState<any[]>([]);
|
const [jobCategoryTreeData, setJobCategoryTreeData] = useState<any[]>([]);
|
||||||
@@ -94,13 +97,36 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
salaryCompositionEnum,
|
salaryCompositionEnum,
|
||||||
welfareBenefitsEnum,
|
welfareBenefitsEnum,
|
||||||
workScheduleEnum,
|
workScheduleEnum,
|
||||||
|
keyPopulationsEnum,
|
||||||
} = props;
|
} = props;
|
||||||
const { mode = props.values ? 'edit' : 'create' } = props;
|
const { mode = props.values ? 'edit' : 'create' } = props;
|
||||||
|
const [showKeyPopulations, setShowKeyPopulations] = useState(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.open) {
|
if (props.open) {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
if (props.values) {
|
if (props.values) {
|
||||||
form.setFieldsValue(toManageFormValues(props.values));
|
form.setFieldsValue(toManageFormValues(props.values));
|
||||||
|
// 预填充公司选项(编辑时回显公司名称)
|
||||||
|
if (props.values.companyId && props.values.companyName) {
|
||||||
|
companyNameMap.current[props.values.companyId] = props.values.companyName;
|
||||||
|
setCompanyOptions([
|
||||||
|
{ label: props.values.companyName, value: props.values.companyId },
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
setCompanyOptions([]);
|
||||||
|
}
|
||||||
|
// 预填充区县选项(编辑时回显工作区县名称)
|
||||||
|
if (props.values.jobLocationAreaCode && areaEnum) {
|
||||||
|
const code = String(props.values.jobLocationAreaCode);
|
||||||
|
const areaItem = areaEnum[code];
|
||||||
|
if (areaItem) {
|
||||||
|
setAreaOptions([{ label: areaItem.label ?? areaItem.text, value: code }]);
|
||||||
|
} else {
|
||||||
|
setAreaOptions([]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setAreaOptions([]);
|
||||||
|
}
|
||||||
// 初始化地图位置信息(编辑时回显)
|
// 初始化地图位置信息(编辑时回显)
|
||||||
if (props.values.latitude || props.values.longitude) {
|
if (props.values.latitude || props.values.longitude) {
|
||||||
setMapViewInfo({
|
setMapViewInfo({
|
||||||
@@ -111,8 +137,17 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
} else {
|
} else {
|
||||||
setMapViewInfo({});
|
setMapViewInfo({});
|
||||||
}
|
}
|
||||||
|
// 初始化重点人群显示状态(编辑时回显)
|
||||||
|
if (props.values.isKeyPopulations === '0') {
|
||||||
|
setShowKeyPopulations(true);
|
||||||
|
} else {
|
||||||
|
setShowKeyPopulations(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setMapViewInfo({});
|
setMapViewInfo({});
|
||||||
|
setShowKeyPopulations(false);
|
||||||
|
setCompanyOptions([]);
|
||||||
|
setAreaOptions([]);
|
||||||
}
|
}
|
||||||
// 加载岗位标签树数据
|
// 加载岗位标签树数据
|
||||||
getJobTitleTreeSelect()
|
getJobTitleTreeSelect()
|
||||||
@@ -123,6 +158,22 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
}
|
}
|
||||||
}, [form, props.values?.jobId, props.open]);
|
}, [form, props.values?.jobId, props.open]);
|
||||||
|
|
||||||
|
// 区县字典加载完成后,回显工作区县名称
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
props.open &&
|
||||||
|
props.values?.jobLocationAreaCode &&
|
||||||
|
areaEnum &&
|
||||||
|
Object.keys(areaEnum).length > 0
|
||||||
|
) {
|
||||||
|
const code = String(props.values.jobLocationAreaCode);
|
||||||
|
const areaItem = areaEnum[code];
|
||||||
|
if (areaItem) {
|
||||||
|
setAreaOptions([{ label: areaItem.label ?? areaItem.text, value: code }]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [areaEnum, props.open, props.values?.jobLocationAreaCode]);
|
||||||
|
|
||||||
// 在查看模式和编辑模式下调用API获取详情
|
// 在查看模式和编辑模式下调用API获取详情
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.open && (mode === 'view' || mode === 'edit') && props.values?.jobId) {
|
if (props.open && (mode === 'view' || mode === 'edit') && props.values?.jobId) {
|
||||||
@@ -141,6 +192,21 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
// 如果是编辑模式,将获取到的详情数据设置到表单中
|
// 如果是编辑模式,将获取到的详情数据设置到表单中
|
||||||
if (mode === 'edit') {
|
if (mode === 'edit') {
|
||||||
form.setFieldsValue(toManageFormValues(response.data));
|
form.setFieldsValue(toManageFormValues(response.data));
|
||||||
|
// 预填充公司选项(从详情API获取的数据回显公司名称)
|
||||||
|
if (response.data.companyId && response.data.companyName) {
|
||||||
|
companyNameMap.current[response.data.companyId] = response.data.companyName;
|
||||||
|
setCompanyOptions([
|
||||||
|
{ label: response.data.companyName, value: response.data.companyId },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
// 预填充区县选项(从详情API获取的数据回显工作区县名称)
|
||||||
|
if (response.data.jobLocationAreaCode && areaEnum) {
|
||||||
|
const code = String(response.data.jobLocationAreaCode);
|
||||||
|
const areaItem = areaEnum[code];
|
||||||
|
if (areaItem) {
|
||||||
|
setAreaOptions([{ label: areaItem.label ?? areaItem.text, value: code }]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -203,6 +269,8 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
),
|
),
|
||||||
jobCategory: values.jobCategory,
|
jobCategory: values.jobCategory,
|
||||||
isUrgent: values.isUrgent ? 1 : 0,
|
isUrgent: values.isUrgent ? 1 : 0,
|
||||||
|
isKeyPopulations: showKeyPopulations ? '0' : '1',
|
||||||
|
keyPopulations: showKeyPopulations ? values.keyPopulations : undefined,
|
||||||
latitude: values.latitude,
|
latitude: values.latitude,
|
||||||
longitude: values.longitude,
|
longitude: values.longitude,
|
||||||
};
|
};
|
||||||
@@ -237,6 +305,16 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
label="是否急聘"
|
label="是否急聘"
|
||||||
valueEnum={{ 0: '否', 1: '是' }}
|
valueEnum={{ 0: '否', 1: '是' }}
|
||||||
/>
|
/>
|
||||||
|
<ProDescriptions.Item
|
||||||
|
dataIndex="isKeyPopulations"
|
||||||
|
label="是否重点服务人群"
|
||||||
|
valueEnum={{ 0: '是', 1: '否' }}
|
||||||
|
/>
|
||||||
|
<ProDescriptions.Item
|
||||||
|
dataIndex="keyPopulations"
|
||||||
|
label="重点人群"
|
||||||
|
valueEnum={keyPopulationsEnum}
|
||||||
|
/>
|
||||||
<ProDescriptions.Item dataIndex="minSalary" label="最低薪资(元/月)" />
|
<ProDescriptions.Item dataIndex="minSalary" label="最低薪资(元/月)" />
|
||||||
<ProDescriptions.Item dataIndex="maxSalary" label="最高薪资(元/月)" />
|
<ProDescriptions.Item dataIndex="maxSalary" label="最高薪资(元/月)" />
|
||||||
<ProDescriptions.Item
|
<ProDescriptions.Item
|
||||||
@@ -458,6 +536,33 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
initialValue={0}
|
initialValue={0}
|
||||||
fieldProps={{ defaultChecked: false }}
|
fieldProps={{ defaultChecked: false }}
|
||||||
/>
|
/>
|
||||||
|
<ProFormSwitch
|
||||||
|
width="md"
|
||||||
|
name="isKeyPopulations"
|
||||||
|
label="是否重点服务人群"
|
||||||
|
checkedChildren="是"
|
||||||
|
unCheckedChildren="否"
|
||||||
|
initialValue="1"
|
||||||
|
fieldProps={{
|
||||||
|
defaultChecked: false,
|
||||||
|
onChange: (checked) => {
|
||||||
|
setShowKeyPopulations(checked);
|
||||||
|
if (!checked) {
|
||||||
|
form.setFieldValue('keyPopulations', undefined);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{showKeyPopulations && (
|
||||||
|
<ProFormSelect
|
||||||
|
width="md"
|
||||||
|
name="keyPopulations"
|
||||||
|
label="重点人群"
|
||||||
|
valueEnum={keyPopulationsEnum}
|
||||||
|
placeholder="请选择重点人群"
|
||||||
|
rules={[{ required: true, message: '请选择重点人群!' }]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{!isEnterprise && (
|
{!isEnterprise && (
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
showSearch
|
showSearch
|
||||||
@@ -474,6 +579,7 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
onChange: (companyId: number) => {
|
onChange: (companyId: number) => {
|
||||||
form.setFieldValue('companyName', companyNameMap.current[companyId] ?? '');
|
form.setFieldValue('companyName', companyNameMap.current[companyId] ?? '');
|
||||||
},
|
},
|
||||||
|
options: companyOptions.length > 0 ? companyOptions : undefined,
|
||||||
}}
|
}}
|
||||||
placeholder="请输入公司名称选择公司"
|
placeholder="请输入公司名称选择公司"
|
||||||
rules={[{ required: true, message: '请输入公司名称选择公司!' }]}
|
rules={[{ required: true, message: '请输入公司名称选择公司!' }]}
|
||||||
@@ -543,6 +649,9 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
label={'工作区县'}
|
label={'工作区县'}
|
||||||
valueEnum={areaEnum}
|
valueEnum={areaEnum}
|
||||||
placeholder="请选择区县"
|
placeholder="请选择区县"
|
||||||
|
fieldProps={{
|
||||||
|
options: areaOptions.length > 0 ? areaOptions : undefined,
|
||||||
|
}}
|
||||||
rules={[{ required: true, message: '请选择区县!' }]}
|
rules={[{ required: true, message: '请选择区县!' }]}
|
||||||
/>
|
/>
|
||||||
<ProFormDigit
|
<ProFormDigit
|
||||||
@@ -576,7 +685,7 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
|||||||
return title.toLowerCase().includes(inputValue.toLowerCase());
|
return title.toLowerCase().includes(inputValue.toLowerCase());
|
||||||
}}
|
}}
|
||||||
placeholder="请搜索或选择岗位标签"
|
placeholder="请搜索或选择岗位标签"
|
||||||
style={{ width: '100%' }}
|
style={{ width: 328 }}
|
||||||
/>
|
/>
|
||||||
</ProForm.Item>
|
</ProForm.Item>
|
||||||
<ProFormText width="md" name="jobLocation" label="工作地点" placeholder="请输入工作地点" />
|
<ProFormText width="md" name="jobLocation" label="工作地点" placeholder="请输入工作地点" />
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ function ManagementList() {
|
|||||||
const [salaryCompositionEnum, setSalaryCompositionEnum] = useState<any>([]);
|
const [salaryCompositionEnum, setSalaryCompositionEnum] = useState<any>([]);
|
||||||
const [welfareBenefitsEnum, setWelfareBenefitsEnum] = useState<any>([]);
|
const [welfareBenefitsEnum, setWelfareBenefitsEnum] = useState<any>([]);
|
||||||
const [workScheduleEnum, setWorkScheduleEnum] = useState<any>([]);
|
const [workScheduleEnum, setWorkScheduleEnum] = useState<any>([]);
|
||||||
|
const [keyPopulationsEnum, setKeyPopulationsEnum] = useState<any>([]);
|
||||||
const [currentRow, setCurrentRow] = useState<API.ManagementList.Manage>();
|
const [currentRow, setCurrentRow] = useState<API.ManagementList.Manage>();
|
||||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||||
const [mode, setMode] = useState<'view' | 'edit' | 'create'>('create');
|
const [mode, setMode] = useState<'view' | 'edit' | 'create'>('create');
|
||||||
@@ -128,6 +129,9 @@ function ManagementList() {
|
|||||||
getDictValueEnum('work_schedule', false, true).then((data) => {
|
getDictValueEnum('work_schedule', false, true).then((data) => {
|
||||||
setWorkScheduleEnum(data);
|
setWorkScheduleEnum(data);
|
||||||
});
|
});
|
||||||
|
getDictValueEnum('kp_type', false, true).then((data) => {
|
||||||
|
setKeyPopulationsEnum(data);
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
async function changeRelease(record: API.ManagementList.Manage) {
|
async function changeRelease(record: API.ManagementList.Manage) {
|
||||||
@@ -440,6 +444,9 @@ function ManagementList() {
|
|||||||
rowKey="jobId"
|
rowKey="jobId"
|
||||||
key="index"
|
key="index"
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
search={{
|
||||||
|
defaultCollapsed: false,
|
||||||
|
}}
|
||||||
request={(params) =>
|
request={(params) =>
|
||||||
getCmsJobList({ ...params } as API.ManagementList.ListParams).then((res) => {
|
getCmsJobList({ ...params } as API.ManagementList.ListParams).then((res) => {
|
||||||
console.log(params);
|
console.log(params);
|
||||||
@@ -533,6 +540,7 @@ function ManagementList() {
|
|||||||
salaryCompositionEnum={salaryCompositionEnum}
|
salaryCompositionEnum={salaryCompositionEnum}
|
||||||
welfareBenefitsEnum={welfareBenefitsEnum}
|
welfareBenefitsEnum={welfareBenefitsEnum}
|
||||||
workScheduleEnum={workScheduleEnum}
|
workScheduleEnum={workScheduleEnum}
|
||||||
|
keyPopulationsEnum={keyPopulationsEnum}
|
||||||
></EditManageRow>
|
></EditManageRow>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -68,20 +68,24 @@ function CompanyUserList() {
|
|||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '联系人',
|
title: '企业联系人',
|
||||||
dataIndex: 'contactPerson',
|
dataIndex: 'companyContactList',
|
||||||
valueType: 'text',
|
valueType: 'text',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100,
|
width: 180,
|
||||||
render: (_, record) => record.contactPerson || '-',
|
render: (_, record) => {
|
||||||
|
const list = record.companyContactList;
|
||||||
|
if (!list || list.length === 0) return '-';
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{list.map((item, index) => (
|
||||||
|
<div key={index}>
|
||||||
|
{item.contactPerson || '-'}:{item.contactPersonPhone || '-'}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '联系电话',
|
|
||||||
dataIndex: 'contactPersonPhone',
|
|
||||||
valueType: 'text',
|
|
||||||
align: 'center',
|
|
||||||
width: 130,
|
|
||||||
render: (_, record) => record.contactPersonPhone || '-',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
|
|||||||
8
src/types/Management/list.d.ts
vendored
8
src/types/Management/list.d.ts
vendored
@@ -39,6 +39,10 @@ declare namespace API.ManagementList {
|
|||||||
createTime?: string;
|
createTime?: string;
|
||||||
jobCategory?: string;
|
jobCategory?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
/** 是否重点人群 0是,1否 */
|
||||||
|
isKeyPopulations?: string;
|
||||||
|
/** 重点人群-1农民工、2团场职工、3失业人员、4零就业家庭、5零工人员、6退役军人 */
|
||||||
|
keyPopulations?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AddParams {
|
export interface AddParams {
|
||||||
@@ -71,6 +75,10 @@ declare namespace API.ManagementList {
|
|||||||
jobContactList?: ContactPerson[];
|
jobContactList?: ContactPerson[];
|
||||||
jobCategory?: string;
|
jobCategory?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
/** 是否重点人群 0是,1否 */
|
||||||
|
isKeyPopulations?: string;
|
||||||
|
/** 重点人群-1农民工、2团场职工、3失业人员、4零就业家庭、5零工人员、6退役军人 */
|
||||||
|
keyPopulations?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ListParams {
|
export interface ListParams {
|
||||||
|
|||||||
11
src/types/cms/company.d.ts
vendored
11
src/types/cms/company.d.ts
vendored
@@ -7,6 +7,15 @@ declare namespace API.CmsCompany {
|
|||||||
data?: any;
|
data?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CompanyContact {
|
||||||
|
createTime: string | null;
|
||||||
|
updateTime: string | null;
|
||||||
|
id: number | null;
|
||||||
|
companyId: number;
|
||||||
|
contactPerson: string;
|
||||||
|
contactPersonPhone: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CompanyUser {
|
export interface CompanyUser {
|
||||||
createTime: string;
|
createTime: string;
|
||||||
updateTime: string;
|
updateTime: string;
|
||||||
@@ -29,7 +38,7 @@ declare namespace API.CmsCompany {
|
|||||||
contactPersonPhone?: string | null;
|
contactPersonPhone?: string | null;
|
||||||
status: number; // 0 待审核, 1 通过, 2 驳回
|
status: number; // 0 待审核, 1 通过, 2 驳回
|
||||||
notPassReason?: string | null;
|
notPassReason?: string | null;
|
||||||
companyContactList?: any;
|
companyContactList?: CompanyContact[];
|
||||||
registeredAddress: string;
|
registeredAddress: string;
|
||||||
isAbnormal?: any;
|
isAbnormal?: any;
|
||||||
rejectTime?: string | null;
|
rejectTime?: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user