From b0a4b449b537c5c710981dd945255d02307f7ebd Mon Sep 17 00:00:00 2001 From: xingjx Date: Tue, 5 Dec 2023 11:36:08 +0800 Subject: [PATCH] =?UTF-8?q?fix():=E8=B7=AF=E5=A4=96=E7=B3=BB=E7=BB=9Fbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableModule/index.jsx | 39 +++++++++++++++++-- .../OperationCenter/CarMgm/CarInfo/loadable.jsx | 2 +- .../OperationCenter/UserMgm/UserInfo/loadable.jsx | 2 +- .../OutRoadMgm/OutSegmentMgm/OutSegment/index.scss | 20 ++++++++++ .../OutSegmentMgm/OutSegment/loadable.jsx | 45 +++++++++++++++------- src/services/common.js | 9 +++++ 6 files changed, 98 insertions(+), 19 deletions(-) diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 39ff839..7d957de 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -258,6 +258,39 @@ const TableModule = forwardRef((props, ref) => { const handleChange = (newValue) => { setValue(newValue); }; + const fetchPlateSearch = (value, callback, item) => { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + currentValue = value; + const fake = () => { + const str = { + plate: value, + }; + ajax.getPlateSearch(str).then((res) => { + if (currentValue === value) { + const data = res.data.map((item) => ({ + value: item.value, + text: item.label, + })); + callback(data); + } + }) + }; + timeout = setTimeout(fake, 1000); + }; + const handlePlateSearch = (newValue, item) => { + console.log(newValue, item); + if (newValue) { + fetchPlateSearch(newValue, setData, item); + } else { + setData([]); + } + }; + const handlePlateChange = (newValue) => { + setValue(newValue); + }; // useEffect(() => { // console.log(deftime.startDateTime); // if (deftime.startDateTime) { @@ -423,12 +456,12 @@ const TableModule = forwardRef((props, ref) => { + + 参数默认为5次,“≥n”代表正常,若为“0”表示不限制} + > + ? + - + + 参数默认为30天,“≥n”代表正常,若为“0”表示不限制} + > + ? + +

须知:修改默认参数配置会对全局车场评分有影响,点击确定立即生效,请谨慎修改!

{ data: params, }); }; +//车牌搜索 +const getPlateSearch = (params) => { + return ajax({ + url: "/api/ope/car/plate_list", + type: "get", + data: params, + }); +}; export default { getSysConfig, getRoadSearch, + getPlateSearch, getUserInfo, login, getPubKey,