flat:商圈优化,导出文件优化2
This commit is contained in:
@@ -4,7 +4,13 @@ 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 UpStationEdit from '@/pages/Area/Business/UpLine/edit';
|
||||
import { addCmsAreaListRow, deleteCmsAreaListRow, getCmsAreaList } from '@/services/area/business';
|
||||
import {
|
||||
addCmsAreaListRow,
|
||||
deleteCmsAreaListRow,
|
||||
getCmsAreaList,
|
||||
updateCmsAreaListRow,
|
||||
} from '@/services/area/business';
|
||||
import { useLocation } from '@@/exports';
|
||||
|
||||
const handleRemoveOne = async (selectedRow: API.AreaSubWay.LinePoint) => {
|
||||
const hide = message.loading('正在删除');
|
||||
@@ -30,16 +36,23 @@ function ManagementList() {
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const location = useLocation();
|
||||
const params = useParams();
|
||||
|
||||
const searchParams = new URLSearchParams(location.search);
|
||||
const name = searchParams.get('name');
|
||||
const id = params.id || '0';
|
||||
|
||||
const [regionalId, setRegionalId] = useState<string>();
|
||||
const [regionalName, setRegionalName] = 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 (regionalId !== id) {
|
||||
setRegionalId(id);
|
||||
setRegionalName(name);
|
||||
}
|
||||
}, [regionalId, params]);
|
||||
|
||||
@@ -157,9 +170,8 @@ function ManagementList() {
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
onSubmit={async (values) => {
|
||||
// values.regionalId =
|
||||
// values.lineName =
|
||||
const resData = await addCmsAreaListRow(values);
|
||||
if (values.commercialAreaId) {
|
||||
const resData = await updateCmsAreaListRow(values);
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
@@ -168,6 +180,33 @@ function ManagementList() {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let params = {
|
||||
regionalName,
|
||||
regionalId,
|
||||
...values,
|
||||
};
|
||||
const resData = await addCmsAreaListRow(params);
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
message.success('添加成功');
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
// values.regionalId =
|
||||
// values.lineName =
|
||||
// const resData = await addCmsAreaListRow(values);
|
||||
// if (resData.code === 200) {
|
||||
// setModalVisible(false);
|
||||
// setCurrentRow(undefined);
|
||||
// message.success('添加成功');
|
||||
// if (actionRef.current) {
|
||||
// actionRef.current.reload();
|
||||
// }
|
||||
// }
|
||||
}}
|
||||
values={currentRow}
|
||||
></UpStationEdit>
|
||||
|
||||
@@ -54,7 +54,11 @@ function ManagementList() {
|
||||
render: (dom, record) => (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => history.push(`/area/updata-router/business/${record.regionalId}`)}
|
||||
onClick={() =>
|
||||
history.push(
|
||||
`/area/updata-router/business/${record.regionalId}?name=${record.regionalName}`,
|
||||
)
|
||||
}
|
||||
block
|
||||
>
|
||||
{dom}
|
||||
|
||||
@@ -10,7 +10,13 @@ import {
|
||||
} from '@/services/Management/list';
|
||||
import { Button, FormInstance, message, Modal, Switch } from 'antd';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { AlignLeftOutlined, BarChartOutlined, DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AlignLeftOutlined,
|
||||
BarChartOutlined,
|
||||
DeleteOutlined,
|
||||
FormOutlined,
|
||||
PlusOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import EditManageRow from './edit';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
@@ -100,16 +106,16 @@ function ManagementList() {
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '最大最小薪资',
|
||||
title: '最小薪资',
|
||||
dataIndex: 'minSalary',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '最大薪资',
|
||||
dataIndex: 'maxSalary',
|
||||
valueType: 'text',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
render: (_, record) => (
|
||||
<>
|
||||
{record.minSalary}-{record.maxSalary}
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '单位名称',
|
||||
@@ -244,7 +250,7 @@ function ManagementList() {
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</div>
|
||||
</div>,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
export async function getCmsAreaList(params?: API.BusinessParams.BusinessParams) {
|
||||
export async function getCmsAreaList(params?: API.AreaRegional.BusinessParams) {
|
||||
return request<API.AreaRegional.Regional>(`/api/cms/area/list`, {
|
||||
method: 'GET',
|
||||
params: params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function addCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
|
||||
return request<API.BusinessParams.Business>(`/api/cms/area`, {
|
||||
export async function addCmsAreaListRow(params?: API.AreaRegional.BusinessParams) {
|
||||
return request<API.AreaRegional.Business>(`/api/cms/area`, {
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
|
||||
return request<API.BusinessParams.Business>(`/api/cms/area`, {
|
||||
export async function updateCmsAreaListRow(params?: API.AreaRegional.BusinessParams) {
|
||||
return request<API.AreaRegional.Business>(`/api/cms/area`, {
|
||||
method: 'put',
|
||||
data: params,
|
||||
});
|
||||
@@ -28,7 +28,7 @@ export async function deleteCmsAreaListRow(ids: number) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function exportCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
|
||||
export async function exportCmsAreaListRow(params?: API.AreaRegional.BusinessParams) {
|
||||
return downLoadXlsx(`/api/cms/area/export`, { params }, `区域_${getDateTimeForFilename()}.xlsx`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user