Browse Source

fix():bug修改

tags/PMS_V1.0.0_Alpha5
xingjx 1 year ago
parent
commit
33ac78b775
  1. 2
      src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyDuration/loadable.jsx
  2. 2
      src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx
  3. 1
      src/pages/OutRoadMgm/OutDeviceMgm/OutNvrMgm/loadable.jsx
  4. 26
      src/pages/OutRoadMgm/OutRoadOverview/loadable.jsx
  5. 12
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx
  6. 7
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/TimePart.jsx
  7. 10
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx
  8. 2
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BillingRules.jsx
  9. 6
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx
  10. 13
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarManagement.jsx
  11. 9
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/Detail.jsx
  12. 3
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx

2
src/pages/DataAnalysisPrediction/ParkingBusinessAly/ParkingAlyDuration/loadable.jsx

@ -1041,7 +1041,7 @@ function ParkingAlyDuration() {
onChange={(key) => { onChange={(key) => {
setTabCarKey(key); setTabCarKey(key);
setPageInfo({ ...pageInfo, ...{ pn: 1 } }); setPageInfo({ ...pageInfo, ...{ pn: 1 } });
getListData({}, { pn: 1 })
getListData({ sort: 1 }, { pn: 1 })
}} }}
items={[ items={[
{ {

2
src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx

@ -429,7 +429,7 @@ function OutDevice() {
columns={columns} columns={columns}
pagination={false} pagination={false}
loading={tabLoading} loading={tabLoading}
scroll={{y:620}}
scroll={{ y: "calc(100% - 50px)" }}
/> />
<Pagination {...paginationProps} className="pagination-common" /> <Pagination {...paginationProps} className="pagination-common" />
</ResultFlowResult> </ResultFlowResult>

1
src/pages/OutRoadMgm/OutDeviceMgm/OutNvrMgm/loadable.jsx

@ -637,6 +637,7 @@ function OutNvrMgm(props) {
columns={tableColumns} columns={tableColumns}
pagination={false} pagination={false}
loading={tabLoading} loading={tabLoading}
scroll={{ y: "calc(100% - 50px)" }}
/> />
<Pagination {...paginationProps} className="pagination-common" /> <Pagination {...paginationProps} className="pagination-common" />
</ResultFlowResult> </ResultFlowResult>

26
src/pages/OutRoadMgm/OutRoadOverview/loadable.jsx

@ -32,6 +32,24 @@ const OutRoadOverview = () => {
const [recordData, setRecordData] = useState({}); const [recordData, setRecordData] = useState({});
// //
const [displayMapping, setDisplayMapping] = useState({}) const [displayMapping, setDisplayMapping] = useState({})
const numberFormat = (num) => {
if (!num) {
return "0"
}
let str = JSON.stringify(num);
let len = str.length;
if (len > 8) {
let str1 = str.substring(0, len - 8);
let str2 = str.substring(str1.length, str1.length + 1);
str = str1 + "." + str2 + "亿";
}
else if (len > 4 && len <= 8) {
let str1 = str.substring(0, len - 4);
let str2 = str.substring(str1.length, str1.length + 1);
str = str1 + "." + str2 + '万';
}
return str;
}
// //
const getRevenueOption = (data) => { const getRevenueOption = (data) => {
// //
@ -56,7 +74,7 @@ const OutRoadOverview = () => {
data: dates.map((item) => { data: dates.map((item) => {
for (const { pay_date, income } of areaData) { for (const { pay_date, income } of areaData) {
console.log(pay_date, income); console.log(pay_date, income);
if (pay_date === item) return income;
if (pay_date === item) return numberFormat(income);
} }
return 0; return 0;
}), }),
@ -79,7 +97,7 @@ const OutRoadOverview = () => {
setRevenueData({ setRevenueData({
title: { title: {
text: "停车场收入概览",
text: "",
textStyle: { textStyle: {
color: "#fff", color: "#fff",
}, },
@ -428,7 +446,9 @@ const OutRoadOverview = () => {
</div> </div>
<div id="body"> <div id="body">
<div className="left"> <div className="left">
<div className="revenue-left card" style={{ visibility: displayMapping['13'] ? '' : 'hidden' }}>
{/* <div className="revenue-left card" style={{ visibility: displayMapping['13'] ? '' : 'hidden' }}> */}
<div className="revenue-left card">
<div style={{ fontSize: '18px', fontWeight: '800' }}>停车场收入概览</div>
<ReactEcharts <ReactEcharts
option={revenueData} option={revenueData}
style={{ height: "100%", width: "100%", overflow: "hidden" }} style={{ height: "100%", width: "100%", overflow: "hidden" }}

12
src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx

@ -26,6 +26,12 @@ function EffectiveDate(props) {
disable = false, disable = false,
record = {}, record = {},
} = props; } = props;
//
const disabledDate = (current) => {
//return current && current < moment().subtract(1, "days"); //
return current && current < moment().endOf("day");//
}
const [form] = Form.useForm(); const [form] = Form.useForm();
const [effTimePart, setEffTimePart] = useState() const [effTimePart, setEffTimePart] = useState()
const [timePartList, setTimePartList] = useState(() => { const [timePartList, setTimePartList] = useState(() => {
@ -55,7 +61,7 @@ function EffectiveDate(props) {
} }
const addTimePart = () => { const addTimePart = () => {
if (flatten(effTimePart).some(ele => ele === false)) { if (flatten(effTimePart).some(ele => ele === false)) {
message.error("请先把当前时段填写完整")
message.error("请先把当前时段填写正确")
return return
} }
const randomNum = Math.floor(Math.random() * 1000); const randomNum = Math.floor(Math.random() * 1000);
@ -142,7 +148,7 @@ function EffectiveDate(props) {
initialValues={{ initialValues={{
unit_fee_type_group: [], unit_fee_type_group: [],
...record, ...record,
date: moment(record.date),
date: moment(new Date()).add(1, 'days'),
}} }}
disabled={disable} disabled={disable}
> >
@ -153,7 +159,7 @@ function EffectiveDate(props) {
name="date" name="date"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<DatePicker />
<DatePicker disabledDate={disabledDate} getPopupContainer={(e) => e.parentNode}/>
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>

7
src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/TimePart.jsx

@ -61,6 +61,10 @@ function TimePart(props) {
//timePart(false) //timePart(false)
effTimePart(timearr) effTimePart(timearr)
} else { } else {
if (all.start != "00:00:00" && countDown(all.end) - countDown(all.start) < 0) {
message.error('结束时间需大于开始时间,设置00:00:00除外')
return
}
console.log('完整了', all, countDown(all.end) - countDown(all.start), all.items[0].segment * 60) console.log('完整了', all, countDown(all.end) - countDown(all.start), all.items[0].segment * 60)
if (all.end != '00:00:00' && countDown(all.end) - countDown(all.start) < all.items[0].segment * 60) { if (all.end != '00:00:00' && countDown(all.end) - countDown(all.start) < all.items[0].segment * 60) {
message.error("输入的'前...分钟'数据要小于时间段时间") message.error("输入的'前...分钟'数据要小于时间段时间")
@ -202,7 +206,7 @@ function TimePart(props) {
<Row gutter={[30]}> <Row gutter={[30]}>
<Col span={16}> <Col span={16}>
<Form.Item label={`时段${index}`} name="time_part" rules={[{ required: true, message: '请选择时间段!' }]}> <Form.Item label={`时段${index}`} name="time_part" rules={[{ required: true, message: '请选择时间段!' }]}>
<TimePicker.RangePicker style={{ width: "50%" }} order={false} secondStep={60} />
<TimePicker.RangePicker style={{ width: "50%" }} order={false} secondStep={60} getPopupContainer={(e) => e.parentNode}/>
</Form.Item> </Form.Item>
<div style={{ marginBottom: '10px', color: '#858585' }}>*时段结束时间设置00:00:00相当于23:59:59</div> <div style={{ marginBottom: '10px', color: '#858585' }}>*时段结束时间设置00:00:00相当于23:59:59</div>
</Col> </Col>
@ -221,6 +225,7 @@ function TimePart(props) {
<Col span={24}> <Col span={24}>
<Form.Item label={`区间${index}`} name="type" initialValue={1}> <Form.Item label={`区间${index}`} name="type" initialValue={1}>
<Select <Select
getPopupContainer={(e) => e.parentNode}
style={{ width: "20%" }} style={{ width: "20%" }}
options={[ options={[
{ {

10
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx

@ -28,6 +28,7 @@ function AddParking(props) {
status = "add", status = "add",
type = 0, type = 0,
search = () => { }, search = () => { },
closeDetail= () => { },
} = props; } = props;
useEffect(() => { useEffect(() => {
if (type == 2 || type == 3 || type == 4) { if (type == 2 || type == 3 || type == 4) {
@ -231,6 +232,7 @@ function AddParking(props) {
if (res.status === 20000) { if (res.status === 20000) {
message.success("编辑成功"); message.success("编辑成功");
close(); close();
closeDetail(Math.ceil(Math.random()*10));
//location.reload(); //location.reload();
} else { } else {
message.error(res.message); message.error(res.message);
@ -252,10 +254,10 @@ function AddParking(props) {
message.error('车场泊位数必须为数字!') message.error('车场泊位数必须为数字!')
return return
} }
// if (topBerthNum && parseFloat(values.total_berth_number) < topBerthNum) {
// message.error('' + topBerthNum)
// //return
// }
if (processImgData(fileList) && processImgData(fileList).length == 0) {
message.error('请上传图片!')
return
}
if (!lngLat) { if (!lngLat) {
message.error('请选择经纬度') message.error('请选择经纬度')
return return

2
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BillingRules.jsx

@ -302,7 +302,7 @@ function BillingRules(props) {
name="rule_id" name="rule_id"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Select options={chargeRuleList} />
<Select options={chargeRuleList.slice(1)} />
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>

6
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx

@ -152,8 +152,7 @@ function CarGroupMgm({ id }) {
page_size, page_size,
}); });
} }
useEffect(() => {
const getAllCarGroup = () => {
ajax ajax
.getAllCarGroup({ road_id: id }) .getAllCarGroup({ road_id: id })
.then((res) => { .then((res) => {
@ -166,6 +165,9 @@ function CarGroupMgm({ id }) {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}
useEffect(() => {
getAllCarGroup()
}, []); }, []);
const toCarGroup = (type) => { const toCarGroup = (type) => {

13
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarManagement.jsx

@ -41,8 +41,8 @@ function CarManagement({ id }) {
}, },
{ {
title: "车辆组", title: "车辆组",
dataIndex: "group_id",
key: "group_id",
dataIndex: "group_name",
key: "group_name",
align: "center", align: "center",
}, },
{ {
@ -135,7 +135,7 @@ function CarManagement({ id }) {
<div> <div>
<a <a
onClick={() => { onClick={() => {
if (record.status === 1) {
if (record.status == "1") {
disableVehicle(record.id); disableVehicle(record.id);
submit(form.getFieldValue()); submit(form.getFieldValue());
return; return;
@ -241,6 +241,7 @@ function CarManagement({ id }) {
setEditModal({ visible: false }); setEditModal({ visible: false });
submit(form.getFieldValue()); submit(form.getFieldValue());
editForm.resetFields(); editForm.resetFields();
getAllCarGroup()
} else { } else {
message.error(res.message) message.error(res.message)
} }
@ -294,8 +295,7 @@ function CarManagement({ id }) {
useEffect(() => { useEffect(() => {
submit(); submit();
}, [pageData]); }, [pageData]);
useEffect(() => {
const getAllCarGroup = () => {
ajax ajax
.getAllCarGroup({ road_id: id }) .getAllCarGroup({ road_id: id })
.then((res) => { .then((res) => {
@ -308,6 +308,9 @@ function CarManagement({ id }) {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}
useEffect(() => {
getAllCarGroup()
}, []); }, []);
return ( return (
<div style={{ margin: "20px 0 0" }}> <div style={{ margin: "20px 0 0" }}>

9
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/Detail.jsx

@ -15,6 +15,7 @@ function Detail(props) {
detailData = {}, detailData = {},
visible = false, visible = false,
close = () => { }, close = () => { },
closeDetail,//
itemData = {}, itemData = {},
setConfigModal,// setConfigModal,//
setEditModal, setEditModal,
@ -33,7 +34,7 @@ function Detail(props) {
{ {
label: "停车场详情", label: "停车场详情",
key: "1", key: "1",
children: <ParkingDetail itemData={itemData} setEditModal={setEditModal} setConfigModal={setConfigModal} />,
children: <ParkingDetail itemData={itemData} setEditModal={setEditModal} setConfigModal={setConfigModal} closeDetail={closeDetail} />,
}, },
{ {
label: "车场评价详情", label: "车场评价详情",
@ -68,6 +69,7 @@ function ParkingDetail(props) {
const { itemData, const { itemData,
setConfigModal, setConfigModal,
setEditModal,// setEditModal,//
closeDetail,
} = props; } = props;
return ( return (
<Tabs <Tabs
@ -80,7 +82,7 @@ function ParkingDetail(props) {
{ {
label: "子车场信息", label: "子车场信息",
key: "2", key: "2",
children: <ChildParkingContent itemData={itemData} id={itemData.id} ChildParkingContent setEditModal={setEditModal} setConfigModal={setConfigModal} />,
children: <ChildParkingContent closeDetail={closeDetail} itemData={itemData} id={itemData.id} ChildParkingContent setEditModal={setEditModal} setConfigModal={setConfigModal} />,
}, },
]} ]}
></Tabs> ></Tabs>
@ -173,6 +175,7 @@ function ChildParkingContent(props) {
const { const {
setConfigModal,// setConfigModal,//
setEditModal,// setEditModal,//
closeDetail,
} = props; } = props;
const columns = [ const columns = [
@ -268,7 +271,7 @@ function ChildParkingContent(props) {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}, []);
}, [closeDetail]);
return ( return (
<> <>
<Table <Table

3
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx

@ -42,6 +42,7 @@ function OutSegment() {
const [sessionTabList, setSessionTabList] = useSessionStorageState('outSegment', { const [sessionTabList, setSessionTabList] = useSessionStorageState('outSegment', {
value: '' value: ''
}) })
const [closeDetail, setCloseDetail] = useState(false)
const [formData, setFormData] = useState() const [formData, setFormData] = useState()
const [tipData, setTipData] = useState({ const [tipData, setTipData] = useState({
count: '', count: '',
@ -618,6 +619,7 @@ function OutSegment() {
visible={checkModal.visible} visible={checkModal.visible}
close={checkModal.close} close={checkModal.close}
itemData={checkModal.record} itemData={checkModal.record}
closeDetail={closeDetail}
setConfigModal={(myData) => { setConfigModal={(myData) => {
console.log(myData, 'myData') console.log(myData, 'myData')
if(myData){ if(myData){
@ -644,6 +646,7 @@ function OutSegment() {
record={editModal.record} record={editModal.record}
status={editModal.status} status={editModal.status}
type={editModal.type} type={editModal.type}
closeDetail={(e)=>{console.log(12222,e);setCloseDetail(e)}}
/> />
)} )}
<ConfigParking <ConfigParking

Loading…
Cancel
Save