Browse Source

fix():修改重置传参

tags/PMS_Frontend_v1.0.6-develop
guoxin 1 year ago
parent
commit
3570635efe
  1. 116
      src/components/Map/Apimap/index.jsx
  2. 20
      src/components/Map/Apimap/index.scss
  3. 4
      src/components/TableModule/index.jsx
  4. 10
      src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx
  5. 67
      src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx
  6. 8
      src/pages/SystemMgm/AdminMgm/loadable.jsx

116
src/components/Map/Apimap/index.jsx

@ -1,33 +1,95 @@
import React, { useEffect } from 'react';
// import AMapLoader from '@amap/amap-jsapi-loader';
const Apimap = () => {
useEffect(() => {
// AMapLoader.load({
// "key": "71273e067acb371c4a32f4c4c444134d", // WebKey load
// "version": "2.0", // JSAPI 1.4.15
// "plugins": [] //
// }).then((AMap) => {
// let amap = new AMap.Map('mapContainer', { // mapcontainerid
// zoom: 15, //
// center: [112.5266, 27.91507] //
// });
// //
// let marker = new AMap.Marker({
// position: [112.5266, 27.91507] //
// });
// //
// amap.add(marker);
// }).catch(e => {
// console.log(e);
// })
import React, { useState, useEffect, useRef, useLayoutEffect } from "react";import L from "leaflet";
import "leaflet/dist/leaflet.css";
import "leaflet.chinatmsproviders";
import ajax from "@/services";
function ModalMap(props) {
const {
setLnglat = () => {},
getLntLat = () => {},
searchLnglatValue = [],
} = props;
const mapConfig = {
center: sysConfig.map.center,
zoom: sysConfig.map.zoom,
zooms: sysConfig.map.zooms,
maxZoom: sysConfig.map.zooms[1],
minZoom: sysConfig.map.zooms[0],
mapTileHost: sysConfig.map.mapTileHost,
zoomOffset: sysConfig.map.zoomOffset,
mapTileType: sysConfig.map.mapTileType,
};
const [map, setMap] = useState(null);
const mapRef = useRef(null);
const initMap = () => {
// console.log(mapConfig);
// const _map = L.map("mapid", {
// scrollWheelZoom: true,
// zoomSnap: 1,
// crs: L.CRS.EPSG3857,
// }).setView([mapConfig.center[0], mapConfig.center[1]], mapConfig.zoom);
// L.tileLayer("{mapTileHost}/v3/tile?z={z}&x={x}&y={y}", {
// maxZoom: mapConfig.zooms[1],
// minZoom: mapConfig.zooms[0],
// zoomOffset: 0,
// mapTileHost: mapConfig.mapTileHost,
// }).addTo(_map);
// _map.on("click", function (e) {
// clearMarkers(_map);
// L.marker(e.latlng).addTo(_map);
// setLnglat([e.latlng.lng.toFixed(4), e.latlng.lat.toFixed(4)]);
// getLntLat([e.latlng.lng.toFixed(4), e.latlng.lat.toFixed(4)]);
// });
// _map.invalidateSize();
// setMap(_map);
// mapRef.current = _map;
let _map = new AMap.Map("mapid", {
resizeEnable: true,
layers: [
new AMap.TileLayer.Satellite(),
new AMap.TileLayer.RoadNet()
]
});
_map.setCenter([mapConfig.center[1], mapConfig.center[0]], mapConfig.zoom);
setMap(_map)
_map.on('click', function(e) {
console.log(e)
// onClick(info)
setLnglat([e.lnglat.lng.toFixed(4), e.lnglat.lat.toFixed(4)]);
getLntLat([e.lnglat.lng.toFixed(4), e.lnglat.lat.toFixed(4)]);
})
mapRef.current = map
};
function clearMarkers(map) {
map.eachLayer(function (layer) {
if (layer instanceof L.Marker) {
map.removeLayer(layer);
}
});
}
useEffect(() => {
initMap();
return () => {
if (mapRef.current) {
mapRef.current.remove();
}
};
}, []);
useEffect(() => {
if (searchLnglatValue.length === 0) return;
mapRef.current.setView(searchLnglatValue, 13);
}, [searchLnglatValue]);
return (
<div id="mapContainer" style={{ width: '100%', height: '400px' }}></div>
<div
id="mapid"
className="map"
style={{
height: "100%",
width: "100%",
}}
></div>
);
};
export default Apimap;
}
export default ModalMap;

20
src/components/Map/Apimap/index.scss

@ -0,0 +1,20 @@
.home_div,#map{
padding: 0px;
margin: 0px;
width: 100%;
height: 100%;
}
.map-title{
position:absolute;
z-index: 1;
width: 100%;
height: 50px;
background-color: rgba(27, 25, 27, 0.884);
}
h3{
position:absolute;
left: 10px;
z-index: 2;
color: white;
}

4
src/components/TableModule/index.jsx

@ -53,6 +53,7 @@ const TableModule = forwardRef((props, ref) => {
userInfo = {},//
valueChange,
mandatory,
locale={},
limitCon,//
mandatory_name,
pageName = '',//
@ -60,6 +61,7 @@ const TableModule = forwardRef((props, ref) => {
const [sessionTabList, setSessionTabList] = useSessionStorageState(pageName, {
value: ''
})
console.log(locale);
const [formData, setFormData] = useState()
const [inputSelectGroup, setInputSelectGroup] = useState([])
const [deftime, setDeftime] = useState([])
@ -195,6 +197,7 @@ const TableModule = forwardRef((props, ref) => {
//
function reset() {
searchForm.resetFields();
fetch()
}
function cascaderChange(value, options) {
let last = options[options.length - 1];
@ -698,6 +701,7 @@ const TableModule = forwardRef((props, ref) => {
columns={columns}
dataSource={tableData}
pagination={false}
locale={locale}
/>
</div>
<div>

10
src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx

@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect } from "react";
import { BaseMap, Marker, ExportBtn, ResultFlowResult } from "@/components"
import { Apimap, Marker, ExportBtn, ResultFlowResult} from "@/components"
import { Select, Input, Button, Table, message, Pagination, DatePicker, Space, Modal } from 'antd'
import {
operator,
@ -484,8 +484,8 @@ function WorkerAttendance(props) {
pagination={false}
loading={ajaxLoading}
/>
<BaseMap zoom={13} id={"map" + new Date().getTime()} >
<Marker
<Apimap >
{/* <Marker
{...markerConf}
/>
<Marker
@ -493,8 +493,8 @@ function WorkerAttendance(props) {
markerArr={markers}
refresh={true}
type="img"
/>
</BaseMap>
/> */}
</Apimap>
</div>
<div className="table">
<Table

67
src/pages/InRoadMgm/RecordInquiry/ParkRecordTotal/loadable.jsx

@ -13,11 +13,13 @@ import {
Select,
Image,
Timeline,
Popover
} from "antd";
// import { dictionary, utils } from "@/config/common";
// import moment from 'moment'
// import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks';
import ajax from "@/services";
import { QuestionCircleOutlined } from '@ant-design/icons';
import { TableModule } from "@/components";
import "./index.scss";
import {
@ -32,6 +34,31 @@ const { TextArea } = Input;
let array = [];
function ParkRecordTotal() {
const roadContent = (
<div>
<p>出场时间-入场时间的计算金额</p>
</div>
)
const receivableContent = (
<div>
<p>订单金额-折扣金额</p>
</div>
)
const discountContent = (
<div>
<p>折扣金额=停车卡抵扣+路段折扣</p>
</div>
)
const preferentialContent = (
<div>
<p>优惠券支付金额</p>
</div>
)
const refundContent = (
<div>
<p>退款总计=退实付+退优惠</p>
</div>
)
const columns = [
{
title: "序号",
@ -47,8 +74,12 @@ function ParkRecordTotal() {
dataIndex: "park_id",
align: "center",
render: (text, record, index) => (
<div style={{ width: "130px", wordBreak: "break-all" }}>{record.park_id}</div>
)
<div style={{ width: "130px", wordBreak: "break-all" }}>
<a onClick={() => {
navigator.clipboard.writeText(`${text}`).then(() => { message.success("已复制到剪切板") });
}}>{record.park_id}</a>
</div>
),
},
{
title: "区域",
@ -62,7 +93,7 @@ function ParkRecordTotal() {
title: "商户名称",
dataIndex: "operator",
align: "center",
render: (text, record, index) => (
render: (text, record, index) => (
<div style={{ width: "150px", wordBreak: "break-all" }}>{record.operator}</div>
)
},
@ -86,8 +117,8 @@ function ParkRecordTotal() {
dataIndex: "plate",
align: "center",
render: (text, record, index) => (
<div style={{ width: "100px", wordBreak: "break-all" }}>{record.plate}</div>
)
<div style={{ width: "100px", wordBreak: "break-all" }}>{record.plate}</div>
)
},
{
title: "车牌颜色",
@ -147,6 +178,11 @@ function ParkRecordTotal() {
key: "order_amount",
width: 100,
align: "center",
filterDropdown: true,
filterIcon:
<Popover content={roadContent} >
<QuestionCircleOutlined />
</Popover>
},
{
title: "应收金额",
@ -154,6 +190,11 @@ function ParkRecordTotal() {
key: "receivable_amount",
width: 100,
align: "center",
filterDropdown: true,
filterIcon:
<Popover content={receivableContent} >
<QuestionCircleOutlined />
</Popover>
},
{
title: "折扣金额",
@ -161,6 +202,11 @@ function ParkRecordTotal() {
key: "discount_amount",
width: 100,
align: "center",
filterDropdown: true,
filterIcon:
<Popover content={discountContent} >
<QuestionCircleOutlined />
</Popover>
},
{
title: "优惠金额",
@ -168,6 +214,11 @@ function ParkRecordTotal() {
key: "preferential_amount",
width: 100,
align: "center",
filterDropdown: true,
filterIcon:
<Popover content={preferentialContent} >
<QuestionCircleOutlined />
</Popover>
},
{
title: "实付金额",
@ -182,6 +233,11 @@ function ParkRecordTotal() {
key: "refund_total",
width: 100,
align: "center",
filterDropdown: true,
filterIcon:
<Popover content={refundContent} >
<QuestionCircleOutlined />
</Popover>
},
{
title: "操作",
@ -203,6 +259,7 @@ function ParkRecordTotal() {
},
},
];
const formSearch = [
{
name: "region",

8
src/pages/SystemMgm/AdminMgm/loadable.jsx

@ -431,10 +431,10 @@ function AdminMgm(props) {
//
const changePn = (pn, length) => {
if (lastFormData.page_size === length) {
setFormData(Object.assign({}, formData, { pn: pn, page_size: length }))
setFormData(Object.assign({}, formData, { pn: pn, page_size: length }))
setLastFormData(Object.assign({}, lastFormData, { pn: pn }))
lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn })
getData(Object.assign({}, formData, { pn: pn , page_size: length}))
getData(Object.assign({}, formData, { pn: pn, page_size: length }))
}
}
//
@ -751,7 +751,7 @@ function AdminMgm(props) {
style={{ width: 260, marginLeft: 22 }}
placeholder="请选择"
value={addManage.moveArea}
options={getMoveList}
options={getMoveList || []}
onChange={handleMoveArea}
/>
</div>
@ -964,7 +964,7 @@ function AdminMgm(props) {
style={{ width: 260, marginLeft: 22 }}
placeholder="请选择"
value={getImg.moveArea}
options={getMoveList}
options={getMoveList || []}
onChange={(v) => {
setGetImg(
Object.assign({}, getImg, { moveArea: v })

Loading…
Cancel
Save