flat: 添加来源监测相关
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:
Apcallover
2026-04-27 09:13:30 +08:00
parent a67946a1cb
commit b7d7437c21
18 changed files with 1696 additions and 2 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -15,7 +15,8 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
'/api/': {
// 要代理的地址
target: 'http://localhost:9091', // 本地代理
target: 'http://39.98.44.136:6024/api/shihezi/',
// target: 'http://localhost:9091', // 本地代理
// target: 'http://wykj.cdwsx.com/api',// 后端
// target: 'http://ks.zhaopinzao8dian.com/api/ks',
// 配置了这个可以从 http 代理到 https

View File

@@ -219,7 +219,8 @@ export const request = {
...errorConfig,
// baseURL: process.env.NODE_ENV === 'development' ? '' : 'http://ks.zhaopinzao8dian.com/api/ks',
// baseURL: process.env.NODE_ENV === 'development' ? '' : 'http://36.105.163.21:30081/api/ks',
baseURL: process.env.NODE_ENV === 'development' ? '' : 'https://xjshzly.longbiosphere.com:30081/api/ks',
// baseURL: process.env.NODE_ENV === 'development' ? '' : 'https://xjshzly.longbiosphere.com:30081/api/ks',
baseURL: process.env.NODE_ENV === 'development' ? '' : 'http://39.98.44.136:6024/api/shihezi/',
// baseURL: 'http://39.98.44.136:8080',
requestInterceptors: [
(url: any, options: { headers: any }) => {

View File

@@ -0,0 +1,119 @@
import React, { useEffect } from 'react';
import { Modal, Descriptions,Button } from 'antd';
import { DictValueEnumObj } from '@/components/DictTag';
export type DetailModalProps = {
onCancel: () => void;
open: boolean;
values?: Partial<API.ManagementList.Manage>;
educationEnum?: DictValueEnumObj;
experienceEnum?: DictValueEnumObj;
areaEnum?: DictValueEnumObj;
};
const DetailModal: React.FC<DetailModalProps> = (props) => {
const { values } = props;
// 可以在这里获取字典数据,如果传入的话
// 或者通过 useEffect 请求
// 如果没有传入字典数据,可以在这里获取
useEffect(() => {
if (props.open && !props.educationEnum) {
// 这里可以获取字典数据
// getDictValueEnum('education', true, true).then(setEducationEnum);
}
}, [props.open]);
const handleCancel = () => {
props.onCancel();
};
// 如果没有数据,显示加载状态
if (!values) {
return null;
}
return (
<Modal
title="岗位详情"
open={props.open}
width={800}
onCancel={handleCancel}
footer={[
<Button key="close" onClick={handleCancel}>
</Button>
]}
destroyOnHidden
>
<Descriptions column={2} bordered>
<Descriptions.Item label="岗位名称" span={2}>
{values.jobTitle || '-'}
</Descriptions.Item>
<Descriptions.Item label="公司名称">
{values.companyName || '-'}
</Descriptions.Item>
<Descriptions.Item label="薪资范围">
{`${values.minSalary || 0} - ${values.maxSalary || 0} 元/月`}
</Descriptions.Item>
<Descriptions.Item label="学历要求">
{props.educationEnum ? (
<span>{props.educationEnum[values.education as string] || values.education || '-'}</span>
) : (
values.education || '-'
)}
</Descriptions.Item>
<Descriptions.Item label="工作经验">
{props.experienceEnum ? (
<span>{props.experienceEnum[values.experience as string] || values.experience || '-'}</span>
) : (
values.experience || '-'
)}
</Descriptions.Item>
<Descriptions.Item label="工作区县">
{props.areaEnum ? (
<span>{props.areaEnum[values.jobLocationAreaCode as string] || values.jobLocationAreaCode || '-'}</span>
) : (
values.jobLocationAreaCode || '-'
)}
</Descriptions.Item>
<Descriptions.Item label="招聘人数">
{values.vacancies || 0}
</Descriptions.Item>
<Descriptions.Item label="工作地点" span={2}>
{values.jobLocation || '-'}
</Descriptions.Item>
<Descriptions.Item label="岗位描述" span={2}>
<div style={{ whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>
{values.description || '-'}
</div>
</Descriptions.Item>
<Descriptions.Item label="浏览量">
{values.view || 0}
</Descriptions.Item>
<Descriptions.Item label="发布时间">
{values.createTime || '-'}
</Descriptions.Item>
{values.isPublish !== undefined && (
<Descriptions.Item label="发布状态">
{values.isPublish === 1 ? '已发布' : '未发布'}
</Descriptions.Item>
)}
</Descriptions>
</Modal>
);
};
export default DetailModal;

View File

@@ -0,0 +1,286 @@
import React, { Fragment, useRef, useState, useEffect } from 'react';
import { history, useAccess } from '@umijs/max';
import { getCmsJobList, getJobTrend } from '@/services/Management/list';
import { Button, DatePicker, FormInstance, message, Space, Card } from 'antd';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { AlignLeftOutlined } from '@ant-design/icons';
import { Line } from '@ant-design/charts';
import dayjs from 'dayjs';
import { getDictValueEnum } from '@/services/system/dict';
import DictTag from '@/components/DictTag';
import DetailModal from './detail';
const { RangePicker } = DatePicker;
function JobStatistics() {
const access = useAccess();
const formTableRef = useRef<FormInstance>();
const actionRef = useRef<ActionType>();
const [chartData, setChartData] = useState<any[]>([]);
const [currentRow, setCurrentRow] = useState<API.ManagementList.Manage>();
const [detailVisible, setDetailVisible] = useState<boolean>(false);
const [educationEnum, setEducationEnum] = useState<any>([]);
const [experienceEnum, setExperienceEnum] = useState<any>([]);
const [areaEnum, setAreaEnum] = useState<any>([]);
const [isPublishEnum, setIsPublishEnum] = useState<any>([]);
const [params, setParams] = useState({
beginTime: dayjs().subtract(13, 'day').format('YYYY-MM-DD'),
endTime: dayjs().format('YYYY-MM-DD'),
});
const getPickerValue = () => {
return [dayjs(params.beginTime), dayjs(params.endTime)];
};
const disabledDate = (current: dayjs.Dayjs) => {
const now = dayjs();
return current.isAfter(now.endOf('day'));
};
// 初始化图表数据
useEffect(() => {
getChartData();
}, [params.beginTime, params.endTime]);
useEffect(() => {
getDictValueEnum('education', true, true).then((data) => {
setEducationEnum(data);
});
getDictValueEnum('experience', true, true).then((data) => {
setExperienceEnum(data);
});
getDictValueEnum('area', true, true).then((data) => {
setAreaEnum(data);
});
getDictValueEnum('is_publish', true).then((data) => {
setIsPublishEnum(data);
});
}, []);
const handleDateRangeChange = (dates: any, dateStrings: [string, string]) => {
if (dates && dates[0] && dates[1]) {
setParams(() => ({
beginTime: dateStrings[0],
endTime: dateStrings[1],
}));
}
};
async function getChartData() {
let { data } = await getJobTrend(params);
setChartData(data); // 暂时使用模拟数据
}
// 图表配置
const chartConfig = {
data: chartData,
xField: 'storageTime',
yField: 'insertCount',
style: {
columnWidthRatio: 0.6,
},
xAxis: {
label: {
autoHide: true,
autoRotate: false,
},
},
point: {
size: 4,
shape: 'circle',
},
line: {
size: 3,
style: {
lineCap: 'round',
},
},
tooltip: {
items: [
{
field: 'insertCount',
name: '录入数量',
valueFormatter: (v) => `${v}`,
title: '日期',
},
],
},
};
const columns: ProColumns<API.ManagementList.Manage>[] = [
{
title: '岗位采集日期',
dataIndex: 'collectionDate1',
hideInTable: true,
valueType: 'dateRange',
search: {
transform: (value) => {
return {
beginTime: value[0],
endTime: value[1],
};
},
},
},
{
title: '岗位名称',
dataIndex: 'jobTitle',
valueType: 'text',
align: 'center',
},
{
title: '最小薪资(元/月)',
dataIndex: 'minSalary',
valueType: 'text',
align: 'center',
hideInSearch: true,
},
{
title: '最大薪资(元/月)',
dataIndex: 'maxSalary',
valueType: 'text',
align: 'center',
hideInSearch: true,
},
{
title: '单位名称',
dataIndex: 'companyName',
valueType: 'text',
align: 'center',
},
{
title: '学历要求',
dataIndex: 'education',
valueType: 'select',
align: 'center',
valueEnum: educationEnum,
render: (_, record) => {
return <DictTag enums={educationEnum} value={record.education} />;
},
hideInSearch: true,
},
{
title: '经验要求',
dataIndex: 'experience',
valueType: 'select',
align: 'center',
valueEnum: experienceEnum,
render: (_, record) => {
return <DictTag enums={experienceEnum} value={record.experience} />;
},
hideInSearch: true,
},
{
title: '是否发布',
dataIndex: 'isPublish',
valueType: 'select',
align: 'center',
valueEnum: isPublishEnum,
render: (_, record) => {
return <DictTag enums={isPublishEnum} value={record.isPublish} />;
},
hideInSearch: true,
},
{
title: '招聘人数',
dataIndex: 'vacancies',
valueType: 'text',
align: 'center',
hideInSearch: true,
},
{
title: '浏览量',
dataIndex: 'view',
valueType: 'text',
align: 'center',
hideInSearch: true,
},
{
title: '操作',
hideInSearch: true,
align: 'center',
dataIndex: 'jobId',
width: 100,
render: (jobId, record) => (
<Button
type="link"
size="small"
icon={<AlignLeftOutlined />}
onClick={() => {
setCurrentRow(record);
setDetailVisible(true);
}}
>
</Button>
),
},
];
return (
<Fragment>
<Card
title={<span>📊 </span>}
style={{
marginBottom: 16,
}}
extra={
<div>
<span></span>
<RangePicker
picker="date"
value={getPickerValue()}
onChange={handleDateRangeChange}
disabledDate={disabledDate}
/>
</div>
}
>
<div style={{ height: 300 }}>
<Line {...chartConfig} />
</div>
</Card>
<div style={{ background: '#fff', padding: 24, borderRadius: 8 }}>
<ProTable<API.ManagementList.Manage>
actionRef={actionRef}
formRef={formTableRef}
rowKey="jobId"
key="jobStatisticsList"
columns={columns}
request={(params) => {
return getCmsJobList(params as API.ManagementList.ListParams).then((res) => {
const result = {
data: res.rows,
total: res.total,
success: true,
};
return result;
});
}}
search={{
labelWidth: 120,
}}
toolBarRender={false}
pagination={{
pageSize: 10,
}}
/>
</div>
<DetailModal
open={detailVisible}
onCancel={() => {
setDetailVisible(false);
setCurrentRow(undefined);
}}
values={currentRow}
/>
</Fragment>
);
}
export default JobStatistics;

View File

@@ -0,0 +1,102 @@
import { Modal, Table } from 'antd';
import { ProDescriptions } from '@ant-design/pro-components';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
export type StorageFormProps = {
onCancel: (flag?: boolean, formVals?: unknown) => void;
open: boolean;
values?: Partial<API.StorageDetection.StorageItem>;
};
const ViewStorageDetail: React.FC<StorageFormProps> = (props) => {
// 使用 Antd Table 的标准 ColumnsType
const detailColumns: ColumnsType<API.StorageDetection.StorageDetailItem> = [
// {
// title: '详情ID',
// dataIndex: 'detailId',
// key: 'detailId',
// width: 80,
// ellipsis: true,
// },
{
title: '入库来源网站名称',
dataIndex: 'websiteName',
key: 'websiteName',
width: 150,
},
{
title: '入库成功数量',
dataIndex: 'successNumber',
key: 'successNumber',
width: 120,
align: 'center',
},
{
title: '入库失败数量',
dataIndex: 'failedNumber',
key: 'failedNumber',
width: 120,
align: 'center',
},
{
title: '入库数据详情',
dataIndex: 'storageDetail',
key: 'storageDetail',
width: 200,
ellipsis: true,
},
{
title: '入库具体时间',
dataIndex: 'storageTime',
key: 'storageTime',
width: 180,
},
];
const handleCancel = () => {
props.onCancel();
};
return (
<Modal
title="入库监测详情"
open={props.open}
width={1200}
onCancel={handleCancel}
footer={null}
>
{/* 基本信息 */}
<div style={{ marginBottom: 24 }}>
<h3 style={{ marginBottom: 16 }}></h3>
<ProDescriptions<API.StorageDetection.StorageItem>
column={2}
dataSource={props.values || {}}
bordered
>
{/* <ProDescriptions.Item dataIndex="detectionId" label="监测ID" /> */}
<ProDescriptions.Item dataIndex="storageDate" label="采集入库日期" />
<ProDescriptions.Item dataIndex="storageNumber" label="采集数量" />
<ProDescriptions.Item dataIndex="storageResult" label="采集入库结果" />
<ProDescriptions.Item dataIndex="storageDetail" label="入库数据详情" span={2} />
</ProDescriptions>
</div>
{/* 入库数据来源详情列表 */}
<div>
<h3 style={{ marginBottom: 16 }}></h3>
<Table<API.StorageDetection.StorageDetailItem>
columns={detailColumns}
dataSource={props.values?.details || []}
rowKey="detailId"
pagination={false}
bordered
size="middle"
scroll={{ x: 800 }}
/>
</div>
</Modal>
);
};
export default ViewStorageDetail;

View File

@@ -0,0 +1,146 @@
import React, { Fragment, useRef, useState } from 'react';
import { useAccess } from '@umijs/max';
import {
getStorageDetectionList,
getStorageDetectionSingle,
} from '@/services/recruitmentDataCollection/jobMonitor';
import { Button, FormInstance, message } from 'antd';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { EyeOutlined } from '@ant-design/icons';
import ViewStorageDetail from './detail';
function StorageDetectionList() {
const access = useAccess();
const formTableRef = useRef<FormInstance>();
const actionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState<API.StorageDetection.StorageItem>();
const [modalVisible, setModalVisible] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
// 查看详情
const handleViewDetail = async (detectionId: any) => {
setLoading(true);
try {
const res = await getStorageDetectionSingle(detectionId);
if (res.code === 200) {
setCurrentRow(res.data);
setModalVisible(true);
} else {
message.error(res.msg);
}
} catch (error) {
message.error('获取详情失败');
} finally {
setLoading(false);
}
};
const columns: ProColumns<API.StorageDetection.StorageItem>[] = [
{
title: '采集入库日期',
dataIndex: 'storageDate',
valueType: 'date',
align: 'center',
},
{
title: '采集入库数量',
dataIndex: 'storageNumber',
valueType: 'text',
align: 'center',
hideInSearch: true,
},
{
title: '采集入库结果',
dataIndex: 'storageResult',
valueType: 'text',
align: 'center',
hideInSearch: true,
},
// {
// title: '入库数据来源名称',
// dataIndex: 'websiteName',
// valueType: 'text',
// align: 'center',
// hideInSearch: true,
// ellipsis: true,
// },
{
title: '入库数据详情',
dataIndex: 'storageDetail',
valueType: 'text',
align: 'center',
hideInSearch: true,
ellipsis: true,
},
{
title: '是否异常',
dataIndex: 'failedReason',
valueType: 'text',
align: 'center',
},
{
title: '操作',
hideInSearch: true,
align: 'center',
dataIndex: 'detectionId',
width: 120,
render: (detectionId, record) => (
<div style={{ display: 'flex', justifyContent: 'center', gap: 8 }}>
<Button
type="link"
size="small"
key="view"
icon={<EyeOutlined />}
loading={loading}
hidden={!access.hasPerms('recruitmentDataCollection:jobMonitor:view')}
onClick={() => handleViewDetail(detectionId)}
>
</Button>
</div>
),
},
];
return (
<Fragment>
<div style={{ width: '100%', float: 'right' }}>
<ProTable<API.StorageDetection.StorageItem>
actionRef={actionRef}
formRef={formTableRef}
rowKey="detectionId"
key="storageDetectionIndex"
columns={columns}
search={{ labelWidth: 'auto' }}
request={async (
params: API.StorageDetection.ListParams & {
pageSize?: number;
current?: number;
},
) => {
const res = await getStorageDetectionList({
...params,
} as API.StorageDetection.ListParams);
return {
data: res.rows,
total: res.total,
success: true,
};
}}
/>
</div>
<ViewStorageDetail
open={modalVisible}
values={currentRow}
onCancel={() => {
setModalVisible(false);
setCurrentRow(undefined);
}}
/>
</Fragment>
);
}
export default StorageDetectionList;

View File

@@ -0,0 +1,118 @@
import {
ModalForm,
ProForm,
ProFormSelect,
ProFormText,
ProFormTextArea,
ProDescriptions,
} from '@ant-design/pro-components';
import { Form } from 'antd';
import React, { useEffect } from 'react';
import DictTag from '@/components/DictTag';
export type JobIndexFormProps = {
onCancel: (flag?: boolean, formVals?: unknown) => void;
onSubmit: (values: API.JobIndex.JobIndexItem) => Promise<void>;
open: boolean;
values?: Partial<API.JobIndex.JobIndexItem>;
mode?: 'view' | 'edit' | 'create';
isActiveEnum: any;
};
const JobIndexEdit: React.FC<JobIndexFormProps> = (props) => {
const [form] = Form.useForm<API.JobIndex.JobIndexItem>();
const { mode = props.values ? 'edit' : 'create', isActiveEnum } = props;
useEffect(() => {
if (props.open) {
form.resetFields();
if (props.values) {
form.setFieldsValue(props.values);
}
}
}, [form, props.values?.indexId, props.open]);
const handleCancel = () => {
props.onCancel();
form.resetFields();
};
const handleFinish = async (values: Record<string, any>) => {
await props.onSubmit(values as API.JobIndex.JobIndexItem);
};
if (mode === 'view') {
return (
<ModalForm
title="指标信息详情"
open={props.open}
width={800}
modalProps={{
destroyOnClose: true,
onCancel: () => handleCancel(),
footer: null,
}}
submitter={false}
>
<ProDescriptions<API.JobIndex.JobIndexItem> column={2} bordered dataSource={props.values || {}}>
{/* <ProDescriptions.Item dataIndex="indexId" label="指标ID" /> */}
<ProDescriptions.Item dataIndex="indexName" label="指标名称" />
<ProDescriptions.Item dataIndex="indexDesc" label="指标描述" span={2} />
<ProDescriptions.Item
dataIndex="isActive"
label="是否启用"
render={(text) => <DictTag enums={isActiveEnum} value={text as string} />}
/>
</ProDescriptions>
</ModalForm>
);
}
return (
<ModalForm<API.JobIndex.JobIndexItem>
title={mode === 'edit' ? '编辑指标信息' : '新建指标信息'}
form={form}
autoFocusFirstInput
open={props.open}
modalProps={{
destroyOnClose: true,
onCancel: () => handleCancel(),
}}
submitTimeout={2000}
onFinish={handleFinish}
>
<ProForm.Group>
<ProFormText width="md" hidden name="indexId" />
<ProFormText
width="md"
name="indexName"
label="指标名称"
placeholder="请输入指标名称"
rules={[{ required: true, message: '请输入指标名称!' }]}
/>
<ProFormSelect
width="md"
name="isActive"
label="是否启用"
valueEnum={isActiveEnum}
placeholder="请选择状态"
rules={[{ required: true, message: '请选择是否启用!' }]}
/>
</ProForm.Group>
<ProForm.Group>
<ProFormTextArea
width="lg"
name="indexDesc"
label="指标描述"
placeholder="请输入指标描述"
rules={[{ required: true, message: '请输入指标描述!' }]}
fieldProps={{
rows: 4,
}}
/>
</ProForm.Group>
</ModalForm>
);
};
export default JobIndexEdit;

View File

@@ -0,0 +1,272 @@
import React, { Fragment, useRef, useState, useEffect } from 'react';
import { useAccess } from '@umijs/max';
import {
getJobIndexList,
getJobIndexSingle,
saveJobIndex,
updateJobIndex,
deleteJobIndex,
} from '@/services/recruitmentDataCollection/metricAdmin';
import { Button, FormInstance, message, Modal } from 'antd';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { DeleteOutlined, FormOutlined, PlusOutlined, EyeOutlined } from '@ant-design/icons';
import { getDictValueEnum } from '@/services/system/dict';
import DictTag from '@/components/DictTag';
import EditJobIndexRow from './edit';
function JobIndexList() {
const access = useAccess();
const formTableRef = useRef<FormInstance>();
const actionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState<API.JobIndex.JobIndexItem>();
const [modalVisible, setModalVisible] = useState<boolean>(false);
const [mode, setMode] = useState<'view' | 'edit' | 'create'>('create');
const [loading, setLoading] = useState<boolean>(false);
const [isActiveEnum, setIsActiveEnum] = useState<any>([]);
useEffect(() => {
getDictValueEnum('enable_status', true).then((data) => {
setIsActiveEnum(data);
});
}, []);
const handleRemoveOne = async (indexId: any) => {
const hide = message.loading('正在删除');
if (!indexId) return true;
try {
const resp = await deleteJobIndex({ indexId });
hide();
if (resp.code === 200) {
message.success('删除成功,即将刷新');
} else {
message.error(resp.msg);
}
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
// 查看详情
const handleViewDetail = async (indexId: any) => {
setLoading(true);
try {
const res = await getJobIndexSingle(indexId);
if (res.code === 200) {
setCurrentRow(res.data);
setModalVisible(true);
setMode('view');
} else {
message.error(res.msg);
}
} catch (error) {
message.error('获取详情失败');
} finally {
setLoading(false);
}
};
// 编辑
const handleEdit = async (indexId: any) => {
setLoading(true);
try {
const res = await getJobIndexSingle(indexId);
if (res.code === 200) {
setCurrentRow(res.data);
setModalVisible(true);
setMode('edit');
} else {
message.error(res.msg);
}
} catch (error) {
message.error('获取编辑数据失败');
} finally {
setLoading(false);
}
};
const columns: ProColumns<API.JobIndex.JobIndexItem>[] = [
// {
// title: '指标ID',
// dataIndex: 'indexId',
// valueType: 'text',
// align: 'center',
// hideInSearch: true,
// },
{
title: '指标名称',
dataIndex: 'indexName',
valueType: 'text',
align: 'center',
},
{
title: '指标描述',
dataIndex: 'indexDesc',
valueType: 'text',
align: 'center',
},
{
title: '是否启用',
dataIndex: 'isActive',
valueType: 'select',
align: 'center',
valueEnum: isActiveEnum,
fieldProps: {
allowClear: false,
defaultValue: '1',
},
render: (_, record) => {
return <DictTag enums={isActiveEnum} value={record.isActive} />;
},
},
{
title: '操作',
hideInSearch: true,
align: 'center',
dataIndex: 'indexId',
width: 300,
render: (indexId, record) => (
<div style={{ display: 'flex', justifyContent: 'center', gap: 8 }}>
<Button
type="link"
size="small"
key="view"
icon={<EyeOutlined />}
loading={loading}
hidden={!access.hasPerms('recruitmentDataCollection:metricAdmin:view')}
onClick={() => handleViewDetail(indexId)}
>
</Button>
<Button
type="link"
size="small"
key="edit"
icon={<FormOutlined />}
loading={loading}
hidden={!access.hasPerms('recruitmentDataCollection:metricAdmin:edit')}
onClick={() => handleEdit(indexId)}
>
</Button>
<Button
type="link"
size="small"
danger
key="delete"
icon={<DeleteOutlined />}
hidden={!access.hasPerms('recruitmentDataCollection:metricAdmin:delete')}
onClick={async () => {
Modal.confirm({
title: '删除',
content: '确定删除该指标吗?',
okText: '确认',
cancelText: '取消',
onOk: async () => {
const success = await handleRemoveOne(indexId);
if (success) {
if (actionRef.current) {
actionRef.current.reload();
}
}
},
});
}}
>
</Button>
</div>
),
},
];
return (
<Fragment>
<div style={{ width: '100%', float: 'right' }}>
<ProTable<API.JobIndex.JobIndexItem>
actionRef={actionRef}
formRef={formTableRef}
rowKey="indexId"
key="jobIndexIndex"
columns={columns}
search={{
labelWidth: 'auto',
}}
request={async (
params: API.JobIndex.ListParams & {
pageSize?: number;
current?: number;
},
) => {
const queryParams = {
...params,
isActive: params.isActive || '1', //默认查询启用
};
const res = await getJobIndexList({ ...queryParams } as API.JobIndex.ListParams);
return {
data: res.rows,
total: res.total,
success: true,
};
}}
toolBarRender={() => [
<Button
type="primary"
key="add"
hidden={!access.hasPerms('recruitmentDataCollection:metricAdmin:add')}
onClick={async () => {
setCurrentRow(undefined);
setModalVisible(true);
setMode('create');
}}
>
<PlusOutlined />
</Button>,
]}
/>
</div>
<EditJobIndexRow
open={modalVisible}
mode={mode}
isActiveEnum={isActiveEnum}
onSubmit={async (values: API.JobIndex.JobIndexItem) => {
try {
let resData;
if (values.indexId) {
resData = await updateJobIndex(values as API.JobIndex.UpdateParams);
} else {
resData = await saveJobIndex(values as API.JobIndex.AddParams);
}
if (resData.code === 200) {
setModalVisible(false);
setCurrentRow(undefined);
if (values.indexId) {
message.success('修改成功');
} else {
message.success('新增成功');
}
if (actionRef.current) {
actionRef.current.reload();
}
} else {
message.error(resData.msg || '操作失败');
}
} catch (error) {
message.error('操作失败');
}
}}
values={currentRow}
onCancel={() => {
setModalVisible(false);
setCurrentRow(undefined);
}}
/>
</Fragment>
);
}
export default JobIndexList;

View File

@@ -0,0 +1,125 @@
import {
ModalForm,
ProForm,
ProFormSelect,
ProFormText,
ProDescriptions,
} from '@ant-design/pro-components';
import { Form } from 'antd';
import React, { useEffect } from 'react';
import DictTag from '@/components/DictTag';
export type WebsiteFormProps = {
onCancel: (flag?: boolean, formVals?: unknown) => void;
onSubmit: (values: API.Website.WebsiteItem) => Promise<void>;
open: boolean;
values?: Partial<API.Website.WebsiteItem>;
mode?: 'view' | 'edit' | 'create';
isActiveEnum: any;
};
const WebsiteEdit: React.FC<WebsiteFormProps> = (props) => {
const [form] = Form.useForm<API.Website.WebsiteItem>();
const { mode = props.values ? 'edit' : 'create', isActiveEnum } = props;
useEffect(() => {
if (props.open) {
form.resetFields();
if (props.values) {
form.setFieldsValue(props.values);
}
}
}, [form, props.values?.websiteId, props.open]);
const handleCancel = () => {
props.onCancel();
form.resetFields();
};
const handleFinish = async (values: Record<string, any>) => {
await props.onSubmit(values as API.Website.WebsiteItem);
};
if (mode === 'view') {
return (
<ModalForm
title="网站信息详情"
open={props.open}
width={800}
modalProps={{
destroyOnClose: true,
onCancel: () => handleCancel(),
footer: null,
}}
submitter={false}
>
<ProDescriptions<API.Website.WebsiteItem> column={2} bordered dataSource={props.values || {}}>
{/* <ProDescriptions.Item dataIndex="websiteId" label="网站ID" /> */}
<ProDescriptions.Item dataIndex="websiteName" label="网站名称" />
<ProDescriptions.Item dataIndex="websiteUrl" label="网站地址" />
<ProDescriptions.Item dataIndex="websiteOwnerCompany" label="归属单位公司" />
<ProDescriptions.Item
dataIndex="isActive"
label="是否启用"
render={(text) => <DictTag enums={isActiveEnum} value={text as string} />}
/>
</ProDescriptions>
</ModalForm>
);
}
return (
<ModalForm<API.Website.WebsiteItem>
title={mode === 'edit' ? '编辑网站信息' : '新建网站信息'}
form={form}
autoFocusFirstInput
open={props.open}
modalProps={{
destroyOnClose: true,
onCancel: () => handleCancel(),
}}
submitTimeout={2000}
onFinish={handleFinish}
>
<ProForm.Group>
<ProFormText width="md" hidden name="websiteId" />
<ProFormText
width="md"
name="websiteName"
label="网站名称"
placeholder="请输入网站名称"
rules={[{ required: true, message: '请输入网站名称!' }]}
/>
<ProFormText
width="md"
name="websiteUrl"
label="网站地址"
placeholder="请输入网站地址"
rules={[
{ required: true, message: '请输入网站地址!' },
{ type: 'url', message: '请输入有效的网址!' },
]}
/>
</ProForm.Group>
<ProForm.Group>
<ProFormText
width="md"
name="websiteOwnerCompany"
label="归属单位公司"
placeholder="请输入归属单位公司"
rules={[{ required: true, message: '请输入归属单位公司!' }]}
/>
<ProFormSelect
width="md"
name="isActive"
label="是否启用"
valueEnum={isActiveEnum}
placeholder="请选择状态"
rules={[{ required: true, message: '请选择是否启用!' }]}
/>
</ProForm.Group>
</ModalForm>
);
};
export default WebsiteEdit;

View File

@@ -0,0 +1,278 @@
import React, { Fragment, useRef, useState, useEffect } from 'react';
import { useAccess } from '@umijs/max';
import {
getWebsiteList,
getWebsiteSingle,
saveWebsite,
updateWebsite,
deleteWebsite,
} from '@/services/recruitmentDataCollection/sourceManager';
import { getDictValueEnum } from '@/services/system/dict';
import { Button, FormInstance, message, Modal } from 'antd';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import DictTag from '@/components/DictTag';
import { DeleteOutlined, FormOutlined, PlusOutlined, EyeOutlined } from '@ant-design/icons';
import EditWebsiteRow from './edit';
function WebsiteList() {
const access = useAccess();
const formTableRef = useRef<FormInstance>();
const actionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState<API.Website.WebsiteItem>();
const [modalVisible, setModalVisible] = useState<boolean>(false);
const [mode, setMode] = useState<'view' | 'edit' | 'create'>('create');
const [loading, setLoading] = useState<boolean>(false);
const [isActiveEnum, setIsActiveEnum] = useState<any>([]);
useEffect(() => {
getDictValueEnum('enable_status', true).then((data) => {
setIsActiveEnum(data);
});
}, []);
const handleRemoveOne = async (websiteId: any) => {
const hide = message.loading('正在删除');
if (!websiteId) return true;
try {
const resp = await deleteWebsite({ websiteId });
hide();
if (resp.code === 200) {
message.success('删除成功,即将刷新');
} else {
message.error(resp.msg);
}
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
// 查看详情
const handleViewDetail = async (websiteId: any) => {
setLoading(true);
try {
const res = await getWebsiteSingle(websiteId);
if (res.code === 200) {
setCurrentRow(res.data);
setModalVisible(true);
setMode('view');
} else {
message.error(res.msg);
}
} catch (error) {
message.error('获取详情失败');
} finally {
setLoading(false);
}
};
// 编辑
const handleEdit = async (websiteId: any) => {
setLoading(true);
try {
const res = await getWebsiteSingle(websiteId);
if (res.code === 200) {
setCurrentRow(res.data);
setModalVisible(true);
setMode('edit');
} else {
message.error(res.msg);
}
} catch (error) {
message.error('获取编辑数据失败');
} finally {
setLoading(false);
}
};
const columns: ProColumns<API.Website.WebsiteItem>[] = [
// {
// title: '网站ID',
// dataIndex: 'websiteId',
// valueType: 'text',
// align: 'center',
// hideInSearch: true,
// },
{
title: '网站名称',
dataIndex: 'websiteName',
valueType: 'text',
align: 'center',
},
{
title: '网站地址',
dataIndex: 'websiteUrl',
valueType: 'text',
align: 'center',
},
{
title: '归属单位公司',
dataIndex: 'websiteOwnerCompany',
valueType: 'text', // 改为文本输入
align: 'center',
},
{
title: '是否启用',
dataIndex: 'isActive',
valueType: 'select',
align: 'center',
valueEnum: isActiveEnum,
fieldProps: {
allowClear: false,
defaultValue: '1',
},
render: (_, record) => {
return <DictTag enums={isActiveEnum} value={record.isActive} />;
},
},
{
title: '操作',
hideInSearch: true,
align: 'center',
dataIndex: 'websiteId',
width: 300,
render: (websiteId, record) => (
<div style={{ display: 'flex', justifyContent: 'center', gap: 8 }}>
<Button
type="link"
size="small"
key="view"
icon={<EyeOutlined />}
loading={loading}
hidden={!access.hasPerms('recruitmentDataCollection:sourceManager:view')}
onClick={() => handleViewDetail(websiteId)}
>
</Button>
<Button
type="link"
size="small"
key="edit"
icon={<FormOutlined />}
loading={loading}
hidden={!access.hasPerms('recruitmentDataCollection:sourceManager:edit')}
onClick={() => handleEdit(websiteId)}
>
</Button>
<Button
type="link"
size="small"
danger
key="delete"
icon={<DeleteOutlined />}
hidden={!access.hasPerms('recruitmentDataCollection:sourceManager:delete')}
onClick={async () => {
Modal.confirm({
title: '删除',
content: '确定删除该网站信息吗?',
okText: '确认',
cancelText: '取消',
onOk: async () => {
const success = await handleRemoveOne(websiteId);
if (success) {
if (actionRef.current) {
actionRef.current.reload();
}
}
},
});
}}
>
</Button>
</div>
),
},
];
return (
<Fragment>
<div style={{ width: '100%', float: 'right' }}>
<ProTable<API.Website.WebsiteItem>
actionRef={actionRef}
formRef={formTableRef}
rowKey="websiteId"
key="websiteIndex"
columns={columns}
search={{
labelWidth: 'auto',
}}
request={async (
params: API.Website.ListParams & {
pageSize?: number;
current?: number;
},
) => {
const queryParams = {
...params,
isActive: params.isActive || '1', //默认查询启用
};
const res = await getWebsiteList({ ...queryParams } as API.Website.ListParams);
return {
data: res.rows,
total: res.total,
success: true,
};
}}
toolBarRender={() => [
<Button
type="primary"
key="add"
hidden={!access.hasPerms('recruitmentDataCollection:sourceManager:add')}
onClick={async () => {
setCurrentRow(undefined);
setModalVisible(true);
setMode('create');
}}
>
<PlusOutlined />
</Button>,
]}
/>
</div>
<EditWebsiteRow
open={modalVisible}
mode={mode}
isActiveEnum={isActiveEnum}
onSubmit={async (values: API.Website.WebsiteItem) => {
try {
let resData;
if (values.websiteId) {
resData = await updateWebsite(values as API.Website.UpdateParams);
} else {
resData = await saveWebsite(values as API.Website.AddParams);
}
if (resData.code === 200) {
setModalVisible(false);
setCurrentRow(undefined);
if (values.websiteId) {
message.success('修改成功');
} else {
message.success('新增成功');
}
if (actionRef.current) {
actionRef.current.reload();
}
} else {
message.error(resData.msg || '操作失败');
}
} catch (error) {
message.error('操作失败');
}
}}
values={currentRow}
onCancel={() => {
setModalVisible(false);
setCurrentRow(undefined);
}}
/>
</Fragment>
);
}
export default WebsiteList;

View File

@@ -57,6 +57,13 @@ export async function exportCmsJobCandidates(ids: string) {
});
}
export async function getJobTrend(params) {
return request(`/api/cms/jobTrend/list`, {
method: 'GET',
params: params
});
}
export async function addCmsEmployeeConfirmList(params?: API.Management.Hire) {
return request<API.Management.ManagePageResult>(`/api/cms/employeeConfirm`, {
method: 'POST',

View File

@@ -0,0 +1,24 @@
import { request } from '@umijs/max';
export async function getStorageDetectionList(params?: API.StorageDetection.ListParams) {
return request<API.StorageDetection.StoragePageResult>(`/api/cms/storageDetection/getList`, {
method: 'GET',
params: params,
});
}
export async function getStorageDetectionSingle(detectionId: string) {
return request<API.StorageDetection.StorageIdResult>(
`/api/cms/storageDetection/getSingle/${detectionId}`,
{
method: 'GET',
},
);
}
export async function saveStorageDetection(params?: API.StorageDetection.AddParams) {
return request(`/api/cms/storageDetection/save`, {
method: 'POST',
data: params,
});
}

View File

@@ -0,0 +1,35 @@
import { request } from '@umijs/max';
export async function getJobIndexList(params?: API.JobIndex.ListParams) {
return request<API.JobIndex.JobIndexPageResult>(`/api/cms/jobIndex/getList`, {
method: 'GET',
params: params,
});
}
export async function getJobIndexSingle(indexId: string) {
return request<API.JobIndex.JobIndexIdResult>(`/api/cms/jobIndex/getSingle/${indexId}`, {
method: 'GET',
});
}
export async function saveJobIndex(params?: API.JobIndex.AddParams) {
return request(`/api/cms/jobIndex/save`, {
method: 'POST',
data: params,
});
}
export async function updateJobIndex(params?: API.JobIndex.UpdateParams) {
return request(`/api/cms/jobIndex/update`, {
method: 'POST',
data: params,
});
}
export async function deleteJobIndex(params?: API.JobIndex.DeleteParams) {
return request(`/api/cms/jobIndex/delete`, {
method: 'POST',
data: params,
});
}

View File

@@ -0,0 +1,35 @@
import { request } from '@umijs/max';
export async function getWebsiteList(params?: API.Website.ListParams) {
return request<API.Website.WebsitePageResult>(`/api/cms/website/getList`, {
method: 'GET',
params: params,
});
}
export async function getWebsiteSingle(websiteId: string) {
return request<API.Website.WebsiteIdResult>(`/api/cms/website/getSingle/${websiteId}`, {
method: 'GET',
});
}
export async function saveWebsite(params?: API.Website.AddParams) {
return request(`/api/cms/website/save`, {
method: 'POST',
data: params,
});
}
export async function updateWebsite(params?: API.Website.UpdateParams) {
return request(`/api/cms/website/update`, {
method: 'POST',
data: params,
});
}
export async function deleteWebsite(params?: API.Website.DeleteParams) {
return request(`/api/cms/website/delete`, {
method: 'POST',
data: params,
});
}

View File

@@ -0,0 +1,49 @@
declare namespace API.StorageDetection {
export interface StorageDetailItem {
detailId?: string;
websiteId?: string;
websiteName?: string;
successNumber?: string;
failedNumber?: string;
storageDetail?: string;
storageTime?: string;
}
export interface StorageItem {
detectionId?: string;
storageDate?: string;
storageNumber?: string;
storageResult?: string;
storageDetail?: string;
websiteId?: string;
websiteName?: string;
details?: StorageDetailItem[];
}
export interface AddParams {
storageDate?: string;
storageNumber?: string;
storageResult?: string;
storageDetail?: string;
websiteName?: string;
}
export interface ListParams {
storageDate?: string;
pageSize?: number;
current?: number;
}
export interface StorageIdResult {
code: number;
msg: string;
data: StorageItem;
}
export interface StoragePageResult {
code: number;
msg: string;
total: number;
rows: Array<StorageItem>;
}
}

View File

@@ -0,0 +1,46 @@
declare namespace API.JobIndex {
export interface JobIndexItem {
indexId?: string;
indexName?: string;
indexDesc?: string;
isActive?: string;
}
export interface AddParams {
indexName?: string;
indexDesc?: string;
isActive?: string;
}
export interface UpdateParams {
indexId?: string;
indexName?: string;
indexDesc?: string;
isActive?: string;
}
export interface ListParams {
indexName?: string;
indexDesc?: string;
isActive?: string;
pageSize?: number;
current?: number;
}
export interface DeleteParams {
indexId?: string;
}
export interface JobIndexIdResult {
code: number;
msg: string;
data: JobIndexItem;
}
export interface JobIndexPageResult {
code: number;
msg: string;
total: number;
rows: Array<JobIndexItem>;
}
}

View File

@@ -0,0 +1,50 @@
declare namespace API.Website {
export interface WebsiteItem {
websiteId?: string;
websiteName?: string;
websiteUrl?: string;
websiteOwnerCompany?: string;
isActive?: string;
}
export interface AddParams {
websiteName?: string;
websiteUrl?: string;
websiteOwnerCompany?: string;
isActive?: string;
}
export interface UpdateParams {
websiteId?: string;
websiteName?: string;
websiteUrl?: string;
websiteOwnerCompany?: string;
isActive?: string;
}
export interface ListParams {
websiteName?: string;
websiteUrl?: string;
websiteOwnerCompany?: string;
isActive?: string;
pageSize?: number;
current?: number;
}
export interface DeleteParams {
websiteId?: string;
}
export interface WebsiteIdResult {
code: number;
msg: string;
data: WebsiteItem;
}
export interface WebsitePageResult {
code: number;
msg: string;
total: number;
rows: Array<WebsiteItem>;
}
}