|
|
@ -2,10 +2,11 @@ import React, { useState, useRef, useEffect } from "react"; |
|
|
|
import { message, Modal, Button ,Input} from "antd"; |
|
|
|
import ajax from "@/services"; |
|
|
|
import { TableModule ,FormInput,FormSelect} from "@/components"; |
|
|
|
import { utils } from "@/config/common"; |
|
|
|
import "./index.scss"; |
|
|
|
|
|
|
|
function PhysicalPileManagement() { |
|
|
|
const [selectData, setSelectData] = useState([]); |
|
|
|
const [selectData, setSelectData] = useState([{value: 0, label: "全部"}]); |
|
|
|
const listData={ |
|
|
|
name: "", |
|
|
|
code:"", |
|
|
@ -15,15 +16,6 @@ function PhysicalPileManagement() { |
|
|
|
} |
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
title: "序号", |
|
|
|
dataIndex: "index", |
|
|
|
key: "index", |
|
|
|
align:"center", |
|
|
|
render: (_, record, index) => { |
|
|
|
return index + 1; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "设备名称", |
|
|
|
dataIndex: "name", |
|
|
|
align: "center", |
|
|
@ -72,7 +64,7 @@ function PhysicalPileManagement() { |
|
|
|
//搜索参数初始化 |
|
|
|
const initFormData = { |
|
|
|
name: "", |
|
|
|
// charging_station_id: "0", |
|
|
|
charging_station_id: 0, |
|
|
|
}; |
|
|
|
const [visible, setVisible] = useState(false); |
|
|
|
// 新增数据 |
|
|
@ -83,6 +75,7 @@ function PhysicalPileManagement() { |
|
|
|
const [total, setTotal] = useState(0); |
|
|
|
|
|
|
|
function search(params) { |
|
|
|
utils.tableScrollTop("parent-table-scroll"); |
|
|
|
ajax.getList(params).then((res) => { |
|
|
|
if (res.status === 20000) { |
|
|
|
setTableData(res.data.list); |
|
|
@ -104,16 +97,16 @@ function PhysicalPileManagement() { |
|
|
|
} |
|
|
|
// 确定 |
|
|
|
const handleOk = () => { |
|
|
|
if(!rowData.name){ |
|
|
|
if(!rowData.name||rowData.name.match(/^\s+$/)){ |
|
|
|
message.destroy(); |
|
|
|
message.warning(`设备名称不可为空`); |
|
|
|
return |
|
|
|
}else if(!rowData.code){ |
|
|
|
}else if(!rowData.code||rowData.code.match(/^\s+$/)){ |
|
|
|
message.destroy(); |
|
|
|
message.warning(`硬件编码不可为空`); |
|
|
|
return |
|
|
|
} |
|
|
|
else if(!rowData.model){ |
|
|
|
else if(!rowData.model||rowData.model.match(/^\s+$/)){ |
|
|
|
message.destroy(); |
|
|
|
message.warning(`设备型号不可为空`); |
|
|
|
return |
|
|
@ -159,6 +152,7 @@ function PhysicalPileManagement() { |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<TableModule |
|
|
|
showSerial={true} |
|
|
|
ref={tableRef} |
|
|
|
columns={columns} |
|
|
|
tableData={tableData} |
|
|
|