flat:商圈优化,导出文件优化
This commit is contained in:
@@ -55,6 +55,11 @@ export default [
|
||||
path: '/area/updata-router/index/:id',
|
||||
component: './Area/Subway/UpLine',
|
||||
},
|
||||
{
|
||||
name: '字典数据',
|
||||
path: '/area/updata-router/business/:id',
|
||||
component: './Area/Business/UpLine',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -116,5 +121,4 @@ export default [
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
172
src/pages/Area/Business/UpLine/edit.tsx
Normal file
172
src/pages/Area/Business/UpLine/edit.tsx
Normal 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;
|
||||
178
src/pages/Area/Business/UpLine/index.tsx
Normal file
178
src/pages/Area/Business/UpLine/index.tsx
Normal 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;
|
||||
@@ -1,14 +1,13 @@
|
||||
import { ModalForm, ProForm, ProFormDigit, ProFormText } from '@ant-design/pro-components';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Button, Form } from 'antd';
|
||||
import { Form } from 'antd';
|
||||
import { DictOptionType, DictValueEnumObj } from '@/components/DictTag';
|
||||
import ProFromMap from '@/components/ProFromMap';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export type ListFormProps = {
|
||||
onCancel: (flag?: boolean, formVals?: unknown) => void;
|
||||
onSubmit: (values: API.AreaBusiness.CircleEditParams) => Promise<void>;
|
||||
onSubmit: (values: API.AreaSubWay.Line) => Promise<void>;
|
||||
open: boolean;
|
||||
values?: Partial<API.AreaBusiness.CircleEditParams>;
|
||||
values?: Partial<API.AreaSubWay.Line>;
|
||||
jobGroupOptions?: DictOptionType[];
|
||||
statusOptions?: DictValueEnumObj;
|
||||
};
|
||||
@@ -24,57 +23,31 @@ 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) {
|
||||
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.setFieldsValue({
|
||||
regionalId: props.values.regionalId,
|
||||
regionalName: props.values.regionalName,
|
||||
});
|
||||
}
|
||||
}, [form, props]);
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
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);
|
||||
props.onSubmit(values as API.AreaSubWay.Line);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm<API.AreaBusiness.CircleParams>
|
||||
title={`${props.values ? '编辑' : '新增'}商圈`}
|
||||
<ModalForm<{
|
||||
name: string;
|
||||
company: string;
|
||||
}>
|
||||
title={`${props.values ? '编辑' : '新增'}线路`}
|
||||
form={form}
|
||||
// layout="inline"
|
||||
autoFocusFirstInput
|
||||
@@ -87,85 +60,15 @@ const SubWayEdit: React.FC<ListFormProps> = (props) => {
|
||||
onFinish={handleFinish}
|
||||
>
|
||||
<ProFormDigit
|
||||
name="commercialAreaId"
|
||||
name="regionalId"
|
||||
label={'字典主键'}
|
||||
placeholder="请输入字典主键"
|
||||
disabled
|
||||
hidden={true}
|
||||
/>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="commercialAreaName"
|
||||
label="商圈名称"
|
||||
placeholder="请输入名称"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入商圈名称!',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<ProFormText width="xl" name="regionalName" label="区域名称:" placeholder="请输入名称" />
|
||||
</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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
import React, {Fragment, useRef, useState} from "react";
|
||||
import { FormattedMessage, useAccess } from '@umijs/max';
|
||||
import { FormInstance, Button, message, Modal } from 'antd';
|
||||
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 { PlusOutlined, DeleteOutlined, FormOutlined, AlignLeftOutlined } from '@ant-design/icons';
|
||||
import { DeleteOutlined, FormOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
getCmsAreaList,
|
||||
addCmsAreaListRow,
|
||||
updateCmsAreaListRow,
|
||||
deleteCmsAreaListRow,
|
||||
exportCmsAreaListRow
|
||||
} from "@/services/area/business";
|
||||
import BusinessEdit from "@/pages/Area/Business/edit";
|
||||
addCmsLineSubWay,
|
||||
deleteCmsLineSubWay,
|
||||
getCmsLineList,
|
||||
putCmsLineSubWay,
|
||||
} from '@/services/area/subway';
|
||||
import SubWayEdit from '@/pages/Area/Business/edit';
|
||||
import {
|
||||
addCmsSaveRegionalData,
|
||||
deleteCmsRegionalData,
|
||||
getCmsRegionalList,
|
||||
updateRegionalData,
|
||||
} from '@/services/area/business';
|
||||
|
||||
|
||||
const handleRemoveOne = async (selectedRow: API.AreaBusiness.Circle) => {
|
||||
const handleRemoveOne = async (selectedRow: API.AreaRegional.RegionalRows) => {
|
||||
const hide = message.loading('正在删除');
|
||||
if (!selectedRow) return true;
|
||||
try {
|
||||
const resp = await deleteCmsAreaListRow(selectedRow.commercialAreaId);
|
||||
const resp = await deleteCmsRegionalData(selectedRow.regionalId);
|
||||
hide();
|
||||
if (resp.code === 200) {
|
||||
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() {
|
||||
const access = useAccess();
|
||||
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.AreaBusiness.Circle>()
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||
const [currentRow, setCurrentRow] = useState<API.AreaSubWay.Line>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
|
||||
const columns: ProColumns<API.AreaBusiness.Circle>[] = [
|
||||
const columns: ProColumns<API.AreaRegional.RegionalRows>[] = [
|
||||
{
|
||||
title: '商圈名称',
|
||||
dataIndex: 'commercialAreaName',
|
||||
valueType: 'text',
|
||||
title: '区域名称',
|
||||
dataIndex: 'regionalName',
|
||||
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: '操作',
|
||||
hideInSearch: true,
|
||||
align: 'center',
|
||||
width: 300,
|
||||
hideInSearch: true,
|
||||
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
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon = {<FormOutlined />}
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={() => {
|
||||
setModalVisible(true);
|
||||
@@ -99,8 +85,8 @@ function ManagementList() {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon ={<DeleteOutlined/>}
|
||||
hidden={!access.hasPerms('area:business:List')}
|
||||
icon=<DeleteOutlined />
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
title: '删除',
|
||||
@@ -119,30 +105,33 @@ function ManagementList() {
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
]
|
||||
}
|
||||
]
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable<API.AreaBusiness.Circle>
|
||||
<ProTable<API.AreaSubWay.Line>
|
||||
// params 是需要自带的参数
|
||||
// 这个参数优先级更高,会覆盖查询表单的参数
|
||||
actionRef={actionRef}
|
||||
formRef={formTableRef}
|
||||
columns={columns}
|
||||
rowKey={"commercialAreaName"}
|
||||
key={"index"}
|
||||
request={(params) =>
|
||||
getCmsAreaList({ ...params } as API.AreaBusiness.CircleParams).then((res) => {
|
||||
return {
|
||||
headerTitle="信息"
|
||||
rowKey="regionalId"
|
||||
key="lineIdList"
|
||||
request={(params) => {
|
||||
return getCmsRegionalList(params as API.AreaRegional.RegionalParams).then((res) => {
|
||||
console.log(params);
|
||||
const result = {
|
||||
data: res.rows,
|
||||
total: res.total,
|
||||
success: true,
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
return result;
|
||||
});
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
@@ -155,50 +144,39 @@ 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);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined />
|
||||
<FormattedMessage id="pages.searchTable.export" defaultMessage="导出" />
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<BusinessEdit
|
||||
<SubWayEdit
|
||||
open={modalVisible}
|
||||
onSubmit={async (values) => {
|
||||
let resData
|
||||
if(values.commercialAreaId) {
|
||||
resData = await updateCmsAreaListRow(values)
|
||||
let resData;
|
||||
if (values.regionalId) {
|
||||
resData = await updateRegionalData(values);
|
||||
} else {
|
||||
resData = await addCmsAreaListRow(values)
|
||||
resData = await addCmsSaveRegionalData(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if(values.commercialAreaId) {
|
||||
message.success('修改成功')
|
||||
if (values.regionalId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功')
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}
|
||||
}}
|
||||
values={currentRow}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined)
|
||||
setCurrentRow(undefined);
|
||||
}}
|
||||
></BusinessEdit>
|
||||
values={currentRow}
|
||||
></SubWayEdit>
|
||||
</Fragment>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default ManagementList
|
||||
|
||||
export default ManagementList;
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
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 {
|
||||
addCmsFairList,
|
||||
delCmsFairList,
|
||||
exportCmsFairList,
|
||||
getCmsFairId,
|
||||
getCmsFairList,
|
||||
putCmsFairList,
|
||||
getCmsFairId, getCmstitilelist
|
||||
} from "@/services/jobfair/list";
|
||||
import {getDictValueEnum} from "@/services/system/dict";
|
||||
import DictTag from "@/components/DictTag";
|
||||
} from '@/services/jobfair/list';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import DictTag from '@/components/DictTag';
|
||||
|
||||
const handleRemoveOne = async (jobFairId: string) => {
|
||||
const hide = message.loading('正在删除');
|
||||
@@ -55,20 +54,17 @@ function ManagementList() {
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<API.JobFairList.JobFairListRows>()
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false)
|
||||
const [jobFairType, setJobFairTypeEnum] = useState<any>([])
|
||||
const [currentRow, setCurrentRow] = useState<API.JobFairList.JobFairListRows>();
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [jobFairType, setJobFairTypeEnum] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
getDictValueEnum('job_fair_type', true).then((data) => {
|
||||
setJobFairTypeEnum(data)
|
||||
setJobFairTypeEnum(data);
|
||||
});
|
||||
|
||||
}, []);
|
||||
|
||||
const editSubmit = () => {
|
||||
|
||||
}
|
||||
const editSubmit = () => {};
|
||||
|
||||
const columns: ProColumns<API.JobFairList.JobFairListRows>[] = [
|
||||
{
|
||||
@@ -84,7 +80,7 @@ function ManagementList() {
|
||||
align: 'center',
|
||||
valueEnum: jobFairType,
|
||||
render: (_, record) => {
|
||||
return (<DictTag enums={jobFairType} value={record.jobFairType} />);
|
||||
return <DictTag enums={jobFairType} value={record.jobFairType} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -105,10 +101,10 @@ function ManagementList() {
|
||||
type="link"
|
||||
size="small"
|
||||
key="edit"
|
||||
icon={<FormOutlined/>}
|
||||
icon={<FormOutlined />}
|
||||
hidden={!access.hasPerms('area:business:List.update')}
|
||||
onClick={async () => {
|
||||
let resData = await getCmsFairId(jobFairId as string)
|
||||
let resData = await getCmsFairId(jobFairId as string);
|
||||
setModalVisible(true);
|
||||
setCurrentRow(resData.data);
|
||||
}}
|
||||
@@ -120,7 +116,7 @@ function ManagementList() {
|
||||
size="small"
|
||||
danger
|
||||
key="batchRemove"
|
||||
icon ={<DeleteOutlined/>}
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('area:subway:List')}
|
||||
onClick={async () => {
|
||||
Modal.confirm({
|
||||
@@ -140,10 +136,10 @@ function ManagementList() {
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
]
|
||||
}
|
||||
]
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
return (
|
||||
<Fragment>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
@@ -166,17 +162,17 @@ function ManagementList() {
|
||||
})
|
||||
}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
key="add"
|
||||
hidden={!access.hasPerms('manage:List:add')}
|
||||
onClick={async () => {
|
||||
setCurrentRow(undefined);
|
||||
setModalVisible(true);
|
||||
}}
|
||||
>
|
||||
<PlusOutlined /> 新建
|
||||
</Button>,
|
||||
// <Button
|
||||
// type="primary"
|
||||
// key="add"
|
||||
// hidden={!access.hasPerms('manage:List:add')}
|
||||
// onClick={async () => {
|
||||
// setCurrentRow(undefined);
|
||||
// setModalVisible(true);
|
||||
// }}
|
||||
// >
|
||||
// <PlusOutlined /> 新建
|
||||
// </Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
key="export"
|
||||
@@ -197,17 +193,17 @@ function ManagementList() {
|
||||
onSubmit={async (values) => {
|
||||
let resData;
|
||||
if (values.jobFairId) {
|
||||
resData = await putCmsFairList(values)
|
||||
resData = await putCmsFairList(values);
|
||||
} else {
|
||||
resData = await addCmsFairList(values)
|
||||
resData = await addCmsFairList(values);
|
||||
}
|
||||
if (resData.code === 200) {
|
||||
setModalVisible(false);
|
||||
setCurrentRow(undefined);
|
||||
if(values.jobFairId) {
|
||||
message.success('修改成功')
|
||||
if (values.jobFairId) {
|
||||
message.success('修改成功');
|
||||
} else {
|
||||
message.success('新增成功')
|
||||
message.success('新增成功');
|
||||
}
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
@@ -222,6 +218,7 @@ function ManagementList() {
|
||||
values={currentRow}
|
||||
></EditCompanyListRow>
|
||||
</Fragment>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default ManagementList
|
||||
|
||||
export default ManagementList;
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import React, { useState, useRef, useEffect, useMemo } from 'react';
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
addMobilelog,
|
||||
exportMobilelog,
|
||||
getMobileLogList,
|
||||
removeMobilelog,
|
||||
updateMobilelog
|
||||
} from "@/services/logs/mobilelog";
|
||||
updateMobilelog,
|
||||
} from '@/services/logs/mobilelog';
|
||||
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 DictTag from "@/components/DictTag";
|
||||
import {getDictValueEnum} from "@/services/system/dict";
|
||||
import { ActionType, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
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 {addOperlog, exportOperlog, removeOperlog, updateOperlog} from "@/services/logs/operlog";
|
||||
|
||||
/**
|
||||
* 添加节点
|
||||
*
|
||||
@@ -102,14 +102,13 @@ const handleExport = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const MobileLog: React.FC = () => {
|
||||
// ref
|
||||
const formTableRef = useRef<FormInstance>();
|
||||
const access = useAccess();
|
||||
const actionRef = useRef<ActionType>();
|
||||
// status
|
||||
const [params, useParams] = useState({})
|
||||
const [params, useParams] = useState({});
|
||||
const [modalVisible, setModalVisible] = useState<boolean>(false);
|
||||
const [currentRow, setCurrentRow] = useState<API.Logs.Mobilelog>();
|
||||
const [selectedRows, setSelectedRows] = useState<API.Logs.Mobilelog[]>([]);
|
||||
@@ -131,8 +130,8 @@ const MobileLog: React.FC = () => {
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
||||
const columns: ProColumns<API.Logs.Mobilelog>[] = useMemo(() => [
|
||||
const columns: ProColumns<API.Logs.Mobilelog>[] = useMemo(
|
||||
() => [
|
||||
{
|
||||
title: '日志主键',
|
||||
dataIndex: 'operId',
|
||||
@@ -140,59 +139,59 @@ const MobileLog: React.FC = () => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "操作模块",
|
||||
title: '操作模块',
|
||||
dataIndex: 'title',
|
||||
valueType: 'text',
|
||||
},
|
||||
{
|
||||
title: "业务类型",
|
||||
title: '业务类型',
|
||||
dataIndex: 'businessType',
|
||||
valueType: 'select',
|
||||
valueEnum: businessTypeOptions,
|
||||
render: (_, record) => {
|
||||
return (<DictTag enums={businessTypeOptions} value={record.businessType} />);
|
||||
return <DictTag enums={businessTypeOptions} value={record.businessType} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "请求方式",
|
||||
title: '请求方式',
|
||||
dataIndex: 'requestMethod',
|
||||
valueType: 'text',
|
||||
},
|
||||
// {
|
||||
// title: "操作类别",
|
||||
// dataIndex: 'operatorType',
|
||||
// valueType: 'select',
|
||||
// valueEnum: operatorTypeOptions,
|
||||
// render: (_, record) => {
|
||||
// return (<DictTag enums={operatorTypeOptions} value={record.operatorType} />);
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: "操作类别",
|
||||
dataIndex: 'operatorType',
|
||||
valueType: 'select',
|
||||
valueEnum: operatorTypeOptions,
|
||||
render: (_, record) => {
|
||||
return (<DictTag enums={operatorTypeOptions} value={record.operatorType} />);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作人员",
|
||||
title: '操作人员',
|
||||
dataIndex: 'operName',
|
||||
valueType: 'text',
|
||||
},
|
||||
{
|
||||
title: "主机地址",
|
||||
title: '主机地址',
|
||||
dataIndex: 'operIp',
|
||||
valueType: 'text',
|
||||
},
|
||||
{
|
||||
title: "操作地点",
|
||||
title: '操作地点',
|
||||
dataIndex: 'operLocation',
|
||||
valueType: 'text',
|
||||
},
|
||||
{
|
||||
title: "操作状态",
|
||||
title: '操作状态',
|
||||
dataIndex: 'status',
|
||||
valueType: 'select',
|
||||
valueEnum: statusOptions,
|
||||
render: (_, record) => {
|
||||
return (<DictTag key="status" enums={statusOptions} value={record.status} />);
|
||||
return <DictTag key="status" enums={statusOptions} value={record.status} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作时间",
|
||||
title: '操作时间',
|
||||
dataIndex: 'operTime',
|
||||
valueType: 'dateTime',
|
||||
},
|
||||
@@ -216,9 +215,12 @@ const MobileLog: React.FC = () => {
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
], [businessTypeOptions, operatorTypeOptions, statusOptions])
|
||||
],
|
||||
[businessTypeOptions, operatorTypeOptions, statusOptions],
|
||||
);
|
||||
|
||||
return <>
|
||||
return (
|
||||
<>
|
||||
<PageContainer>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ProTable
|
||||
@@ -275,7 +277,7 @@ const MobileLog: React.FC = () => {
|
||||
actionRef.current?.reloadAndRest?.();
|
||||
}
|
||||
},
|
||||
onCancel() { },
|
||||
onCancel() {},
|
||||
});
|
||||
}}
|
||||
>
|
||||
@@ -323,8 +325,8 @@ const MobileLog: React.FC = () => {
|
||||
statusOptions={statusOptions}
|
||||
/>
|
||||
</PageContainer>
|
||||
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default MobileLog
|
||||
export default MobileLog;
|
||||
|
||||
@@ -222,13 +222,13 @@ const Login: React.FC = () => {
|
||||
defaultMessage: '账户密码登录',
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'mobile',
|
||||
label: intl.formatMessage({
|
||||
id: 'pages.login.phoneLogin.tab',
|
||||
defaultMessage: '手机号登录',
|
||||
}),
|
||||
},
|
||||
// {
|
||||
// key: 'mobile',
|
||||
// label: intl.formatMessage({
|
||||
// id: 'pages.login.phoneLogin.tab',
|
||||
// defaultMessage: '手机号登录',
|
||||
// }),
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
export async function getCmsJobList(params?: API.ManagementList.ListParams) {
|
||||
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) {
|
||||
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) {
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
export async function getCmsAreaList(params?: API.AreaBusiness.CircleParams) {
|
||||
return request<API.AreaBusiness.CirclePageResult>(`/api/cms/area/list`, {
|
||||
export async function getCmsAreaList(params?: API.BusinessParams.BusinessParams) {
|
||||
return request<API.AreaRegional.Regional>(`/api/cms/area/list`, {
|
||||
method: 'GET',
|
||||
params: params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function addCmsAreaListRow(params?: API.AreaBusiness.CircleEditParams) {
|
||||
return request<API.AreaBusiness.CirclePageResult>(`/api/cms/area`, {
|
||||
export async function addCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
|
||||
return request<API.BusinessParams.Business>(`/api/cms/area`, {
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateCmsAreaListRow(params?: API.AreaBusiness.CircleEditParams) {
|
||||
return request<API.AreaBusiness.CirclePageResult>(`/api/cms/area`, {
|
||||
export async function updateCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
|
||||
return request<API.BusinessParams.Business>(`/api/cms/area`, {
|
||||
method: 'put',
|
||||
data: params,
|
||||
});
|
||||
@@ -28,6 +28,37 @@ export async function deleteCmsAreaListRow(ids: number) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function exportCmsAreaListRow(params?: API.AreaBusiness.CircleEditParams) {
|
||||
return downLoadXlsx(`/api/cms/area/export`, { params }, `dict_data_${new Date().getTime()}.xlsx`);
|
||||
export async function exportCmsAreaListRow(params?: API.BusinessParams.BusinessParams) {
|
||||
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',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
export async function getCmsIndustryList(params?: API.ClassifyIndustry.Params) {
|
||||
return request<API.ClassifyIndustry.IndustryResult>(`/api/cms/industry/list`, {
|
||||
@@ -38,6 +39,6 @@ export async function exportCmsIndustry(params?: API.ClassifyIndustry.Params) {
|
||||
return downLoadXlsx(
|
||||
`/api/cms/industry/export`,
|
||||
{ params },
|
||||
`dict_data_${new Date().getTime()}.xlsx`,
|
||||
`分析_${getDateTimeForFilename()}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,5 @@ export async function getCmsJobTitleList(params?: API.ClassifyJobs.Params) {
|
||||
}
|
||||
|
||||
export async function exportCmsJobTitleList(params?: API.ClassifyJobs.Params) {
|
||||
return downLoadXlsx(
|
||||
`/api/cms/job/titile/export`,
|
||||
{ params },
|
||||
`dict_data_${new Date().getTime()}.xlsx`,
|
||||
);
|
||||
return downLoadXlsx(`/api/cms/job/titile/export`, { params }, `dict_data_${f}.xlsx`);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
export async function getCmsCompanyList(params?: API.CompanyList.Params) {
|
||||
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) {
|
||||
return downLoadXlsx(`/cms/company/export`, { params }, `dict_data_${new Date().getTime()}.xlsx`);
|
||||
return downLoadXlsx(
|
||||
`/cms/company/export`,
|
||||
{ params },
|
||||
`dict_data_${getDateTimeForFilename()}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
export async function getCmsFairList(params?: API.JobFairList.Params) {
|
||||
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) {
|
||||
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) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
// 查询字典数据列表
|
||||
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', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
@@ -61,5 +65,9 @@ export function exportDictData(
|
||||
params?: API.System.DictDataListParams,
|
||||
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`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import { getDateTimeForFilename } from '@/utils/tools';
|
||||
|
||||
// 查询字典数据列表
|
||||
export async function getDictDataList(
|
||||
@@ -67,6 +68,6 @@ export function exportDictData(
|
||||
return downLoadXlsx(
|
||||
`/api/cms/dict/data/export`,
|
||||
{ params },
|
||||
`dict_data_${new Date().getTime()}.xlsx`,
|
||||
`枚举_${getDateTimeForFilename()}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
70
src/types/area/business.d.ts
vendored
70
src/types/area/business.d.ts
vendored
@@ -1,39 +1,51 @@
|
||||
declare namespace API.AreaBusiness {
|
||||
export interface Circle {
|
||||
declare namespace API.AreaRegional {
|
||||
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;
|
||||
commercialAreaName: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
createTime: string;
|
||||
address: string;
|
||||
regionalId?: any;
|
||||
regionalName?: any;
|
||||
}
|
||||
|
||||
export interface LinePoint {
|
||||
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;
|
||||
export interface BusinessParams {
|
||||
commercialAreaId?: number;
|
||||
commercialAreaName?: string;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
address?: string;
|
||||
}
|
||||
|
||||
export interface CirclePageResult {
|
||||
code: number;
|
||||
msg: string;
|
||||
total: number;
|
||||
rows: Array<Line>;
|
||||
regionalId?: any;
|
||||
regionalName?: any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,3 +18,20 @@ export function debounce<T extends (...args: any[]) => any>(fn: T, delay = 300)
|
||||
}, 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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user