feat : 新增岗位数据入库监测、岗位信息来源管理、岗位信息指标管理 三个列表页面
This commit is contained in:
126
src/pages/RecruitmentDataCollection/JobMonitor/edit.tsx
Normal file
126
src/pages/RecruitmentDataCollection/JobMonitor/edit.tsx
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import {
|
||||||
|
ModalForm,
|
||||||
|
ProForm,
|
||||||
|
ProFormDatePicker,
|
||||||
|
ProFormDigit,
|
||||||
|
ProFormText,
|
||||||
|
ProFormTextArea,
|
||||||
|
ProDescriptions,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Form } from 'antd';
|
||||||
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
|
export type StorageFormProps = {
|
||||||
|
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||||
|
onSubmit: (values: API.StorageDetection.StorageItem) => Promise<void>;
|
||||||
|
open: boolean;
|
||||||
|
values?: Partial<API.StorageDetection.StorageItem>;
|
||||||
|
mode?: 'view' | 'edit' | 'create';
|
||||||
|
};
|
||||||
|
|
||||||
|
const StorageEdit: React.FC<StorageFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm<API.StorageDetection.StorageItem>();
|
||||||
|
const { mode = props.values ? 'edit' : 'create' } = props;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (props.open) {
|
||||||
|
form.resetFields();
|
||||||
|
if (props.values) {
|
||||||
|
form.setFieldsValue(props.values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [form, props.values?.detectionId, props.open]);
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
props.onCancel();
|
||||||
|
form.resetFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleFinish = async (values: Record<string, any>) => {
|
||||||
|
props.onSubmit(values as API.StorageDetection.StorageItem);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (mode === 'view') {
|
||||||
|
return (
|
||||||
|
<ModalForm
|
||||||
|
title="入库监测详情"
|
||||||
|
open={props.open}
|
||||||
|
width={800}
|
||||||
|
modalProps={{
|
||||||
|
destroyOnClose: true,
|
||||||
|
onCancel: () => handleCancel(),
|
||||||
|
footer: null,
|
||||||
|
}}
|
||||||
|
submitter={false}
|
||||||
|
>
|
||||||
|
<ProDescriptions<API.StorageDetection.StorageItem>
|
||||||
|
column={2}
|
||||||
|
dataSource={props.values || {}}
|
||||||
|
>
|
||||||
|
<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>
|
||||||
|
</ModalForm>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalForm<API.StorageDetection.StorageItem>
|
||||||
|
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="detectionId" />
|
||||||
|
<ProFormDatePicker
|
||||||
|
width="md"
|
||||||
|
name="storageDate"
|
||||||
|
label="采集入库日期"
|
||||||
|
placeholder="请选择采集入库日期"
|
||||||
|
rules={[{ required: true, message: '请选择采集入库日期!' }]}
|
||||||
|
fieldProps={{
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ProFormDigit
|
||||||
|
name="storageNumber"
|
||||||
|
width="md"
|
||||||
|
min={0}
|
||||||
|
label="采集入库数量"
|
||||||
|
placeholder="请输入采集入库数量"
|
||||||
|
rules={[{ required: true, message: '请输入采集入库数量!' }]}
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="storageResult"
|
||||||
|
label="采集入库结果"
|
||||||
|
placeholder="请输入采集入库结果"
|
||||||
|
rules={[{ required: true, message: '请输入采集入库结果!' }]}
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormTextArea
|
||||||
|
width="lg"
|
||||||
|
name="storageDetail"
|
||||||
|
label="入库数据详情"
|
||||||
|
placeholder="请输入入库数据详情"
|
||||||
|
rules={[{ required: true, message: '请输入入库数据详情!' }]}
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
</ModalForm>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default StorageEdit;
|
||||||
190
src/pages/RecruitmentDataCollection/JobMonitor/index.tsx
Normal file
190
src/pages/RecruitmentDataCollection/JobMonitor/index.tsx
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
import React, { Fragment, useRef, useState } from 'react';
|
||||||
|
import { useAccess } from '@umijs/max';
|
||||||
|
import {
|
||||||
|
getStorageDetectionList,
|
||||||
|
getStorageDetectionSingle,
|
||||||
|
saveStorageDetection,
|
||||||
|
} from '@/services/recruitmentDataCollection/jobMonitor';
|
||||||
|
import { Button, FormInstance, message } from 'antd';
|
||||||
|
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { FormOutlined, EyeOutlined } from '@ant-design/icons';
|
||||||
|
import EditStorageRow from './edit';
|
||||||
|
|
||||||
|
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 [mode, setMode] = useState<'view' | 'edit'>('view');
|
||||||
|
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);
|
||||||
|
setMode('view');
|
||||||
|
} else {
|
||||||
|
message.error(res.msg);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
message.error('获取详情失败');
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 编辑
|
||||||
|
const handleEdit = async (detectionId: any) => {
|
||||||
|
setLoading(true);
|
||||||
|
try {
|
||||||
|
const res = await getStorageDetectionSingle(detectionId);
|
||||||
|
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.StorageDetection.StorageItem>[] = [
|
||||||
|
{
|
||||||
|
title: '监测ID',
|
||||||
|
dataIndex: 'detectionId',
|
||||||
|
valueType: 'text',
|
||||||
|
align: 'center',
|
||||||
|
hideInSearch: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: 'storageDetail',
|
||||||
|
valueType: 'text',
|
||||||
|
align: 'center',
|
||||||
|
hideInSearch: true,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
hideInSearch: true,
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'detectionId',
|
||||||
|
width: 200,
|
||||||
|
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('storage:detection:view')}
|
||||||
|
onClick={() => handleViewDetail(detectionId)}
|
||||||
|
>
|
||||||
|
查看详情
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined />}
|
||||||
|
loading={loading}
|
||||||
|
hidden={!access.hasPerms('storage:detection:update')}
|
||||||
|
onClick={() => handleEdit(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>
|
||||||
|
<EditStorageRow
|
||||||
|
open={modalVisible}
|
||||||
|
mode={mode}
|
||||||
|
onSubmit={async (values: API.StorageDetection.StorageItem) => {
|
||||||
|
try {
|
||||||
|
const resData = await saveStorageDetection(values);
|
||||||
|
if (resData.code === 200) {
|
||||||
|
setModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
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 StorageDetectionList;
|
||||||
122
src/pages/RecruitmentDataCollection/MetricAdmin/edit.tsx
Normal file
122
src/pages/RecruitmentDataCollection/MetricAdmin/edit.tsx
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
import {
|
||||||
|
ModalForm,
|
||||||
|
ProForm,
|
||||||
|
ProFormSelect,
|
||||||
|
ProFormText,
|
||||||
|
ProFormTextArea,
|
||||||
|
ProDescriptions,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Form } from 'antd';
|
||||||
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
|
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';
|
||||||
|
};
|
||||||
|
|
||||||
|
const JobIndexEdit: React.FC<JobIndexFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm<API.JobIndex.JobIndexItem>();
|
||||||
|
const { mode = props.values ? 'edit' : 'create' } = 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} 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="是否启用"
|
||||||
|
valueEnum={{
|
||||||
|
'0': { text: '启用' },
|
||||||
|
'2': { text: '未启用' },
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</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={{
|
||||||
|
'0': '启用',
|
||||||
|
'2': '未启用',
|
||||||
|
}}
|
||||||
|
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;
|
||||||
267
src/pages/RecruitmentDataCollection/MetricAdmin/index.tsx
Normal file
267
src/pages/RecruitmentDataCollection/MetricAdmin/index.tsx
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
import React, { Fragment, useRef, useState } 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 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 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: {
|
||||||
|
'0': { text: '启用' },
|
||||||
|
'2': { text: '未启用' },
|
||||||
|
},
|
||||||
|
fieldProps: {
|
||||||
|
options: [
|
||||||
|
{ label: '启用', value: '0' },
|
||||||
|
{ label: '未启用', value: '2' },
|
||||||
|
],
|
||||||
|
defaultValue: '0',
|
||||||
|
allowClear: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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('jobIndex:view')}
|
||||||
|
onClick={() => handleViewDetail(indexId)}
|
||||||
|
>
|
||||||
|
查看详情
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined />}
|
||||||
|
loading={loading}
|
||||||
|
hidden={!access.hasPerms('jobIndex:update')}
|
||||||
|
onClick={() => handleEdit(indexId)}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
danger
|
||||||
|
key="delete"
|
||||||
|
icon={<DeleteOutlined />}
|
||||||
|
hidden={!access.hasPerms('jobIndex: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 || '0', //默认查询启用
|
||||||
|
};
|
||||||
|
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('jobIndex:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setModalVisible(true);
|
||||||
|
setMode('create');
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> 新建
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<EditJobIndexRow
|
||||||
|
open={modalVisible}
|
||||||
|
mode={mode}
|
||||||
|
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;
|
||||||
129
src/pages/RecruitmentDataCollection/SourceManager/edit.tsx
Normal file
129
src/pages/RecruitmentDataCollection/SourceManager/edit.tsx
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
import {
|
||||||
|
ModalForm,
|
||||||
|
ProForm,
|
||||||
|
ProFormSelect,
|
||||||
|
ProFormText,
|
||||||
|
ProDescriptions,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { Form } from 'antd';
|
||||||
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
|
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';
|
||||||
|
};
|
||||||
|
|
||||||
|
const WebsiteEdit: React.FC<WebsiteFormProps> = (props) => {
|
||||||
|
const [form] = Form.useForm<API.Website.WebsiteItem>();
|
||||||
|
const { mode = props.values ? 'edit' : 'create' } = 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} 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="是否启用"
|
||||||
|
valueEnum={{
|
||||||
|
'0': { text: '启用' },
|
||||||
|
'2': { text: '未启用' },
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</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={{
|
||||||
|
'0': '启用',
|
||||||
|
'2': '未启用',
|
||||||
|
}}
|
||||||
|
placeholder="请选择状态"
|
||||||
|
rules={[{ required: true, message: '请选择是否启用!' }]}
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
</ModalForm>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default WebsiteEdit;
|
||||||
272
src/pages/RecruitmentDataCollection/SourceManager/index.tsx
Normal file
272
src/pages/RecruitmentDataCollection/SourceManager/index.tsx
Normal file
@@ -0,0 +1,272 @@
|
|||||||
|
import React, { Fragment, useRef, useState } from 'react';
|
||||||
|
import { useAccess } from '@umijs/max';
|
||||||
|
import {
|
||||||
|
getWebsiteList,
|
||||||
|
getWebsiteSingle,
|
||||||
|
saveWebsite,
|
||||||
|
updateWebsite,
|
||||||
|
deleteWebsite,
|
||||||
|
} from '@/services/recruitmentDataCollection/sourceManager';
|
||||||
|
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 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 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: {
|
||||||
|
'0': { text: '启用' },
|
||||||
|
'2': { text: '未启用' },
|
||||||
|
},
|
||||||
|
fieldProps: {
|
||||||
|
options: [
|
||||||
|
{ label: '启用', value: '0' },
|
||||||
|
{ label: '未启用', value: '2' },
|
||||||
|
],
|
||||||
|
allowClear: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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('website:view')}
|
||||||
|
onClick={() => handleViewDetail(websiteId)}
|
||||||
|
>
|
||||||
|
查看详情
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
key="edit"
|
||||||
|
icon={<FormOutlined />}
|
||||||
|
loading={loading}
|
||||||
|
hidden={!access.hasPerms('website:update')}
|
||||||
|
onClick={() => handleEdit(websiteId)}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
size="small"
|
||||||
|
danger
|
||||||
|
key="delete"
|
||||||
|
icon={<DeleteOutlined />}
|
||||||
|
hidden={!access.hasPerms('website: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 || '0', //默认查询启用
|
||||||
|
};
|
||||||
|
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('website:add')}
|
||||||
|
onClick={async () => {
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
setModalVisible(true);
|
||||||
|
setMode('create');
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusOutlined /> 新建
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<EditWebsiteRow
|
||||||
|
open={modalVisible}
|
||||||
|
mode={mode}
|
||||||
|
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;
|
||||||
24
src/services/recruitmentDataCollection/jobMonitor.ts
Normal file
24
src/services/recruitmentDataCollection/jobMonitor.ts
Normal 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,
|
||||||
|
});
|
||||||
|
}
|
||||||
35
src/services/recruitmentDataCollection/metricAdmin.ts
Normal file
35
src/services/recruitmentDataCollection/metricAdmin.ts
Normal 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,
|
||||||
|
});
|
||||||
|
}
|
||||||
35
src/services/recruitmentDataCollection/sourceManager.ts
Normal file
35
src/services/recruitmentDataCollection/sourceManager.ts
Normal 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,
|
||||||
|
});
|
||||||
|
}
|
||||||
35
src/types/RecruitmentDataCollection/jobMonitor.d.ts
vendored
Normal file
35
src/types/RecruitmentDataCollection/jobMonitor.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
declare namespace API.StorageDetection {
|
||||||
|
export interface StorageItem {
|
||||||
|
detectionId?: string;
|
||||||
|
storageDate?: string;
|
||||||
|
storageNumber?: string;
|
||||||
|
storageResult?: string;
|
||||||
|
storageDetail?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AddParams {
|
||||||
|
storageDate?: string;
|
||||||
|
storageNumber?: string;
|
||||||
|
storageResult?: string;
|
||||||
|
storageDetail?: 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>;
|
||||||
|
}
|
||||||
|
}
|
||||||
46
src/types/RecruitmentDataCollection/metricAdmin.d.ts
vendored
Normal file
46
src/types/RecruitmentDataCollection/metricAdmin.d.ts
vendored
Normal 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>;
|
||||||
|
}
|
||||||
|
}
|
||||||
50
src/types/RecruitmentDataCollection/sourceManager.d.ts
vendored
Normal file
50
src/types/RecruitmentDataCollection/sourceManager.d.ts
vendored
Normal 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>;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user