|
|
@ -1,46 +1,26 @@ |
|
|
|
import React, { useState, useRef, useEffect, useMemo } from "react"; |
|
|
|
import { |
|
|
|
message, |
|
|
|
Pagination, |
|
|
|
Table, |
|
|
|
Space, |
|
|
|
Modal, |
|
|
|
Button, |
|
|
|
Tabs, |
|
|
|
Descriptions, |
|
|
|
Input, |
|
|
|
Steps, |
|
|
|
Select, |
|
|
|
Image, |
|
|
|
Timeline, |
|
|
|
Popover, |
|
|
|
} from "antd"; |
|
|
|
|
|
|
|
import { dictionary, utils } from "@/config/common"; |
|
|
|
import { ResultFlow, ExportBtnNew, QuickMenu } from "@/components"; |
|
|
|
import React, { useState, useEffect, useMemo } from "react"; |
|
|
|
import { message } from "antd"; |
|
|
|
import { utils } from "@/config/common"; |
|
|
|
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 { functions } from "lodash"; |
|
|
|
|
|
|
|
|
|
|
|
function PileMonitor() { |
|
|
|
// const [pageData,setPageData] = useState({ |
|
|
|
// pn:1, |
|
|
|
// page_size:15 |
|
|
|
// }) |
|
|
|
// const [loading,setLoading] = useState(false); |
|
|
|
const [tableData, setTableData] = useState([]); // 列表数据 |
|
|
|
const [total, setTotal] = useState(0); // 数据总数 |
|
|
|
const [statsData, setStatsData] = useState({}); // 统计数据 |
|
|
|
const [statsData, setStatsData] = useState({ |
|
|
|
all_count: 0, |
|
|
|
kx_count: 0, |
|
|
|
zy_count: 0, |
|
|
|
gz_count: 0, |
|
|
|
lx_count: 0, |
|
|
|
}); // 统计数据 |
|
|
|
|
|
|
|
const initFormData = { |
|
|
|
station_name: "", // 充电桩 |
|
|
|
muzzle_text: "", // 枪名称 |
|
|
|
pile_type: "", // 充电类型 |
|
|
|
charge_status: "", // 枪状态 |
|
|
|
pile_type: sysConfig?.energyChargingType[0]?.value ?? 0, // 充电类型 |
|
|
|
charge_status: sysConfig?.energyChargingGunStatus[0]?.value ?? 0, // 枪状态 |
|
|
|
}; // 初始数据 |
|
|
|
|
|
|
|
const formSearch = [ |
|
|
@ -60,15 +40,15 @@ function PileMonitor() { |
|
|
|
label: "充电类型", |
|
|
|
name: "pile_type", |
|
|
|
type: "Select", |
|
|
|
defaultValue: 0, |
|
|
|
options: sysConfig.energyChargingType, |
|
|
|
defaultValue: initFormData.pile_type, |
|
|
|
options: sysConfig.energyChargingType ?? [], |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "枪状态", |
|
|
|
name: "charge_status", |
|
|
|
type: "Select", |
|
|
|
defaultValue: 0, |
|
|
|
options: sysConfig.energyChargingGunStatus, |
|
|
|
defaultValue: initFormData.charge_status, |
|
|
|
options: sysConfig.energyChargingGunStatus ?? [], |
|
|
|
}, |
|
|
|
]; // 搜索栏配置 |
|
|
|
|
|
|
@ -148,7 +128,6 @@ function PileMonitor() { |
|
|
|
//获取函数 |
|
|
|
function search(params) { |
|
|
|
utils.tableScrollTop("parent-table-scroll"); |
|
|
|
// setLoading(true); |
|
|
|
ajax |
|
|
|
.getPileMonitorList(params) |
|
|
|
.then((res) => { |
|
|
@ -163,7 +142,6 @@ function PileMonitor() { |
|
|
|
console.error(err); |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
// setLoading(false); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -196,12 +174,11 @@ function PileMonitor() { |
|
|
|
return ( |
|
|
|
<div className="item"> |
|
|
|
<div className="item-left"> |
|
|
|
{/* <img src="" alt="" /> */} |
|
|
|
<div className={`img img-${type}`}></div> |
|
|
|
</div> |
|
|
|
<div className="item-right"> |
|
|
|
<span className="num">{num ?? 0}</span> |
|
|
|
<span className="label">{label }</span> |
|
|
|
<span className="label">{label}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
@ -220,105 +197,19 @@ function PileMonitor() { |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<TableModule |
|
|
|
className={"real-time-monitor_pile-monitor"} |
|
|
|
showSerial={true} |
|
|
|
isExport={false} |
|
|
|
columns={columns} |
|
|
|
pageName={"pileMonitor"} |
|
|
|
pagename="电桩监控" |
|
|
|
tableData={tableData} |
|
|
|
formSearch={formSearch} |
|
|
|
className={"real-time-monitor_pile-monitor"} |
|
|
|
pagename="电桩监控" |
|
|
|
pageName={"pileMonitor"} |
|
|
|
initFormData={initFormData} |
|
|
|
total={total} |
|
|
|
search={search} |
|
|
|
rightHeaderCompSlot={renderRightListHeader} |
|
|
|
isExport={false} |
|
|
|
rightHeaderCompSlot={renderRightListHeader} // 插入 |
|
|
|
/> |
|
|
|
{/* <div className="pile-monitor" > |
|
|
|
<div className="left-search"> |
|
|
|
<div className="title">{"查询条件"}</div> |
|
|
|
<div className="searchWrap"> |
|
|
|
{renderSearch()} |
|
|
|
<div className="bottomBox"> |
|
|
|
<Button className="reset" onClick={reset}> |
|
|
|
重置 |
|
|
|
</Button> |
|
|
|
<Button type="primary" className="submit" |
|
|
|
onClick={() => { |
|
|
|
if(pageData.pn == 1){ |
|
|
|
fetch(1) |
|
|
|
}else{ |
|
|
|
setPageData({ ...pageData, pn: 1 }) |
|
|
|
fetch({ ...pageData, pn: 1 }) |
|
|
|
} |
|
|
|
}}> |
|
|
|
查询 |
|
|
|
</Button> |
|
|
|
{renderAdd()} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="right-list"> |
|
|
|
<div className="total-row-wrapper"> |
|
|
|
<span className="number-wrapper"> |
|
|
|
<span className="letter">共查询到</span> |
|
|
|
<span className="total-number"> {total}</span> |
|
|
|
<span className="letter">条结果</span> |
|
|
|
</span> |
|
|
|
<div className="right-button-group"> |
|
|
|
|
|
|
|
{true && ( |
|
|
|
|
|
|
|
total ? ( |
|
|
|
<ExportBtnNew |
|
|
|
children={<Button className="export-btn" size='medium' type="primary">导出</Button>} |
|
|
|
modalType="noImg" |
|
|
|
ref={exportRef} |
|
|
|
totalRecords={total} |
|
|
|
exportUrl={exportUrl} |
|
|
|
imgno={false} |
|
|
|
postdata={{ |
|
|
|
formData: pageData |
|
|
|
}} |
|
|
|
isTableModule={true} |
|
|
|
onOk={handleExport} |
|
|
|
/> |
|
|
|
) : <></> |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<ResultFlow |
|
|
|
hasLoad={true} |
|
|
|
loading={loading} |
|
|
|
resultData={tableData} |
|
|
|
message={"暂无数据"} |
|
|
|
> |
|
|
|
<div className="table-wrap parent-table-scroll"> |
|
|
|
<Table |
|
|
|
rowSelection={rowSelection} |
|
|
|
rowKey={rowKey} |
|
|
|
columns={getNewColumns()} |
|
|
|
dataSource={tableData} |
|
|
|
pagination={false} |
|
|
|
locale={locale} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Pagination |
|
|
|
className="pagination-common" |
|
|
|
showSizeChanger={true} |
|
|
|
showQuickJumper={true} |
|
|
|
// showTotal={() => `共 ${total_records} 条`} |
|
|
|
total={total} |
|
|
|
current={pageData.pn} |
|
|
|
pageSize={pageData.page_size} |
|
|
|
pageSizeOptions={dictionary?.pageSizeOptions} |
|
|
|
onChange={onChange} |
|
|
|
// onShowSizeChange={onShowSizeChange} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</ResultFlow> |
|
|
|
</div> |
|
|
|
</div> */} |
|
|
|
</> |
|
|
|
); |
|
|
|
} |
|
|
|