From 0ab34cae8096087c24d6de7b978e5f196326e8dc Mon Sep 17 00:00:00 2001 From: wanghx Date: Thu, 11 Jan 2024 17:00:35 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E9=94=99=E6=97=B6=E8=BD=A6=E5=9C=BA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ImportBtn/index.jsx | 2 +- src/components/TableModule/index.jsx | 2 +- .../ShareParkMgm/infoModal/index.jsx | 15 +++++++++--- .../OffPeakShareRecords/ShareParkMgm/loadable.jsx | 18 ++++++++++++-- .../OffPeakShareRecords/StallCount/loadable.jsx | 28 +++++++++++++++++----- src/services/OffPeak/index.js | 12 ++++++++-- 6 files changed, 62 insertions(+), 15 deletions(-) diff --git a/src/components/ImportBtn/index.jsx b/src/components/ImportBtn/index.jsx index a088ae1..469a373 100644 --- a/src/components/ImportBtn/index.jsx +++ b/src/components/ImportBtn/index.jsx @@ -23,7 +23,7 @@ function ImportBtn(props) { if (e && e.status == 20000) { setMsg(e.message) } else { - message.error(e.message) + // message.error(e.message) } } diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 5c08be9..1e4d390 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -655,7 +655,7 @@ const TableModule = forwardRef((props, ref) => { onChange={handleChange} defaultValue={item.defaultValue} filterOption={(input, option) => (option?.label ?? '').includes(input)} - options={getRoadList} + options={item.options || getRoadList} /> ); diff --git a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx index 5dece80..44360e4 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx +++ b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx @@ -11,6 +11,7 @@ function InfoModal (props) { isDetail=false, onCancel, timeRulesData=[], + parkList=[], data={}, onOk } = props @@ -24,6 +25,10 @@ function InfoModal (props) { }, ] + const handleParkChange = (v, _) => { + baseForm.setFieldValue('total', _.berth_number) + } + const handleSave = () => { baseForm.validateFields().then((data) => { onOk({...data}) @@ -66,14 +71,18 @@ function InfoModal (props) { - - + + {/* */} + + diff --git a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx index f473522..63572e1 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx +++ b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/loadable.jsx @@ -15,6 +15,7 @@ function ShareParkMgm() { const [isEdit, setIsEdit] = useState(false) const [editData, setEditData] = useState({}) const [timeRulesData, setTimeRulesData] = useState([]) + const [parkList, setParkList] = useState([]) const tableRef = useRef(null) const columns = [ { @@ -70,11 +71,11 @@ function ShareParkMgm() { placeholder:"请选择商户名称" }, { - type: "Input", + type: "SearchSelect", label: "车场名称", placeholder: "请输入车场名称", name: "parkName", - hiddenCount: 1 + options: [{label: '全部', value: ""}, ...parkList] }, { type: "Input", @@ -85,6 +86,16 @@ function ShareParkMgm() { } ]; + const ajaxGetPark = () => { + ajax.getParkList().then(res => { + if (res.status == 20000) { + setParkList([...res.data]) + } else { + setParkList([]) + } + }) + } + const handleEdit = (data) => { setIsEdit(true) setEditData({...data}) @@ -171,6 +182,7 @@ function ShareParkMgm() { useEffect(() => { getTimeRulesData() + ajaxGetPark() }, []) @@ -187,6 +199,7 @@ function ShareParkMgm() { renderAdd={() => ( )} + isExport={false} // mandatory={'parking_num'} // mandatory_name={'泊位号'} // pagename="PDA操作记录" @@ -201,6 +214,7 @@ function ShareParkMgm() { onOk={handleEditConfirm} data={editData} timeRulesData={timeRulesData} + parkList={parkList} /> ); diff --git a/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx b/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx index 3d31406..1f0c1a9 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx +++ b/src/pages/OffPeak/OffPeakShareRecords/StallCount/loadable.jsx @@ -10,6 +10,7 @@ import { TableModule } from "@/components"; function StallCount() { + const [parkList, setParkList] = useState([]) const columns = [ { title: '日期', @@ -56,12 +57,12 @@ function StallCount() { name: 'time' }, { - type: 'Input', - label: '车场名称', - name: 'parkName', - placeholder: '请输入车场名称', - hiddenCount: 1 - } + type: "SearchSelect", + label: "车场名称", + placeholder: "请输入车场名称", + name: "parkName", + options: [{label: '全部', value: ""}, ...parkList] + }, ]; //搜索参数初始化 const initFormData = { @@ -81,6 +82,20 @@ function StallCount() { }); } + const ajaxGetPark = () => { + ajax.getParkList().then(res => { + if (res.status == 20000) { + setParkList([...res.data]) + } else { + setParkList([]) + } + }) + } + + useEffect(() => { + ajaxGetPark() + }, []) + return ( ); diff --git a/src/services/OffPeak/index.js b/src/services/OffPeak/index.js index bccf2c6..036c5d0 100644 --- a/src/services/OffPeak/index.js +++ b/src/services/OffPeak/index.js @@ -59,7 +59,14 @@ const getTimeRulesData = () => { return ajax({ url: "/api/off_peak/park_info/get_time_rules_list", type: "get", - data: params, + // data: params, + }) +} + +const getParkList = () => { + return ajax({ + url: '/api/common/get_park_select', + type: 'get' }) } @@ -72,5 +79,6 @@ export default { shareParkAdd, getBookInfoList, getBreakInfoList, - getOffPeakRecords + getOffPeakRecords, + getParkList } \ No newline at end of file