Browse Source

fix():bug修改

tags/PMS_V1.0.0_Alpha5
xingjx 1 year ago
parent
commit
83a61c058a
  1. 46
      src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx
  2. 52
      src/pages/OutRoadMgm/OutRoadOverview/loadable.jsx
  3. 5
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx
  4. 1
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx
  5. 16
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx

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

@ -6,6 +6,7 @@ import {
Button, Button,
Pagination, Pagination,
Table, Table,
Cascader,
Dropdown, Dropdown,
} from "antd"; } from "antd";
import { ResultFlowResult } from "@/components"; import { ResultFlowResult } from "@/components";
@ -54,6 +55,8 @@ function OutDevice() {
}); });
// //
const [rowData, setRowData] = useState({}); const [rowData, setRowData] = useState({});
//
const [areaId, setAreaId] = useState([]); //id
// //
const [storeData, setStoreData] = useState([]); const [storeData, setStoreData] = useState([]);
const [roadData, setRoadData] = useState([]); const [roadData, setRoadData] = useState([]);
@ -213,7 +216,7 @@ function OutDevice() {
setDefaultParams({ ...postData, ...pageInfo }); setDefaultParams({ ...postData, ...pageInfo });
// console.log(postData); // console.log(postData);
setTabLoading(true); setTabLoading(true);
ajax.getDeviceMgnList({ ...postData, ...v, ...pageInfo }).then(
ajax.getDeviceMgnList({ ...postData, ...v, ...pageInfo, area_id: formData.area, }).then(
(res) => { (res) => {
if (parseInt(res?.status) === 20000) { if (parseInt(res?.status) === 20000) {
setResultData(res?.data || {}); setResultData(res?.data || {});
@ -293,6 +296,27 @@ function OutDevice() {
); );
}; };
function cascaderChange(value, options) {
console.log(options)
let last = options[options.length - 1];
let res = [];
if (last.children) {
addChild(last, res);
}
res.push(last.id);
setAreaId(res);
setFormData({ ...formData, area: res, area_id: value })
}
const addChild = (child, res) => {
if (child.children) {
child.children.forEach((item) => {
addChild(item, res);
});
} else {
res.push(child.id);
}
};
// //
const handleBack = () => { const handleBack = () => {
setPageType("1"); setPageType("1");
@ -308,7 +332,7 @@ function OutDevice() {
<div className="form-Wrap"> <div className="form-Wrap">
<div className="form-box"> <div className="form-box">
<div className="form-txt">区域</div> <div className="form-txt">区域</div>
<Select
{/* <Select
className="form-con" className="form-con"
allowClear allowClear
fieldNames={{ fieldNames={{
@ -319,8 +343,26 @@ function OutDevice() {
placeholder="全部" placeholder="全部"
value={formData?.area_id || undefined} value={formData?.area_id || undefined}
onChange={(e) => setFormData({ ...formData, area_id: e })} onChange={(e) => setFormData({ ...formData, area_id: e })}
/> */}
<div style={{ width: '260px' }}>
<Cascader
style={{ width: '100%' }}
onChange={cascaderChange}
allowClear={false}
options={areaList}
value={formData?.area_id || undefined}
placeholder="请选择区域"
expandTrigger="hover"
changeOnSelect
fieldNames={{
label: "name",
value: "id",
children: "children",
}}
/> />
</div> </div>
</div>
<div className="form-box"> <div className="form-box">
<div className="form-txt">商户名称</div> <div className="form-txt">商户名称</div>
<Select <Select

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

@ -32,24 +32,6 @@ 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) => {
// //
@ -137,7 +119,17 @@ const OutRoadOverview = () => {
}, },
}, },
axisLabel: { axisLabel: {
formatter: "{value}元",
//formatter: "{value}",
formatter: function (value, index) {
if (value <= 10000) {
value = value + "元";
} else if (value >= 10000 && value < 10000000) {
value = value / 10000 + "万元";
} else if (value >= 10000000) {
value = value / 10000000 + "千万元";
}
return value;
},
textStyle: { textStyle: {
color: "#bbb", color: "#bbb",
}, },
@ -146,7 +138,7 @@ const OutRoadOverview = () => {
color: ["#4DC3FF", "#FFD767"], color: ["#4DC3FF", "#FFD767"],
series: seriesData, series: seriesData,
grid: { grid: {
x: 50,
x: 55,
y: 55, y: 55,
x2: 30, x2: 30,
y2: 20, y2: 20,
@ -198,7 +190,7 @@ const OutRoadOverview = () => {
setRecordData({ setRecordData({
title: { title: {
text: "停车场记录概览",
text: "",
textStyle: { textStyle: {
color: "#fff", color: "#fff",
}, },
@ -238,7 +230,17 @@ const OutRoadOverview = () => {
}, },
}, },
axisLabel: { axisLabel: {
formatter: "{value}个",
//formatter: "{value}",
formatter: function (value, index) {
if (value <= 10000) {
value = value + "个";
} else if (value >= 10000 && value < 10000000) {
value = value / 10000 + "万个";
} else if (value >= 10000000) {
value = value / 10000000 + "千万个";
}
return value;
},
textStyle: { textStyle: {
color: "#bbb", color: "#bbb",
}, },
@ -449,18 +451,24 @@ const OutRoadOverview = () => {
<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 className="revenue-left card"> */}
<div style={{ fontSize: '18px', fontWeight: '800' }}>停车场收入概览</div> <div style={{ fontSize: '18px', fontWeight: '800' }}>停车场收入概览</div>
<div style={{ height: "190px", width: "100%", zoom: 1 / document.body.style.zoom }}>
<ReactEcharts <ReactEcharts
option={revenueData} option={revenueData}
style={{ height: "100%", width: "100%", overflow: "hidden" }} style={{ height: "100%", width: "100%", overflow: "hidden" }}
/> />
</div> </div>
</div>
<div className="record-left card" style={{ visibility: displayMapping['14'] ? '' : 'hidden' }}> <div className="record-left card" style={{ visibility: displayMapping['14'] ? '' : 'hidden' }}>
{/* <div className="revenue-left card"> */}
<div style={{ fontSize: '18px', fontWeight: '800' }}>停车场记录概览</div>
<div style={{ height: "190px", width: "100%", zoom: 1 / document.body.style.zoom }}>
<ReactEcharts <ReactEcharts
option={recordData} option={recordData}
style={{ height: "100%", width: "100%", overflow: "hidden" }} style={{ height: "100%", width: "100%", overflow: "hidden" }}
/> />
</div> </div>
</div> </div>
</div>
<div className="center"> <div className="center">
<div> <div>
<Select <Select

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

@ -148,7 +148,8 @@ function EffectiveDate(props) {
initialValues={{ initialValues={{
unit_fee_type_group: [], unit_fee_type_group: [],
...record, ...record,
date: moment(new Date()).add(1, 'days'),
//date: moment(new Date()).add(1, 'days'),
date: record.date ? moment(record.date) : moment(new Date()).add(1, 'days'),
}} }}
disabled={disable} disabled={disable}
> >
@ -159,7 +160,7 @@ function EffectiveDate(props) {
name="date" name="date"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<DatePicker disabledDate={disabledDate} getPopupContainer={(e) => e.parentNode}/>
<DatePicker disabledDate={disabledDate} getPopupContainer={(e) => e.parentNode} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>

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

@ -189,6 +189,7 @@ function CarGroupMgm({ id }) {
pn: 1, pn: 1,
page_size: 15, page_size: 15,
}); });
getAllCarGroup()
} else { } else {
message.error(res.message); message.error(res.message);
} }

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

@ -368,7 +368,8 @@ function OutSegment() {
let end = values.area?.length > 0 ? values.area.slice(-1) : null; let end = values.area?.length > 0 ? values.area.slice(-1) : null;
let params = { let params = {
...values, ...values,
area_id: values.area?.length > 0 ? end : areaId,
//area_id: values.area?.length > 0 ? end : areaId,
area_id:areaId,
}; };
ajax.getOrpRoadExp({ ajax.getOrpRoadExp({
...pageData, ...pageData,
@ -396,7 +397,8 @@ function OutSegment() {
let end = values.area?.length > 0 ? values.area.slice(-1) : null; let end = values.area?.length > 0 ? values.area.slice(-1) : null;
let params = { let params = {
...values, ...values,
area_id: values.area?.length > 0 ? end : areaId,
//area_id: values.area?.length > 0 ? end : areaId,
area_id: areaId,
}; };
ajax ajax
.getOrpRoadList({ .getOrpRoadList({
@ -483,7 +485,7 @@ function OutSegment() {
operator_status: 0, operator_status: 0,
name: "", name: "",
code: "", code: "",
area: '0',
area: ['0'],
operator: "0", operator: "0",
is_no_pwd_pay: 0, is_no_pwd_pay: 0,
}} }}
@ -622,9 +624,9 @@ function OutSegment() {
closeDetail={closeDetail} closeDetail={closeDetail}
setConfigModal={(myData) => { setConfigModal={(myData) => {
console.log(myData, 'myData') console.log(myData, 'myData')
if(myData){
setConfigModal({...configModal, record: myData, visible: true})
}else{
if (myData) {
setConfigModal({ ...configModal, record: myData, visible: true })
} else {
setConfigModal({ ...configModal, visible: true, record: recordData }); setConfigModal({ ...configModal, visible: true, record: recordData });
} }
}} }}
@ -646,7 +648,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)}}
closeDetail={(e) => { setCloseDetail(e) }}
/> />
)} )}
<ConfigParking <ConfigParking

Loading…
Cancel
Save