|
|
@ -14,6 +14,8 @@ function Violation() { |
|
|
|
const [detailVisible, setDetailVisible] = useState(false); |
|
|
|
// 列表数据 |
|
|
|
const [tableData, setTableData] = useState([]); |
|
|
|
// 违规类型下拉 |
|
|
|
const [typeList, setTypeList] = useState([]); |
|
|
|
// 数据总数 |
|
|
|
const [total, setTotal] = useState(0); |
|
|
|
// 详情数据 |
|
|
@ -27,8 +29,8 @@ function Violation() { |
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
title: "用户手机号", |
|
|
|
dataIndex: "operator", |
|
|
|
key: "operator", |
|
|
|
dataIndex: "phone", |
|
|
|
key: "phone", |
|
|
|
align: "center", |
|
|
|
}, |
|
|
|
{ |
|
|
@ -39,20 +41,20 @@ function Violation() { |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "充电站", |
|
|
|
dataIndex: "plate_color", |
|
|
|
key: "plate_color", |
|
|
|
dataIndex: "name", |
|
|
|
key: "name", |
|
|
|
align: "center", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "违规类型", |
|
|
|
dataIndex: "berth_id", |
|
|
|
key: "berth_id", |
|
|
|
dataIndex: "type", |
|
|
|
key: "type", |
|
|
|
align: "center", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "记录创建时间", |
|
|
|
dataIndex: "in_time", |
|
|
|
key: "in_time", |
|
|
|
dataIndex: "create_time", |
|
|
|
key: "create_time", |
|
|
|
align: "center", |
|
|
|
}, |
|
|
|
{ |
|
|
@ -62,16 +64,16 @@ function Violation() { |
|
|
|
align: "center", |
|
|
|
fixed: "right", |
|
|
|
width: 100, |
|
|
|
render: (text, record, index) => { |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<Button type="primary" onClick={() => openModal(index, record)}> |
|
|
|
详情 |
|
|
|
</Button> |
|
|
|
</> |
|
|
|
) |
|
|
|
// render: (text, record, index) => { |
|
|
|
// return ( |
|
|
|
// <> |
|
|
|
// <Button type="primary" onClick={() => openModal(index, record)}> |
|
|
|
// 详情 |
|
|
|
// </Button> |
|
|
|
// </> |
|
|
|
// ) |
|
|
|
|
|
|
|
}, |
|
|
|
// }, |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
@ -89,25 +91,40 @@ function Violation() { |
|
|
|
placeholder: "请输入车牌号", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "charging", |
|
|
|
name: "name", |
|
|
|
type: "Input", |
|
|
|
label: "充电站", |
|
|
|
placeholder: "请输入充电站", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "operator", |
|
|
|
name: "type", |
|
|
|
type: "Select", |
|
|
|
label: "违规类型", |
|
|
|
options: typeList, |
|
|
|
defaultValue: "0", |
|
|
|
placeholder: "请选择违规类型", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "timeStart", |
|
|
|
name: "create_time", |
|
|
|
type: "DateRangePicker", |
|
|
|
label: "记录创建时间", |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
// 获取站点状态下拉 |
|
|
|
const getSelect = () => { |
|
|
|
ajax.recordsInquiry.getViolationSelect().then((res) => { |
|
|
|
const { status, data } = res |
|
|
|
if (status === 20000) { |
|
|
|
if (data && data.length) { |
|
|
|
setTypeList(data); |
|
|
|
} |
|
|
|
} else { |
|
|
|
message.error(res.message) |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 打开弹窗 |
|
|
|
const openModal = (index, record) => { |
|
|
|
setDetailData(record) |
|
|
@ -116,10 +133,10 @@ function Violation() { |
|
|
|
|
|
|
|
// 检索 |
|
|
|
const search = (params) => { |
|
|
|
ajax.getParkingList(params).then((res) => { |
|
|
|
ajax.recordsInquiry.getViolationList(params).then((res) => { |
|
|
|
if (res.status === 20000) { |
|
|
|
setTableData(res.data.list); |
|
|
|
setTotal(res.data.total); |
|
|
|
setTableData(res.data); |
|
|
|
setTotal(res.total); |
|
|
|
} else { |
|
|
|
message.error(res.message) |
|
|
|
} |
|
|
@ -130,6 +147,10 @@ function Violation() { |
|
|
|
setDetailVisible(true) |
|
|
|
} |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
getSelect() |
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
@ -137,14 +158,14 @@ function Violation() { |
|
|
|
<TableModule |
|
|
|
showSerial={true} |
|
|
|
isExport={false} |
|
|
|
diyButton={ |
|
|
|
<Button |
|
|
|
type="primary" |
|
|
|
onClick={handelAdd} |
|
|
|
> |
|
|
|
新增 |
|
|
|
</Button> |
|
|
|
} |
|
|
|
// diyButton={ |
|
|
|
// <Button |
|
|
|
// type="primary" |
|
|
|
// onClick={handelAdd} |
|
|
|
// > |
|
|
|
// 新增 |
|
|
|
// </Button> |
|
|
|
// } |
|
|
|
columns={columns} |
|
|
|
tableData={tableData} |
|
|
|
formSearch={formSearch} |
|
|
|