Browse Source

fix():bug修改

tags/PMS_V1.0.0_Alpha5
xingjx 1 year ago
parent
commit
9089850f7d
  1. BIN
      src/components/SelectGaodeLngLat/blue-point.png
  2. 39
      src/components/SelectGaodeLngLat/index.jsx
  3. 2
      src/pages/DataAnalysisPrediction/ParkingBusinessAly/CarTypeAly/loadable.jsx
  4. 4
      src/pages/FinancialMgm/OrderInquiry/OrderChangeInquiry/index.jsx
  5. 8
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/EffectiveDate.jsx
  6. 2
      src/pages/OutRoadMgm/OutSegmentMgm/ChargeRulesMgm/TimePart.jsx
  7. 17
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/AddParking.jsx
  8. 20
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BillingRules.jsx
  9. 8
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx
  10. 17
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/WhitelistManagement.jsx
  11. 2
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/LEDConfiguration.jsx

BIN
src/components/SelectGaodeLngLat/blue-point.png

After

Width: 48  |  Height: 54  |  Size: 2.3 KiB

39
src/components/SelectGaodeLngLat/index.jsx

@ -6,7 +6,8 @@ import "leaflet/dist/leaflet.css";
import "leaflet.chinatmsproviders"; import "leaflet.chinatmsproviders";
import ajax from "@/services"; import ajax from "@/services";
import "./index.scss"; import "./index.scss";
import { compileString } from "sass";
import Rerm from "./blue-point.png";
let timer = null; let timer = null;
function SelectGaodeLngLat(props) { function SelectGaodeLngLat(props) {
const { const {
@ -17,6 +18,7 @@ function SelectGaodeLngLat(props) {
onChange = () => { }, onChange = () => { },
} = props; } = props;
const [lnglat, setLnglat] = useState([]); const [lnglat, setLnglat] = useState([]);
const [marker, setMarker] = useState([]);
const [address, setAddress] = useState(""); const [address, setAddress] = useState("");
const [searchLnglatValue, setSearchLnglatValue] = useState([]); const [searchLnglatValue, setSearchLnglatValue] = useState([]);
const [getLngLabel, setGetLngLabel] = useState([]) const [getLngLabel, setGetLngLabel] = useState([])
@ -59,6 +61,7 @@ function SelectGaodeLngLat(props) {
let add = getLngLabel.filter((ele) => ele.value == data)[0] || []; let add = getLngLabel.filter((ele) => ele.value == data)[0] || [];
console.log(add); console.log(add);
// setSearchLnglatValue([ add.lng,add.lat]) // setSearchLnglatValue([ add.lng,add.lat])
setMarker([add.lng, add.lat])
setLnglat([add.lng, add.lat]); setLnglat([add.lng, add.lat]);
getLntLat([add.lng, add.lat]); getLntLat([add.lng, add.lat]);
}; };
@ -103,7 +106,9 @@ function SelectGaodeLngLat(props) {
setLnglat={setLnglat} setLnglat={setLnglat}
getLntLat={getLntLat} getLntLat={getLntLat}
searchLnglatValue={searchLnglatValue} searchLnglatValue={searchLnglatValue}
/>
markerPoint={marker}
>
</ModalMap>
</div> </div>
<div className="bottom-input"> <div className="bottom-input">
@ -142,6 +147,7 @@ function ModalMap(props) {
setLnglat = () => { }, setLnglat = () => { },
getLntLat = () => { }, getLntLat = () => { },
searchLnglatValue = [], searchLnglatValue = [],
markerPoint = []
} = props; } = props;
const mapConfig = { const mapConfig = {
center: sysConfig.map.center, center: sysConfig.map.center,
@ -154,6 +160,7 @@ function ModalMap(props) {
mapTileType: sysConfig.map.mapTileType, mapTileType: sysConfig.map.mapTileType,
}; };
const [map, setMap] = useState(null); const [map, setMap] = useState(null);
const [Marker, setMarker] = useState(null);
const mapRef = useRef(null); const mapRef = useRef(null);
const initMap = () => { const initMap = () => {
// console.log(mapConfig); // console.log(mapConfig);
@ -195,6 +202,30 @@ function ModalMap(props) {
}) })
mapRef.current = map mapRef.current = map
}; };
useEffect(() => {
if (map) {
addMarker(markerPoint); //
}
}, [markerPoint]);
const markerContent = `<div class="custom-content-marker">
<img src='${Rerm}' />
</div>`;
const addMarker = (data) => {
if(data.length==0) return
if (Marker) {
map.remove(Marker);
}
let marker = new AMap.Marker({
position: new AMap.LngLat(parseFloat(data[0]), parseFloat(data[1])),
content: markerContent,
offset: new AMap.Pixel(-24, -45),
});
map.add(marker);
setMarker(marker);
setTimeout(() => {
map.setCenter(new AMap.LngLat(parseFloat(data[0]), parseFloat(data[1])));
}, 800);
};
function clearMarkers(map) { function clearMarkers(map) {
map.eachLayer(function (layer) { map.eachLayer(function (layer) {
if (layer instanceof L.Marker) { if (layer instanceof L.Marker) {
@ -211,10 +242,10 @@ function ModalMap(props) {
}; };
}, []); }, []);
useEffect(() => { useEffect(() => {
setTimeout(()=>{
setTimeout(() => {
if (searchLnglatValue.length === 0) return; if (searchLnglatValue.length === 0) return;
mapRef.current.setView(searchLnglatValue, 13); mapRef.current.setView(searchLnglatValue, 13);
},800)
}, 800)
}, [searchLnglatValue]); }, [searchLnglatValue]);
return ( return (

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

@ -77,6 +77,7 @@ function CarTypeAly() {
} }
}, [isAjax]) }, [isAjax])
useEffect(() => { useEffect(() => {
console.log(formData)
if (show.length > 0 || show == 1) { if (show.length > 0 || show == 1) {
setSessionTabList({ setSessionTabList({
...formData, ...formData,
@ -85,6 +86,7 @@ function CarTypeAly() {
} else { } else {
setSessionTabList({ setSessionTabList({
...formData, ...formData,
//show: show.length > 0 ? show : []
}) })
} }
}, [formData, show]) }, [formData, show])

4
src/pages/FinancialMgm/OrderInquiry/OrderChangeInquiry/index.jsx

@ -294,7 +294,7 @@ function EditOrderInquiry(props) {
align: "center", align: "center",
width: 160, width: 160,
render: (text, data) => { render: (text, data) => {
console.log(text);
//console.log(text);
if (data.arrearsAmount_new) { if (data.arrearsAmount_new) {
return <div> return <div>
<span style={{ "text-decoration": "line-through" }}>{data.arrearsAmount}</span> <span style={{ "text-decoration": "line-through" }}>{data.arrearsAmount}</span>
@ -888,7 +888,7 @@ function EditOrderInquiry(props) {
<div className="form-btn"> <div className="form-btn">
<Button <Button
className="reset" className="reset"
onClick={() => { setFormData(defaultData); setPageInfo({ pn: 1, page: 15 }); getData({ ...defaultData }, { pn: 1, page: 15 }); }}
onClick={() => { setFormData(defaultData); setPageInfo({ pn: 1, page_size: 15 }); getData({ ...defaultData }, { pn: 1, page_size: 15 }); }}
> >
重置 重置
</Button> </Button>

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

@ -76,6 +76,7 @@ function EffectiveDate(props) {
"minutes" "minutes"
) )
); );
total += 1;
} else { } else {
total += Math.abs( total += Math.abs(
moment(timePartList[i].end, "HH:mm:ss").diff( moment(timePartList[i].end, "HH:mm:ss").diff(
@ -83,11 +84,16 @@ function EffectiveDate(props) {
"minutes" "minutes"
) )
); );
console.log(Math.abs(
moment(timePartList[i].end, "HH:mm:ss").diff(
moment(timePartList[i].start, "HH:mm:ss"),
"minutes"
)
))
} }
arr.push(timePartList[i].end) arr.push(timePartList[i].end)
arr.push(timePartList[i].start) arr.push(timePartList[i].start)
} }
total += 1;
if (total === 1440) { if (total === 1440) {
if ([...new Set(arr)].length != timePartList.length) { if ([...new Set(arr)].length != timePartList.length) {
message.error('时段范围不能重叠!') message.error('时段范围不能重叠!')

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

@ -192,7 +192,7 @@ function TimePart(props) {
<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} />
</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>
<Col span={8}> <Col span={8}>
{index === 1 ? null : ( {index === 1 ? null : (

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

@ -273,7 +273,20 @@ function AddParking(props) {
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));
} }
const valueChange = (value, all) => {
if (value.road_type) {
form.setFieldsValue({
pid: '',
area_id: '',
operator_id: '',
address: '',
is_business: '',
cooperate_type: '',
access_type:'',
})
setLngLat([])
}
};
useEffect(() => { useEffect(() => {
getAreaList(); getAreaList();
operationName(); operationName();
@ -295,6 +308,7 @@ function AddParking(props) {
form={form} form={form}
labelCol={{ span: 8 }} labelCol={{ span: 8 }}
colon={false} colon={false}
onValuesChange={valueChange}
initialValues={ initialValues={
status === "edit" status === "edit"
? { ? {
@ -348,7 +362,6 @@ function AddParking(props) {
> >
{({ getFieldValue }) => { {({ getFieldValue }) => {
const type = getFieldValue("road_type"); const type = getFieldValue("road_type");
console.log(type);
if (type !== 0 && type !== 1) { if (type !== 0 && type !== 1) {
return ( return (
<Col span="4_8" style={{ width: "33%" }}> <Col span="4_8" style={{ width: "33%" }}>

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

@ -72,7 +72,7 @@ function BillingRules(props) {
<div> <div>
<a <a
onClick={() => { onClick={() => {
setModalData({ ...modalData, visible: true });
setModalData({ ...modalData, visible: true, stutus: 'edit' });
console.log(record.group_ids); console.log(record.group_ids);
editform.setFieldsValue({ editform.setFieldsValue({
rule_id: record.rule_id, rule_id: record.rule_id,
@ -125,7 +125,7 @@ function BillingRules(props) {
id: "", id: "",
}); });
const addRule = () => { const addRule = () => {
setModalData({ ...modalData, visible: true });
setModalData({ ...modalData, visible: true, status: 'add' });
}; };
// //
@ -150,8 +150,8 @@ function BillingRules(props) {
}); });
}; };
// //
const getTempGroup = () => {
ajax.getRoadTemporaryGroup({ road_id: id }).then((res) => {
const getTempGroup = (type) => {
ajax.getRoadTemporaryGroup({ road_id: id, vehicle_type: type }).then((res) => {
if (res.status === 20000) { if (res.status === 20000) {
setTempGroup(res.data); setTempGroup(res.data);
} }
@ -216,8 +216,14 @@ function BillingRules(props) {
useEffect(() => { useEffect(() => {
getChargeRuleList(); getChargeRuleList();
getTempGroup();
}, []); }, []);
const valueChange = (value, all) => {
console.log(value, all)
if (value.vehicle_type) {
getTempGroup(value.vehicle_type);
editform.setFieldsValue({ group_ids: '' })
}
};
useEffect(() => { useEffect(() => {
search(); search();
}, [pageData]); }, [pageData]);
@ -266,7 +272,7 @@ function BillingRules(props) {
></Table> ></Table>
</main> </main>
<Modal <Modal
title="添加计费规则"
title={modalData.status === "edit" ? "编辑计费规则" : "添加计费规则"}
open={modalData.visible} open={modalData.visible}
onCancel={() => { onCancel={() => {
setModalData({ ...modalData, visible: false }); setModalData({ ...modalData, visible: false });
@ -274,7 +280,7 @@ function BillingRules(props) {
}} }}
onOk={submit} onOk={submit}
> >
<Form labelCol={{ span: 6 }} form={editform}>
<Form labelCol={{ span: 6 }} form={editform} onValuesChange={valueChange}>
<Form.Item <Form.Item
label="车辆类型" label="车辆类型"
name="vehicle_type" name="vehicle_type"

8
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx

@ -73,8 +73,8 @@ function BlacklistManagement({ id }) {
}, },
{ {
title: "状态", title: "状态",
dataIndex: "status",
key: "status",
dataIndex: "status_name",
key: "status_name",
align: "center", align: "center",
}, },
{ {
@ -387,7 +387,7 @@ function BlacklistManagement({ id }) {
rules={[{ required: true }]} rules={[{ required: true }]}
name="plate_color" name="plate_color"
> >
<Select disabled={editModal.status === "edit"} options={sysConfig.plateColor} />
<Select disabled={editModal.status === "edit"} options={sysConfig.plateColor.slice(1)} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
@ -398,7 +398,7 @@ function BlacklistManagement({ id }) {
> >
<Select <Select
options={[ options={[
{ label: "全部", value: '0' },
// { label: "", value: '0' },
{ label: "启用", value: '1' }, { label: "启用", value: '1' },
{ label: "禁用", value: '2' }, { label: "禁用", value: '2' },
]} ]}

17
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/WhitelistManagement.jsx

@ -72,8 +72,8 @@ function WhitelistManagement({ id }) {
}, },
{ {
title: "状态", title: "状态",
dataIndex: "status",
key: "status",
dataIndex: "status_name",
key: "status_name",
align: "center", align: "center",
}, },
{ {
@ -206,9 +206,14 @@ function WhitelistManagement({ id }) {
editForm editForm
.validateFields() .validateFields()
.then((res) => { .then((res) => {
if(new Date(res.effective_date[0]).getTime() < new Date().getTime()){
message.error('生效日期必须为当前时间以后的时间')
return
}
if (editModal.status === "add") { if (editModal.status === "add") {
ajax.addWhiteList({ ajax.addWhiteList({
...res, ...res,
road_id: id,
effective_begin_date: moment(res.effective_date[0]).format("YY-MM-DD HH:mm:ss"), effective_begin_date: moment(res.effective_date[0]).format("YY-MM-DD HH:mm:ss"),
effective_end_date: moment(res.effective_date[1]).format("YY-MM-DD HH:mm:ss") effective_end_date: moment(res.effective_date[1]).format("YY-MM-DD HH:mm:ss")
}).then((res) => { }).then((res) => {
@ -225,7 +230,7 @@ function WhitelistManagement({ id }) {
res.id = currentId; res.id = currentId;
ajax.editWhiteVehicle({ ajax.editWhiteVehicle({
...res, ...res,
road_id: id,
id: id,
effective_begin_date: moment(res.effective_date[0]).format("YY-MM-DD HH:mm:ss"), effective_begin_date: moment(res.effective_date[0]).format("YY-MM-DD HH:mm:ss"),
effective_end_date: moment(res.effective_date[1]).format("YY-MM-DD HH:mm:ss") effective_end_date: moment(res.effective_date[1]).format("YY-MM-DD HH:mm:ss")
}).then((res) => { }).then((res) => {
@ -326,7 +331,7 @@ function WhitelistManagement({ id }) {
/> />
</main> </main>
<Modal <Modal
title="添加白名单"
title={editModal.status == "add" ? "添加白名单" : "编辑白名单"}
open={editModal.visible} open={editModal.visible}
onCancel={() => { onCancel={() => {
setEditModal({ visible: false }); setEditModal({ visible: false });
@ -352,7 +357,7 @@ function WhitelistManagement({ id }) {
rules={[{ required: true }]} rules={[{ required: true }]}
name="plate_color" name="plate_color"
> >
<Select disabled={editModal.status === "edit"} options={sysConfig.plateColor} />
<Select disabled={editModal.status === "edit"} options={sysConfig.plateColor.slice(1)} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
@ -363,7 +368,7 @@ function WhitelistManagement({ id }) {
> >
<Select <Select
options={[ options={[
{ label: "全部", value: '0' },
// { label: "", value: '0' },
{ label: "启用", value: '1' }, { label: "启用", value: '1' },
{ label: "禁用", value: '2' }, { label: "禁用", value: '2' },
]} ]}

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

@ -242,7 +242,7 @@ function LEDConfiguration({ id }) {
rules={[{ required: true }]} rules={[{ required: true }]}
name="business_type" name="business_type"
> >
<Select options={(modalData.status === "add"?modalBusinessList:businessList)|| []} disabled={modalData.status === "edit"} />
<Select getPopupContainer={(e) => e.parentNode} options={(modalData.status === "add"?modalBusinessList:businessList)|| []} disabled={modalData.status === "edit"} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="LED显示文案" label="LED显示文案"

Loading…
Cancel
Save