@vtx/modals2 5.0.47 → 5.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,8 @@ import { Circle, Dom, FeatureLayer, Map } from '@vtx/ol-map';
14
14
  import { useUpdateEffect } from 'ahooks';
15
15
  import { Tooltip } from 'antd';
16
16
  import classNames from 'classnames';
17
+ import { register } from 'ol/proj/proj4';
18
+ import proj4 from 'proj4';
17
19
  import { useEffect, useRef, useState } from 'react';
18
20
  import useSettings from "../../_hooks/useSettings";
19
21
  import "./index.less";
@@ -40,6 +42,7 @@ export default function VmOlMap(_ref) {
40
42
  isDark = _useSettings.isDark,
41
43
  theme = _useSettings.theme,
42
44
  mapInfo = _useSettings.mapInfo;
45
+ var projectionRef = useRef(mapInfo.epsg ? "EPSG:".concat(mapInfo.epsg) : 'EPSG:4326');
43
46
  var _useState3 = useState({
44
47
  data: [],
45
48
  style: {}
@@ -49,6 +52,11 @@ export default function VmOlMap(_ref) {
49
52
  setNewPoints = _useState4[1];
50
53
  useEffect(function () {
51
54
  if (mapInfo !== null && mapInfo !== void 0 && mapInfo.longitude) {
55
+ if (mapInfo.epsg) {
56
+ projectionRef.current = "EPSG:".concat(mapInfo.epsg);
57
+ proj4.defs("EPSG:".concat(mapInfo.epsg), mapInfo.proj4);
58
+ register(proj4);
59
+ }
52
60
  setDefaultCenter([mapInfo.longitude, mapInfo.latitude]);
53
61
  }
54
62
  }, [mapInfo]);
@@ -202,6 +210,7 @@ export default function VmOlMap(_ref) {
202
210
  zoom: 16,
203
211
  dark: isDark || theme === 'blue',
204
212
  tk: "1adbb6e47668cb33757cd799548bf1f4",
213
+ projection: projectionRef.current,
205
214
  customBaseLayers: layers.length > 0 ? function () {
206
215
  return layers;
207
216
  } : null,
@@ -9,11 +9,12 @@ import { useRequest } from 'ahooks';
9
9
  var CommonService = {
10
10
  useBaseInfo: function useBaseInfo(id) {
11
11
  var _baseInfoRes$data, _baseInfoRes$data2, _tabConfig$data;
12
+ var coordType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'wgs84';
12
13
  var _useRequest = useRequest(function () {
13
14
  return request.get('/cloud/jcss-reborn/facility/get', {
14
15
  data: {
15
16
  id: id,
16
- coordType: 'wgs84'
17
+ coordType: coordType
17
18
  }
18
19
  });
19
20
  }, {
@@ -7,14 +7,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
7
7
  /**
8
8
  * 通用弹窗
9
9
  */
10
- import { VmCustom, VmRepairMaintain, VmVideo } from "../_components";
11
- import Appraisal from "../vtx-kh-modal/components/Record";
12
10
  import { useMemo } from 'react';
11
+ import { VmCustom, VmRepairMaintain, VmVideo } from "../_components";
13
12
  import useGetChannels from "../_hooks/useGetChannels";
14
13
  import useGetConfig from "../_hooks/useGetConfig";
15
14
  import { CommonService } from "../_service";
16
15
  import VtxBaseModal from "../vtx-base-modal";
17
16
  import Metering from "../vtx-df-modal/components/Metering";
17
+ import Appraisal from "../vtx-kh-modal/components/Record";
18
18
  import { BaseInfo } from "./components";
19
19
  import "./style";
20
20
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
@@ -43,7 +43,7 @@ var VtxDefaultModal = function VtxDefaultModal(props) {
43
43
  key: TABS_BASE,
44
44
  title: '总览信息'
45
45
  }];
46
- var _CommonService$useBas = CommonService.useBaseInfo(id, 'wgs84'),
46
+ var _CommonService$useBas = CommonService.useBaseInfo(id, (customMapInfo === null || customMapInfo === void 0 ? void 0 : customMapInfo.coordinate) || 'wgs84'),
47
47
  photos = _CommonService$useBas.photos,
48
48
  info = _CommonService$useBas.info;
49
49
  var _useGetConfig = useGetConfig(info === null || info === void 0 ? void 0 : info.typeCode, tabs),
@@ -39,7 +39,7 @@ var VtxDfModal = function VtxDfModal(props) {
39
39
  showCollect = _props$showCollect === void 0 ? true : _props$showCollect,
40
40
  _props$zdReborn = props.zdReborn,
41
41
  zdReborn = _props$zdReborn === void 0 ? false : _props$zdReborn;
42
- var _CommonService$useBas = CommonService.useBaseInfo(id),
42
+ var _CommonService$useBas = CommonService.useBaseInfo(id, (customMapInfo === null || customMapInfo === void 0 ? void 0 : customMapInfo.coordinate) || 'wgs84'),
43
43
  info = _CommonService$useBas.info,
44
44
  photos = _CommonService$useBas.photos;
45
45
  var tabs = [{
@@ -8,12 +8,12 @@ import useGetChannels from "../_hooks/useGetChannels";
8
8
  import { BaseInfo as DefaultBaseInfo } from "../vtx-default-modal/components";
9
9
  import { BaseInfo, Calendar, Metering, WorkCondition } from "../vtx-df-modal/components";
10
10
  // import Appraisal from '../vm-appraisal-info';
11
- import VmVideo from "../_components/vm-video";
12
- import { CommonService } from "../_service";
13
- import { BaseService } from "../vtx-df-modal/api";
14
11
  import VmCustom from "../_components/vm-custom";
12
+ import VmVideo from "../_components/vm-video";
15
13
  import useGetConfig from "../_hooks/useGetConfig";
14
+ import { CommonService } from "../_service";
16
15
  import VtxBaseModal from "../vtx-base-modal";
16
+ import { BaseService } from "../vtx-df-modal/api";
17
17
  import "../vtx-df-modal/style";
18
18
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
19
19
  var TABS_BASE = 'base';
@@ -38,7 +38,7 @@ var VtxDfModal = function VtxDfModal(props) {
38
38
  tabChose = props.tabChose,
39
39
  _props$showCollect = props.showCollect,
40
40
  showCollect = _props$showCollect === void 0 ? true : _props$showCollect;
41
- var _CommonService$useBas = CommonService.useBaseInfo(id),
41
+ var _CommonService$useBas = CommonService.useBaseInfo(id, (customMapInfo === null || customMapInfo === void 0 ? void 0 : customMapInfo.coordinate) || 'wgs84'),
42
42
  info = _CommonService$useBas.info,
43
43
  photos = _CommonService$useBas.photos;
44
44
  var tabs = [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/modals2",
3
- "version": "5.0.47",
3
+ "version": "5.0.48",
4
4
  "description": "弹窗组件",
5
5
  "license": "MIT",
6
6
  "module": "lib/index.js",
@@ -40,9 +40,12 @@
40
40
  "@types/react-dom": "^18.0.0",
41
41
  "@umijs/lint": "^4.0.0",
42
42
  "@vtx/components": "^3.1.166",
43
- "@vtx/ol-map": "^1.0.151",
43
+ "@vtx/ol-map": "^1.0.170",
44
44
  "@vtx/player": "latest",
45
45
  "@vtx/utils": "^1.0.20",
46
+ "@turf/turf": "^7.3.4",
47
+ "ol": "6.15.1",
48
+ "proj4": "^2.20.8",
46
49
  "ahooks": "^3.1.5",
47
50
  "antd": "^4.24.16",
48
51
  "antd-dayjs-webpack-plugin": "^1.0.6",