From c84987d881880a297cfbf73482f2862b3c0dd397 Mon Sep 17 00:00:00 2001 From: wanghx Date: Tue, 23 Jan 2024 10:45:34 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E5=AF=BC=E5=87=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=B8=8B=E8=BD=BD=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E8=87=B3=E5=AF=BC=E5=87=BA=E4=B8=8B=E8=BD=BD=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Export/ExportBtnNew/index.jsx | 27 ++++++++------ src/components/TableModule/index.jsx | 9 ++--- .../FinancialReport/OperationReport/loadable.jsx | 3 +- .../FinancialReport/ParkCardReport/loadable.jsx | 3 +- .../ParkingIncomeReport/loadable.jsx | 3 +- .../FinancialReport/PaySummaryReport/loadable.jsx | 3 +- .../FinancialReport/PdaStat/loadable.jsx | 3 +- .../FinancialReport/PreOrderReport/loadable.jsx | 3 +- src/pages/FinancialMgm/PayRecordTotal/loadable.jsx | 4 +-- .../FinancialMgm/SettleBill/PayRepeat/loadable.jsx | 3 +- .../BusinessMgm/SpecialRecord/loadable.jsx | 3 +- .../EquipmentMgm/EquipmentStatus/Device/index.jsx | 3 +- .../EquipmentOpe/faultReport/loadable.jsx | 3 +- .../EquipmentOpe/patrolStatistics/loadable.jsx | 3 +- .../Attendance/WorkerAttendance/loadable.jsx | 3 +- .../Attendance/WorkerSchedule/loadable.jsx | 3 +- .../PersonMgm/Performance/SalesStat/loadable.jsx | 6 ++-- .../PersonMgm/Performance/WorkerStat/loadable.jsx | 3 +- .../InRoadMgm/PersonMgm/ReportMsg/loadable.jsx | 3 +- src/pages/InRoadMgm/RoadMgm/RoadConf/loadable.jsx | 9 ++--- .../CallbackSuggestion/loadable.jsx | 3 +- .../CustomerServieMgm/ComplainManage/loadable.jsx | 3 +- .../CouponMgm/WriteOffDetail/loadable.jsx | 3 +- .../CouponMgm/WriteOffStat/loadable.jsx | 3 +- .../ParkingCard/ParkingCardOrder/loadable.jsx | 3 +- .../Staggered/StaggeredOrder/loadable.jsx | 3 +- .../Staggered/StaggeredStat/loadable.jsx | 3 +- .../OutExceptionMgm/LiftUpPoleRecord/loadable.jsx | 28 ++++++++++++--- .../ZombieCarCleanRecord/loadable.jsx | 41 +++++++++++++++++++--- .../OutSegmentMgm/OutSegment/loadable.jsx | 3 +- 30 files changed, 138 insertions(+), 55 deletions(-) diff --git a/src/components/Export/ExportBtnNew/index.jsx b/src/components/Export/ExportBtnNew/index.jsx index b1cf3f7..ea4d70b 100644 --- a/src/components/Export/ExportBtnNew/index.jsx +++ b/src/components/Export/ExportBtnNew/index.jsx @@ -126,6 +126,7 @@ const ExportBtn = forwardRef((props, ref) => { key="max" min={1} value={max} + max={totalRecords} onChange={(e) => handleChangeNum(e, "max")} /> @@ -177,7 +178,7 @@ const ExportBtn = forwardRef((props, ref) => { //全部 else { if (isTableModule) { - onOk(1, totalRecords) + onOk(1, totalRecords, undefined, 1) } else { startExport(1, totalRecords, exportType == "hasImg" ? 1 : 0) } @@ -199,11 +200,12 @@ const ExportBtn = forwardRef((props, ref) => { return } if (res.status === 20000) { - if (end - start > 500) { - message.info('当前导出任务, 已加入导出任务列表') - } else { - downloadFile(res.data.url || res.data.export_url) - } + // if (end - start > 500) { + // message.info('当前导出任务, 已加入导出任务列表') + // } else { + // } + message.info(res.message) + downloadFile(res.data.url || res.data.export_url) handleCancel() // 成功 res.data.task_url // setInProcess("2"); @@ -227,11 +229,12 @@ const ExportBtn = forwardRef((props, ref) => { return } if (res.status === 20000) { - if (end - start > 500) { - message.info('当前导出任务, 已加入导出任务列表') - } else { - downloadFile(res.data.url || res.data.export_url) - } + // if (end - start > 500) { + // message.info('当前导出任务, 已加入导出任务列表') + // } else { + // } + message.info(res.message) + downloadFile(res.data.url || res.data.export_url) handleCancel() // setInProcess("2"); // setProcess(res.data?.task_url) @@ -250,6 +253,7 @@ const ExportBtn = forwardRef((props, ref) => { // 执行下载 const downloadFile = (url) => { + if (!url) return var link = document.createElement("a"); link.setAttribute("target", "_blank"); link.style.display = "none"; @@ -279,6 +283,7 @@ const ExportBtn = forwardRef((props, ref) => { setInProcess("1"); setProcess(0); setMaxExportNum(modalType === "hasImg" ? 10000 : 100000); + setBtnLoading(false) }; //导出进度 diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 172703b..7f1836b 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -949,10 +949,10 @@ const TableModule = forwardRef((props, ref) => { }) .then((res) => { if (res.status === 20000) { - const link = document.createElement("a"); - link.href = res.data.url || res.data.export_url; - link.target = "_blank"; // 打开新页面 - link.click(); + // const link = document.createElement("a"); + // link.href = res.data.url || res.data.export_url; + // link.target = "_blank"; // 打开新页面 + // link.click(); setTipModal({ ...tipModal, visible: false, filename: @@ -961,6 +961,7 @@ const TableModule = forwardRef((props, ref) => { new Date().getDate(), }); tipForm.setFieldsValue({ filename: pagename + (new Date().getMonth() + 1).toString().padStart(2, "0") + new Date().getDate(), }) + message.success(res.message) resolved() } else { message.error(res.message); diff --git a/src/pages/FinancialMgm/FinancialReport/OperationReport/loadable.jsx b/src/pages/FinancialMgm/FinancialReport/OperationReport/loadable.jsx index 21a1315..1014296 100644 --- a/src/pages/FinancialMgm/FinancialReport/OperationReport/loadable.jsx +++ b/src/pages/FinancialMgm/FinancialReport/OperationReport/loadable.jsx @@ -607,7 +607,8 @@ function OperationReport() { }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.url); + // Daownload(res?.data?.url); + message.success(res.message) exportRef.current.handleCancel() } else { message.error(res?.message); diff --git a/src/pages/FinancialMgm/FinancialReport/ParkCardReport/loadable.jsx b/src/pages/FinancialMgm/FinancialReport/ParkCardReport/loadable.jsx index 6648520..96c83b7 100644 --- a/src/pages/FinancialMgm/FinancialReport/ParkCardReport/loadable.jsx +++ b/src/pages/FinancialMgm/FinancialReport/ParkCardReport/loadable.jsx @@ -314,7 +314,8 @@ function ParkCardReport() { }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.url); + // Daownload(res?.data?.url); + message.success(res.message) exportRef.current.handleCancel() } else { message.error(res?.message); diff --git a/src/pages/FinancialMgm/FinancialReport/ParkingIncomeReport/loadable.jsx b/src/pages/FinancialMgm/FinancialReport/ParkingIncomeReport/loadable.jsx index c6a521d..39a4c8c 100644 --- a/src/pages/FinancialMgm/FinancialReport/ParkingIncomeReport/loadable.jsx +++ b/src/pages/FinancialMgm/FinancialReport/ParkingIncomeReport/loadable.jsx @@ -550,7 +550,8 @@ function ParkingIncomeReport() { }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.url); + // Daownload(res?.data?.url); + message.success(res.message) exportRef.current.handleCancel() } else { message.error(res?.message); diff --git a/src/pages/FinancialMgm/FinancialReport/PaySummaryReport/loadable.jsx b/src/pages/FinancialMgm/FinancialReport/PaySummaryReport/loadable.jsx index 8102c09..fe2894c 100644 --- a/src/pages/FinancialMgm/FinancialReport/PaySummaryReport/loadable.jsx +++ b/src/pages/FinancialMgm/FinancialReport/PaySummaryReport/loadable.jsx @@ -384,7 +384,8 @@ function PaySummaryReport() { }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.url); + // Daownload(res?.data?.url); + message.success(res.message) exportRef.current.handleCancel() } else { message.error(res?.message); diff --git a/src/pages/FinancialMgm/FinancialReport/PdaStat/loadable.jsx b/src/pages/FinancialMgm/FinancialReport/PdaStat/loadable.jsx index 5e1e230..766e2f5 100644 --- a/src/pages/FinancialMgm/FinancialReport/PdaStat/loadable.jsx +++ b/src/pages/FinancialMgm/FinancialReport/PdaStat/loadable.jsx @@ -344,7 +344,8 @@ function PdaStat() { }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.url); + // Daownload(res?.data?.url); + message.success(res.message) exportRef.current.handleCancel() } else { message.error(res?.message); diff --git a/src/pages/FinancialMgm/FinancialReport/PreOrderReport/loadable.jsx b/src/pages/FinancialMgm/FinancialReport/PreOrderReport/loadable.jsx index 9989047..9c9dc8a 100644 --- a/src/pages/FinancialMgm/FinancialReport/PreOrderReport/loadable.jsx +++ b/src/pages/FinancialMgm/FinancialReport/PreOrderReport/loadable.jsx @@ -349,7 +349,8 @@ function PreOrderReport() { }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.url); + // Daownload(res?.data?.url); + message.success(res.message) exportRef.current.handleCancel() } else { message.error(res?.message); diff --git a/src/pages/FinancialMgm/PayRecordTotal/loadable.jsx b/src/pages/FinancialMgm/PayRecordTotal/loadable.jsx index a3b4f8f..e2b2424 100644 --- a/src/pages/FinancialMgm/PayRecordTotal/loadable.jsx +++ b/src/pages/FinancialMgm/PayRecordTotal/loadable.jsx @@ -284,11 +284,11 @@ function PayRecordTotal(props) { const handleExport = (start, end) => { if (resultData.list?.length > 0) { let { pn, page_size, ...params } = defaultParams; - ajax.getPayRecordTotalListExport(params).then( + ajax.getPayRecordTotalListExport({...params, start: start, end: end}).then( (res) => { if (parseInt(res?.status) === 20000) { //window.location.href = res.data?.url - window.open(res.data?.url) + // window.open(res.data?.url) message.success(res?.message); exportRef.current.handleCancel() } else { diff --git a/src/pages/FinancialMgm/SettleBill/PayRepeat/loadable.jsx b/src/pages/FinancialMgm/SettleBill/PayRepeat/loadable.jsx index 920b3cf..f509610 100644 --- a/src/pages/FinancialMgm/SettleBill/PayRepeat/loadable.jsx +++ b/src/pages/FinancialMgm/SettleBill/PayRepeat/loadable.jsx @@ -422,7 +422,8 @@ function PayRepeat() { }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.url); + // Daownload(res?.data?.url); + message.success(res?.message); exportRef.current.handleCancel() } else { message.error(res?.message); diff --git a/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx b/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx index 97e6618..e678a2d 100644 --- a/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx +++ b/src/pages/InRoadMgm/BusinessMgm/SpecialRecord/loadable.jsx @@ -927,7 +927,8 @@ function CollectorWorkStat(props) { end: end } ajax.specialExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res?.message); resolved() }).catch(err => { rejected(err) diff --git a/src/pages/InRoadMgm/EquipmentMgm/EquipmentStatus/Device/index.jsx b/src/pages/InRoadMgm/EquipmentMgm/EquipmentStatus/Device/index.jsx index 228046e..f3b3b45 100644 --- a/src/pages/InRoadMgm/EquipmentMgm/EquipmentStatus/Device/index.jsx +++ b/src/pages/InRoadMgm/EquipmentMgm/EquipmentStatus/Device/index.jsx @@ -252,7 +252,8 @@ function Road(props) { const handleExport = (start, end) => { ajax.deviceDimensionExport({...form, start: start, end: end}).then(e => { if (e.status == 20000) { - window.open(e.data.url) + // window.open(e.data.url) + message.success(res?.message); exportRef.current.handleCancel() } else { exportRef.current.handleError() diff --git a/src/pages/InRoadMgm/EquipmentOpe/faultReport/loadable.jsx b/src/pages/InRoadMgm/EquipmentOpe/faultReport/loadable.jsx index b9c7960..e4ea6cf 100644 --- a/src/pages/InRoadMgm/EquipmentOpe/faultReport/loadable.jsx +++ b/src/pages/InRoadMgm/EquipmentOpe/faultReport/loadable.jsx @@ -70,7 +70,8 @@ function faultReport(props) { end: end } ajax.getFaultReportExport(data).then(res => { - window.open(res.data.export_url) + // window.open(res.data.export_url) + message.success(res?.message); resolved() }).catch(err => { rejected(err) diff --git a/src/pages/InRoadMgm/EquipmentOpe/patrolStatistics/loadable.jsx b/src/pages/InRoadMgm/EquipmentOpe/patrolStatistics/loadable.jsx index 0cc42c8..f49ca96 100644 --- a/src/pages/InRoadMgm/EquipmentOpe/patrolStatistics/loadable.jsx +++ b/src/pages/InRoadMgm/EquipmentOpe/patrolStatistics/loadable.jsx @@ -70,7 +70,8 @@ function patrolStatistics(props) { end: end } ajax.getBerthWarningListExport(data).then(res => { - window.open(res.data.export_url) + // window.open(res.data.export_url) + message.success(res?.message); resolved() }).catch(err => { rejected(err) diff --git a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx index a33736f..a9b0c95 100644 --- a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx @@ -332,7 +332,8 @@ function WorkerAttendance (props) { end: end } ajax.attendanceExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res?.message); resolved() }).catch(err => { rejected() diff --git a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerSchedule/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerSchedule/loadable.jsx index 3d3e687..ed156a7 100644 --- a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerSchedule/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerSchedule/loadable.jsx @@ -292,7 +292,8 @@ function WorkerSchedule(props) { end: end } ajax.scheduleExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res?.message); resolved() }).catch(err => { rejected() diff --git a/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx index ff3a1e8..aeb8d6c 100644 --- a/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx @@ -293,7 +293,8 @@ function SalesStat(props) { end: end } ajax.salesExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) setExportVisible(false) }) } @@ -304,7 +305,8 @@ function SalesStat(props) { export_type: "all" } ajax.salesExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) setExportVisible(false) }) } diff --git a/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx index 0143dee..36605eb 100644 --- a/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Performance/WorkerStat/loadable.jsx @@ -149,7 +149,8 @@ function WorkerStat(props) { end: end } ajax.statExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) resolved() }).catch(err => { rejected() diff --git a/src/pages/InRoadMgm/PersonMgm/ReportMsg/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/ReportMsg/loadable.jsx index 46f82f2..bfd9a81 100644 --- a/src/pages/InRoadMgm/PersonMgm/ReportMsg/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/ReportMsg/loadable.jsx @@ -65,7 +65,8 @@ function ReportMsg(props) { end: end } ajax.getReportExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) resolved() }).catch(err => { rejected(err) diff --git a/src/pages/InRoadMgm/RoadMgm/RoadConf/loadable.jsx b/src/pages/InRoadMgm/RoadMgm/RoadConf/loadable.jsx index 19bf63d..212c023 100644 --- a/src/pages/InRoadMgm/RoadMgm/RoadConf/loadable.jsx +++ b/src/pages/InRoadMgm/RoadMgm/RoadConf/loadable.jsx @@ -445,10 +445,11 @@ function RoadConf() { .exportRoadList({...result, start: start, end: end}) .then((res) => { if (res.status === 20000) { - const link = document.createElement("a"); - link.href = res.data.export_url; - link.target = "_blank"; // 打开新页面 - link.click(); + // const link = document.createElement("a"); + // link.href = res.data.export_url; + // link.target = "_blank"; // 打开新页面 + // link.click(); + message.success(res.message) resolved() } }) diff --git a/src/pages/OperationCenter/CustomerServieMgm/CallbackSuggestion/loadable.jsx b/src/pages/OperationCenter/CustomerServieMgm/CallbackSuggestion/loadable.jsx index e08cb6c..6c3ec29 100644 --- a/src/pages/OperationCenter/CustomerServieMgm/CallbackSuggestion/loadable.jsx +++ b/src/pages/OperationCenter/CustomerServieMgm/CallbackSuggestion/loadable.jsx @@ -523,7 +523,8 @@ function CallbackSuggestion(props) { end: end } ajax.exportDataList(data).then(res => { - window.open(res.data.export_url) + // window.open(res.data.export_url) + message.success(res.message) exportRef.current.handleCancel() }).catch(err => { exportRef.current.handleError() diff --git a/src/pages/OperationCenter/CustomerServieMgm/ComplainManage/loadable.jsx b/src/pages/OperationCenter/CustomerServieMgm/ComplainManage/loadable.jsx index 1325cd3..4bda681 100644 --- a/src/pages/OperationCenter/CustomerServieMgm/ComplainManage/loadable.jsx +++ b/src/pages/OperationCenter/CustomerServieMgm/ComplainManage/loadable.jsx @@ -245,7 +245,8 @@ function ComplainManage(props) { let data = { ...holdData, ...pageInfo, start: start, end: end }; ajax.getComplainExport(data).then((res) => { if (res?.data?.url) { - window.open(res.data.url); + // window.open(res.data.url); + message.success(res.message) exportRef.current.handleCancel() } else { message.error("导出异常"); diff --git a/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffDetail/loadable.jsx b/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffDetail/loadable.jsx index 1fc51fc..79b06e9 100644 --- a/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffDetail/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffDetail/loadable.jsx @@ -251,7 +251,8 @@ function WriteOffDetail() { end: end } ajax.handleOffExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) exportRef.current.handleCancel() }).catch(err => { exportRef.current.handleError() diff --git a/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffStat/loadable.jsx b/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffStat/loadable.jsx index 9b845d8..a19094b 100644 --- a/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffStat/loadable.jsx +++ b/src/pages/OperationCenter/OperationSales/CouponMgm/WriteOffStat/loadable.jsx @@ -154,7 +154,8 @@ function WriteOffStat(props) { end: end } ajax.handleCountExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) exportRef.current.handleCancel() }).catch(err => { exportRef.current.handleError() diff --git a/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardOrder/loadable.jsx b/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardOrder/loadable.jsx index 997e48b..e490cb0 100644 --- a/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardOrder/loadable.jsx +++ b/src/pages/OperationCenter/OtherBusiness/ParkingCard/ParkingCardOrder/loadable.jsx @@ -300,7 +300,8 @@ function ParkingCardOrder() { } ajax.exportOrder({...formData, start: start, end: end}).then(res => { if (parseInt(res?.status) === 20000){ - Donwload(res.data?.url) + // Donwload(res.data?.url) + message.success(res.message) exportRef.current.handleCancel() } else { diff --git a/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredOrder/loadable.jsx b/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredOrder/loadable.jsx index cc9bf43..f235b31 100644 --- a/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredOrder/loadable.jsx +++ b/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredOrder/loadable.jsx @@ -77,7 +77,8 @@ function StaggeredOrder(props) { end: end } ajax.getExportOrder(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) exportRef.current.handleCancel() }).catch(err => { exportRef.current.handleError() diff --git a/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredStat/loadable.jsx b/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredStat/loadable.jsx index 5e04951..90eb0be 100644 --- a/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredStat/loadable.jsx +++ b/src/pages/OperationCenter/OtherBusiness/Staggered/StaggeredStat/loadable.jsx @@ -58,7 +58,8 @@ function StaggeredStat(props) { end: end } ajax.getStaggeredStatExport(data).then(res => { - window.open(res.data.url) + // window.open(res.data.url) + message.success(res.message) exportRef.current.handleCancel() }).catch(err => { exportRef.current.handleError() diff --git a/src/pages/OutRoadMgm/OutExceptionMgm/LiftUpPoleRecord/loadable.jsx b/src/pages/OutRoadMgm/OutExceptionMgm/LiftUpPoleRecord/loadable.jsx index bde8fc4..35eebf5 100644 --- a/src/pages/OutRoadMgm/OutExceptionMgm/LiftUpPoleRecord/loadable.jsx +++ b/src/pages/OutRoadMgm/OutExceptionMgm/LiftUpPoleRecord/loadable.jsx @@ -1,5 +1,5 @@ import React, { useState, useRef, useEffect } from "react"; -import { ResultFlowResult } from "@/components" +import { ResultFlowResult, ExportBtnNew } from "@/components" import { Button, Table, message, Pagination, Input, Modal, Image, DatePicker, Space } from 'antd' import { pageSizeOptions @@ -27,6 +27,7 @@ function LiftUpPoleRecord(props) { pn: 1, page_size: Number(pageSizeOptions[0]), // 每页条数 } + const exportRef = useRef(null) const [formData, setFormData] = useState(parameter) const [lastFormData, setLastFormData] = useState(formData) const lastFormDataRef = useRef(formData) @@ -198,15 +199,20 @@ function LiftUpPoleRecord(props) { getData({...data, pn: 1}) } //导出 - const salesData = () => { + const salesData = (start, end) => { let data = { - ...formData + ...formData, + start: start, + end: end } ajax.poleExport(data).then(res => { if (res.status == 20000) { - window.open(res.data.url || res.data.export_url) + // window.open(res.data.url || res.data.export_url) + message.success(res.message) + exportRef.current.handleCancel() } else { message.error(res.message) + exportRef.current.handleError() } }) } @@ -276,7 +282,19 @@ function LiftUpPoleRecord(props) {
共检索到{resultData.total_records}条结果
- + {/* */} + 导出} + modalType="noImg" + ref={exportRef} + totalRecords={resultData.total_records} + imgno={false} + postdata={{ + formData: formData + }} + isTableModule={true} + onOk={salesData} + />
{ // getData() // }, []) + + const exportOk = (start, end, type, isAll) => { + let data = { + ...formData, + start: start, + end: end, + export_type: isAll == 1 ? 'all' : '' + } + ajax.zombieExport(data).then(res => { + if (res.status == 20000) { + // window.open(res.data?.url || res.data?.export_url) + message.success(res.message) + exportRef.current.handleCancel() + } else { + message.error(res.message) + exportRef.current.handleError() + } + }) + } + function handleOk() { let data = { ...formData, @@ -533,10 +554,22 @@ function ZombieCarCleanRecord(props) {
共检索到{resultData.total_records}条结果 -
-   +   */} + 导出} + modalType="noImg" + ref={exportRef} + totalRecords={resultData.total_records} + imgno={false} + postdata={{ + formData: formData + }} + isTableModule={true} + onOk={exportOk} + /> diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx index 8b39a70..114c627 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx @@ -412,7 +412,8 @@ function OutSegment() { }).then( (res) => { if (res) { - window.open(res.data.export_url) + // window.open(res.data.export_url) + message.success(res.message) tableRef.current.handleCancel() } else { message.error(res?.message);