Browse Source

fix():bug修改

tags/PMS_V1.0.0_Alpha5
xingjx 1 year ago
parent
commit
83a61c058a
  1. 48
      src/pages/OutRoadMgm/OutDeviceMgm/OutDevice/loadable.jsx
  2. 68
      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. 18
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx

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

@ -6,6 +6,7 @@ import {
Button,
Pagination,
Table,
Cascader,
Dropdown,
} from "antd";
import { ResultFlowResult } from "@/components";
@ -54,6 +55,8 @@ function OutDevice() {
});
//
const [rowData, setRowData] = useState({});
//
const [areaId, setAreaId] = useState([]); //id
//
const [storeData, setStoreData] = useState([]);
const [roadData, setRoadData] = useState([]);
@ -213,7 +216,7 @@ function OutDevice() {
setDefaultParams({ ...postData, ...pageInfo });
// console.log(postData);
setTabLoading(true);
ajax.getDeviceMgnList({ ...postData, ...v, ...pageInfo }).then(
ajax.getDeviceMgnList({ ...postData, ...v, ...pageInfo, area_id: formData.area, }).then(
(res) => {
if (parseInt(res?.status) === 20000) {
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 = () => {
setPageType("1");
@ -308,7 +332,7 @@ function OutDevice() {
<div className="form-Wrap">
<div className="form-box">
<div className="form-txt">区域</div>
<Select
{/* <Select
className="form-con"
allowClear
fieldNames={{
@ -319,7 +343,25 @@ function OutDevice() {
placeholder="全部"
value={formData?.area_id || undefined}
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 className="form-box">
<div className="form-txt">商户名称</div>

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

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

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

@ -148,7 +148,8 @@ function EffectiveDate(props) {
initialValues={{
unit_fee_type_group: [],
...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}
>
@ -159,7 +160,7 @@ function EffectiveDate(props) {
name="date"
rules={[{ required: true }]}
>
<DatePicker disabledDate={disabledDate} getPopupContainer={(e) => e.parentNode}/>
<DatePicker disabledDate={disabledDate} getPopupContainer={(e) => e.parentNode} />
</Form.Item>
</Col>
<Col span={12}>

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

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

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

Loading…
Cancel
Save