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. 35
      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

35
src/components/SelectGaodeLngLat/index.jsx

@ -6,7 +6,8 @@ import "leaflet/dist/leaflet.css";
import "leaflet.chinatmsproviders";
import ajax from "@/services";
import "./index.scss";
import { compileString } from "sass";
import Rerm from "./blue-point.png";
let timer = null;
function SelectGaodeLngLat(props) {
const {
@ -17,6 +18,7 @@ function SelectGaodeLngLat(props) {
onChange = () => { },
} = props;
const [lnglat, setLnglat] = useState([]);
const [marker, setMarker] = useState([]);
const [address, setAddress] = useState("");
const [searchLnglatValue, setSearchLnglatValue] = useState([]);
const [getLngLabel, setGetLngLabel] = useState([])
@ -59,6 +61,7 @@ function SelectGaodeLngLat(props) {
let add = getLngLabel.filter((ele) => ele.value == data)[0] || [];
console.log(add);
// setSearchLnglatValue([ add.lng,add.lat])
setMarker([add.lng, add.lat])
setLnglat([add.lng, add.lat]);
getLntLat([add.lng, add.lat]);
};
@ -103,7 +106,9 @@ function SelectGaodeLngLat(props) {
setLnglat={setLnglat}
getLntLat={getLntLat}
searchLnglatValue={searchLnglatValue}
/>
markerPoint={marker}
>
</ModalMap>
</div>
<div className="bottom-input">
@ -142,6 +147,7 @@ function ModalMap(props) {
setLnglat = () => { },
getLntLat = () => { },
searchLnglatValue = [],
markerPoint = []
} = props;
const mapConfig = {
center: sysConfig.map.center,
@ -154,6 +160,7 @@ function ModalMap(props) {
mapTileType: sysConfig.map.mapTileType,
};
const [map, setMap] = useState(null);
const [Marker, setMarker] = useState(null);
const mapRef = useRef(null);
const initMap = () => {
// console.log(mapConfig);
@ -195,6 +202,30 @@ function ModalMap(props) {
})
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) {
map.eachLayer(function (layer) {
if (layer instanceof L.Marker) {

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

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

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

@ -294,7 +294,7 @@ function EditOrderInquiry(props) {
align: "center",
width: 160,
render: (text, data) => {
console.log(text);
//console.log(text);
if (data.arrearsAmount_new) {
return <div>
<span style={{ "text-decoration": "line-through" }}>{data.arrearsAmount}</span>
@ -888,7 +888,7 @@ function EditOrderInquiry(props) {
<div className="form-btn">
<Button
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>

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

@ -76,6 +76,7 @@ function EffectiveDate(props) {
"minutes"
)
);
total += 1;
} else {
total += Math.abs(
moment(timePartList[i].end, "HH:mm:ss").diff(
@ -83,11 +84,16 @@ function EffectiveDate(props) {
"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].start)
}
total += 1;
if (total === 1440) {
if ([...new Set(arr)].length != timePartList.length) {
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: '请选择时间段!' }]}>
<TimePicker.RangePicker style={{ width: "50%" }} order={false} secondStep={60} />
</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 span={8}>
{index === 1 ? null : (

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

@ -273,7 +273,20 @@ function AddParking(props) {
})
.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(() => {
getAreaList();
operationName();
@ -295,6 +308,7 @@ function AddParking(props) {
form={form}
labelCol={{ span: 8 }}
colon={false}
onValuesChange={valueChange}
initialValues={
status === "edit"
? {
@ -348,7 +362,6 @@ function AddParking(props) {
>
{({ getFieldValue }) => {
const type = getFieldValue("road_type");
console.log(type);
if (type !== 0 && type !== 1) {
return (
<Col span="4_8" style={{ width: "33%" }}>

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

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

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

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

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

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

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

@ -242,7 +242,7 @@ function LEDConfiguration({ id }) {
rules={[{ required: true }]}
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
label="LED显示文案"

Loading…
Cancel
Save