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

This commit is contained in:
Apcallover
2025-10-29 17:34:55 +08:00
parent d2cfb609d7
commit de7cf14248
19 changed files with 943 additions and 628 deletions

View File

@@ -55,6 +55,11 @@ export default [
path: '/area/updata-router/index/:id', path: '/area/updata-router/index/:id',
component: './Area/Subway/UpLine', component: './Area/Subway/UpLine',
}, },
{
name: '字典数据',
path: '/area/updata-router/business/:id',
component: './Area/Business/UpLine',
},
], ],
}, },
{ {
@@ -116,5 +121,4 @@ export default [
}, },
], ],
}, },
]; ];

View File

@@ -0,0 +1,172 @@
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>;
open: boolean;
values?: Partial<API.AreaSubWay.LinePoint>;
jobGroupOptions?: DictOptionType[];
statusOptions?: DictValueEnumObj;
};
const waitTime = (time: number = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
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(props.values);
setViewInfo(props.values);
}
}, [form, props]);
const handleCancel = () => {
props.onCancel();
form.resetFields();
};
const handleFinish = async (values: Record<string, any>) => {
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}
// layout="inline"
autoFocusFirstInput
open={props.open}
modalProps={{
destroyOnClose: true,
onCancel: () => handleCancel(),
}}
initialValues={{
sort: 0,
}}
submitTimeout={2000}
onFinish={handleFinish}
>
<ProFormDigit
name="commercialAreaId"
label={'字典主键'}
placeholder="请输入字典主键"
disabled
hidden={true}
/>
<ProForm.Group>
<ProFormText
width="md"
name="commercialAreaName"
label="商业区名称"
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: '请输入纬度!',
},
]}
/>
<ProFormDigit
label="经度"
placeholder="请输入经度"
name="longitude"
width="md"
min={-180}
hidden={true}
max={180}
fieldProps={{ controls: false }}
rules={[
{
required: true,
message: '请输入经度!',
},
]}
/>
</ProForm.Group>
<ProFromMap open={open} onSelect={select} onCancel={cancel}></ProFromMap>
</ModalForm>
);
};
export default SubWayEdit;

View File

@@ -0,0 +1,178 @@
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 UpStationEdit from '@/pages/Area/Business/UpLine/edit';
import { addCmsAreaListRow, deleteCmsAreaListRow, getCmsAreaList } from '@/services/area/business';
const handleRemoveOne = async (selectedRow: API.AreaSubWay.LinePoint) => {
const hide = message.loading('正在删除');
if (!selectedRow) return true;
try {
const resp = await deleteCmsAreaListRow(selectedRow.commercialAreaId);
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 [regionalId, setRegionalId] = 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);
}
}, [regionalId, params]);
const getStationInfo = useCallback(async () => {
// const resData = await getCmsLineSubWay()
}, []);
const columns: ProColumns<API.AreaSubWay.LinePoint>[] = [
{
title: '商业区名称',
dataIndex: 'commercialAreaName',
align: 'center',
valueType: 'text',
},
{
title: '商业区地址',
dataIndex: 'address',
hideInSearch: true,
align: 'center',
valueType: 'text',
},
{
title: '操作',
hideInSearch: true,
align: 'center',
width: 300,
render: (_, 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(record);
if (success) {
if (actionRef.current) {
actionRef.current.reload();
}
}
},
});
}}
>
</Button>,
],
},
];
return (
<Fragment>
<div style={{ width: '100%', float: 'right' }}>
<ProTable<API.AreaPlatForm.Line>
// params 是需要自带的参数
// 这个参数优先级更高,会覆盖查询表单的参数
actionRef={actionRef}
formRef={formTableRef}
columns={columns}
headerTitle="信息"
rowKey="stationId"
key="stationId"
request={(params) => {
return getCmsAreaList({
regionalId,
...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
type="primary"
key="add"
hidden={!access.hasPerms('manage:List:add')}
onClick={async () => {
setCurrentRow(undefined);
setModalVisible(true);
}}
>
<PlusOutlined />
</Button>,
]}
/>
</div>
<UpStationEdit
open={modalVisible}
onCancel={() => {
setModalVisible(false);
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();
}
}
}}
values={currentRow}
></UpStationEdit>
</Fragment>
);
}
export default ManagementList;

View File

@@ -1,14 +1,13 @@
import { ModalForm, ProForm, ProFormDigit, ProFormText } from '@ant-design/pro-components'; import { ModalForm, ProForm, ProFormDigit, ProFormText } from '@ant-design/pro-components';
import React, { useEffect, useState } from 'react'; import { Form } from 'antd';
import { Button, Form } from 'antd';
import { DictOptionType, DictValueEnumObj } from '@/components/DictTag'; import { DictOptionType, DictValueEnumObj } from '@/components/DictTag';
import ProFromMap from '@/components/ProFromMap'; import { useEffect } from 'react';
export type ListFormProps = { export type ListFormProps = {
onCancel: (flag?: boolean, formVals?: unknown) => void; onCancel: (flag?: boolean, formVals?: unknown) => void;
onSubmit: (values: API.AreaBusiness.CircleEditParams) => Promise<void>; onSubmit: (values: API.AreaSubWay.Line) => Promise<void>;
open: boolean; open: boolean;
values?: Partial<API.AreaBusiness.CircleEditParams>; values?: Partial<API.AreaSubWay.Line>;
jobGroupOptions?: DictOptionType[]; jobGroupOptions?: DictOptionType[];
statusOptions?: DictValueEnumObj; statusOptions?: DictValueEnumObj;
}; };
@@ -24,57 +23,31 @@ const waitTime = (time: number = 100) => {
const SubWayEdit: React.FC<ListFormProps> = (props) => { const SubWayEdit: React.FC<ListFormProps> = (props) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [open, setOpen] = useState<boolean>(false);
const [viewInfo, setViewInfo] = useState<any>({});
useEffect(() => { useEffect(() => {
form.resetFields(); form.resetFields();
if (props.values) { if (props.values) {
const obj = { form.setFieldsValue({
commercialAreaId: props.values.commercialAreaId, regionalId: props.values.regionalId,
commercialAreaName: props.values.commercialAreaName, regionalName: props.values.regionalName,
latitude: props.values.latitude, });
longitude: props.values.longitude,
address: props.values.address,
};
form.setFieldsValue(obj);
setViewInfo(obj);
} else {
setViewInfo({});
} }
}, [form, props]); }, [form, props]);
const handleCancel = () => { const handleCancel = () => {
props.onCancel(); props.onCancel();
form.resetFields(); form.resetFields();
}; };
const handleFinish = async (values: Record<string, any>) => { const handleFinish = async (values: Record<string, any>) => {
props.onSubmit(values as API.AreaBusiness.CircleEditParams); props.onSubmit(values as API.AreaSubWay.Line);
};
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 ( return (
<ModalForm<API.AreaBusiness.CircleParams> <ModalForm<{
title={`${props.values ? '编辑' : '新增'}商圈`} name: string;
company: string;
}>
title={`${props.values ? '编辑' : '新增'}线路`}
form={form} form={form}
// layout="inline" // layout="inline"
autoFocusFirstInput autoFocusFirstInput
@@ -87,85 +60,15 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
onFinish={handleFinish} onFinish={handleFinish}
> >
<ProFormDigit <ProFormDigit
name="commercialAreaId" name="regionalId"
label={'字典主键'} label={'字典主键'}
placeholder="请输入字典主键" placeholder="请输入字典主键"
disabled disabled
hidden={true} hidden={true}
/> />
<ProForm.Group> <ProForm.Group>
<ProFormText <ProFormText width="xl" name="regionalName" label="区域名称:" placeholder="请输入名称" />
width="md"
name="commercialAreaName"
label="商圈名称"
placeholder="请输入名称"
rules={[
{
required: true,
message: '请输入商圈名称!',
},
]}
/>
</ProForm.Group> </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"
min={-90}
max={90}
hidden={true}
fieldProps={{ controls: false }}
rules={[
{
required: true,
message: '请输入纬度!',
},
]}
/>
<ProFormDigit
label="经度"
placeholder="请输入经度"
name="longitude"
width="md"
min={-180}
hidden={true}
max={180}
fieldProps={{ controls: false }}
rules={[
{
required: true,
message: '请输入经度!',
},
]}
/>
</ProForm.Group>
<ProFromMap open={open} onSelect={select} onCancel={cancel}></ProFromMap>
</ModalForm> </ModalForm>
); );
}; };

View File

@@ -1,23 +1,27 @@
import React, {Fragment, useRef, useState} from "react"; import React, { Fragment, useRef, useState } from 'react';
import { FormattedMessage, useAccess } from '@umijs/max'; import { history, useAccess } from '@umijs/max';
import { FormInstance, Button, message, Modal } from 'antd'; import { Button, FormInstance, message, Modal } from 'antd';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { PlusOutlined, DeleteOutlined, FormOutlined, AlignLeftOutlined } from '@ant-design/icons'; import { DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
import { import {
getCmsAreaList, addCmsLineSubWay,
addCmsAreaListRow, deleteCmsLineSubWay,
updateCmsAreaListRow, getCmsLineList,
deleteCmsAreaListRow, putCmsLineSubWay,
exportCmsAreaListRow } from '@/services/area/subway';
} from "@/services/area/business"; import SubWayEdit from '@/pages/Area/Business/edit';
import BusinessEdit from "@/pages/Area/Business/edit"; import {
addCmsSaveRegionalData,
deleteCmsRegionalData,
getCmsRegionalList,
updateRegionalData,
} from '@/services/area/business';
const handleRemoveOne = async (selectedRow: API.AreaRegional.RegionalRows) => {
const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
const hide = message.loading('正在删除'); const hide = message.loading('正在删除');
if (!selectedRow) return true; if (!selectedRow) return true;
try { try {
const resp = await deleteCmsAreaListRow(selectedRow.commercialAreaId); const resp = await deleteCmsRegionalData(selectedRow.regionalId);
hide(); hide();
if (resp.code === 200) { if (resp.code === 200) {
message.success('删除成功,即将刷新'); message.success('删除成功,即将刷新');
@@ -32,60 +36,42 @@ const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
} }
}; };
const handleExport = async (values: API.AreaBusiness.CircleEditParams) => {
const hide = message.loading('正在导出');
try {
await exportCmsAreaListRow(values);
hide();
message.success('导出成功');
return true;
} catch (error) {
hide();
message.error('导出失败,请重试');
return false;
}
};
function ManagementList() { function ManagementList() {
const access = useAccess(); const access = useAccess();
const formTableRef = useRef<FormInstance>(); const formTableRef = useRef<FormInstance>();
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState<API.AreaBusiness.Circle>() const [currentRow, setCurrentRow] = useState<API.AreaSubWay.Line>();
const [modalVisible, setModalVisible] = useState<boolean>(false) const [modalVisible, setModalVisible] = useState<boolean>(false);
const columns: ProColumns<API.AreaBusiness.Circle>[] = [ const columns: ProColumns<API.AreaRegional.RegionalRows>[] = [
{ {
title: '商圈名称', title: '区域名称',
dataIndex: 'commercialAreaName', dataIndex: 'regionalName',
valueType: 'text',
align: 'center', align: 'center',
hideInSearch: true, valueType: 'text',
render: (dom, record) => (
<Button
type="link"
onClick={() => history.push(`/area/updata-router/business/${record.regionalId}`)}
block
>
{dom}
</Button>
),
}, },
{ {
title: '操作', title: '操作',
hideInSearch: true,
align: 'center', align: 'center',
width: 300, width: 300,
hideInSearch: true,
render: (_, record) => [ render: (_, record) => [
<Button
type="link"
size="small"
key="detail"
icon={<AlignLeftOutlined />}
hidden={!access.hasPerms('area:business:List.detail')}
onClick={() => {
setModalVisible(true);
setCurrentRow(record);
}}
>
</Button>,
<Button <Button
type="link" type="link"
size="small" size="small"
key="edit" key="edit"
icon = {<FormOutlined />} icon={<FormOutlined />}
hidden={!access.hasPerms('area:business:List.update')} hidden={!access.hasPerms('area:business:List.update')}
onClick={() => { onClick={() => {
setModalVisible(true); setModalVisible(true);
@@ -99,8 +85,8 @@ function ManagementList() {
size="small" size="small"
danger danger
key="batchRemove" key="batchRemove"
icon ={<DeleteOutlined/>} icon=<DeleteOutlined />
hidden={!access.hasPerms('area:business:List')} hidden={!access.hasPerms('area:subway:List')}
onClick={async () => { onClick={async () => {
Modal.confirm({ Modal.confirm({
title: '删除', title: '删除',
@@ -119,30 +105,33 @@ function ManagementList() {
}} }}
> >
</Button> </Button>,
] ],
} },
] ];
return ( return (
<Fragment> <Fragment>
<div style={{ width: '100%', float: 'right' }}> <div style={{ width: '100%', float: 'right' }}>
<ProTable<API.AreaBusiness.Circle> <ProTable<API.AreaSubWay.Line>
// params 是需要自带的参数 // params 是需要自带的参数
// 这个参数优先级更高,会覆盖查询表单的参数 // 这个参数优先级更高,会覆盖查询表单的参数
actionRef={actionRef} actionRef={actionRef}
formRef={formTableRef} formRef={formTableRef}
columns={columns} columns={columns}
rowKey={"commercialAreaName"} headerTitle="信息"
key={"index"} rowKey="regionalId"
request={(params) => key="lineIdList"
getCmsAreaList({ ...params } as API.AreaBusiness.CircleParams).then((res) => { request={(params) => {
return { return getCmsRegionalList(params as API.AreaRegional.RegionalParams).then((res) => {
console.log(params);
const result = {
data: res.rows, data: res.rows,
total: res.total, total: res.total,
success: true, success: true,
} };
}) return result;
} });
}}
toolBarRender={() => [ toolBarRender={() => [
<Button <Button
type="primary" type="primary"
@@ -155,50 +144,39 @@ function ManagementList() {
> >
<PlusOutlined /> <PlusOutlined />
</Button>, </Button>,
<Button
type="primary"
key="export"
hidden={!access.hasPerms('system:user:export')}
onClick={async () => {
const searchVal = formTableRef.current && formTableRef.current.getFieldsValue();
handleExport(searchVal);
}}
>
<PlusOutlined />
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
</Button>,
]} ]}
/> />
</div> </div>
<BusinessEdit <SubWayEdit
open={modalVisible} open={modalVisible}
onSubmit={async (values) => { onSubmit={async (values) => {
let resData let resData;
if(values.commercialAreaId) { if (values.regionalId) {
resData = await updateCmsAreaListRow(values) resData = await updateRegionalData(values);
} else { } else {
resData = await addCmsAreaListRow(values) resData = await addCmsSaveRegionalData(values);
} }
if (resData.code === 200) { if (resData.code === 200) {
setModalVisible(false); setModalVisible(false);
setCurrentRow(undefined); setCurrentRow(undefined);
if(values.commercialAreaId) { if (values.regionalId) {
message.success('修改成功') message.success('修改成功');
} else { } else {
message.success('新增成功') message.success('新增成功');
} }
if (actionRef.current) { if (actionRef.current) {
actionRef.current.reload(); actionRef.current.reload();
} }
} }
}} }}
values={currentRow}
onCancel={() => { onCancel={() => {
setModalVisible(false); setModalVisible(false);
setCurrentRow(undefined) setCurrentRow(undefined);
}} }}
></BusinessEdit> values={currentRow}
></SubWayEdit>
</Fragment> </Fragment>
) );
} }
export default ManagementList
export default ManagementList;

View File

@@ -1,20 +1,19 @@
import React, {Fragment, useRef, useState, useEffect} from "react"; import React, { Fragment, useEffect, useRef, useState } from 'react';
import { useIntl, FormattedMessage, useAccess, history } from '@umijs/max'; import { FormattedMessage, useAccess } from '@umijs/max';
import {delCmsJobIds, getCmsJobList} from "@/services/Management/list"; import { Button, FormInstance, message, Modal } from 'antd';
import { Dropdown, FormInstance, Space, Button, message, Modal } from 'antd'; import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components'; import { DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
import { PlusOutlined, DeleteOutlined, FormOutlined, DownOutlined, EditOutlined } from '@ant-design/icons'; import EditCompanyListRow from './edit';
import EditCompanyListRow from './edit'
import { import {
addCmsFairList, addCmsFairList,
delCmsFairList, delCmsFairList,
exportCmsFairList, exportCmsFairList,
getCmsFairId,
getCmsFairList, getCmsFairList,
putCmsFairList, putCmsFairList,
getCmsFairId, getCmstitilelist } from '@/services/jobfair/list';
} from "@/services/jobfair/list"; import { getDictValueEnum } from '@/services/system/dict';
import {getDictValueEnum} from "@/services/system/dict"; import DictTag from '@/components/DictTag';
import DictTag from "@/components/DictTag";
const handleRemoveOne = async (jobFairId: string) => { const handleRemoveOne = async (jobFairId: string) => {
const hide = message.loading('正在删除'); const hide = message.loading('正在删除');
@@ -55,20 +54,17 @@ function ManagementList() {
const formTableRef = useRef<FormInstance>(); const formTableRef = useRef<FormInstance>();
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState<API.JobFairList.JobFairListRows>() const [currentRow, setCurrentRow] = useState<API.JobFairList.JobFairListRows>();
const [modalVisible, setModalVisible] = useState<boolean>(false) const [modalVisible, setModalVisible] = useState<boolean>(false);
const [jobFairType, setJobFairTypeEnum] = useState<any>([]) const [jobFairType, setJobFairTypeEnum] = useState<any>([]);
useEffect(() => { useEffect(() => {
getDictValueEnum('job_fair_type', true).then((data) => { getDictValueEnum('job_fair_type', true).then((data) => {
setJobFairTypeEnum(data) setJobFairTypeEnum(data);
}); });
}, []); }, []);
const editSubmit = () => { const editSubmit = () => {};
}
const columns: ProColumns<API.JobFairList.JobFairListRows>[] = [ const columns: ProColumns<API.JobFairList.JobFairListRows>[] = [
{ {
@@ -84,7 +80,7 @@ function ManagementList() {
align: 'center', align: 'center',
valueEnum: jobFairType, valueEnum: jobFairType,
render: (_, record) => { render: (_, record) => {
return (<DictTag enums={jobFairType} value={record.jobFairType} />); return <DictTag enums={jobFairType} value={record.jobFairType} />;
}, },
}, },
{ {
@@ -105,10 +101,10 @@ function ManagementList() {
type="link" type="link"
size="small" size="small"
key="edit" key="edit"
icon={<FormOutlined/>} icon={<FormOutlined />}
hidden={!access.hasPerms('area:business:List.update')} hidden={!access.hasPerms('area:business:List.update')}
onClick={async () => { onClick={async () => {
let resData = await getCmsFairId(jobFairId as string) let resData = await getCmsFairId(jobFairId as string);
setModalVisible(true); setModalVisible(true);
setCurrentRow(resData.data); setCurrentRow(resData.data);
}} }}
@@ -120,7 +116,7 @@ function ManagementList() {
size="small" size="small"
danger danger
key="batchRemove" key="batchRemove"
icon ={<DeleteOutlined/>} icon={<DeleteOutlined />}
hidden={!access.hasPerms('area:subway:List')} hidden={!access.hasPerms('area:subway:List')}
onClick={async () => { onClick={async () => {
Modal.confirm({ Modal.confirm({
@@ -140,10 +136,10 @@ function ManagementList() {
}} }}
> >
</Button> </Button>,
] ],
} },
] ];
return ( return (
<Fragment> <Fragment>
<div style={{ width: '100%', float: 'right' }}> <div style={{ width: '100%', float: 'right' }}>
@@ -166,17 +162,17 @@ function ManagementList() {
}) })
} }
toolBarRender={() => [ toolBarRender={() => [
<Button // <Button
type="primary" // type="primary"
key="add" // key="add"
hidden={!access.hasPerms('manage:List:add')} // hidden={!access.hasPerms('manage:List:add')}
onClick={async () => { // onClick={async () => {
setCurrentRow(undefined); // setCurrentRow(undefined);
setModalVisible(true); // setModalVisible(true);
}} // }}
> // >
<PlusOutlined /> // <PlusOutlined /> 新建
</Button>, // </Button>,
<Button <Button
type="primary" type="primary"
key="export" key="export"
@@ -197,17 +193,17 @@ function ManagementList() {
onSubmit={async (values) => { onSubmit={async (values) => {
let resData; let resData;
if (values.jobFairId) { if (values.jobFairId) {
resData = await putCmsFairList(values) resData = await putCmsFairList(values);
} else { } else {
resData = await addCmsFairList(values) resData = await addCmsFairList(values);
} }
if (resData.code === 200) { if (resData.code === 200) {
setModalVisible(false); setModalVisible(false);
setCurrentRow(undefined); setCurrentRow(undefined);
if(values.jobFairId) { if (values.jobFairId) {
message.success('修改成功') message.success('修改成功');
} else { } else {
message.success('新增成功') message.success('新增成功');
} }
if (actionRef.current) { if (actionRef.current) {
actionRef.current.reload(); actionRef.current.reload();
@@ -222,6 +218,7 @@ function ManagementList() {
values={currentRow} values={currentRow}
></EditCompanyListRow> ></EditCompanyListRow>
</Fragment> </Fragment>
) );
} }
export default ManagementList
export default ManagementList;

View File

@@ -1,20 +1,20 @@
import React, { useState, useRef, useEffect, useMemo } from 'react'; import React, { useEffect, useMemo, useRef, useState } from 'react';
import { import {
addMobilelog, addMobilelog,
exportMobilelog, exportMobilelog,
getMobileLogList, getMobileLogList,
removeMobilelog, removeMobilelog,
updateMobilelog updateMobilelog,
} from "@/services/logs/mobilelog"; } from '@/services/logs/mobilelog';
import type { FormInstance } from 'antd'; import type { FormInstance } from 'antd';
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import { Button, message, Modal } from 'antd'; import { Button, message, Modal } from 'antd';
import DictTag from "@/components/DictTag"; import { ActionType, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
import {getDictValueEnum} from "@/services/system/dict"; import { FormattedMessage, useAccess } from '@umijs/max';
import { DeleteOutlined, ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons';
import DictTag from '@/components/DictTag';
import { getDictValueEnum } from '@/services/system/dict';
import UpdateForm from './detail'; import UpdateForm from './detail';
import {addOperlog, exportOperlog, removeOperlog, updateOperlog} from "@/services/logs/operlog";
/** /**
* 添加节点 * 添加节点
* *
@@ -102,14 +102,13 @@ const handleExport = async () => {
} }
}; };
const MobileLog: React.FC = () => {
const MobileLog: React.FC = () => {
// ref // ref
const formTableRef = useRef<FormInstance>(); const formTableRef = useRef<FormInstance>();
const access = useAccess(); const access = useAccess();
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
// status // status
const [params, useParams] = useState({}) const [params, useParams] = useState({});
const [modalVisible, setModalVisible] = useState<boolean>(false); const [modalVisible, setModalVisible] = useState<boolean>(false);
const [currentRow, setCurrentRow] = useState<API.Logs.Mobilelog>(); const [currentRow, setCurrentRow] = useState<API.Logs.Mobilelog>();
const [selectedRows, setSelectedRows] = useState<API.Logs.Mobilelog[]>([]); const [selectedRows, setSelectedRows] = useState<API.Logs.Mobilelog[]>([]);
@@ -131,200 +130,203 @@ const MobileLog: React.FC = () => {
}); });
}, []); }, []);
const columns: ProColumns<API.Logs.Mobilelog>[] = useMemo(
() => [
{
title: '日志主键',
dataIndex: 'operId',
valueType: 'text',
hideInSearch: true,
},
{
title: '操作模块',
dataIndex: 'title',
valueType: 'text',
},
{
title: '业务类型',
dataIndex: 'businessType',
valueType: 'select',
valueEnum: businessTypeOptions,
render: (_, record) => {
return <DictTag enums={businessTypeOptions} value={record.businessType} />;
},
},
{
title: '请求方式',
dataIndex: 'requestMethod',
valueType: 'text',
},
// {
// title: "操作类别",
// dataIndex: 'operatorType',
// valueType: 'select',
// valueEnum: operatorTypeOptions,
// render: (_, record) => {
// return (<DictTag enums={operatorTypeOptions} value={record.operatorType} />);
// },
// },
{
title: '操作人员',
dataIndex: 'operName',
valueType: 'text',
},
{
title: '主机地址',
dataIndex: 'operIp',
valueType: 'text',
},
{
title: '操作地点',
dataIndex: 'operLocation',
valueType: 'text',
},
{
title: '操作状态',
dataIndex: 'status',
valueType: 'select',
valueEnum: statusOptions,
render: (_, record) => {
return <DictTag key="status" enums={statusOptions} value={record.status} />;
},
},
{
title: '操作时间',
dataIndex: 'operTime',
valueType: 'dateTime',
},
{
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="操作" />,
dataIndex: 'option',
width: '120px',
valueType: 'option',
render: (_, record) => [
<Button
type="link"
size="small"
key="edit"
hidden={!access.hasPerms('logs:mobilelog:edit.tsx')}
onClick={() => {
setModalVisible(true);
setCurrentRow(record);
}}
>
</Button>,
],
},
],
[businessTypeOptions, operatorTypeOptions, statusOptions],
);
const columns: ProColumns<API.Logs.Mobilelog>[] = useMemo(() => [ return (
{ <>
title: '日志主键', <PageContainer>
dataIndex: 'operId', <div style={{ width: '100%', float: 'right' }}>
valueType: 'text', <ProTable
hideInSearch: true, // params 是需要自带的参数
}, // 这个参数优先级更高,会覆盖查询表单的参数
{ actionRef={actionRef}
title: "操作模块", formRef={formTableRef}
dataIndex: 'title', rowKey="operId"
valueType: 'text', columns={columns}
}, search={{
{ labelWidth: 120,
title: "业务类型", }}
dataIndex: 'businessType', rowSelection={{
valueType: 'select', onChange: (_, selectedRows) => {
valueEnum: businessTypeOptions, setSelectedRows(selectedRows);
render: (_, record) => { },
return (<DictTag enums={businessTypeOptions} value={record.businessType} />); }}
}, request={(params) =>
}, getMobileLogList({ ...params } as API.Logs.MobilelogListParams).then((res) => {
{ const result = {
title: "请求方式", data: res.rows,
dataIndex: 'requestMethod', total: res.total,
valueType: 'text', success: true,
}, };
{ return result;
title: "操作类别", })
dataIndex: 'operatorType', }
valueType: 'select', toolBarRender={() => [
valueEnum: operatorTypeOptions, // <Button
render: (_, record) => { // type="primary"
return (<DictTag enums={operatorTypeOptions} value={record.operatorType} />); // key="add"
}, // hidden={!access.hasPerms('logs:mobilelog:add')}
}, // onClick={async () => {
{ // setCurrentRow(undefined);
title: "操作人员", // setModalVisible(true);
dataIndex: 'operName', // }}
valueType: 'text', // >
}, // <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="新建" />
{ // </Button>,
title: "主机地址", <Button
dataIndex: 'operIp', type="primary"
valueType: 'text', key="remove"
}, danger
{ hidden={selectedRows?.length === 0 || !access.hasPerms('logs:mobilelog:remove')}
title: "操作地点", onClick={async () => {
dataIndex: 'operLocation', Modal.confirm({
valueType: 'text', title: '是否确认删除所选数据项?',
}, icon: <ExclamationCircleOutlined />,
{ content: '请谨慎操作',
title: "操作状态", async onOk() {
dataIndex: 'status', const success = await handleRemove(selectedRows);
valueType: 'select', if (success) {
valueEnum: statusOptions, setSelectedRows([]);
render: (_, record) => { actionRef.current?.reloadAndRest?.();
return (<DictTag key="status" enums={statusOptions} value={record.status} />); }
}, },
}, onCancel() {},
{ });
title: "操作时间", }}
dataIndex: 'operTime', >
valueType: 'dateTime', <DeleteOutlined />
}, <FormattedMessage id="pages.searchTable.delete" defaultMessage="删除" />
{ </Button>,
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="操作" />, <Button
dataIndex: 'option', type="primary"
width: '120px', key="export"
valueType: 'option', hidden={!access.hasPerms('logs:mobilelog:export')}
render: (_, record) => [ onClick={async () => {
<Button handleExport();
type="link" }}
size="small" >
key="edit" <PlusOutlined />
hidden={!access.hasPerms('logs:mobilelog:edit.tsx')} <FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
onClick={() => { </Button>,
setModalVisible(true); ]}
setCurrentRow(record); />
</div>
<UpdateForm
onSubmit={async (values) => {
let success = false;
if (values.operId) {
success = await handleUpdate({ ...values } as API.Logs.Mobilelog);
} else {
success = await handleAdd({ ...values } as API.Logs.Mobilelog);
}
if (success) {
setModalVisible(false);
setCurrentRow(undefined);
if (actionRef.current) {
actionRef.current.reload();
}
}
}} }}
> onCancel={() => {
</Button>,
],
},
], [businessTypeOptions, operatorTypeOptions, statusOptions])
return <>
<PageContainer>
<div style={{ width: '100%', float: 'right' }}>
<ProTable
// params 是需要自带的参数
// 这个参数优先级更高,会覆盖查询表单的参数
actionRef={actionRef}
formRef={formTableRef}
rowKey="operId"
columns={columns}
search={{
labelWidth: 120,
}}
rowSelection={{
onChange: (_, selectedRows) => {
setSelectedRows(selectedRows);
},
}}
request={(params) =>
getMobileLogList({ ...params } as API.Logs.MobilelogListParams).then((res) => {
const result = {
data: res.rows,
total: res.total,
success: true,
};
return result;
})
}
toolBarRender={() => [
// <Button
// type="primary"
// key="add"
// hidden={!access.hasPerms('logs:mobilelog:add')}
// onClick={async () => {
// setCurrentRow(undefined);
// setModalVisible(true);
// }}
// >
// <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="新建" />
// </Button>,
<Button
type="primary"
key="remove"
danger
hidden={selectedRows?.length === 0 || !access.hasPerms('logs:mobilelog:remove')}
onClick={async () => {
Modal.confirm({
title: '是否确认删除所选数据项?',
icon: <ExclamationCircleOutlined />,
content: '请谨慎操作',
async onOk() {
const success = await handleRemove(selectedRows);
if (success) {
setSelectedRows([]);
actionRef.current?.reloadAndRest?.();
}
},
onCancel() { },
});
}}
>
<DeleteOutlined />
<FormattedMessage id="pages.searchTable.delete" defaultMessage="删除" />
</Button>,
<Button
type="primary"
key="export"
hidden={!access.hasPerms('logs:mobilelog:export')}
onClick={async () => {
handleExport();
}}
>
<PlusOutlined />
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
</Button>,
]}
/>
</div>
<UpdateForm
onSubmit={async (values) => {
let success = false;
if (values.operId) {
success = await handleUpdate({ ...values } as API.Logs.Mobilelog);
} else {
success = await handleAdd({ ...values } as API.Logs.Mobilelog);
}
if (success) {
setModalVisible(false); setModalVisible(false);
setCurrentRow(undefined); setCurrentRow(undefined);
if (actionRef.current) { }}
actionRef.current.reload(); open={modalVisible}
} values={currentRow || {}}
} businessTypeOptions={businessTypeOptions}
}} operatorTypeOptions={operatorTypeOptions}
onCancel={() => { statusOptions={statusOptions}
setModalVisible(false); />
setCurrentRow(undefined); </PageContainer>
}} </>
open={modalVisible} );
values={currentRow || {}}
businessTypeOptions={businessTypeOptions}
operatorTypeOptions={operatorTypeOptions}
statusOptions={statusOptions}
/>
</PageContainer>
</>
}; };
export default MobileLog export default MobileLog;

View File

@@ -222,13 +222,13 @@ const Login: React.FC = () => {
defaultMessage: '账户密码登录', defaultMessage: '账户密码登录',
}), }),
}, },
{ // {
key: 'mobile', // key: 'mobile',
label: intl.formatMessage({ // label: intl.formatMessage({
id: 'pages.login.phoneLogin.tab', // id: 'pages.login.phoneLogin.tab',
defaultMessage: '手机号登录', // defaultMessage: '手机号登录',
}), // }),
}, // },
]} ]}
/> />

View File

@@ -1,5 +1,6 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile'; import { downLoadXlsx } from '@/utils/downloadfile';
import { getDateTimeForFilename } from '@/utils/tools';
export async function getCmsJobList(params?: API.ManagementList.ListParams) { export async function getCmsJobList(params?: API.ManagementList.ListParams) {
return request<API.ManagementList.ManagePageResult>(`/api/cms/job/list`, { return request<API.ManagementList.ManagePageResult>(`/api/cms/job/list`, {
@@ -35,7 +36,11 @@ export async function delCmsJobIds(ids: string) {
} }
export async function exportCmsJob(params?: API.ManagementList.ListParams) { export async function exportCmsJob(params?: API.ManagementList.ListParams) {
return downLoadXlsx(`/api/cms/job/export`, { params }, `job_data_${new Date().getTime()}.xlsx`); return downLoadXlsx(
`/api/cms/job/export`,
{ params },
`岗位数据_${getDateTimeForFilename()}.xlsx`,
);
} }
export async function exportCmsJobCandidates(ids: string) { export async function exportCmsJobCandidates(ids: string) {

View File

@@ -1,22 +1,22 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile'; import { getDateTimeForFilename } from '@/utils/tools';
export async function getCmsAreaList(params?: API.AreaBusiness.CircleParams) { export async function getCmsAreaList(params?: API.BusinessParams.BusinessParams) {
return request<API.AreaBusiness.CirclePageResult>(`/api/cms/area/list`, { return request<API.AreaRegional.Regional>(`/api/cms/area/list`, {
method: 'GET', method: 'GET',
params: params, params: params,
}); });
} }
export async function addCmsAreaListRow(params?: API.AreaBusiness.CircleEditParams) { export async function addCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
return request<API.AreaBusiness.CirclePageResult>(`/api/cms/area`, { return request<API.BusinessParams.Business>(`/api/cms/area`, {
method: 'post', method: 'post',
data: params, data: params,
}); });
} }
export async function updateCmsAreaListRow(params?: API.AreaBusiness.CircleEditParams) { export async function updateCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
return request<API.AreaBusiness.CirclePageResult>(`/api/cms/area`, { return request<API.BusinessParams.Business>(`/api/cms/area`, {
method: 'put', method: 'put',
data: params, data: params,
}); });
@@ -28,6 +28,37 @@ export async function deleteCmsAreaListRow(ids: number) {
}); });
} }
export async function exportCmsAreaListRow(params?: API.AreaBusiness.CircleEditParams) { export async function exportCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
return downLoadXlsx(`/api/cms/area/export`, { params }, `dict_data_${new Date().getTime()}.xlsx`); return downLoadXlsx(`/api/cms/area/export`, { params }, `区域_${getDateTimeForFilename()}.xlsx`);
}
//区划
// 获取
export async function getCmsRegionalList(params?: API.AreaRegional.RegionalParams) {
return request<API.AreaRegional.Regional>(`/api/cms/regional/getList`, {
method: 'GET',
params: params,
});
}
// 更新
export async function updateRegionalData(params?: API.AreaRegional.RegionalParams) {
return request<API.AreaRegional.Regional>(`/api/cms/regional/updateRegionalData`, {
method: 'POST',
data: params,
});
}
export async function addCmsSaveRegionalData(params?: API.AreaRegional.RegionalParams) {
return request<API.AreaRegional.Regional>(`/api/cms/regional/saveRegionalData`, {
method: 'post',
data: params,
});
}
// 删除
export async function deleteCmsRegionalData(ids: number) {
return request<API.AreaRegional.Regional>(`/api/cms/regional/delRegionalData/${ids}`, {
method: 'POST',
});
} }

View File

@@ -1,5 +1,6 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile'; import { downLoadXlsx } from '@/utils/downloadfile';
import { getDateTimeForFilename } from '@/utils/tools';
export async function getCmsIndustryList(params?: API.ClassifyIndustry.Params) { export async function getCmsIndustryList(params?: API.ClassifyIndustry.Params) {
return request<API.ClassifyIndustry.IndustryResult>(`/api/cms/industry/list`, { return request<API.ClassifyIndustry.IndustryResult>(`/api/cms/industry/list`, {
@@ -38,6 +39,6 @@ export async function exportCmsIndustry(params?: API.ClassifyIndustry.Params) {
return downLoadXlsx( return downLoadXlsx(
`/api/cms/industry/export`, `/api/cms/industry/export`,
{ params }, { params },
`dict_data_${new Date().getTime()}.xlsx`, `分析_${getDateTimeForFilename()}.xlsx`,
); );
} }

View File

@@ -9,9 +9,5 @@ export async function getCmsJobTitleList(params?: API.ClassifyJobs.Params) {
} }
export async function exportCmsJobTitleList(params?: API.ClassifyJobs.Params) { export async function exportCmsJobTitleList(params?: API.ClassifyJobs.Params) {
return downLoadXlsx( return downLoadXlsx(`/api/cms/job/titile/export`, { params }, `dict_data_${f}.xlsx`);
`/api/cms/job/titile/export`,
{ params },
`dict_data_${new Date().getTime()}.xlsx`,
);
} }

View File

@@ -1,5 +1,6 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile'; import { downLoadXlsx } from '@/utils/downloadfile';
import { getDateTimeForFilename } from '@/utils/tools';
export async function getCmsCompanyList(params?: API.CompanyList.Params) { export async function getCmsCompanyList(params?: API.CompanyList.Params) {
return request<API.CompanyList.CompanyListResult>(`/api/cms/company/list`, { return request<API.CompanyList.CompanyListResult>(`/api/cms/company/list`, {
@@ -29,5 +30,9 @@ export async function putCmsCompanyList(params?: API.CompanyList.Params) {
} }
export async function exportCmsCompanyList(params?: API.CompanyList.Params) { export async function exportCmsCompanyList(params?: API.CompanyList.Params) {
return downLoadXlsx(`/cms/company/export`, { params }, `dict_data_${new Date().getTime()}.xlsx`); return downLoadXlsx(
`/cms/company/export`,
{ params },
`dict_data_${getDateTimeForFilename()}.xlsx`,
);
} }

View File

@@ -1,5 +1,6 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile'; import { downLoadXlsx } from '@/utils/downloadfile';
import { getDateTimeForFilename } from '@/utils/tools';
export async function getCmsFairList(params?: API.JobFairList.Params) { export async function getCmsFairList(params?: API.JobFairList.Params) {
return request<API.JobFairList.JobFairListResult>(`/api/cms/fair/list`, { return request<API.JobFairList.JobFairListResult>(`/api/cms/fair/list`, {
@@ -29,7 +30,11 @@ export async function delCmsFairList(ids?: string) {
} }
export async function exportCmsFairList(params?: API.JobFairList.Params) { export async function exportCmsFairList(params?: API.JobFairList.Params) {
return downLoadXlsx(`/api/cms/fair/export`, { params }, `dict_data_${new Date().getTime()}.xlsx`); return downLoadXlsx(
`/api/cms/fair/export`,
{ params },
`招聘会_${getDateTimeForFilename()}.xlsx`,
);
} }
export async function getCmsFairId(jobFairId?: string) { export async function getCmsFairId(jobFairId?: string) {

View File

@@ -1,5 +1,6 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile'; import { downLoadXlsx } from '@/utils/downloadfile';
import { getDateTimeForFilename } from '@/utils/tools';
// 查询字典数据列表 // 查询字典数据列表
export async function getDictDataList( export async function getDictDataList(
@@ -37,7 +38,10 @@ export async function addDictData(params: API.System.DictData, options?: { [key:
} }
// 修改字典数据 // 修改字典数据
export async function updateDictData(params: API.System.DictData, options?: { [key: string]: any }) { export async function updateDictData(
params: API.System.DictData,
options?: { [key: string]: any },
) {
return request<API.Result>('/api/system/dict/data', { return request<API.Result>('/api/system/dict/data', {
method: 'PUT', method: 'PUT',
headers: { headers: {
@@ -61,5 +65,9 @@ export function exportDictData(
params?: API.System.DictDataListParams, params?: API.System.DictDataListParams,
options?: { [key: string]: any }, options?: { [key: string]: any },
) { ) {
return downLoadXlsx(`/api/system/dict/data/export`, { params }, `dict_data_${new Date().getTime()}.xlsx`); return downLoadXlsx(
`/api/system/dict/data/export`,
{ params },
`枚举_${getDateTimeForFilename()}.xlsx`,
);
} }

View File

@@ -1,5 +1,6 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile'; import { downLoadXlsx } from '@/utils/downloadfile';
import { getDateTimeForFilename } from '@/utils/tools';
// 查询字典数据列表 // 查询字典数据列表
export async function getDictDataList( export async function getDictDataList(
@@ -67,6 +68,6 @@ export function exportDictData(
return downLoadXlsx( return downLoadXlsx(
`/api/cms/dict/data/export`, `/api/cms/dict/data/export`,
{ params }, { params },
`dict_data_${new Date().getTime()}.xlsx`, `枚举_${getDateTimeForFilename()}.xlsx`,
); );
} }

View File

@@ -1,39 +1,51 @@
declare namespace API.AreaBusiness { declare namespace API.AreaRegional {
export interface Circle { export interface Regional {
total: number;
rows: RegionalRows[];
code: number;
msg: string;
data?: any;
}
export interface RegionalRows {
createTime: string;
regionalId: number;
regionalName: string;
areaList?: any;
}
export interface RegionalParams {
regionalId?: number;
regionalName?: string;
areaList?: any;
}
export interface Business {
total: number;
rows: BusinessRows[];
code: number;
msg: string;
data?: any;
}
export interface BusinessRows {
createTime: string;
commercialAreaId: number; commercialAreaId: number;
commercialAreaName: string; commercialAreaName: string;
latitude: number; latitude: number;
longitude: number; longitude: number;
createTime: string; address: string;
regionalId?: any;
regionalName?: any;
} }
export interface LinePoint { export interface BusinessParams {
latitude: number;
longitude: numberl;
lineName: string;
stationId: number;
stationName: string;
}
export interface CircleParams {
createTime?: string;
updateTime?: string;
pageSize?: string;
current?: string;
}
export interface CircleEditParams {
commercialAreaName: string;
latitude: number;
longitude: number;
commercialAreaId?: number; commercialAreaId?: number;
commercialAreaName?: string;
latitude?: number;
longitude?: number;
address?: string; address?: string;
} regionalId?: any;
regionalName?: any;
export interface CirclePageResult {
code: number;
msg: string;
total: number;
rows: Array<Line>;
} }
} }

View File

@@ -18,3 +18,20 @@ export function debounce<T extends (...args: any[]) => any>(fn: T, delay = 300)
}, delay); }, delay);
}; };
} }
/**
* 获取当前年、月、日、时、分、秒,并格式化为适用于文件名的字符串。
* 格式为YYYYMMDD_HHmmss (例如20251029_172406)
* @returns {string} 格式化后的日期时间字符串。
*/
export function getDateTimeForFilename() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hour = String(now.getHours()).padStart(2, '0');
const minute = String(now.getMinutes()).padStart(2, '0');
const second = String(now.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hour}${minute}${second}`;
}