From 83a61c058ae3006bd02748502adc3b4386968ad7 Mon Sep 17 00:00:00 2001 From: xingjx Date: Fri, 12 Jan 2024 15:56:41 +0800 Subject: [PATCH] =?UTF-8?q?fix():bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx | 48 ++++++++++++++- src/pages/OutRoadMgm/OutRoadOverview/loadable.jsx | 68 ++++++++++++---------- .../OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx | 5 +- .../ConfigParking/CarMgm/CarGroupMgm.jsx | 1 + .../OutSegmentMgm/OutSegment/loadable.jsx | 18 +++--- 5 files changed, 97 insertions(+), 43 deletions(-) diff --git a/src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx b/src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx index 545180d..ccc8d76 100644 --- a/src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx +++ b/src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx @@ -6,6 +6,7 @@ import { Button, Pagination, Table, + Cascader, Dropdown, } from "antd"; import { ResultFlowResult } from "@/components"; @@ -54,6 +55,8 @@ function OutDevice() { }); // 详情数据 const [rowData, setRowData] = useState({}); + //区域的参数 + const [areaId, setAreaId] = useState([]); //区域id // 商户名称 const [storeData, setStoreData] = useState([]); const [roadData, setRoadData] = useState([]); @@ -213,7 +216,7 @@ function OutDevice() { setDefaultParams({ ...postData, ...pageInfo }); // console.log(postData); setTabLoading(true); - ajax.getDeviceMgnList({ ...postData, ...v, ...pageInfo }).then( + ajax.getDeviceMgnList({ ...postData, ...v, ...pageInfo, area_id: formData.area, }).then( (res) => { if (parseInt(res?.status) === 20000) { setResultData(res?.data || {}); @@ -293,6 +296,27 @@ function OutDevice() { ); }; + function cascaderChange(value, options) { + console.log(options) + let last = options[options.length - 1]; + let res = []; + if (last.children) { + addChild(last, res); + } + res.push(last.id); + setAreaId(res); + setFormData({ ...formData, area: res, area_id: value }) + } + + const addChild = (child, res) => { + if (child.children) { + child.children.forEach((item) => { + addChild(item, res); + }); + } else { + res.push(child.id); + } + }; // 返回并刷新列表 const handleBack = () => { setPageType("1"); @@ -308,7 +332,7 @@ function OutDevice() {
区域
-