flat:商圈优化,导出文件优化2

This commit is contained in:
Apcallover
2025-10-30 10:54:08 +08:00
parent de7cf14248
commit 203b7d4ef7
4 changed files with 140 additions and 91 deletions

View File

@@ -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,17 +170,43 @@ function ManagementList() {
setCurrentRow(undefined);
}}
onSubmit={async (values) => {
// 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();
if (values.commercialAreaId) {
const resData = await updateCmsAreaListRow(values);
if (resData.code === 200) {
setModalVisible(false);
setCurrentRow(undefined);
message.success('添加成功');
if (actionRef.current) {
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>

View File

@@ -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}

View File

@@ -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: '单位名称',
@@ -179,72 +185,72 @@ function ManagementList() {
width: 300,
render: (jobId, record) => [
<div key="first-row" style={{ marginBottom: 8, display: 'flex', justifyContent: 'center' }}>
<Button
type="link"
size="small"
key="view"
icon={<AlignLeftOutlined />}
hidden={!access.hasPerms('area:business:List.view')}
onClick={() => {
setCurrentRow(record);
setModalVisible(true);
setMode('view'); // 新增状态控制模式
}}
>
</Button>
<Button
type="link"
size="small"
key="edit"
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="view"
icon={<AlignLeftOutlined />}
hidden={!access.hasPerms('area:business:List.view')}
onClick={() => {
setCurrentRow(record);
setModalVisible(true);
setMode('view'); // 新增状态控制模式
}}
>
</Button>
<Button
type="link"
size="small"
key="edit"
icon={<BarChartOutlined />}
hidden={!access.hasPerms('area:business:List.update')}
onClick={() => history.push(`/management/see-matching/index/${record.jobId}`)}
>
</Button>
</div>,
<div key="second-row" style={{ display: 'flex', justifyContent: 'space-evenly'}}>
<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(jobId as string);
if (success) {
if (actionRef.current) {
actionRef.current.reload();
<div key="second-row" style={{ display: 'flex', justifyContent: 'space-evenly' }}>
<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(jobId as string);
if (success) {
if (actionRef.current) {
actionRef.current.reload();
}
}
}
},
});
}}
>
</Button>
</div>
},
});
}}
>
</Button>
</div>,
],
},
];