From d8dd1fc7720f69bfe149afe0bb0c4c69b884a7e4 Mon Sep 17 00:00:00 2001 From: wanghx Date: Wed, 10 Jan 2024 17:34:02 +0800 Subject: [PATCH] =?UTF-8?q?feat():=20=E9=94=99=E5=B3=B0=E8=BD=A6=E5=9C=BA?= =?UTF-8?q?=E7=AE=A1=E7=90=86page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableModule/index.jsx | 5 +- .../OffPeakShareRecords/ShareParkMgm/index.scss | 9 ++ .../ShareParkMgm/infoModal/index.jsx | 123 +++++++++++++++++++++ .../ShareParkMgm/infoModal/index.scss | 32 ++++++ .../OffPeakShareRecords/ShareParkMgm/loadable.jsx | 115 ++++++++++++++++--- src/services/OffPeak/index.js | 28 ++++- 6 files changed, 296 insertions(+), 16 deletions(-) create mode 100644 src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx create mode 100644 src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.scss diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 7f23c2d..673d1c4 100644 --- a/src/components/TableModule/index.jsx +++ b/src/components/TableModule/index.jsx @@ -37,6 +37,7 @@ const { RangePicker } = DatePicker; //如想在外部调用搜索方法,请通过 , Ref.current.fetche 的方式调用 const TableModule = forwardRef((props, ref) => { const { + className="", pagename = "", columns = [], //表头 tableData = [], //table的数据 @@ -60,6 +61,7 @@ const TableModule = forwardRef((props, ref) => { limitCon,//自定义限制条件 isQuickMenu = [], mandatory_name, + renderAdd=() => {}, pageName = '',//路由名字 showSerial = false,// 表格是否显示序号 limitType = 0, // 时间限制类型 0无限制, < 0 今天之前不可选, > 0 今天之后不可选 @@ -934,7 +936,7 @@ const TableModule = forwardRef((props, ref) => { }) }, []) return ( -
+
{"查询条件"}
@@ -946,6 +948,7 @@ const TableModule = forwardRef((props, ref) => { + {renderAdd()}
diff --git a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/index.scss b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/index.scss index d5b67b3..787ba70 100644 --- a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/index.scss +++ b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/index.scss @@ -3,4 +3,13 @@ &:hover { cursor: pointer; } +} +.share-park-table { + .bottomBox { + > button { + &:nth-child(2) { + margin: 0 25px; + } + } + } } \ No newline at end of file diff --git a/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx new file mode 100644 index 0000000..5dece80 --- /dev/null +++ b/src/pages/OffPeak/OffPeakShareRecords/ShareParkMgm/infoModal/index.jsx @@ -0,0 +1,123 @@ +import React, {useState, useEffect} from 'react' +import { Modal, Form, Input, DatePicker, TreeSelect, Button, Col, Row, Select } from 'antd' +import { SearchableTreeSelect } from '@/components' +import moment from 'moment' +import './index.scss' + +function InfoModal (props) { + const { + visible, + isEdit=false, + isDetail=false, + onCancel, + timeRulesData=[], + data={}, + onOk + } = props + + const [baseForm] = Form.useForm() + + const rules = [ + { + required: true, + message: "此为必填字段", + }, + ] + + const handleSave = () => { + baseForm.validateFields().then((data) => { + onOk({...data}) + }).catch(err => { + console.error(err) + }) + } + + const validateCws = (_, value) => { + const total = baseForm.getFieldValue('total'); + if (value > total) { + return Promise.reject(new Error('可预约车位数大于总数')); + } + return Promise.resolve(); + } + + useEffect(() => { + if (visible) { + baseForm.setFieldsValue({...data}) + console.log(data) + } else { + baseForm.resetFields() + } + }, [visible]) + + return ( + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +