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,