diff --git a/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/index.scss b/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/index.scss index 9772ef5..2793eb8 100644 --- a/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/index.scss +++ b/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/index.scss @@ -27,3 +27,11 @@ } } } + +.custom-modal__charger-monitor{ + .content{ + display: flex; + align-items: center; + justify-content: center; + } +} diff --git a/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/loadable.jsx b/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/loadable.jsx index e3c82ab..9a63ac1 100644 --- a/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/loadable.jsx +++ b/src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/loadable.jsx @@ -1,52 +1,29 @@ import React, { useState, useRef, useEffect } from "react"; -import { - message, - Pagination, - Table, - Space, - Modal, - Button, - Tabs, - Descriptions, - Input, - Steps, - Select, - Image, - Timeline, - Popover, -} from "antd"; +import { message, Modal, Image } from "antd"; import { dictionary, utils } from "@/config/common"; -// import moment from 'moment' -// import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; import ajax from "@/services"; -import errorImg from "@/assets/images/error-img-new.png"; -import { QuestionCircleOutlined } from "@ant-design/icons"; import { TableModule } from "@/components"; import "./index.scss"; -import { - payRecordColumns, - refundRecordColumns, - operatorRecordColumns, -} from "./dataSource"; -// import errorImg from "@/assets/images/layout/error.png" +import moment from "moment"; function ChargerMonitor() { const [tableData, setTableData] = useState([]); // 列表数据 const [total, setTotal] = useState(0); // 数据总数 const initFormData = { - status: "", // 充电状态 - plate: "", // 车牌号 + station_name: "", // 充电桩 phone: "", // 手机号 - station_name: "", // 充电站 - start_time: "", // 开始时间 - end_time: "", // 结束时间 + plate: "", // 车牌号 + status: sysConfig?.energyChargingStatus[0]?.value ?? 0, // 充电状态 + timePeriod: moment().format("YYYY-MM-DD HH:mm:ss"), + // start_time: "", // 开始时间 + // end_time: "", // 结束时间 }; // 初始数据 const formSearch = [ { label: "充电桩", - name: "charging_pile", + name: "station_name", type: "Input", placeholder: "请输入", }, @@ -64,17 +41,19 @@ function ChargerMonitor() { }, { label: "充电状态", - name: "charging_status", + name: "status", type: "Select", placeholder: "请选择充电状态", - defaultValue: 0, - options: sysConfig.energyChargingStatus, + defaultValue: initFormData.status, + options: sysConfig.energyChargingStatus ?? [], }, { - name: "time", + name: "timePeriod", type: "RangePicker", label: "充电开始时间", + // defaultTitle: ["充电开始时间", "充电结束时间"], defaultTitle: ["充电开始时间", " "], + defaultValue: [moment().subtract(1, "months"), moment()], }, ]; // 检索栏 @@ -198,6 +177,9 @@ function ChargerMonitor() { }) .catch((err) => { console.error(err); + }) + .finally(() => { + utils.tableScrollTop("parent-table-scroll"); }); } @@ -233,17 +215,17 @@ function ChargerMonitor() { /> { closeImgRecordModal(); }} > -
+
{ @@ -163,7 +142,6 @@ function PileMonitor() { console.error(err); }) .finally(() => { - // setLoading(false); }); } @@ -196,12 +174,11 @@ function PileMonitor() { return (
- {/* */}
{num ?? 0} - {label } + {label}
); @@ -220,105 +197,19 @@ function PileMonitor() { return ( <> - {/*
-
-
{"查询条件"}
-
- {renderSearch()} -
- - - {renderAdd()} -
-
-
-
-
- - 共查询到 - {total} - 条结果 - -
- - {true && ( - - total ? ( - 导出} - modalType="noImg" - ref={exportRef} - totalRecords={total} - exportUrl={exportUrl} - imgno={false} - postdata={{ - formData: pageData - }} - isTableModule={true} - onOk={handleExport} - /> - ) : <> - )} -
-
- -
- - -
- `共 ${total_records} 条`} - total={total} - current={pageData.pn} - pageSize={pageData.page_size} - pageSizeOptions={dictionary?.pageSizeOptions} - onChange={onChange} - // onShowSizeChange={onShowSizeChange} - /> -
- - - */} ); } diff --git a/src/pages/NewEnergy/RecordsInquiry/Unlocking/loadable.jsx b/src/pages/NewEnergy/RecordsInquiry/Unlocking/loadable.jsx index 10d87f4..5886fa4 100644 --- a/src/pages/NewEnergy/RecordsInquiry/Unlocking/loadable.jsx +++ b/src/pages/NewEnergy/RecordsInquiry/Unlocking/loadable.jsx @@ -1,39 +1,24 @@ import React, { useState, useRef, useEffect } from "react"; -import { - message, - Pagination, - Table, - Space, - Modal, - Button, - Tabs, - Descriptions, - Input, - Steps, - Select, - Image, - Timeline, - Popover -} from "antd"; -import { dictionary } from "@/config/common"; +import { message as Message } from "antd"; +import { dictionary, utils } from "@/config/common"; import ajax from "@/services"; import { TableModule } from "@/components"; import "./index.scss"; import moment from "moment"; -const { TextArea } = Input; // 开锁记录 function Unlocking() { - const [tableData, setTableData] = useState([]); // 列表数据 const [total, setTotal] = useState(0); // 数据总数 // 初始搜索条件 const initFormData = { - tel: "", - charging_station: "", - ground_lock_name: "", - unlocking_timerange:[moment().subtract(1,"weeks"),moment()] + tel: "", // 手机号 + charging_station: "", // 充电站 + ground_lock_name: "", // 地锁名称 + start_time: "", // 开始时间 + end_time: "", // 结束时间 + unlocking_timerange: [moment().subtract(1, "months"), moment()], // 解锁时间范围 最后返回 start_time, end_time 查看search 函数 }; const formSearch = [ @@ -58,7 +43,8 @@ function Unlocking() { { name: "unlocking_timerange", type: "DateRangePicker", - label: "降锁时间", + label: "降锁时间范围", + defaultValue: initFormData.unlocking_timerange, }, ]; // 搜索栏 @@ -114,45 +100,42 @@ function Unlocking() { // 检索 const search = (params) => { - let temp_obj = {...params} - if(temp_obj.unlocking_timerange?.length){ - temp_obj.unlocking_timerange = temp_obj.unlocking_timerange[0].format('YYYY-MM-DD') + ',' + temp_obj.unlocking_timerange[1].format('YYYY-MM-DD') - }else{ - temp_obj.unlocking_timerange = '' + let temp_obj = { ...params }; + if (temp_obj.unlocking_timerange?.length) { + temp_obj.start_time = + temp_obj.unlocking_timerange[0].format("YYYY-MM-DD"); + temp_obj.end_time = temp_obj.unlocking_timerange[1].format("YYYY-MM-DD"); + } else { + temp_obj.start_time = ""; + temp_obj.end_time = ""; } - ajax.recordsInquiry.getUnlockingList(params).then((res) => { + temp_obj.unlocking_timerange = undefined; + ajax.recordsInquiry.getUnlockingList(temp_obj).then((res) => { if (res.status === 20000) { setTableData(res.data.list); setTotal(res.data.total); } else { - message.error(res.message) + Message.error(res?.message); } - }); - } - + }).finally(()=>{ + utils.tableScrollTop("parent-table-scroll"); + }) + }; return ( <> {}} - > - 新增 - - } - columns={columns} - tableData={tableData} - formSearch={formSearch} - pagename="开锁记录" - pageName={'unlockingRecord'} - initFormData={initFormData} - total={total} - search={search} - exportUrl="/api/new_power/records/unlocking" + showSerial={true} // 显示序号 + isExport={false} // 显示导出按钮 + pagename="开锁记录" // 页面名称 + pageName={"unlockingRecord"} // 页面名称 用户 useSessionStorage 存储记录表单数据 + exportUrl="/api/new_power/records/unlocking" // 导出url + formSearch={formSearch} // 左侧搜索栏 + columns={columns} // 表头 + initFormData={initFormData} // 初始表单数据 + search={search} // 请求函数 + total={total} // 数据总数 + tableData={tableData} // 表格数据 /> {/*