flat: 暂存
This commit is contained in:
128
src/pages/Application/Preproducts/edit.tsx
Normal file
128
src/pages/Application/Preproducts/edit.tsx
Normal file
@@ -0,0 +1,128 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormDigit,
|
||||
ProFormRadio,
|
||||
ProFormSelect,
|
||||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Form } from 'antd';
|
||||
import { DictValueEnumObj } from '@/components/DictTag';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
onSubmit: (values: API.ApplicationProducts.Product) => Promise<void>;
|
||||
open: boolean;
|
||||
values?: Partial<API.ApplicationProducts.Product>;
|
||||
// jobGroupOptions: DictOptionType[];
|
||||
companyLabelEnum?: DictValueEnumObj;
|
||||
companyNatureEnum?: DictValueEnumObj;
|
||||
enableStatusEnum?: DictValueEnumObj;
|
||||
};
|
||||
|
||||
const waitTime = (time: number = 100) => {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(true);
|
||||
}, time);
|
||||
});
|
||||
};
|
||||
|
||||
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const [colorHex, setColorHex] = useState('#3b82f6');
|
||||
const { companyNatureEnum, companyLabelEnum, enableStatusEnum } = props;
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if (props.values) {
|
||||
form.setFieldsValue({
|
||||
...props.values,
|
||||
status: String(props.values.status),
|
||||
});
|
||||
setColorHex(props.values.backgroudColor);
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
// console.log(colorHex, values.backgroudColor);
|
||||
if (typeof colorHex === 'string') {
|
||||
values.backgroudColor = colorHex;
|
||||
} else {
|
||||
values.backgroudColor = values.backgroudColor.toHexString();
|
||||
}
|
||||
props.onSubmit(values as API.ApplicationProducts.Product);
|
||||
};
|
||||
return (
|
||||
<ModalForm<{
|
||||
name: string;
|
||||
company: string;
|
||||
}>
|
||||
title={`${props.values ? '编辑' : '新增'}企业`}
|
||||
form={form}
|
||||
autoFocusFirstInput
|
||||
open={props.open}
|
||||
modalProps={{
|
||||
destroyOnClose: true,
|
||||
onCancel: () => handleCancel(),
|
||||
}}
|
||||
submitTimeout={2000}
|
||||
onFinish={handleFinish}
|
||||
initialValues={{
|
||||
cardOrder: 0,
|
||||
status: '0',
|
||||
}}
|
||||
>
|
||||
<ProFormDigit label="InputNumber" name="companyCardId" disabled hidden={true} />
|
||||
<ProForm.Group>
|
||||
<ProFormText width="md" name="name" label="卡片名称" placeholder="请输入卡片名称" />
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="backgroudColor"
|
||||
label="卡片背景色"
|
||||
valueType="color"
|
||||
disabledAlpha
|
||||
placeholder="请选择单位规模"
|
||||
fieldProps={{
|
||||
value: colorHex,
|
||||
onChange: (e) => setColorHex(e),
|
||||
}}
|
||||
/>
|
||||
{/*<span>HEX: {colorHex.}</span>*/}
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="companyNature"
|
||||
label="企业性质"
|
||||
valueEnum={companyNatureEnum}
|
||||
placeholder="请选择企业性质"
|
||||
/>
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="targ"
|
||||
label="企业标签"
|
||||
valueEnum={companyLabelEnum}
|
||||
placeholder="请选择企业标签"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormDigit width="md" label="排序" name="cardOrder" min={0} />
|
||||
<ProFormRadio.Group
|
||||
valueEnum={enableStatusEnum}
|
||||
name="status"
|
||||
label="启用状态"
|
||||
width="md"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default listEdit;
|
||||
221
src/pages/Application/Preproducts/index.tsx
Normal file
221
src/pages/Application/Preproducts/index.tsx
Normal file
@@ -0,0 +1,221 @@
|
||||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { useAccess } from '@umijs/max';
|
||||
import { Button, FormInstance, message, Modal, Switch } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, FormOutlined, PieChartFilled, PlusOutlined } from '@ant-design/icons';
|
||||
import EditCompanyListRow from './edit';
|
||||
import { delCmsCompanyList } from '@/services/company/list';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import {
|
||||
addCmsCardList,
|
||||
delCmsCardList,
|
||||
getCmsCardList,
|
||||
putCmsCardList,
|
||||
} from '@/services/application/preproducts';
|
||||
|
||||
const handleRemoveOne = async (companyCardId: string) => {
|
||||
const hide = message.loading('正在删除');
|
||||
if (!companyCardId) return true;
|
||||
try {
|
||||
const resp = await delCmsCompanyList(companyCardId);
|
||||
hide();
|
||||
if (resp.code === 200) {
|
||||
message.success('删除成功,即将刷新');
|
||||
} else {
|
||||
message.error(resp.msg);
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('删除失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function ManagementList() {
|
||||
const access = useAccess();
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.ApplicationProducts.Product>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [companyNatureEnum, setCompanyNatureEnum] = useState<any>([]);
|
||||
const [companyLabelEnum, setCompanyLabelEnum] = useState<any>([]);
|
||||
const [enableStatusEnum, setEnableStatusEnum] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
getDictValueEnum('company_nature', true, true).then((data) => {
|
||||
setCompanyNatureEnum(data);
|
||||
});
|
||||
getDictValueEnum('company_label', true, true).then((data) => {
|
||||
setCompanyLabelEnum(data);
|
||||
});
|
||||
getDictValueEnum('enable_status', true).then((data) => {
|
||||
setEnableStatusEnum(data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const changeStatus = async (record: API.ApplicationProducts.Product) => {
|
||||
let resData = await putCmsCardList({
|
||||
companyCardId: record.companyCardId,
|
||||
status: record.status === 1 ? 0 : 1,
|
||||
});
|
||||
if (resData.code === 200) {
|
||||
message.success('修改成功');
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const columns: ProColumns<API.ApplicationProducts.Product>[] = [
|
||||
{
|
||||
title: '卡片名称',
|
||||
dataIndex: 'name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '卡片颜色',
|
||||
dataIndex: 'backgroudColor',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
render: (text, _) => <PieChartFilled style={{ color: text }} />,
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'cardOrder',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '启用状态',
|
||||
dataIndex: 'status',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: enableStatusEnum,
|
||||
render: (text, record) => (
|
||||
<Switch checked={record.status === 1} onChange={changeStatus.bind(null, record)} />
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
dataIndex: 'companyCardId',
|
||||
width: 300,
|
||||
render: (companyCardId, record) => [
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>,
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '删除',
|
||||
content: '确定删除该项吗?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
const success = await delCmsCardList(companyCardId as string);
|
||||
if (success) {
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.ApplicationProducts.Product>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
rowKey="companyCardId"
|
||||
key="index"
|
||||
columns={columns}
|
||||
request={(params) =>
|
||||
getCmsCardList({ ...params } as API.ApplicationProducts.Params).then((res) => {
|
||||
return {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
})
|
||||
}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
key="add"
|
||||
hidden={!access.hasPerms('manage:List:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow(undefined);
|
||||
setModalVisible(true);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined /> 新建
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<EditCompanyListRow
|
||||
open={modalVisible}
|
||||
onSubmit={async (values) => {
|
||||
let resData;
|
||||
if (values.companyCardId) {
|
||||
resData = await putCmsCardList(values);
|
||||
} else {
|
||||
resData = await addCmsCardList(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if (values.companyCardId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
}}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
values={currentRow}
|
||||
companyLabelEnum={companyLabelEnum}
|
||||
companyNatureEnum={companyNatureEnum}
|
||||
enableStatusEnum={enableStatusEnum}
|
||||
></EditCompanyListRow>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default ManagementList;
|
||||
@@ -1,21 +1,14 @@
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormDateRangePicker,
|
||||
ProFormSelect,
|
||||
ProFormText,
|
||||
ProFormDigit,
|
||||
} from '@ant-design/pro-components';
|
||||
import React, {useEffect} from "react";
|
||||
import { Button, Form, message, InputNumber } from 'antd';
|
||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
import { ModalForm, ProForm, ProFormDigit, ProFormText } from '@ant-design/pro-components';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Button, Form } from 'antd';
|
||||
import { DictOptionType, DictValueEnumObj } from '@/components/DictTag';
|
||||
import ProFromMap from '@/components/ProFromMap';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
onSubmit: (values: API.AreaBusiness.CircleEditParams) => Promise<void>;
|
||||
onSubmit: (values: API.AreaBusiness.CircleEditParams) => Promise<void>;
|
||||
open: boolean;
|
||||
values?: Partial< API.AreaBusiness.CircleEditParams>;
|
||||
values?: Partial<API.AreaBusiness.CircleEditParams>;
|
||||
jobGroupOptions?: DictOptionType[];
|
||||
statusOptions?: DictValueEnumObj;
|
||||
};
|
||||
@@ -30,15 +23,24 @@ const waitTime = (time: number = 100) => {
|
||||
|
||||
const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
const [viewInfo, setViewInfo] = useState<any>({});
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if(props.values) {
|
||||
form.setFieldsValue({
|
||||
if (props.values) {
|
||||
const obj = {
|
||||
commercialAreaId: props.values.commercialAreaId,
|
||||
commercialAreaName: props.values.commercialAreaName,
|
||||
latitude: props.values.latitude,
|
||||
longitude: props.values.longitude,
|
||||
});
|
||||
address: props.values.address,
|
||||
};
|
||||
form.setFieldsValue(obj);
|
||||
setViewInfo(obj);
|
||||
} else {
|
||||
setViewInfo({});
|
||||
}
|
||||
}, [form, props]);
|
||||
const handleCancel = () => {
|
||||
@@ -47,10 +49,29 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
console.log(values)
|
||||
props.onSubmit(values as API.AreaBusiness.CircleEditParams);
|
||||
};
|
||||
|
||||
const select = (result) => {
|
||||
if (result.location) {
|
||||
const { lat, lng } = result.location;
|
||||
form.setFieldValue('latitude', lat);
|
||||
form.setFieldValue('longitude', lng);
|
||||
form.setFieldValue('address', result.address);
|
||||
const obj = {
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
address: result.address,
|
||||
};
|
||||
setViewInfo(obj);
|
||||
setOpen(false);
|
||||
}
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm<API.AreaBusiness.CircleParams>
|
||||
title={`${props.values ? '编辑' : '新增'}商圈`}
|
||||
@@ -81,12 +102,36 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入商圈名称!" ,
|
||||
message: '请输入商圈名称!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<div>
|
||||
<Button onClick={() => setOpen(true)}>选择位置信息</Button>
|
||||
<div style={{ margin: '10px 0 0 0' }}>
|
||||
{viewInfo.address ? (
|
||||
<span style={{ padding: '0 0 0 16px' }}>地址:{viewInfo.address}</span>
|
||||
) : null}
|
||||
{viewInfo.latitude ? (
|
||||
<span style={{ padding: '0 0 0 16px' }}>
|
||||
经纬度:{viewInfo.latitude},{viewInfo.longitude}
|
||||
</span>
|
||||
) : (
|
||||
<span style={{ padding: '0 0 0 16px', color: 'red' }}>请选择位置!</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="address"
|
||||
label="地理位置"
|
||||
hidden={true}
|
||||
placeholder="请输入地理位置"
|
||||
/>
|
||||
<ProFormDigit
|
||||
label="纬度"
|
||||
placeholder="请输入纬度"
|
||||
@@ -94,11 +139,12 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
width="md"
|
||||
min={-90}
|
||||
max={90}
|
||||
hidden={true}
|
||||
fieldProps={{ controls: false }}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入纬度!" ,
|
||||
message: '请输入纬度!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
@@ -108,18 +154,20 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
name="longitude"
|
||||
width="md"
|
||||
min={-180}
|
||||
hidden={true}
|
||||
max={180}
|
||||
fieldProps={{ controls: false }}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入经度!" ,
|
||||
message: '请输入经度!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProFromMap open={open} onSelect={select} onCancel={cancel}></ProFromMap>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default SubWayEdit
|
||||
export default SubWayEdit;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormDigit,
|
||||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Form } from 'antd';
|
||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
import {useEffect} from 'react'
|
||||
import { ModalForm, ProForm, ProFormDigit, ProFormText } from '@ant-design/pro-components';
|
||||
import { Button, Form } from 'antd';
|
||||
import { DictOptionType, DictValueEnumObj } from '@/components/DictTag';
|
||||
import { useEffect, useState } from 'react';
|
||||
import ProFromMap from '@/components/ProFromMap';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVars?: unknown) => void;
|
||||
onSubmit: (values: API.AreaSubWay.LinePoint) => Promise<void>;
|
||||
@@ -27,15 +24,14 @@ const waitTime = (time: number = 100) => {
|
||||
const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
const [viewInfo, setViewInfo] = useState<any>({});
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if(props.values) {
|
||||
form.setFieldsValue({
|
||||
stationName: props.values.stationName,
|
||||
stationId: props.values.stationId,
|
||||
longitude: props.values.longitude,
|
||||
latitude: props.values.latitude,
|
||||
});
|
||||
if (props.values) {
|
||||
form.setFieldsValue(props.values);
|
||||
setViewInfo(props.values);
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
@@ -48,10 +44,31 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
props.onSubmit(values as API.AreaSubWay.LinePoint);
|
||||
};
|
||||
|
||||
const select = (result) => {
|
||||
if (result.location) {
|
||||
const { lat, lng } = result.location;
|
||||
form.setFieldValue('latitude', lat);
|
||||
form.setFieldValue('longitude', lng);
|
||||
form.setFieldValue('address', result.address);
|
||||
const obj = {
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
address: result.address,
|
||||
};
|
||||
setViewInfo(obj);
|
||||
setOpen(false);
|
||||
}
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm<{
|
||||
name: string;
|
||||
company: string;
|
||||
stationOrder: number;
|
||||
}>
|
||||
title={`${props.values ? '编辑' : '新增'}站点`}
|
||||
form={form}
|
||||
@@ -62,6 +79,9 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
destroyOnClose: true,
|
||||
onCancel: () => handleCancel(),
|
||||
}}
|
||||
initialValues={{
|
||||
sort: 0,
|
||||
}}
|
||||
submitTimeout={2000}
|
||||
onFinish={handleFinish}
|
||||
>
|
||||
@@ -76,23 +96,66 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="stationName"
|
||||
label="站点名称:"
|
||||
label="站点名称"
|
||||
placeholder="请输入名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入名称!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<ProFormDigit
|
||||
width="md"
|
||||
label="排序"
|
||||
name="stationOrder"
|
||||
placeholder="请输入排序"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入排序!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<div>
|
||||
<Button onClick={() => setOpen(true)}>选择位置信息</Button>
|
||||
<div style={{ margin: '10px 0 0 0' }}>
|
||||
{viewInfo.address ? (
|
||||
<span style={{ padding: '0 0 0 16px' }}>地址:{viewInfo.address}</span>
|
||||
) : null}
|
||||
{viewInfo.latitude ? (
|
||||
<span style={{ padding: '0 0 0 16px' }}>
|
||||
经纬度:{viewInfo.latitude},{viewInfo.longitude}
|
||||
</span>
|
||||
) : (
|
||||
<span style={{ padding: '0 0 0 16px', color: 'red' }}>请选择位置!</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="address"
|
||||
label="地理位置"
|
||||
hidden={true}
|
||||
placeholder="请输入地理位置"
|
||||
/>
|
||||
<ProFormDigit
|
||||
label="纬度"
|
||||
placeholder="请输入纬度"
|
||||
name="latitude"
|
||||
width="md"
|
||||
hidden={true}
|
||||
min={-90}
|
||||
max={90}
|
||||
fieldProps={{ controls: false }}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入纬度!" ,
|
||||
message: '请输入纬度!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
@@ -102,18 +165,20 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
name="longitude"
|
||||
width="md"
|
||||
min={-180}
|
||||
hidden={true}
|
||||
max={180}
|
||||
fieldProps={{ controls: false }}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: "请输入经度!" ,
|
||||
message: '请输入经度!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProFromMap open={open} onSelect={select} onCancel={cancel}></ProFromMap>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default SubWayEdit
|
||||
export default SubWayEdit;
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
import React, {Fragment, useRef, useState, useCallback} from "react";
|
||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import {getCmsLineListPlatForm, addCmsLinePlatForm, deleteCmsLinePlatForm} from "@/services/area/upline";
|
||||
import UpStationEdit from "@/pages/Area/Subway/UpLine/edit";
|
||||
import {getCmsLineSubWay} from "@/services/area/subway";
|
||||
const handleRemoveOne = async (selectedRow: API.AreaSubWay.Line) => {
|
||||
import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useAccess, useParams } from '@umijs/max';
|
||||
import { Button, FormInstance, message, Modal } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
addCmsLinePlatForm,
|
||||
deleteCmsLinePlatForm,
|
||||
getCmsLineListPlatForm,
|
||||
} from '@/services/area/upline';
|
||||
import UpStationEdit from '@/pages/Area/Subway/UpLine/edit';
|
||||
|
||||
const handleRemoveOne = async (selectedRow: API.AreaSubWay.LinePoint) => {
|
||||
const hide = message.loading('正在删除');
|
||||
if (!selectedRow) return true;
|
||||
try {
|
||||
const resp = await deleteCmsLinePlatForm(selectedRow.lineId);
|
||||
const resp = await deleteCmsLinePlatForm(selectedRow.stationId);
|
||||
hide();
|
||||
if (resp.code === 200) {
|
||||
message.success('删除成功,即将刷新');
|
||||
@@ -30,43 +34,34 @@ function ManagementList() {
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.AreaPlatForm.Line>()
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||
const [page, setPage] = useState<API.AreaPlatForm.LineParams>({})
|
||||
|
||||
const [lineId, setLineId] = useState<string>();
|
||||
const [currentRow, setCurrentRow] = useState<API.AreaPlatForm.LinePoint>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [page, setPage] = useState<API.AreaPlatForm.LineParams>({});
|
||||
const params = useParams();
|
||||
const id = params.id || '0';
|
||||
useEffect(() => {
|
||||
if (lineId !== id) {
|
||||
setLineId(id);
|
||||
}
|
||||
}, [lineId, params]);
|
||||
const getStationInfo = useCallback(async () => {
|
||||
// const resData = await getCmsLineSubWay()
|
||||
}, [])
|
||||
}, []);
|
||||
|
||||
const columns: ProColumns<API.AreaSubWay.Line>[] = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
valueType: 'index',
|
||||
align: 'center',
|
||||
width: 48,
|
||||
render: (dom, record, index) => {
|
||||
if(page.current && page.pageSize) {
|
||||
return (page.current - 1) * page.pageSize + index + 1
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: '线路名称',
|
||||
// dataIndex: 'lineName',
|
||||
// align: 'center',
|
||||
// search: false,
|
||||
// valueType: 'text',
|
||||
// },
|
||||
const columns: ProColumns<API.AreaSubWay.LinePoint>[] = [
|
||||
{
|
||||
title: '站点名称',
|
||||
dataIndex: 'stationName',
|
||||
align: 'center',
|
||||
valueType: 'text',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'stationOrder',
|
||||
align: 'center',
|
||||
valueType: 'text',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
@@ -77,7 +72,7 @@ function ManagementList() {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined/>}
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
@@ -91,7 +86,7 @@ function ManagementList() {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon ={<DeleteOutlined/>}
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
@@ -111,10 +106,10 @@ function ManagementList() {
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
]
|
||||
}
|
||||
]
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
@@ -124,19 +119,22 @@ function ManagementList() {
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
columns={columns}
|
||||
headerTitle='信息'
|
||||
rowKey="lineId"
|
||||
key="lineIdList"
|
||||
headerTitle="信息"
|
||||
rowKey="stationId"
|
||||
key="stationId"
|
||||
request={(params) => {
|
||||
return getCmsLineListPlatForm(params as API.AreaPlatForm.LineParams).then((res) => {
|
||||
setPage(params as API.AreaPlatForm.LineParams)
|
||||
return getCmsLineListPlatForm({
|
||||
lineId,
|
||||
...params,
|
||||
} as API.AreaPlatForm.LineParams).then((res) => {
|
||||
setPage(params as API.AreaPlatForm.LineParams);
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
})
|
||||
});
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
@@ -157,16 +155,16 @@ function ManagementList() {
|
||||
open={modalVisible}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined)
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
onSubmit={async (values) => {
|
||||
// values.lineId =
|
||||
// values.lineName =
|
||||
const resData = await addCmsLinePlatForm(values)
|
||||
const resData = await addCmsLinePlatForm(values);
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
message.success('添加成功')
|
||||
message.success('添加成功');
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
@@ -175,6 +173,7 @@ function ManagementList() {
|
||||
values={currentRow}
|
||||
></UpStationEdit>
|
||||
</Fragment>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default ManagementList
|
||||
|
||||
export default ManagementList;
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import React, {Fragment, useRef, useState} from "react";
|
||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import {getCmsLineList, addCmsLineSubWay, deleteCmsLineSubWay, putCmsLineSubWay} from "@/services/area/subway";
|
||||
import SubWayEdit from "@/pages/Area/Subway/edit";
|
||||
import React, { Fragment, useRef, useState } from 'react';
|
||||
import { history, useAccess } from '@umijs/max';
|
||||
import { Button, FormInstance, message, Modal } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
addCmsLineSubWay,
|
||||
deleteCmsLineSubWay,
|
||||
getCmsLineList,
|
||||
putCmsLineSubWay,
|
||||
} from '@/services/area/subway';
|
||||
import SubWayEdit from '@/pages/Area/Subway/edit';
|
||||
|
||||
const handleRemoveOne = async (selectedRow: API.AreaSubWay.Line) => {
|
||||
const hide = message.loading('正在删除');
|
||||
if (!selectedRow) return true;
|
||||
@@ -30,8 +36,8 @@ function ManagementList() {
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.AreaSubWay.Line>()
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||
const [currentRow, setCurrentRow] = useState<API.AreaSubWay.Line>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
|
||||
const columns: ProColumns<API.AreaSubWay.Line>[] = [
|
||||
{
|
||||
@@ -39,9 +45,15 @@ function ManagementList() {
|
||||
dataIndex: 'lineName',
|
||||
align: 'center',
|
||||
valueType: 'text',
|
||||
render: (dom, record) => <Button type="link" onClick={() => history.push(`/area/updata-router/index?lineId=${record.lineId}`)} block>
|
||||
{dom}
|
||||
</Button>
|
||||
render: (dom, record) => (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => history.push(`/area/updata-router/index/${record.lineId}`)}
|
||||
block
|
||||
>
|
||||
{dom}
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -53,7 +65,7 @@ function ManagementList() {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined/>}
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
@@ -67,7 +79,7 @@ function ManagementList() {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon = <DeleteOutlined/>
|
||||
icon=<DeleteOutlined />
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
@@ -87,10 +99,10 @@ function ManagementList() {
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
]
|
||||
}
|
||||
]
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
@@ -100,19 +112,19 @@ function ManagementList() {
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
columns={columns}
|
||||
headerTitle='信息'
|
||||
headerTitle="信息"
|
||||
rowKey="lineId"
|
||||
key="lineIdList"
|
||||
request={(params) => {
|
||||
return getCmsLineList(params as API.AreaSubWay.LineParams).then((res) => {
|
||||
console.log(params)
|
||||
console.log(params);
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
})
|
||||
});
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
@@ -134,17 +146,17 @@ function ManagementList() {
|
||||
onSubmit={async (values) => {
|
||||
let resData;
|
||||
if (values.lineId) {
|
||||
resData = await putCmsLineSubWay(values)
|
||||
resData = await putCmsLineSubWay(values);
|
||||
} else {
|
||||
resData = await addCmsLineSubWay(values)
|
||||
resData = await addCmsLineSubWay(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if(values.lineId) {
|
||||
message.success('修改成功')
|
||||
if (values.lineId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功')
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
@@ -153,11 +165,12 @@ function ManagementList() {
|
||||
}}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined)
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
values={currentRow}
|
||||
></SubWayEdit>
|
||||
</Fragment>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default ManagementList
|
||||
|
||||
export default ManagementList;
|
||||
|
||||
144
src/pages/Classify/Industry/edit.tsx
Normal file
144
src/pages/Classify/Industry/edit.tsx
Normal file
@@ -0,0 +1,144 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormDigit,
|
||||
ProFormRadio,
|
||||
ProFormSelect,
|
||||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Form } from 'antd';
|
||||
import { DictValueEnumObj } from '@/components/DictTag';
|
||||
import { FormattedMessage } from '@@/exports';
|
||||
import { getCmsIndustryTree } from '@/services/classify/industry';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVars?: unknown) => void;
|
||||
onSubmit: (values: API.ClassifyIndustry.IndustryRow) => Promise<void>;
|
||||
open: boolean;
|
||||
values?: Partial<API.ClassifyIndustry.IndustryRow>;
|
||||
// industryStatusEnum: DictOptionType[];
|
||||
industryStatusEnum: DictValueEnumObj;
|
||||
};
|
||||
|
||||
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
const { industryStatusEnum } = props;
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if (props.values) {
|
||||
form.setFieldsValue(props.values);
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
props.onSubmit(values as API.ClassifyIndustry.IndustryRow);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm<{
|
||||
name: string;
|
||||
company: string;
|
||||
}>
|
||||
title={`${props.values ? '编辑' : '新增'}行业`}
|
||||
form={form}
|
||||
autoFocusFirstInput
|
||||
open={props.open}
|
||||
modalProps={{
|
||||
destroyOnClose: true,
|
||||
onCancel: () => handleCancel(),
|
||||
}}
|
||||
submitTimeout={2000}
|
||||
onFinish={handleFinish}
|
||||
// readonly
|
||||
>
|
||||
<ProFormDigit label="InputNumber" name="industryId" disabled hidden={true} />
|
||||
<ProForm.Group>
|
||||
<ProFormText width="md" name="industryName" label="行业名称" placeholder="请输入行业名称" />
|
||||
<ProFormDigit
|
||||
label="显示顺序"
|
||||
name="orderNum"
|
||||
width="md"
|
||||
min={0}
|
||||
placeholder="请输入显示顺序"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
{/* 多级 */}
|
||||
{/*<ProFormTreeSelect*/}
|
||||
{/* name="parentId"*/}
|
||||
{/* label="父行业"*/}
|
||||
{/* placeholder="请选择父行业"*/}
|
||||
{/* allowClear*/}
|
||||
{/* width="md"*/}
|
||||
{/* request={async () => {*/}
|
||||
{/* return getCmsIndustryTree().then((res) => {*/}
|
||||
{/* return res.data;*/}
|
||||
{/* });*/}
|
||||
{/* }}*/}
|
||||
{/* fieldProps={{*/}
|
||||
{/* suffixIcon: null,*/}
|
||||
{/* filterTreeNode: true,*/}
|
||||
{/* showSearch: true,*/}
|
||||
{/* popupMatchSelectWidth: false,*/}
|
||||
{/* labelInValue: false,*/}
|
||||
{/* autoClearSearchValue: true,*/}
|
||||
{/* multiple: false,*/}
|
||||
{/* treeNodeFilterProp: 'title',*/}
|
||||
{/* fieldNames: {*/}
|
||||
{/* label: 'label',*/}
|
||||
{/* value: 'id',*/}
|
||||
{/* children: 'children',*/}
|
||||
{/* },*/}
|
||||
{/* }}*/}
|
||||
{/*/>*/}
|
||||
{/* 2级 */}
|
||||
<ProFormSelect
|
||||
name="parentId"
|
||||
label="父行业"
|
||||
allowClear
|
||||
width="md"
|
||||
placeholder="请选择父行业"
|
||||
request={async () => {
|
||||
return getCmsIndustryTree().then((res) => {
|
||||
return res.data;
|
||||
});
|
||||
}}
|
||||
colProps={{ md: 12, xl: 12 }}
|
||||
rules={[{ required: true, message: '请选择父行业!' }]}
|
||||
fieldProps={{
|
||||
suffixIcon: null,
|
||||
showSearch: true,
|
||||
popupMatchSelectWidth: false,
|
||||
labelInValue: false,
|
||||
autoClearSearchValue: true,
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<ProFormRadio.Group
|
||||
valueEnum={industryStatusEnum}
|
||||
name="status"
|
||||
label="行业状态"
|
||||
width="md"
|
||||
placeholder="请输入状态"
|
||||
rules={[
|
||||
{
|
||||
required: false,
|
||||
message: <FormattedMessage id="请输入状态!" defaultMessage="请选择行业状态!" />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default listEdit;
|
||||
221
src/pages/Classify/Industry/index.tsx
Normal file
221
src/pages/Classify/Industry/index.tsx
Normal file
@@ -0,0 +1,221 @@
|
||||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, useAccess } from '@umijs/max';
|
||||
import { Button, FormInstance, message, Modal } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import EditCompanyListRow from './edit';
|
||||
import {
|
||||
addCmsIndustryIndustryt,
|
||||
delCmsIndustryList,
|
||||
exportCmsIndustry,
|
||||
getCmsIndustryList,
|
||||
updateCmsIndustryIndustryt,
|
||||
} from '@/services/classify/industry';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
|
||||
const handleRemoveOne = async (industryId: string) => {
|
||||
const hide = message.loading('正在删除');
|
||||
if (!industryId) return true;
|
||||
try {
|
||||
const resp = await delCmsIndustryList(industryId);
|
||||
hide();
|
||||
if (resp.code === 200) {
|
||||
message.success('删除成功,即将刷新');
|
||||
} else {
|
||||
message.error(resp.msg);
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('删除失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleExport = async (values: API.ClassifyIndustry.Params) => {
|
||||
const hide = message.loading('正在导出');
|
||||
try {
|
||||
await exportCmsIndustry(values);
|
||||
hide();
|
||||
message.success('导出成功');
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('导出失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function ManagementList() {
|
||||
const access = useAccess();
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.ClassifyIndustry.IndustryRow>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [industryStatusEnum, setIndustryStatusEnum] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
getDictValueEnum('sys_industry_status', true).then((data) => {
|
||||
setIndustryStatusEnum(data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const editSubmit = () => {};
|
||||
|
||||
const columns: ProColumns<API.ClassifyIndustry.IndustryRow>[] = [
|
||||
{
|
||||
title: '行业名称',
|
||||
dataIndex: 'industryName',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '显示顺序',
|
||||
dataIndex: 'orderNum',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
align: 'center',
|
||||
valueType: 'select',
|
||||
valueEnum: industryStatusEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={industryStatusEnum} value={record.status} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
dataIndex: 'industryId',
|
||||
width: 300,
|
||||
render: (industryId, record) => [
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
setCurrentRow(record);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>,
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '删除',
|
||||
content: '确定删除该项吗?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
const success = await handleRemoveOne(industryId as string);
|
||||
if (success) {
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.ClassifyIndustry.IndustryRow>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
rowKey="industryId"
|
||||
key="index"
|
||||
columns={columns}
|
||||
request={(params) =>
|
||||
getCmsIndustryList({ ...params } as API.ClassifyIndustry.Params).then((res) => {
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
})
|
||||
}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
key="add"
|
||||
hidden={!access.hasPerms('manage:List:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow(undefined);
|
||||
setModalVisible(true);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined /> 新建
|
||||
</Button>,
|
||||
<Button
|
||||
key="export"
|
||||
hidden={!access.hasPerms('system:user:export')}
|
||||
onClick={async () => {
|
||||
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||
handleExport(searchVal as API.ClassifyIndustry.Params);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined />
|
||||
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<EditCompanyListRow
|
||||
open={modalVisible}
|
||||
onSubmit={async (values) => {
|
||||
let resData;
|
||||
if (values.industryId) {
|
||||
resData = await updateCmsIndustryIndustryt(values);
|
||||
} else {
|
||||
resData = await addCmsIndustryIndustryt(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if (values.industryId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
}}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
industryStatusEnum={industryStatusEnum}
|
||||
values={currentRow}
|
||||
></EditCompanyListRow>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default ManagementList;
|
||||
78
src/pages/Classify/Jobs/edit.tsx
Normal file
78
src/pages/Classify/Jobs/edit.tsx
Normal file
@@ -0,0 +1,78 @@
|
||||
import { useEffect } from 'react';
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormDigit,
|
||||
ProFormText,
|
||||
ProFormTextArea,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Form } from 'antd';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
onSubmit: (values: API.CompanyList.Company) => Promise<void>;
|
||||
open: boolean;
|
||||
values?: Partial<API.CompanyList.Company>;
|
||||
// jobGroupOptions: DictOptionType[];
|
||||
// statusOptions: DictValueEnumObj;
|
||||
};
|
||||
|
||||
const waitTime = (time: number = 100) => {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(true);
|
||||
}, time);
|
||||
});
|
||||
};
|
||||
|
||||
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if (props.values) {
|
||||
form.setFieldsValue(props.values);
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
props.onSubmit(values as API.CompanyList.Company);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm<{
|
||||
name: string;
|
||||
company: string;
|
||||
}>
|
||||
title={`${props.values ? '编辑' : '新增'}企业`}
|
||||
form={form}
|
||||
autoFocusFirstInput
|
||||
open={props.open}
|
||||
modalProps={{
|
||||
destroyOnClose: true,
|
||||
onCancel: () => handleCancel(),
|
||||
}}
|
||||
submitTimeout={2000}
|
||||
onFinish={handleFinish}
|
||||
>
|
||||
<ProFormDigit label="InputNumber" name="companyId" disabled hidden={true} />
|
||||
<ProForm.Group>
|
||||
<ProFormText width="md" name="name" label="单位名称" placeholder="请输入单位名称" />
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText width="md" name="code" label="信用代码" placeholder="请输入信用代码" />
|
||||
<ProFormText width="md" name="industry" label="主要行业" placeholder="请输入主要行业" />
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormTextArea width="xl" name="location" label="单位地点" placeholder="请输入单位地点" />
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default listEdit;
|
||||
216
src/pages/Classify/Jobs/index.tsx
Normal file
216
src/pages/Classify/Jobs/index.tsx
Normal file
@@ -0,0 +1,216 @@
|
||||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, useAccess } from '@umijs/max';
|
||||
import { Button, FormInstance, message, Modal } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import EditCompanyListRow from './edit';
|
||||
import { addCmsCompanyList, delCmsCompanyList, putCmsCompanyList } from '@/services/company/list';
|
||||
import { exportCmsJobTitleList, getCmsJobTitleList } from '@/services/classify/jobs';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
|
||||
const handleRemoveOne = async (jobId: string) => {
|
||||
const hide = message.loading('正在删除');
|
||||
if (!jobId) return true;
|
||||
try {
|
||||
const resp = await delCmsCompanyList(jobId);
|
||||
hide();
|
||||
if (resp.code === 200) {
|
||||
message.success('删除成功,即将刷新');
|
||||
} else {
|
||||
message.error(resp.msg);
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('删除失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleExport = async (values: API.ClassifyJobs.Params) => {
|
||||
const hide = message.loading('正在导出');
|
||||
try {
|
||||
await exportCmsJobTitleList(values);
|
||||
hide();
|
||||
message.success('导出成功');
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('导出失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function ManagementList() {
|
||||
const access = useAccess();
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.ClassifyJobs.Jobs>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [jobsStatusEnum, setJobsStatusEnum] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
getDictValueEnum('sys_jobs_status', true).then((data) => {
|
||||
setJobsStatusEnum(data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const editSubmit = () => {};
|
||||
|
||||
const columns: ProColumns<API.ClassifyJobs.Jobs>[] = [
|
||||
{
|
||||
title: '岗位名称',
|
||||
dataIndex: 'jobName',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '显示顺序',
|
||||
dataIndex: 'orderNum',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
align: 'center',
|
||||
valueType: 'select',
|
||||
valueEnum: jobsStatusEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={jobsStatusEnum} value={record.status} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
dataIndex: 'companyId',
|
||||
width: 300,
|
||||
render: (companyId, record) => [
|
||||
// <Button
|
||||
// type="link"
|
||||
// size="small"
|
||||
// key="edit"
|
||||
// icon={<FormOutlined />}
|
||||
// hidden={!access.hasPerms('area:business:List.update')}
|
||||
// onClick={() => {
|
||||
// setModalVisible(true);
|
||||
// setCurrentRow(record);
|
||||
// }}
|
||||
// >
|
||||
// 编辑
|
||||
// </Button>,
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '删除',
|
||||
content: '确定删除该项吗?',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
const success = await handleRemoveOne(companyId as string);
|
||||
if (success) {
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.ClassifyJobs.Jobs>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
rowKey="jobId"
|
||||
key="index"
|
||||
columns={columns}
|
||||
request={(params) =>
|
||||
getCmsJobTitleList({ ...params } as API.ClassifyJobs.Params).then((res) => {
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
})
|
||||
}
|
||||
toolBarRender={() => [
|
||||
// <Button
|
||||
// type="primary"
|
||||
// key="add"
|
||||
// hidden={!access.hasPerms('manage:List:add')}
|
||||
// onClick={async () => {
|
||||
// setCurrentRow(undefined);
|
||||
// setModalVisible(true);
|
||||
// }}
|
||||
// >
|
||||
// <PlusOutlined /> 新建
|
||||
// </Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
key="export"
|
||||
hidden={!access.hasPerms('system:user:export')}
|
||||
onClick={async () => {
|
||||
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||
handleExport(searchVal as API.ClassifyJobs.Params);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined />
|
||||
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<EditCompanyListRow
|
||||
open={modalVisible}
|
||||
onSubmit={async (values) => {
|
||||
let resData;
|
||||
if (values.companyId) {
|
||||
resData = await putCmsCompanyList(values);
|
||||
} else {
|
||||
resData = await addCmsCompanyList(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if (values.companyId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
}}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
values={currentRow}
|
||||
></EditCompanyListRow>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default ManagementList;
|
||||
@@ -1,13 +1,16 @@
|
||||
import {useEffect} from 'react'
|
||||
import { useEffect } from 'react';
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormTextArea,
|
||||
ProFormDigit,
|
||||
ProFormSelect,
|
||||
ProFormText,
|
||||
ProFormDigit
|
||||
ProFormTextArea,
|
||||
ProFormTreeSelect,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Button, Form, message } from 'antd';
|
||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
import { Form } from 'antd';
|
||||
import { DictValueEnumObj } from '@/components/DictTag';
|
||||
import { getCmsIndustryTree } from '@/services/classify/industry';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
@@ -15,7 +18,7 @@ export type ListFormProps = {
|
||||
open: boolean;
|
||||
values?: Partial<API.CompanyList.Company>;
|
||||
// jobGroupOptions: DictOptionType[];
|
||||
// statusOptions: DictValueEnumObj;
|
||||
scaleEnum?: DictValueEnumObj;
|
||||
};
|
||||
|
||||
const waitTime = (time: number = 100) => {
|
||||
@@ -28,21 +31,24 @@ const waitTime = (time: number = 100) => {
|
||||
|
||||
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const { scaleEnum } = props;
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if(props.values) {
|
||||
form.setFieldsValue(props.values);
|
||||
if (props.values) {
|
||||
form.setFieldsValue({
|
||||
...props.values,
|
||||
// industry: props.values.industry.split(','),
|
||||
});
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
// values.industry = values.industry.join(',');
|
||||
props.onSubmit(values as API.CompanyList.Company);
|
||||
};
|
||||
|
||||
@@ -62,44 +68,60 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
submitTimeout={2000}
|
||||
onFinish={handleFinish}
|
||||
>
|
||||
<ProFormDigit
|
||||
label="InputNumber"
|
||||
name="companyId"
|
||||
disabled
|
||||
hidden={true}
|
||||
/>
|
||||
<ProFormDigit label="InputNumber" name="companyId" disabled hidden={true} />
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
<ProFormText width="md" name="name" label="单位名称" placeholder="请输入单位名称" />
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="name"
|
||||
label="单位名称"
|
||||
placeholder="请输入单位名称"
|
||||
name="scale"
|
||||
label={'单位规模'}
|
||||
valueEnum={scaleEnum}
|
||||
placeholder="请选择单位规模"
|
||||
rules={[{ required: true, message: '请选择单位规模!' }]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="code"
|
||||
label="信用代码"
|
||||
placeholder="请输入信用代码"
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
<ProFormText width="md" name="code" label="信用代码" placeholder="请输入信用代码" />
|
||||
{/*<ProFormText width="md" name="industry" label="主要行业" placeholder="请输入主要行业" />*/}
|
||||
<ProFormTreeSelect
|
||||
name="industry"
|
||||
label="主要行业"
|
||||
placeholder="请输入主要行业"
|
||||
allowClear
|
||||
width="md"
|
||||
request={async () => {
|
||||
return getCmsIndustryTree().then((res) => {
|
||||
return res.data;
|
||||
});
|
||||
}}
|
||||
fieldProps={{
|
||||
suffixIcon: null,
|
||||
filterTreeNode: true,
|
||||
showSearch: true,
|
||||
popupMatchSelectWidth: false,
|
||||
labelInValue: false,
|
||||
autoClearSearchValue: true,
|
||||
multiple: false,
|
||||
treeNodeFilterProp: 'title',
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
children: 'children',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText width="xl" name="location" label="单位地点" placeholder="请输入单位地点" />
|
||||
<ProFormTextArea
|
||||
width="xl"
|
||||
name="location"
|
||||
label="单位地点"
|
||||
placeholder="请输入单位地点"
|
||||
name="description"
|
||||
label="单位介绍"
|
||||
placeholder="请输入单位介绍"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default listEdit
|
||||
export default listEdit;
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import React, {Fragment, useRef, useState, useEffect} from "react";
|
||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||
import {delCmsJobIds, getCmsJobList} from "@/services/Management/list";
|
||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import EditCompanyListRow from './edit'
|
||||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, useAccess } from '@umijs/max';
|
||||
import { Button, FormInstance, message, Modal } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import EditCompanyListRow from './edit';
|
||||
import {
|
||||
addCmsCompanyList,
|
||||
delCmsCompanyList,
|
||||
exportCmsCompanyList,
|
||||
getCmsCompanyList,
|
||||
putCmsCompanyList
|
||||
} from "@/services/company/list";
|
||||
putCmsCompanyList,
|
||||
} from '@/services/company/list';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
|
||||
const handleRemoveOne = async (jobId: string) => {
|
||||
const hide = message.loading('正在删除');
|
||||
@@ -52,27 +53,23 @@ function ManagementList() {
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.CompanyList.Company>()
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||
const [salaryEnum, setSalaryEnum] = useState<any>([])
|
||||
const [currentRow, setCurrentRow] = useState<API.CompanyList.Company>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [scaleEnum, setScaleEnum] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
// getDictValueEnum('salary', true).then((data) => {
|
||||
// setSalaryEnum(data)
|
||||
// });
|
||||
|
||||
getDictValueEnum('scale', true, true).then((data) => {
|
||||
setScaleEnum(data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const editSubmit = () => {
|
||||
|
||||
}
|
||||
const editSubmit = () => {};
|
||||
|
||||
const columns: ProColumns<API.CompanyList.Company>[] = [
|
||||
{
|
||||
title: '公司名称',
|
||||
dataIndex: 'name',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
@@ -84,9 +81,12 @@ function ManagementList() {
|
||||
{
|
||||
title: '公司规模',
|
||||
dataIndex: 'scale',
|
||||
valueType: 'text',
|
||||
// hideInSearch: true,
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: scaleEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={scaleEnum} value={record.scale} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '公司位置',
|
||||
@@ -106,7 +106,7 @@ function ManagementList() {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined/>}
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
@@ -120,7 +120,7 @@ function ManagementList() {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon ={<DeleteOutlined/>}
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
@@ -140,10 +140,10 @@ function ManagementList() {
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
]
|
||||
}
|
||||
]
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
@@ -195,19 +195,20 @@ function ManagementList() {
|
||||
<EditCompanyListRow
|
||||
open={modalVisible}
|
||||
onSubmit={async (values) => {
|
||||
console.log(values);
|
||||
let resData;
|
||||
if (values.companyId) {
|
||||
resData = await putCmsCompanyList(values)
|
||||
resData = await putCmsCompanyList(values);
|
||||
} else {
|
||||
resData = await addCmsCompanyList(values)
|
||||
resData = await addCmsCompanyList(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if(values.companyId) {
|
||||
message.success('修改成功')
|
||||
if (values.companyId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功')
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
@@ -219,8 +220,10 @@ function ManagementList() {
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
values={currentRow}
|
||||
scaleEnum={scaleEnum}
|
||||
></EditCompanyListRow>
|
||||
</Fragment>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default ManagementList
|
||||
|
||||
export default ManagementList;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {useEffect} from 'react'
|
||||
import {useEffect, useCallback, useState} from 'react'
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
@@ -6,11 +6,14 @@ import {
|
||||
ProFormText,
|
||||
ProFormDigit,
|
||||
ProFormRadio,
|
||||
ProFormDateRangePicker
|
||||
ProFormDateRangePicker,
|
||||
ProFormList,
|
||||
ProFormSelect,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Button, Form, message } from 'antd';
|
||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
import { useIntl, FormattedMessage } from '@umijs/max';
|
||||
import {getCmsCompanyList} from "@/services/company/list";
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
@@ -32,9 +35,12 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
const intl = useIntl();
|
||||
const { jobFairType } = props;
|
||||
|
||||
const [companyOptions, setCompanyOptions] = useState([])
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if(props.values) {
|
||||
console.log(props.values)
|
||||
form.setFieldsValue({
|
||||
...props.values,
|
||||
createTimeRanger: [props.values.startTime, props.values.endTime],
|
||||
@@ -43,6 +49,21 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
}, [form, props]);
|
||||
|
||||
|
||||
const handleChange =(_: string, value: any) => {
|
||||
const ls = form.getFieldsValue().companyList.map((item: any) => {
|
||||
if(value.value === item.companyId) {
|
||||
return {
|
||||
...item,
|
||||
companyName: value.title
|
||||
}
|
||||
}
|
||||
return item;
|
||||
})
|
||||
form.setFieldValue('companyList', ls)
|
||||
console.log(ls)
|
||||
}
|
||||
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
form.resetFields();
|
||||
@@ -114,6 +135,42 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
placeholder="请输入招聘会地点"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProFormList
|
||||
name="companyList"
|
||||
creatorButtonProps={{
|
||||
position: 'bottom',
|
||||
creatorButtonText: '新建一行',
|
||||
}}
|
||||
copyIconProps={{
|
||||
tooltipText: '复制此行到末尾',
|
||||
}}
|
||||
deleteIconProps={{
|
||||
tooltipText: '移除本行',
|
||||
}}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormSelect
|
||||
key="companyId"
|
||||
showSearch
|
||||
width="md"
|
||||
name="companyId"
|
||||
onChange={handleChange}
|
||||
request={async ({keyWords}) => {
|
||||
let resData = await getCmsCompanyList({ name: keyWords })
|
||||
return resData.rows.map((item) => ({ label: item.name, value: item.companyId}))
|
||||
}}
|
||||
placeholder="请输入公司名称选择公司"
|
||||
rules={[{ required: true, message: '请输入公司名称选择公司!' }]}
|
||||
label="招聘会公司列表"
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="companyName"
|
||||
label=" "
|
||||
hidden={true}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ProFormList>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -10,7 +10,8 @@ import {
|
||||
delCmsFairList,
|
||||
exportCmsFairList,
|
||||
getCmsFairList,
|
||||
putCmsFairList
|
||||
putCmsFairList,
|
||||
getCmsFairId, getCmstitilelist
|
||||
} from "@/services/jobfair/list";
|
||||
import {getDictValueEnum} from "@/services/system/dict";
|
||||
import DictTag from "@/components/DictTag";
|
||||
@@ -74,7 +75,6 @@ function ManagementList() {
|
||||
title: '招聘会名称',
|
||||
dataIndex: 'name',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
@@ -107,9 +107,10 @@ function ManagementList() {
|
||||
key="edit"
|
||||
icon={<FormOutlined/>}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
onClick={async () => {
|
||||
let resData = await getCmsFairId(jobFairId as string)
|
||||
setModalVisible(true);
|
||||
setCurrentRow(record);
|
||||
setCurrentRow(resData.data);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
|
||||
74
src/pages/Management/List/SeeMatching/detail.tsx
Normal file
74
src/pages/Management/List/SeeMatching/detail.tsx
Normal file
@@ -0,0 +1,74 @@
|
||||
import { Modal } from 'antd';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export type ListFormProps = {
|
||||
onClose: (flag?: boolean, formVals?: unknown) => void;
|
||||
open: boolean;
|
||||
values?: Partial<API.MobileUser.ListRow>;
|
||||
matching?: any;
|
||||
};
|
||||
|
||||
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
const { open, values, matching } = props;
|
||||
|
||||
const mapRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(matching);
|
||||
if (matching && open) {
|
||||
const myCharts = echarts.init(mapRef.current);
|
||||
const { educationMatch, maxSimilarity, salaryMatch, areaMatch } = matching;
|
||||
// educationMatch
|
||||
// maxSimilarity
|
||||
// salaryMatch
|
||||
// areaMatch
|
||||
myCharts.setOption({
|
||||
radar: {
|
||||
shape: 'circle',
|
||||
indicator: [
|
||||
{ name: '学历', max: 1 },
|
||||
{ name: '薪资', max: 1 },
|
||||
{ name: '区域', max: 1 },
|
||||
{ name: '内容', max: 1 },
|
||||
],
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '综合匹配度',
|
||||
type: 'radar',
|
||||
data: [
|
||||
{
|
||||
value: [educationMatch, salaryMatch, areaMatch, maxSimilarity],
|
||||
name: 'Allocated Budget',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
}, [matching]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="匹配详情"
|
||||
width={400}
|
||||
open={props.open}
|
||||
footer={''}
|
||||
onCancel={() => props.onClose()}
|
||||
maskClosable={true}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<div style={{ width: '300px', height: '300px' }} ref={mapRef}></div>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default listEdit;
|
||||
235
src/pages/Management/List/SeeMatching/index.tsx
Normal file
235
src/pages/Management/List/SeeMatching/index.tsx
Normal file
@@ -0,0 +1,235 @@
|
||||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, useAccess, useParams } from '@umijs/max';
|
||||
import { Button, FormInstance, message } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
import { exportCmsAppUserExport } from '@/services/mobileusers/list';
|
||||
import { exportCmsJobCandidates, getCmsJobIds } from '@/services/Management/list';
|
||||
import similarityJobs from '@/utils/similarity_Job';
|
||||
import Detail from './detail';
|
||||
|
||||
const handleExport = async (values: API.MobileUser.ListParams) => {
|
||||
const hide = message.loading('正在导出');
|
||||
try {
|
||||
await exportCmsAppUserExport(values);
|
||||
hide();
|
||||
message.success('导出成功');
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('导出失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function ManagementList() {
|
||||
const access = useAccess();
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [jobId, setJobId] = useState<string>();
|
||||
const [educationEnum, setEducationEnum] = useState<any>([]);
|
||||
const [experienceEnum, setExperienceEnum] = useState<any>([]);
|
||||
const [areaEnum, setAreaEnum] = useState<any>([]);
|
||||
const [sexEnum, setSexEnum] = useState<any>([]);
|
||||
const [hotEnum, setHotEnum] = useState<any>([]);
|
||||
const [politicalEnum, setPoliticalEnum] = useState<any>([]);
|
||||
const [currentRow, setCurrentRow] = useState<API.MobileUser.ListRow>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [jobInfo, setJobInfo] = useState({});
|
||||
const [matchingDegree, setMatchingDegree] = useState<any>(null);
|
||||
const params = useParams();
|
||||
const id = params.id || '0';
|
||||
useEffect(() => {
|
||||
if (jobId !== id) {
|
||||
setJobId(id);
|
||||
getJobInfo(id);
|
||||
}
|
||||
}, [jobId, params]);
|
||||
|
||||
const getJobInfo = async (jobId: string) => {
|
||||
let resData = await getCmsJobIds(jobId);
|
||||
if (resData.code === 200) {
|
||||
similarityJobs.setJobInfo(resData.data);
|
||||
setJobInfo(resData.data);
|
||||
}
|
||||
};
|
||||
|
||||
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('sys_user_sex', true).then((data) => {
|
||||
setSexEnum(data);
|
||||
});
|
||||
getDictValueEnum('political_affiliation', true, true).then((data) => {
|
||||
setPoliticalEnum(data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const columns: ProColumns<API.MobileUser.ListRow>[] = [
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '期望薪资',
|
||||
dataIndex: 'minSalary',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<>
|
||||
{record.salaryMin}-{record.salaryMax}
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '出生日期',
|
||||
dataIndex: 'birthDate',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '学历要求',
|
||||
dataIndex: 'education',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: educationEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={educationEnum} value={record.education} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '区域',
|
||||
dataIndex: 'area',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: areaEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={areaEnum} value={record.area} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'sex',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: sexEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={sexEnum} value={record.sex} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '政治面貌',
|
||||
dataIndex: 'politicalAffiliation',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: politicalEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={politicalEnum} value={record.politicalAffiliation} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '匹配度',
|
||||
dataIndex: 'minSalary',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<>{similarityJobs.calculationMatchingDegreeJob(record).overallMatch}</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
dataIndex: 'jobId',
|
||||
width: 200,
|
||||
render: (jobId, record) => [
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
setCurrentRow(record);
|
||||
const val = similarityJobs.calculationMatchingDegreeJob(record);
|
||||
setMatchingDegree(val);
|
||||
}}
|
||||
>
|
||||
查看匹配详情
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.MobileUser.ListRow>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
rowKey="jobId"
|
||||
key="index"
|
||||
columns={columns}
|
||||
request={(params) =>
|
||||
exportCmsJobCandidates(jobId).then((res) => {
|
||||
// const v = similarityJobs.calculationMatchingDegreeJob(res.rows[0]);
|
||||
// console.log(v);
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
})
|
||||
}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
key="export"
|
||||
hidden={!access.hasPerms('system:user:export')}
|
||||
onClick={async () => {
|
||||
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||
handleExport(searchVal as API.MobileUser.ListParams);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined />
|
||||
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
<Detail
|
||||
values={currentRow}
|
||||
open={modalVisible}
|
||||
matching={matchingDegree}
|
||||
onClose={() => {
|
||||
console.log('close');
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
setMatchingDegree(null);
|
||||
}}
|
||||
></Detail>
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default ManagementList;
|
||||
@@ -1,21 +1,24 @@
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
ModalForm,
|
||||
ProForm,
|
||||
ProFormDateRangePicker,
|
||||
ProFormDigit,
|
||||
ProFormSelect,
|
||||
ProFormText,
|
||||
ProFormTextArea,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Button, Form, message } from 'antd';
|
||||
import {DictOptionType, DictValueEnumObj} from "@/components/DictTag";
|
||||
import { Form } from 'antd';
|
||||
import React, { useEffect } from 'react';
|
||||
import { DictValueEnumObj } from '@/components/DictTag';
|
||||
import { getCmsCompanyList } from '@/services/company/list';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
onSubmit: (values: API.ManagementList.Manage) => Promise<void>;
|
||||
open: boolean;
|
||||
// values: Partial<API.Management.Manage>;
|
||||
// jobGroupOptions: DictOptionType[];
|
||||
// statusOptions: DictValueEnumObj;
|
||||
values?: Partial<API.ManagementList.Manage>;
|
||||
educationEnum: DictValueEnumObj;
|
||||
experienceEnum: DictValueEnumObj;
|
||||
areaEnum: DictValueEnumObj;
|
||||
};
|
||||
|
||||
const waitTime = (time: number = 100) => {
|
||||
@@ -27,7 +30,17 @@ const waitTime = (time: number = 100) => {
|
||||
};
|
||||
|
||||
const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm<{ name: string; company: string }>();
|
||||
const [form] = Form.useForm<{ name: string; company: string; companyName: number }>();
|
||||
const { educationEnum, experienceEnum, areaEnum } = props;
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if (props.values) {
|
||||
form.setFieldsValue({
|
||||
...props.values,
|
||||
jobLocationAreaCode: String(props.values.jobLocationAreaCode || ''),
|
||||
});
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
@@ -38,6 +51,10 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
props.onSubmit(values as API.ManagementList.Manage);
|
||||
};
|
||||
|
||||
const handleChange = (_: string, value: any) => {
|
||||
form.setFieldValue('companyName', value.label);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm<{
|
||||
name: string;
|
||||
@@ -55,71 +72,87 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
onFinish={handleFinish}
|
||||
>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
<ProFormText width="md" hidden name="jobId" />
|
||||
<ProFormText width="md" hidden name="companyName" />
|
||||
<ProFormText width="md" name="jobTitle" label="岗位名称" placeholder="请输入岗位名称" />
|
||||
<ProFormSelect
|
||||
showSearch
|
||||
width="md"
|
||||
name="jobTitle"
|
||||
label="岗位名称"
|
||||
placeholder="请输入名称"
|
||||
name="companyId"
|
||||
onChange={handleChange}
|
||||
request={async ({ keyWords }) => {
|
||||
let resData = await getCmsCompanyList({ name: keyWords });
|
||||
return resData.rows.map((item) => ({ label: item.name, value: item.companyId }));
|
||||
}}
|
||||
placeholder="请输入公司名称选择公司"
|
||||
rules={[{ required: true, message: '请输入公司名称选择公司!' }]}
|
||||
label="招聘会公司"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
<ProFormDigit
|
||||
name="minSalary"
|
||||
label="最小薪资"
|
||||
width="md"
|
||||
min={0}
|
||||
label="最小薪资(元/月)"
|
||||
placeholder="请输入最小薪资(元)"
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
<ProFormDigit
|
||||
name="maxSalary"
|
||||
label="最大薪资"
|
||||
width="md"
|
||||
min={0}
|
||||
label="最大薪资(元/月)"
|
||||
placeholder="请输入最大薪资(元)"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="education"
|
||||
label="学历要求"
|
||||
placeholder="请输入学历要求"
|
||||
label={'学历要求'}
|
||||
valueEnum={educationEnum}
|
||||
placeholder="请选择学历要求"
|
||||
rules={[{ required: true, message: '请选择学历要求!' }]}
|
||||
/>
|
||||
<ProFormText
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="experience"
|
||||
label="工作经验"
|
||||
placeholder="请输入工作经验"
|
||||
label={'工作经验'}
|
||||
valueEnum={experienceEnum}
|
||||
placeholder="请选择岗位"
|
||||
rules={[{ required: true, message: '请选择工作经验!' }]}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="companyName"
|
||||
label="单位名称"
|
||||
placeholder="请输入单位名称"
|
||||
name="jobLocationAreaCode"
|
||||
label={'工作区县'}
|
||||
valueEnum={areaEnum}
|
||||
placeholder="请选择区县"
|
||||
rules={[{ required: true, message: '请选择区县!' }]}
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="jobLocation"
|
||||
label="工作地点"
|
||||
placeholder="请输入工作地点"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="vacancies"
|
||||
<ProFormDigit
|
||||
label="招聘人数"
|
||||
name="vacancies"
|
||||
width="md"
|
||||
min={0}
|
||||
placeholder="请输入招聘人数"
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="jobLocation"
|
||||
label="工作地点"
|
||||
placeholder="请输入工作地点"
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText width="lg" name="jobLocation" label="工作地点" placeholder="请输入工作地点" />
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormTextArea
|
||||
width="lg"
|
||||
name="description"
|
||||
label="岗位描述"
|
||||
placeholder="请输入岗位描述"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
export default listEdit
|
||||
export default listEdit;
|
||||
|
||||
@@ -1,13 +1,33 @@
|
||||
import React, {Fragment, useRef, useState, useEffect} from "react";
|
||||
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max';
|
||||
import {delCmsJobIds, getCmsJobList} from "@/services/Management/list";
|
||||
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd';
|
||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons';
|
||||
import EditManageRow from './edit'
|
||||
import {getDictValueEnum} from "@/services/system/dict";
|
||||
import DictTag from "@/components/DictTag";
|
||||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, history, useAccess } from '@umijs/max';
|
||||
|
||||
import {
|
||||
addCmsJobList,
|
||||
delCmsJobIds,
|
||||
exportCmsJob,
|
||||
getCmsJobList,
|
||||
updateCmsJobList,
|
||||
} from '@/services/Management/list';
|
||||
import { Button, FormInstance, message, Modal, Switch } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { BarChartOutlined, DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import EditManageRow from './edit';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
|
||||
const handleExport = async (values: API.ManagementList.ListParams) => {
|
||||
const hide = message.loading('正在导出');
|
||||
try {
|
||||
await exportCmsJob(values);
|
||||
hide();
|
||||
message.success('导出成功');
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('导出失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const handleRemoveOne = async (jobId: string) => {
|
||||
const hide = message.loading('正在删除');
|
||||
if (!jobId) return true;
|
||||
@@ -33,23 +53,44 @@ function ManagementList() {
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [educationEnum, setEducationEnum] = useState<any>([])
|
||||
const [experienceEnum, setExperienceEnum] = useState<any>([])
|
||||
const [hotEnum, setHotEnum] = useState<any>([])
|
||||
const [currentRow, setCurrentRow] = useState<API.ManagementList.Manage>()
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||
const [educationEnum, setEducationEnum] = useState<any>([]);
|
||||
const [experienceEnum, setExperienceEnum] = useState<any>([]);
|
||||
const [areaEnum, setAreaEnum] = useState<any>([]);
|
||||
const [isPublishEnum, setIsPublishEnum] = useState<any>([]);
|
||||
const [hotEnum, setHotEnum] = useState<any>([]);
|
||||
const [currentRow, setCurrentRow] = useState<API.ManagementList.Manage>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
getDictValueEnum('education',true).then((data) => {
|
||||
setEducationEnum(data)
|
||||
})
|
||||
getDictValueEnum('experience',true).then((data) => {
|
||||
setExperienceEnum(data)
|
||||
})
|
||||
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);
|
||||
});
|
||||
// getDictValueEnum('job_hot',true).then((data) => {
|
||||
// setHotEnum(data)
|
||||
// })
|
||||
}, [])
|
||||
}, []);
|
||||
|
||||
async function changeRelease(record: API.ManagementList.Manage) {
|
||||
let resData = await updateCmsJobList({
|
||||
jobId: record.jobId,
|
||||
isPublish: record.isPublish === 1 ? 0 : 1,
|
||||
});
|
||||
if (resData.code === 200) {
|
||||
message.success('修改成功');
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const columns: ProColumns<API.ManagementList.Manage>[] = [
|
||||
{
|
||||
@@ -57,13 +98,18 @@ function ManagementList() {
|
||||
dataIndex: 'jobTitle',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},{
|
||||
},
|
||||
{
|
||||
title: '最大最小薪资',
|
||||
dataIndex: 'maxSalary',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (_, record) => <>{record.minSalary}-{record.maxSalary}</>
|
||||
render: (_, record) => (
|
||||
<>
|
||||
{record.minSalary}-{record.maxSalary}
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '单位名称',
|
||||
@@ -78,18 +124,17 @@ function ManagementList() {
|
||||
align: 'center',
|
||||
valueEnum: educationEnum,
|
||||
render: (_, record) => {
|
||||
return (<DictTag enums={educationEnum} value={record.education} />);
|
||||
return <DictTag enums={educationEnum} value={record.education} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '经验要求',
|
||||
dataIndex: 'experience',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: experienceEnum,
|
||||
render: (_, record) => {
|
||||
return (<DictTag enums={experienceEnum} value={record.experience} />);
|
||||
return <DictTag enums={experienceEnum} value={record.experience} />;
|
||||
},
|
||||
},
|
||||
// {
|
||||
@@ -103,11 +148,14 @@ function ManagementList() {
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '发布时间',
|
||||
dataIndex: 'postingDate',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
title: '是否发布',
|
||||
dataIndex: 'isPublish',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: isPublishEnum,
|
||||
render: (text, record) => (
|
||||
<Switch checked={record.isPublish === 1} onChange={changeRelease.bind(null, record)} />
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '招聘人数',
|
||||
@@ -134,7 +182,17 @@ function ManagementList() {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined/>}
|
||||
icon={<BarChartOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => history.push(`/management/see-matching/index/${record.jobId}`)}
|
||||
>
|
||||
查看申请人
|
||||
</Button>,
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
@@ -148,7 +206,7 @@ function ManagementList() {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon ={<DeleteOutlined/>}
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
@@ -168,10 +226,10 @@ function ManagementList() {
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
]
|
||||
}
|
||||
]
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
@@ -185,7 +243,7 @@ function ManagementList() {
|
||||
columns={columns}
|
||||
request={(params) =>
|
||||
getCmsJobList({ ...params } as API.ManagementList.ListParams).then((res) => {
|
||||
console.log(params)
|
||||
console.log(params);
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
@@ -206,21 +264,54 @@ function ManagementList() {
|
||||
>
|
||||
<PlusOutlined /> 新建
|
||||
</Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
key="export"
|
||||
hidden={!access.hasPerms('system:user:export')}
|
||||
onClick={async () => {
|
||||
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||
handleExport(searchVal as API.ManagementList.ListParams);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined />
|
||||
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<EditManageRow
|
||||
open={modalVisible}
|
||||
onSubmit={(values) => {
|
||||
console.log(values)
|
||||
return Promise.resolve()
|
||||
onSubmit={async (values) => {
|
||||
let resData;
|
||||
if (values.jobId) {
|
||||
resData = await updateCmsJobList(values);
|
||||
} else {
|
||||
resData = await addCmsJobList(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if (values.jobId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
}}
|
||||
values={currentRow}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
educationEnum={educationEnum}
|
||||
experienceEnum={experienceEnum}
|
||||
areaEnum={areaEnum}
|
||||
></EditManageRow>
|
||||
</Fragment>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default ManagementList
|
||||
|
||||
export default ManagementList;
|
||||
|
||||
177
src/pages/Mobileusers/List/index.tsx
Normal file
177
src/pages/Mobileusers/List/index.tsx
Normal file
@@ -0,0 +1,177 @@
|
||||
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, useAccess } from '@umijs/max';
|
||||
import { Button, FormInstance, message } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
import { exportCmsAppUserExport, getCmsAppUserList } from '@/services/mobileusers/list';
|
||||
|
||||
const handleExport = async (values: API.MobileUser.ListParams) => {
|
||||
const hide = message.loading('正在导出');
|
||||
try {
|
||||
await exportCmsAppUserExport(values);
|
||||
hide();
|
||||
message.success('导出成功');
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('导出失败,请重试');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function ManagementList() {
|
||||
const access = useAccess();
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [educationEnum, setEducationEnum] = useState<any>([]);
|
||||
const [experienceEnum, setExperienceEnum] = useState<any>([]);
|
||||
const [areaEnum, setAreaEnum] = useState<any>([]);
|
||||
const [sexEnum, setSexEnum] = useState<any>([]);
|
||||
const [hotEnum, setHotEnum] = useState<any>([]);
|
||||
const [politicalEnum, setPoliticalEnum] = useState<any>([]);
|
||||
const [currentRow, setCurrentRow] = useState<API.MobileUser.ListRow>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
|
||||
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('sys_user_sex', true).then((data) => {
|
||||
setSexEnum(data);
|
||||
});
|
||||
getDictValueEnum('political_affiliation', true, true).then((data) => {
|
||||
setPoliticalEnum(data);
|
||||
});
|
||||
// getDictValueEnum('job_hot',true).then((data) => {
|
||||
// setHotEnum(data)
|
||||
// })
|
||||
}, []);
|
||||
|
||||
const columns: ProColumns<API.MobileUser.ListRow>[] = [
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'name',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '期望薪资',
|
||||
dataIndex: 'minSalary',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<>
|
||||
{record.salaryMin}-{record.salaryMax}
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '出生日期',
|
||||
dataIndex: 'birthDate',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '学历要求',
|
||||
dataIndex: 'education',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: educationEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={educationEnum} value={record.education} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '区域',
|
||||
dataIndex: 'area',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: areaEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={areaEnum} value={record.area} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'sex',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: sexEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={sexEnum} value={record.sex} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '政治面貌',
|
||||
dataIndex: 'politicalAffiliation',
|
||||
valueType: 'select',
|
||||
align: 'center',
|
||||
valueEnum: politicalEnum,
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={politicalEnum} value={record.politicalAffiliation} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
dataIndex: 'jobId',
|
||||
width: 200,
|
||||
render: (jobId, record) => [],
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.MobileUser.ListRow>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
rowKey="jobId"
|
||||
key="index"
|
||||
columns={columns}
|
||||
request={(params) =>
|
||||
getCmsAppUserList({ ...params } as API.MobileUser.ListParams).then((res) => {
|
||||
console.log(params);
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
})
|
||||
}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
key="export"
|
||||
hidden={!access.hasPerms('system:user:export')}
|
||||
onClick={async () => {
|
||||
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
|
||||
handleExport(searchVal as API.MobileUser.ListParams);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined />
|
||||
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default ManagementList;
|
||||
@@ -1,13 +1,24 @@
|
||||
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import { useIntl, FormattedMessage, useAccess, history, useParams } from '@umijs/max';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, history, useAccess, useIntl, useParams } from '@umijs/max';
|
||||
import type { FormInstance } from 'antd';
|
||||
import { Button, message, Modal } from 'antd';
|
||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import { getDictDataList, removeDictData, addDictData, updateDictData, exportDictData } from '@/services/system/dictdata';
|
||||
import {
|
||||
ActionType,
|
||||
FooterToolbar,
|
||||
PageContainer,
|
||||
ProColumns,
|
||||
ProTable,
|
||||
} from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
addDictData,
|
||||
exportDictData,
|
||||
getDictDataList,
|
||||
removeDictData,
|
||||
updateDictData,
|
||||
} from '@/services/system/dictdata';
|
||||
import UpdateForm from './edit';
|
||||
import { getDictValueEnum, getDictType, getDictTypeOptionSelect } from '@/services/system/dict';
|
||||
import { getDictType, getDictTypeOptionSelect, getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
|
||||
/**
|
||||
@@ -123,9 +134,7 @@ export type DictTypeArgs = {
|
||||
id: string;
|
||||
};
|
||||
|
||||
|
||||
const DictDataTableList: React.FC = () => {
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
|
||||
const [dictId, setDictId] = useState<string>('');
|
||||
@@ -221,7 +230,7 @@ const DictDataTableList: React.FC = () => {
|
||||
valueType: 'select',
|
||||
valueEnum: statusOptions,
|
||||
render: (_, record) => {
|
||||
return (<DictTag enums={statusOptions} value={record.status} />);
|
||||
return <DictTag enums={statusOptions} value={record.status} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -235,7 +244,7 @@ const DictDataTableList: React.FC = () => {
|
||||
dataIndex: 'createTime',
|
||||
valueType: 'dateRange',
|
||||
render: (_, record) => {
|
||||
return (<span>{record.createTime.toString()} </span>);
|
||||
return <span>{record.createTime.toString()} </span>;
|
||||
},
|
||||
search: {
|
||||
transform: (value) => {
|
||||
@@ -314,7 +323,11 @@ const DictDataTableList: React.FC = () => {
|
||||
key="add"
|
||||
hidden={!access.hasPerms('system:data:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow({ dictType: dictType, isDefault: 'N', status: '0' } as API.System.DictData);
|
||||
setCurrentRow({
|
||||
dictType: dictType,
|
||||
isDefault: 'N',
|
||||
status: '0',
|
||||
} as API.System.DictData);
|
||||
setModalVisible(true);
|
||||
}}
|
||||
>
|
||||
@@ -337,7 +350,7 @@ const DictDataTableList: React.FC = () => {
|
||||
actionRef.current?.reloadAndRest?.();
|
||||
}
|
||||
},
|
||||
onCancel() { },
|
||||
onCancel() {},
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -357,14 +370,16 @@ const DictDataTableList: React.FC = () => {
|
||||
</Button>,
|
||||
]}
|
||||
request={(params) =>
|
||||
getDictDataList({ ...params, dictType } as API.System.DictDataListParams).then((res) => {
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
})
|
||||
getDictDataList({ ...params, dictType } as API.System.DictDataListParams).then(
|
||||
(res) => {
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
};
|
||||
return result;
|
||||
},
|
||||
)
|
||||
}
|
||||
columns={columns}
|
||||
rowSelection={{
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { FormattedMessage, useAccess, useIntl } from '@umijs/max';
|
||||
import { Button, message, Modal } from 'antd';
|
||||
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import { getMenuList, removeMenu, addMenu, updateMenu } from '@/services/system/menu';
|
||||
import {
|
||||
ActionType,
|
||||
FooterToolbar,
|
||||
PageContainer,
|
||||
ProColumns,
|
||||
ProTable,
|
||||
} from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { addMenu, getMenuList, removeMenu, updateMenu } from '@/services/system/menu';
|
||||
import UpdateForm from './edit';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import { buildTreeData } from '@/utils/tree';
|
||||
@@ -85,9 +90,7 @@ const handleRemoveOne = async (selectedRow: API.System.Menu) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const MenuTableList: React.FC = () => {
|
||||
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
|
||||
const actionRef = useRef<ActionType>();
|
||||
@@ -148,7 +151,7 @@ const MenuTableList: React.FC = () => {
|
||||
valueType: 'select',
|
||||
valueEnum: statusOptions,
|
||||
render: (_, record) => {
|
||||
return (<DictTag enums={statusOptions} value={record.status} />);
|
||||
return <DictTag enums={statusOptions} value={record.status} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -259,7 +262,7 @@ const MenuTableList: React.FC = () => {
|
||||
setMenuTree(treeData);
|
||||
return {
|
||||
data: memuData,
|
||||
total: res.data.length,
|
||||
total: memuData.length,
|
||||
success: true,
|
||||
};
|
||||
})
|
||||
|
||||
@@ -16,14 +16,14 @@ import {
|
||||
ProFormText,
|
||||
} from '@ant-design/pro-components';
|
||||
import { useEmotionCss } from '@ant-design/use-emotion-css';
|
||||
import { FormattedMessage, history, SelectLang, useIntl, useModel, Helmet } from '@umijs/max';
|
||||
import { Alert, Col, message, Row, Tabs, Image } from 'antd';
|
||||
import { FormattedMessage, Helmet, history, SelectLang, useIntl, useModel } from '@umijs/max';
|
||||
import { Alert, Col, Image, message, Row, Tabs } from 'antd';
|
||||
import Settings from '../../../../config/defaultSettings';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { flushSync } from 'react-dom';
|
||||
// flushSync 允许你强制 React 同步刷新提供的回调中的任何更新。这确保了 DOM 立即更新
|
||||
import { clearSessionToken, setSessionToken } from '@/access';
|
||||
import {getRoutersInfo, setRemoteMenu} from "@/services/session";
|
||||
import logoImg from '@/assets/logo.svg'
|
||||
import logoImg from '@/assets/logo.svg';
|
||||
|
||||
const ActionIcons = () => {
|
||||
const langClassName = useEmotionCss(({ token }) => {
|
||||
@@ -87,7 +87,7 @@ const LoginMessage: React.FC<{
|
||||
};
|
||||
|
||||
const Login: React.FC = () => {
|
||||
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({code: 200});
|
||||
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({ code: 200 });
|
||||
const [type, setType] = useState<string>('account');
|
||||
const { initialState, setInitialState } = useModel('@@initialState');
|
||||
const [captchaCode, setCaptchaCode] = useState<string>('');
|
||||
@@ -143,7 +143,7 @@ const Login: React.FC = () => {
|
||||
console.log('login ok');
|
||||
const urlParams = new URL(window.location.href).searchParams;
|
||||
history.push(urlParams.get('redirect') || '/');
|
||||
setTimeout(() => history.go(0), 0)
|
||||
setTimeout(() => history.go(0), 0);
|
||||
return;
|
||||
} else {
|
||||
message.error(response.msg);
|
||||
|
||||
Reference in New Issue
Block a user