From 56d275fe918ecfcde358460e835dcbb80b6bf77b Mon Sep 17 00:00:00 2001 From: guoxin Date: Thu, 19 Oct 2023 18:00:21 +0800 Subject: [PATCH] =?UTF-8?q?fix():=E5=A2=9E=E5=8A=A0=E8=AE=A1=E8=B4=B9?= =?UTF-8?q?=E8=A7=84=E5=88=99=E7=BB=91=E5=AE=9A=E5=81=9C=E8=BD=A6=E5=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InRoadMgm/BusinessMgm/ChargeRules/index.scss | 10 +++ .../InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx | 81 ++++++++++++++++++---- src/pages/SystemMgm/RoleMgm/loadable.jsx | 19 +++-- src/services/search.js | 10 ++- 4 files changed, 97 insertions(+), 23 deletions(-) diff --git a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/index.scss b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/index.scss index 4fe3d51..2cbdd09 100644 --- a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/index.scss +++ b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/index.scss @@ -449,4 +449,14 @@ $color-primary : var(--color-primary); border-left: none !important; border-bottom-color: #626b7e !important; } + .bind-btn{ + margin-top: 20px; + display: flex; + .bindBtn{ + margin-left: 30%; + .colorReset{ + margin-left: 30px; + } + } + } } \ No newline at end of file diff --git a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx index a7610a2..323c5ee 100644 --- a/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx +++ b/src/pages/InRoadMgm/BusinessMgm/ChargeRules/loadable.jsx @@ -421,6 +421,12 @@ function ChargeRules(props) { const [bindData, setBindData] = useState({}) const bindModal = () => { setBindVisible(false) + setBindCarPark({}) + setBindData({ + vehicle_type:'', + charge_type:'', + name:'' + }) } //车辆类型 const handleCarType = (v) => { @@ -473,18 +479,60 @@ function ChargeRules(props) { const onSelectChange = (newSelectedRowKeys) => { setSelectedRowKeys(newSelectedRowKeys); }; + + const bindCanle = () => { + setBindVisible(false) + setBindCarPark({ + vehicle_type:'', + charge_type:'', + name:'' + }) + setBindData({ + vehicle_type:'', + charge_type:'', + name:'' + }) + } const rowSelection = { selectedRowKeys, onChange: onSelectChange, }; const hasSelected = selectedRowKeys.length > 0; const start = () => { - setLoading(true); - // ajax request after empty completing - setTimeout(() => { - setSelectedRowKeys([]); - }, 1000); + console.log(selectedRowKeys); + let arr = selectedRowKeys + let road_ids = arr.toString() + let data = { + road_ids, + vehicle_type: bindData.vehicle_type, + id: getBindId.id + } + ajax.getBind(data).then(res => { + if (res.status === 20000) { + message.success(res.message) + setSelectedRowKeys([]); + } else { + message.error(res.message) + } + }) }; + const bindBtn = () => { + let arr = selectedRowKeys + let road_ids = arr.toString() + let data = { + road_ids, + vehicle_type: bindData.vehicle_type, + id: getBindId.id + } + ajax.getBind(data).then(res => { + if (res.status === 20000) { + message.success(res.message) + setSelectedRowKeys([]); + } else { + message.error(res.message) + } + }) + } const [getOperationName, setGetOperationName] = useState([]) const operationName = () => { ajax.getOperator().then(res => { @@ -600,14 +648,14 @@ function ChargeRules(props) {