diff --git a/src/components/Export/ExportBtnNew/index.jsx b/src/components/Export/ExportBtnNew/index.jsx index 66c71d2..767fb6a 100644 --- a/src/components/Export/ExportBtnNew/index.jsx +++ b/src/components/Export/ExportBtnNew/index.jsx @@ -17,12 +17,14 @@ function ExportBtn(props) { const { children, + className, modalType = "hasImg", // 初始导出弹框显示方式,hasImg显示含图导出,noImg显示无图导出, portrait 导出失败人像 totalRecords = 100, // 可导出总数 exportUrl = "http://192.168.8.7:3001/mock/2995/api/v1/common/export", // 点击导出请求的接口 ajaxType = "post", // 请求导出链接方式 postdata = {}, // post 传参数 传参格式: {formData:(pn,page_size),other:{}} timeDelay = 300, + pageName, imgno = true // 是否支持有图导出 true 含图和无图导出 false 只有无图导出 } = props; @@ -105,7 +107,32 @@ function ExportBtn(props) { // [导出当前页,导出全部,导出指定条数]----选项 const options = [ - { label: "导出全部 (全部导出需等待较长时间,请耐心等候) ", value: "2" } + { label: "导出当前页", value: "1" }, + { + label: ( +
+ 导出 +
+ handleChangeNum(e, "min")} + /> + ~ + handleChangeNum(e, "max")} + /> +
+
{Math.abs(max - min + 1)}条
+
+ ), + value: "3", + }, + { label: "导出全部", value: "2" } ]; // 导出确认 @@ -134,9 +161,9 @@ function ExportBtn(props) { } //当前页 else if (checkedType == 1) { - const { pn, length } = postdata.formData + const { pn, length, page_size } = postdata.formData console.log(postdata.formData) - startExport((pn - 1) * length + 1, pn * length, exportType == "hasImg" ? 1 : 0) + startExport((pn - 1) * (length || page_size) + 1, pn * (length || page_size) , exportType == "hasImg" ? 1 : 0) } //全部 else { @@ -152,8 +179,18 @@ function ExportBtn(props) { let url = exportUrl; if (imgno) { ajax({ url, type: ajaxType, data: { export_type: checkedType, start, end, isimg:exportType == "hasImg" ? 1 : 0, ...formData, ...other } }).then((res) => { + if (pageName == 'parkingOverview') { + downloadFile(res.export_url) + handleCancel() + setBtnLoading(false); + return + } if (res.status === 20000) { - downloadFile(res.data.url) + if (end - start > 500) { + message.info('当前导出任务, 已加入导出任务列表') + } else { + downloadFile(res.data.url || res.data.export_url) + } handleCancel() // 成功 res.data.task_url // setInProcess("2"); @@ -170,8 +207,18 @@ function ExportBtn(props) { }); } else { ajax({ url, type: ajaxType, data: { export_type: checkedType, start, end, isimg:0, ...formData, ...other } }).then((res) => { + if (pageName == 'parkingOverview') { + downloadFile(res.export_url) + handleCancel() + setBtnLoading(false); + return + } if (res.status === 20000) { - downloadFile(res.data.url || res.data.export_url) + if (end - start > 500) { + message.info('当前导出任务, 已加入导出任务列表') + } else { + downloadFile(res.data.url || res.data.export_url) + } handleCancel() // setInProcess("2"); // setProcess(res.data?.task_url) @@ -287,7 +334,7 @@ function ExportBtn(props) {
-
+ {/*
{EXPORT_TYPE.map((item) => (
-
+
*/}
@@ -331,13 +378,14 @@ function ExportBtn(props) {
- {/*
+
-
分段导出每次最多支持导出 {maxExportNum}
-
本次查询包含 {totalRecords} 条数据可供导出
+
导出文件将加入导出下载列表
+ {/*
分段导出每次最多支持导出 {maxExportNum}
*/} + {/*
本次查询包含 {totalRecords} 条数据可供导出
*/}
-
*/} +
)} diff --git a/src/components/MapCircle/index.jsx b/src/components/MapCircle/index.jsx index 34c584b..50e57df 100644 --- a/src/components/MapCircle/index.jsx +++ b/src/components/MapCircle/index.jsx @@ -18,7 +18,7 @@ function Markers(props) { `; useEffect(() => { - if (data.length) { + if (data.length && data[0].lat && data[0].lng) { addMarker(data, getMapValue); console.log(getMapValue); } @@ -78,6 +78,7 @@ function Markers(props) { }, 800); }; useEffect(() => { + if (!data.length || !data[0].lng || !data[0].lat) return map.setCenter(new AMap.LngLat(parseFloat(data[0].lng), parseFloat(data[0].lat))); }, [getReset]) return null; diff --git a/src/pages/DataAnalysisPrediction/EquipmentAly/EquipmentRunningStat/loadable.jsx b/src/pages/DataAnalysisPrediction/EquipmentAly/EquipmentRunningStat/loadable.jsx index 2cf27ec..16c41fe 100644 --- a/src/pages/DataAnalysisPrediction/EquipmentAly/EquipmentRunningStat/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/EquipmentAly/EquipmentRunningStat/loadable.jsx @@ -8,6 +8,7 @@ import { Popover, Cascader, AutoComplete, + Button, Tooltip, Checkbox, Modal, @@ -19,7 +20,7 @@ import moment from "moment"; import ajax from "@/services"; // import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; -import { ResultFlow } from "@/components"; +import { ResultFlow, ExportBtnNew } from "@/components"; import "./index.scss"; import Equip1 from "@/assets/images/equip/equip1.png"; import Equip2 from "@/assets/images/equip/equip2.png"; @@ -711,7 +712,7 @@ function ExceptionParkReport() {

共查询到 {Data?.total || 0}条数据

- { Data?.total && setOpen(true); @@ -723,7 +724,21 @@ function ExceptionParkReport() { }} > 导出 - + */} + 导出} + modalType="noImg" + totalRecords={500} + exportUrl="/api/ana/equipmentRuning/export" + postdata={{ + formData: { + ...FormDatas, + area_id: Show, + export_name: "设备运行统计-" + moment().format("YYYY-MM-DD") + } + }} + imgno={false} + />
- record.id} diff --git a/src/pages/DataAnalysisPrediction/MemberStat/ParkingAly/loadable.jsx b/src/pages/DataAnalysisPrediction/MemberStat/ParkingAly/loadable.jsx index d2089df..aa2262e 100644 --- a/src/pages/DataAnalysisPrediction/MemberStat/ParkingAly/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/MemberStat/ParkingAly/loadable.jsx @@ -4,6 +4,7 @@ import { Pagination, Table, Select, + Button, Input, Popover, Cascader, @@ -18,7 +19,7 @@ import moment from "moment"; import ReactEcharts from "echarts-for-react"; import ajax from "@/services"; // import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; -import { ResultFlow } from "@/components"; +import { ResultFlow, ExportBtnNew } from "@/components"; import "./index.scss"; function ParkingAly() { @@ -602,7 +603,7 @@ function ParkingAly() {

共查询到 {Data?.total || 0}条数据

- { Data?.total && ReportPaySummaryReport(); @@ -610,7 +611,22 @@ function ParkingAly() { }} > 导出 - + */} + 导出} + modalType="noImg" + totalRecords={500} + exportUrl="/api/ana/member/parking_export" + postdata={{ + formData: { + pn: 1, + page_size: 15, + ...FormData, + ...DateFormt(FormDatas.date_type) + } + }} + imgno={false} + />
新能源车排行
-
导出
+ {/*
导出
*/} + 导出} + modalType="noImg" + totalRecords={500} + exportUrl="/api/ana/dataanalysis/carType_export" + postdata={{ + // formData: {...pageInfo, export_type: 'all', area_id: sessionTabList?.show} + formData: { ...pageInfo, export: 1, type: tabKey == 2 ? 'road' : 'region', area_id: sessionTabList?.show} + }} + imgno={false} + />
日均泊位周转次数排行榜
-
导出
+ {/*
导出
*/} + 导出} + modalType="noImg" + totalRecords={500} + exportUrl="/api/ana/dataanalysis/get_turn_times_export" + pageName="parkingOverview" + postdata={{ + formData: {...pageInfo, export_type: 'all', area_id: sessionTabList?.show} + }} + imgno={false} + />
平均停车时长排行榜
-
{ handleExportCar() }}>导出
+ {/*
{ handleExportCar() }}>导出
*/} + 导出} + modalType="noImg" + totalRecords={500} + exportUrl="/api/ana/dataanalysis/get_parking_duration_export" + pageName="parkingOverview" + postdata={{ + formData: {...pageInfo, export_type: 'all', area_id: sessionTabList?.show} + }} + imgno={false} + />
停车资源利用率排行榜
-
导出
+ {/*
导出
*/} + 导出} + modalType="noImg" + totalRecords={500} + exportUrl="/api/ana/dataanalysis/parking_export" + pageName="parkingOverview" + postdata={{ + formData: {...pageInfo, export_type: 'all', area_id: sessionTabList?.show} + }} + imgno={false} + />
共查询到

{resultData?.total_records || 0}

条结果
-
导出
+ {/*
导出
*/} + 导出} + modalType="noImg" + totalRecords={resultData?.total_records || 500} + exportUrl="/api/ana/dataanalysis/parking_total_analysis_export" + pageName="parkingOverview" + postdata={{ + formData: { ...formData, ...pageInfo, area_id: sessionTabList?.show } + }} + imgno={false} + />
{ - setLatlng([lat.toFixed(4), lng.toFixed(4)].join(',')) + setLatlng([lng.toFixed(4), lat.toFixed(4)].join(',')) } // 区域新增 @@ -260,10 +260,19 @@ function AreaManage() { footer={null} >
- handleMapClick(lnglat)} - /> + /> */} + handleMapClick(lnglat)}> + +
diff --git a/src/pages/SystemMgm/SystemLog/loadable.jsx b/src/pages/SystemMgm/SystemLog/loadable.jsx index a7bddd0..f541bec 100644 --- a/src/pages/SystemMgm/SystemLog/loadable.jsx +++ b/src/pages/SystemMgm/SystemLog/loadable.jsx @@ -3,7 +3,7 @@ import { message, Cascader, Select, Input, DatePicker, Button, Table, Pagination import { SearchOutlined, DeleteOutlined, DownloadOutlined } from '@ant-design/icons'; import moment from "moment"; import ajax from '@/services' -import { TableModule } from "@/components"; +import { TableModule, ExportBtnNew } from "@/components"; import { useSessionStorageState } from "ahooks"; import { dictionary } from "@/config/common.js"; import "./index.scss"; @@ -441,9 +441,19 @@ const SystemLog = () => {
共检索到{resultData.total_records}条结果 - + */} + 导出} + modalType="noImg" + totalRecords={resultData.total_records} + exportUrl="/api/manage/system/export_system_log" + postdata={{ + formData: {...formData, ...{is_excel: 1}} + }} + imgno={false} + />