diff --git a/src/components/Map/Apimap/index.jsx b/src/components/Map/Apimap/index.jsx index 4af1103..323027a 100644 --- a/src/components/Map/Apimap/index.jsx +++ b/src/components/Map/Apimap/index.jsx @@ -1,33 +1,95 @@ -import React, { useEffect } from 'react'; -// import AMapLoader from '@amap/amap-jsapi-loader'; - -const Apimap = () => { +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(() => { - // AMapLoader.load({ - // "key": "71273e067acb371c4a32f4c4c444134d", // 申请好的Web端开发者Key,首次调用 load 时必填 - // "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - // "plugins": [] //插件列表 - // }).then((AMap) => { - // let amap = new AMap.Map('mapContainer', { // mapcontainer为容器的id - // 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); - // }) - - + initMap(); + return () => { + if (mapRef.current) { + mapRef.current.remove(); + } + }; }, []); - + useEffect(() => { + if (searchLnglatValue.length === 0) return; + mapRef.current.setView(searchLnglatValue, 13); + }, [searchLnglatValue]); + return ( -
+
); -}; - -export default Apimap; \ No newline at end of file + } + export default ModalMap; \ No newline at end of file diff --git a/src/components/Map/Apimap/index.scss b/src/components/Map/Apimap/index.scss new file mode 100644 index 0000000..d38ccb3 --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/src/components/TableModule/index.jsx b/src/components/TableModule/index.jsx index 3ab81c9..684c15f 100644 --- a/src/components/TableModule/index.jsx +++ b/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} />
diff --git a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx index 69c3ffc..9575e28 100644 --- a/src/pages/InRoadMgm/PersonMgm/Attendance/WorkerAttendance/loadable.jsx +++ b/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} /> - - + {/* - + /> */} +
+

出场时间-入场时间的计算金额

+ + ) + const receivableContent = ( +
+

订单金额-折扣金额

+
+ ) + const discountContent = ( +
+

折扣金额=停车卡抵扣+路段折扣

+
+ ) + const preferentialContent = ( +
+

优惠券支付金额

+
+ ) + const refundContent = ( +
+

退款总计=退实付+退优惠

+
+ ) const columns = [ { title: "序号", @@ -47,8 +74,12 @@ function ParkRecordTotal() { dataIndex: "park_id", align: "center", render: (text, record, index) => ( -
{record.park_id}
- ) +
+ { + navigator.clipboard.writeText(`${text}`).then(() => { message.success("已复制到剪切板") }); + }}>{record.park_id} +
+ ), }, { title: "区域", @@ -62,7 +93,7 @@ function ParkRecordTotal() { title: "商户名称", dataIndex: "operator", align: "center", - render: (text, record, index) => ( + render: (text, record, index) => (
{record.operator}
) }, @@ -86,8 +117,8 @@ function ParkRecordTotal() { dataIndex: "plate", align: "center", render: (text, record, index) => ( -
{record.plate}
- ) +
{record.plate}
+ ) }, { title: "车牌颜色", @@ -147,6 +178,11 @@ function ParkRecordTotal() { key: "order_amount", width: 100, align: "center", + filterDropdown: true, + filterIcon: + + + }, { title: "应收金额", @@ -154,6 +190,11 @@ function ParkRecordTotal() { key: "receivable_amount", width: 100, align: "center", + filterDropdown: true, + filterIcon: + + + }, { title: "折扣金额", @@ -161,6 +202,11 @@ function ParkRecordTotal() { key: "discount_amount", width: 100, align: "center", + filterDropdown: true, + filterIcon: + + + }, { title: "优惠金额", @@ -168,6 +214,11 @@ function ParkRecordTotal() { key: "preferential_amount", width: 100, align: "center", + filterDropdown: true, + filterIcon: + + + }, { title: "实付金额", @@ -182,6 +233,11 @@ function ParkRecordTotal() { key: "refund_total", width: 100, align: "center", + filterDropdown: true, + filterIcon: + + + }, { title: "操作", @@ -203,6 +259,7 @@ function ParkRecordTotal() { }, }, ]; + const formSearch = [ { name: "region", diff --git a/src/pages/SystemMgm/AdminMgm/loadable.jsx b/src/pages/SystemMgm/AdminMgm/loadable.jsx index 7cc7afb..596063c 100644 --- a/src/pages/SystemMgm/AdminMgm/loadable.jsx +++ b/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} /> @@ -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 })