@vtx/cs-map-layer 1.0.14 → 1.0.15

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.
Files changed (49) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +40 -40
  3. package/lib/ConfluenceLineLayer/index.js +12 -1
  4. package/lib/ConfluenceManholeLayer/index.js +12 -1
  5. package/lib/ConfluencePointLayer/index.js +12 -1
  6. package/lib/DeviceLayer/index.d.ts +1 -1
  7. package/lib/DeviceLayer/index.js +15 -2
  8. package/lib/FacilityLayer/index.js +14 -1
  9. package/lib/Layer/index.js +2 -2
  10. package/lib/Layer/layerConfig.d.ts +9 -2
  11. package/lib/Layer/layerConfig.js +4 -1
  12. package/lib/RainLineLayer/index.js +12 -1
  13. package/lib/RainManholeLayer/index.js +12 -1
  14. package/lib/RainPointLayer/index.js +12 -1
  15. package/lib/RawWaterLineLayer/index.js +12 -1
  16. package/lib/RawWaterPointLayer/index.js +12 -1
  17. package/lib/SewageLineLayer/index.js +12 -1
  18. package/lib/SewageManholeLayer/index.js +12 -1
  19. package/lib/SewagePointLayer/index.js +12 -1
  20. package/lib/WaterDrainLineLayer/index.js +12 -1
  21. package/lib/WaterDrainManholeLayer/index.js +12 -1
  22. package/lib/WaterDrainPointLayer/index.js +12 -1
  23. package/lib/WaterSupplyLineLayer/index.js +13 -1
  24. package/lib/WaterSupplyPointLayer/index.js +13 -1
  25. package/lib/_components/Template/CloseBtnV2.d.ts +8 -0
  26. package/lib/_components/Template/CloseBtnV2.js +21 -0
  27. package/lib/_components/Template/DeviceCustomContent.d.ts +21 -0
  28. package/lib/_components/Template/DeviceCustomContent.js +76 -0
  29. package/lib/_components/Template/DeviceTemplate.d.ts +1 -0
  30. package/lib/_components/Template/DeviceTemplate.js +4 -1
  31. package/lib/_components/Template/DeviceTemplateV2.d.ts +7 -0
  32. package/lib/_components/Template/DeviceTemplateV2.js +146 -0
  33. package/lib/_components/Template/FacilityCustomContent.d.ts +20 -0
  34. package/lib/_components/Template/FacilityCustomContent.js +142 -0
  35. package/lib/_components/Template/FacilityTemplate.d.ts +2 -1
  36. package/lib/_components/Template/FacilityTemplate.js +4 -2
  37. package/lib/_components/Template/FacilityTemplateV2.d.ts +12 -0
  38. package/lib/_components/Template/FacilityTemplateV2.js +104 -0
  39. package/lib/_components/Template/index.less +4 -0
  40. package/lib/_components/Template/indexV2.less +574 -0
  41. package/lib/_util/http.js +18 -18
  42. package/lib/_util/interface.d.ts +7 -0
  43. package/lib/_util/layerConfig.d.ts +2 -1
  44. package/lib/_util/layerConfig.js +475 -1
  45. package/lib/assets/address-dark.png +0 -0
  46. package/lib/assets/address.png +0 -0
  47. package/lib/index.d.ts +2 -0
  48. package/lib/index.js +3 -1
  49. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal"];
2
+ var _excluded = ["params", "showModal", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,11 +11,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { ImageLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
13
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
14
15
  import { getTenantId } from "../_util/util";
15
16
  var SewageLineLayer = function SewageLineLayer(props) {
16
17
  var _props$params = props.params,
17
18
  params = _props$params === void 0 ? {} : _props$params,
18
19
  showModal = props.showModal,
20
+ _props$popup = props.popup,
21
+ popup = _props$popup === void 0 ? {
22
+ version: '1'
23
+ } : _props$popup,
19
24
  otherProps = _objectWithoutProperties(props, _excluded);
20
25
  var tenantId = getTenantId();
21
26
  return /*#__PURE__*/React.createElement(ImageLayer, _extends({
@@ -30,6 +35,12 @@ var SewageLineLayer = function SewageLineLayer(props) {
30
35
  zIndex: 20,
31
36
  id: 'RainLineLayer',
32
37
  template: function template(feature) {
38
+ if (popup.version == '2') {
39
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
40
+ feature: feature,
41
+ showModal: showModal
42
+ });
43
+ }
33
44
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
34
45
  feature: feature,
35
46
  showModal: showModal
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal"];
2
+ var _excluded = ["params", "showModal", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,11 +11,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { ImageLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
13
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
14
15
  import { getTenantId } from "../_util/util";
15
16
  var SewageManholeLayer = function SewageManholeLayer(props) {
16
17
  var _props$params = props.params,
17
18
  params = _props$params === void 0 ? {} : _props$params,
18
19
  showModal = props.showModal,
20
+ _props$popup = props.popup,
21
+ popup = _props$popup === void 0 ? {
22
+ version: '1'
23
+ } : _props$popup,
19
24
  otherProps = _objectWithoutProperties(props, _excluded);
20
25
  var tenantId = getTenantId();
21
26
  return /*#__PURE__*/React.createElement(ImageLayer, _extends({
@@ -30,6 +35,12 @@ var SewageManholeLayer = function SewageManholeLayer(props) {
30
35
  zIndex: 30,
31
36
  id: 'SewageManholeLayer',
32
37
  template: function template(feature) {
38
+ if (popup.version == '2') {
39
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
40
+ feature: feature,
41
+ showModal: showModal
42
+ });
43
+ }
33
44
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
34
45
  feature: feature,
35
46
  showModal: showModal
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal"];
2
+ var _excluded = ["params", "showModal", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,11 +11,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { ImageLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
13
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
14
15
  import { getTenantId } from "../_util/util";
15
16
  var SewagePointLayer = function SewagePointLayer(props) {
16
17
  var _props$params = props.params,
17
18
  params = _props$params === void 0 ? {} : _props$params,
18
19
  showModal = props.showModal,
20
+ _props$popup = props.popup,
21
+ popup = _props$popup === void 0 ? {
22
+ version: '1'
23
+ } : _props$popup,
19
24
  otherProps = _objectWithoutProperties(props, _excluded);
20
25
  var tenantId = getTenantId();
21
26
  return /*#__PURE__*/React.createElement(ImageLayer, _extends({
@@ -30,6 +35,12 @@ var SewagePointLayer = function SewagePointLayer(props) {
30
35
  zIndex: 40,
31
36
  id: 'SewagePointLayer',
32
37
  template: function template(feature) {
38
+ if (popup.version == '2') {
39
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
40
+ feature: feature,
41
+ showModal: showModal
42
+ });
43
+ }
33
44
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
34
45
  feature: feature,
35
46
  showModal: showModal
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal"];
2
+ var _excluded = ["params", "showModal", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,11 +11,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { ImageLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
13
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
14
15
  import { getTenantId } from "../_util/util";
15
16
  var WaterDrainLineLayer = function WaterDrainLineLayer(props) {
16
17
  var _props$params = props.params,
17
18
  params = _props$params === void 0 ? {} : _props$params,
18
19
  showModal = props.showModal,
20
+ _props$popup = props.popup,
21
+ popup = _props$popup === void 0 ? {
22
+ version: '1'
23
+ } : _props$popup,
19
24
  otherProps = _objectWithoutProperties(props, _excluded);
20
25
  var tenantId = getTenantId();
21
26
  return /*#__PURE__*/React.createElement(ImageLayer, _extends({
@@ -29,6 +34,12 @@ var WaterDrainLineLayer = function WaterDrainLineLayer(props) {
29
34
  zIndex: 20,
30
35
  id: 'WaterDrainLineLayer',
31
36
  template: function template(feature) {
37
+ if (popup.version == '2') {
38
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
39
+ feature: feature,
40
+ showModal: showModal
41
+ });
42
+ }
32
43
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
33
44
  feature: feature,
34
45
  showModal: showModal
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal"];
2
+ var _excluded = ["params", "showModal", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,11 +11,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { ImageLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
13
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
14
15
  import { getTenantId } from "../_util/util";
15
16
  var WaterDrainManholeLayer = function WaterDrainManholeLayer(props) {
16
17
  var _props$params = props.params,
17
18
  params = _props$params === void 0 ? {} : _props$params,
18
19
  showModal = props.showModal,
20
+ _props$popup = props.popup,
21
+ popup = _props$popup === void 0 ? {
22
+ version: '1'
23
+ } : _props$popup,
19
24
  otherProps = _objectWithoutProperties(props, _excluded);
20
25
  var tenantId = getTenantId();
21
26
  return /*#__PURE__*/React.createElement(ImageLayer, _extends({
@@ -29,6 +34,12 @@ var WaterDrainManholeLayer = function WaterDrainManholeLayer(props) {
29
34
  zIndex: 30,
30
35
  id: 'WaterDrainLineLayer',
31
36
  template: function template(feature) {
37
+ if (popup.version == '2') {
38
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
39
+ feature: feature,
40
+ showModal: showModal
41
+ });
42
+ }
32
43
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
33
44
  feature: feature,
34
45
  showModal: showModal
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal"];
2
+ var _excluded = ["params", "showModal", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,11 +11,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { ImageLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
13
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
14
15
  import { getTenantId } from "../_util/util";
15
16
  var WaterDrainPointLayer = function WaterDrainPointLayer(props) {
16
17
  var _props$params = props.params,
17
18
  params = _props$params === void 0 ? {} : _props$params,
18
19
  showModal = props.showModal,
20
+ _props$popup = props.popup,
21
+ popup = _props$popup === void 0 ? {
22
+ version: '1'
23
+ } : _props$popup,
19
24
  otherProps = _objectWithoutProperties(props, _excluded);
20
25
  var tenantId = getTenantId();
21
26
  return /*#__PURE__*/React.createElement(ImageLayer, _extends({
@@ -29,6 +34,12 @@ var WaterDrainPointLayer = function WaterDrainPointLayer(props) {
29
34
  zIndex: 40,
30
35
  id: 'WaterDrainPointLayer',
31
36
  template: function template(feature) {
37
+ if (popup.version == '2') {
38
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
39
+ feature: feature,
40
+ showModal: showModal
41
+ });
42
+ }
32
43
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
33
44
  feature: feature,
34
45
  showModal: showModal
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal", "customKeys"];
2
+ var _excluded = ["params", "showModal", "customKeys", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -11,6 +11,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
11
11
  import { ImageLayer } from '@vtx/cs-map';
12
12
  import React from 'react';
13
13
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
14
15
  import { FACILITY_CODE } from "../_util/interface";
15
16
  import { facilityCodeMap } from "../_util/layerConfig";
16
17
  var WaterSupplyLineLayer = function WaterSupplyLineLayer(props) {
@@ -19,6 +20,10 @@ var WaterSupplyLineLayer = function WaterSupplyLineLayer(props) {
19
20
  showModal = props.showModal,
20
21
  _props$customKeys = props.customKeys,
21
22
  customKeys = _props$customKeys === void 0 ? [] : _props$customKeys,
23
+ _props$popup = props.popup,
24
+ popup = _props$popup === void 0 ? {
25
+ version: '1'
26
+ } : _props$popup,
22
27
  otherProps = _objectWithoutProperties(props, _excluded);
23
28
  var code = FACILITY_CODE.WATER_SUPPLY_LINE;
24
29
  var _facilityCodeMap$code = facilityCodeMap[code],
@@ -35,6 +40,13 @@ var WaterSupplyLineLayer = function WaterSupplyLineLayer(props) {
35
40
  legend: "GD_GD",
36
41
  id: code,
37
42
  template: function template(feature) {
43
+ if (popup.version == '2') {
44
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
45
+ feature: feature,
46
+ showModal: showModal,
47
+ customKeys: customKeys
48
+ });
49
+ }
38
50
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
39
51
  feature: feature,
40
52
  showModal: showModal,
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["params", "showModal", "groupKey", "customKeys"];
2
+ var _excluded = ["params", "showModal", "groupKey", "customKeys", "popup"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -15,6 +15,7 @@ import { ImageLayer } from '@vtx/cs-map';
15
15
  import { isArray, isEmpty } from 'lodash';
16
16
  import React from 'react';
17
17
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
18
+ import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
18
19
  import { FACILITY_CODE, POINT_CHARACTERISTICS, POINT_CHARACTERISTICS_STR } from "../_util/interface";
19
20
  import { facilityCodeMap } from "../_util/layerConfig";
20
21
  var WaterSupplyPointLayer = function WaterSupplyPointLayer(props) {
@@ -24,6 +25,10 @@ var WaterSupplyPointLayer = function WaterSupplyPointLayer(props) {
24
25
  groupKey = props.groupKey,
25
26
  _props$customKeys = props.customKeys,
26
27
  customKeys = _props$customKeys === void 0 ? [] : _props$customKeys,
28
+ _props$popup = props.popup,
29
+ popup = _props$popup === void 0 ? {
30
+ version: '1'
31
+ } : _props$popup,
27
32
  otherProps = _objectWithoutProperties(props, _excluded);
28
33
  var code = FACILITY_CODE.WATER_SUPPLY_POINT;
29
34
  var _facilityCodeMap$code = facilityCodeMap[code],
@@ -55,6 +60,13 @@ var WaterSupplyPointLayer = function WaterSupplyPointLayer(props) {
55
60
  legend: "GD_POINT",
56
61
  id: code,
57
62
  template: function template(feature) {
63
+ if (popup.version == '2') {
64
+ return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
65
+ feature: feature,
66
+ showModal: showModal,
67
+ customKeys: customKeys
68
+ });
69
+ }
58
70
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
59
71
  feature: feature,
60
72
  showModal: showModal,
@@ -0,0 +1,8 @@
1
+ import { type FC } from "react";
2
+ declare const CloseBtn: FC<{
3
+ feature: any;
4
+ showModal: any;
5
+ type?: string;
6
+ facilityDetail?: any;
7
+ }>;
8
+ export default CloseBtn;
@@ -0,0 +1,21 @@
1
+ import { ExclamationCircleOutlined } from "@ant-design/icons";
2
+ import React from "react";
3
+ import { useProps } from '@vtx/cs-map';
4
+ var CloseBtn = function CloseBtn(props) {
5
+ var feature = props.feature,
6
+ type = props.type,
7
+ facilityDetail = props.facilityDetail;
8
+ var _useProps = useProps(),
9
+ showModal = _useProps.showModal;
10
+ return /*#__PURE__*/React.createElement(ExclamationCircleOutlined, {
11
+ onClick: function onClick() {
12
+ if (props.showModal) {
13
+ props.showModal(feature, type, facilityDetail);
14
+ } else if (showModal) {
15
+ showModal(feature, type, facilityDetail);
16
+ }
17
+ },
18
+ className: "close-btn"
19
+ });
20
+ };
21
+ export default CloseBtn;
@@ -0,0 +1,21 @@
1
+ import PropTypes from 'prop-types';
2
+ import React from 'react';
3
+ declare function CustomContent(props: any): React.JSX.Element;
4
+ declare namespace CustomContent {
5
+ var propTypes: {
6
+ dark: PropTypes.Requireable<boolean>;
7
+ type: PropTypes.Requireable<string>;
8
+ code: PropTypes.Requireable<string>;
9
+ params: PropTypes.Requireable<object>;
10
+ styleOption: PropTypes.Requireable<object>;
11
+ showModal: PropTypes.Requireable<(...args: any[]) => any>;
12
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
13
+ deviceDetail: PropTypes.Requireable<object>;
14
+ deviceData: PropTypes.Requireable<object>;
15
+ valueField: PropTypes.Requireable<string>;
16
+ customButton: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactElementLike | null | undefined>>;
17
+ popup: PropTypes.Requireable<object>;
18
+ detail: PropTypes.Requireable<object>;
19
+ };
20
+ }
21
+ export default CustomContent;
@@ -0,0 +1,76 @@
1
+ import { getVtxToken } from '@vtx/utils';
2
+ import classnames from 'classnames';
3
+ import PropTypes from 'prop-types';
4
+ import React from 'react';
5
+ var _ref = getVtxToken() || {},
6
+ token = _ref.token,
7
+ tenantId = _ref.tenantId,
8
+ userId = _ref.userId;
9
+ function CustomContent(props) {
10
+ var _onClick = props.onClick,
11
+ deviceDetail = props.deviceDetail,
12
+ deviceData = props.deviceData,
13
+ dark = props.dark;
14
+ // console.log(showModal, valueField, customButton, popup, otherProps, 'CustomContent');
15
+ var handleClassName = function handleClassName(str) {
16
+ var commonClassnames = "device-layer-custom-content".concat(dark ? '-dark' : '');
17
+ return str ? "".concat(commonClassnames, "-").concat(str) : commonClassnames;
18
+ };
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ className: classnames(handleClassName()),
21
+ onClick: function onClick() {
22
+ _onClick && _onClick();
23
+ }
24
+ }, /*#__PURE__*/React.createElement("div", {
25
+ className: classnames(handleClassName('title'))
26
+ }, /*#__PURE__*/React.createElement("div", {
27
+ className: classnames(handleClassName('title-left')),
28
+ title: (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.name) || ''
29
+ }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.name) || ''), /*#__PURE__*/React.createElement("div", {
30
+ className: classnames(handleClassName('title-right'))
31
+ }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.deviceTypeName) || '-')), /*#__PURE__*/React.createElement("div", {
32
+ className: classnames(handleClassName('contentBox'))
33
+ }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.installAddress) && /*#__PURE__*/React.createElement("div", {
34
+ className: classnames(handleClassName('keyParam'))
35
+ }, /*#__PURE__*/React.createElement("div", {
36
+ className: classnames(handleClassName('keyParam-deviceDetail'))
37
+ }, /*#__PURE__*/React.createElement("img", {
38
+ src: require("../../assets/address".concat(dark ? '-dark' : '', ".png"))
39
+ }), /*#__PURE__*/React.createElement("div", {
40
+ className: classnames(handleClassName('keyParam-deviceDetail-address')),
41
+ title: (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.installAddress) || ''
42
+ }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.installAddress) || '')), /*#__PURE__*/React.createElement("div", {
43
+ className: classnames(handleClassName('keyParam-line'))
44
+ })), deviceData !== null && deviceData !== void 0 && deviceData.length ? /*#__PURE__*/React.createElement("div", {
45
+ className: classnames(handleClassName('keyIndicators'))
46
+ }, deviceData === null || deviceData === void 0 ? void 0 : deviceData.map(function (v) {
47
+ return /*#__PURE__*/React.createElement("div", {
48
+ key: v === null || v === void 0 ? void 0 : v.name,
49
+ className: classnames(handleClassName('keyIndicators-item'))
50
+ }, /*#__PURE__*/React.createElement("div", {
51
+ className: classnames(handleClassName('keyIndicators-item-left'))
52
+ }, /*#__PURE__*/React.createElement("div", {
53
+ className: classnames(handleClassName('keyIndicators-item-round'))
54
+ }), /*#__PURE__*/React.createElement("span", null, v.name || ''), /*#__PURE__*/React.createElement("span", null, v.unit ? "\uFF08".concat(v.unit, "\uFF09") : '', ":"), /*#__PURE__*/React.createElement("span", {
55
+ className: classnames(handleClassName('keyIndicators-item-left-value'))
56
+ }, v.value || v.value == 0 ? v.value : '')), /*#__PURE__*/React.createElement("div", {
57
+ className: classnames(handleClassName('keyIndicators-item-updateTime'))
58
+ }, v.updateTime));
59
+ })) : null));
60
+ }
61
+ CustomContent.propTypes = {
62
+ dark: PropTypes.bool,
63
+ type: PropTypes.string,
64
+ code: PropTypes.string,
65
+ params: PropTypes.object,
66
+ styleOption: PropTypes.object,
67
+ showModal: PropTypes.func,
68
+ onClick: PropTypes.func,
69
+ deviceDetail: PropTypes.object,
70
+ deviceData: PropTypes.object,
71
+ valueField: PropTypes.string,
72
+ customButton: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),
73
+ popup: PropTypes.object,
74
+ detail: PropTypes.object
75
+ };
76
+ export default CustomContent;
@@ -1,4 +1,5 @@
1
1
  import { FC } from 'react';
2
+ import './index.less';
2
3
  declare const DeviceTemplate: FC<{
3
4
  feature: any;
4
5
  showModal: any;
@@ -12,6 +12,7 @@ import { Col, Empty, Row, Spin } from 'antd';
12
12
  import React, { useEffect, useState } from 'react';
13
13
  import http from "../../_util/http";
14
14
  import CloseBtn from "./CloseBtn";
15
+ import "./index.less";
15
16
  var DeviceTemplate = function DeviceTemplate(props) {
16
17
  var feature = props.feature,
17
18
  showModal = props.showModal;
@@ -61,7 +62,9 @@ var DeviceTemplate = function DeviceTemplate(props) {
61
62
  getDeviceData(id);
62
63
  }
63
64
  }, [id]);
64
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Spin, {
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ className: "cesium-popup-v1"
67
+ }, /*#__PURE__*/React.createElement(Spin, {
65
68
  spinning: loading,
66
69
  size: "small"
67
70
  }, /*#__PURE__*/React.createElement(Row, null, deviceData === null || deviceData === void 0 ? void 0 : deviceData.map(function (item, index) {
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import './indexV2.less';
3
+ declare const DeviceTemplate: FC<{
4
+ feature: any;
5
+ showModal: any;
6
+ }>;
7
+ export default DeviceTemplate;
@@ -0,0 +1,146 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import { Spin } from 'antd';
12
+ import React, { useEffect, useState } from 'react';
13
+ import http from "../../_util/http";
14
+ import CloseBtn from "./CloseBtnV2";
15
+ import CustomContent from "./DeviceCustomContent";
16
+ import { getVtxToken } from '@vtx/utils';
17
+ var _ref = getVtxToken() || {},
18
+ token = _ref.token,
19
+ tenantId = _ref.tenantId,
20
+ userId = _ref.userId;
21
+ import "./indexV2.less";
22
+ var DeviceTemplate = function DeviceTemplate(props) {
23
+ var feature = props.feature,
24
+ showModal = props.showModal;
25
+ var _useState = useState(false),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ loading = _useState2[0],
28
+ setLoading = _useState2[1];
29
+ var _useState3 = useState([]),
30
+ _useState4 = _slicedToArray(_useState3, 2),
31
+ deviceData = _useState4[0],
32
+ setDeviceData = _useState4[1];
33
+ var _useState5 = useState({}),
34
+ _useState6 = _slicedToArray(_useState5, 2),
35
+ deviceDetail = _useState6[0],
36
+ setDeviceDetail = _useState6[1];
37
+ var _useState7 = useState([]),
38
+ _useState8 = _slicedToArray(_useState7, 2),
39
+ factorValuesList = _useState8[0],
40
+ setFactorValuesList = _useState8[1];
41
+ var _ref2 = (feature === null || feature === void 0 ? void 0 : feature.values_) || {},
42
+ id = _ref2.id;
43
+ var getDeviceDetail = function getDeviceDetail(id) {
44
+ http.get('/cloud/device/entity/getBasicInfo', {
45
+ body: {
46
+ deviceId: id,
47
+ coordinateType: 'wgs84'
48
+ }
49
+ }).then(function (res) {
50
+ if (String(res === null || res === void 0 ? void 0 : res.result) === '0') {
51
+ setDeviceDetail(res.data || {});
52
+ }
53
+ });
54
+ };
55
+ var getDeviceData = function getDeviceData(id) {
56
+ setLoading(true);
57
+ http.get('/cloud/zhsw-jcyj/api/dataQuery/getFactorReal', {
58
+ body: {
59
+ deviceId: id
60
+ }
61
+ }).then(function (res) {
62
+ var _res$data;
63
+ setLoading(false);
64
+ var data = [];
65
+ if (String(res === null || res === void 0 ? void 0 : res.result) === '0') {
66
+ data = res.data.map(function (item) {
67
+ return {
68
+ label: item !== null && item !== void 0 && item.unit ? "".concat(item.factorName, "(").concat(item === null || item === void 0 ? void 0 : item.unit, ")") : item.factorName,
69
+ key: item.factorCode,
70
+ value: item.monitorValue
71
+ };
72
+ });
73
+ }
74
+ // // 默认最多展示4条数据
75
+ // if (data?.length > 4) {
76
+ // data = data.slice(0, 4);
77
+ // }
78
+ // 固定加入
79
+ setDeviceData([].concat(_toConsumableArray(data), [{
80
+ label: '数据采集时间',
81
+ key: 'monitorTime',
82
+ value: (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data[0]) === null || _res$data === void 0 ? void 0 : _res$data.monitorTime
83
+ }]));
84
+ });
85
+ };
86
+ var getDeviceValues = function getDeviceValues(id) {
87
+ http.get('/cloud/device/sdk/factor/realTime/deviceValues', {
88
+ body: {
89
+ tenantId: tenantId,
90
+ deviceId: id
91
+ }
92
+ }).then(function (res) {
93
+ var data = [];
94
+ if (String(res === null || res === void 0 ? void 0 : res.result) === '0') {
95
+ var _res$data2;
96
+ res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 || _res$data2.map(function (item) {
97
+ var _item$factorValues;
98
+ item === null || item === void 0 || (_item$factorValues = item.factorValues) === null || _item$factorValues === void 0 || _item$factorValues.map(function (v) {
99
+ data.push({
100
+ // name: v?.factorName,
101
+ name: v === null || v === void 0 ? void 0 : v.monitorItemName,
102
+ unit: v === null || v === void 0 ? void 0 : v.unit,
103
+ value: v === null || v === void 0 ? void 0 : v.formatValue,
104
+ updateTime: v === null || v === void 0 ? void 0 : v.timeDesc
105
+ });
106
+ });
107
+ });
108
+ }
109
+ setFactorValuesList(data);
110
+ });
111
+ };
112
+ useEffect(function () {
113
+ if (id) {
114
+ getDeviceData(id);
115
+ // 获取设备详情
116
+ getDeviceDetail(id);
117
+ // 获取设备的实时因子
118
+ getDeviceValues(id);
119
+ }
120
+ }, [id]);
121
+ return /*#__PURE__*/React.createElement("div", {
122
+ className: "cesium-popup-v2"
123
+ }, /*#__PURE__*/React.createElement(Spin, {
124
+ spinning: loading,
125
+ size: "small"
126
+ }, /*#__PURE__*/React.createElement(CustomContent, {
127
+ dark: true,
128
+ deviceData: factorValuesList,
129
+ deviceDetail: deviceDetail
130
+ // feature={feature}
131
+ ,
132
+ onClick: function onClick() {
133
+ // if (props.showModal) {
134
+ // props.showModal(feature, map, '1');
135
+ // } else {
136
+ // showModal && showModal(feature, map, '1');
137
+ // }
138
+ }
139
+ })), /*#__PURE__*/React.createElement(CloseBtn, {
140
+ facilityDetail: deviceDetail,
141
+ showModal: showModal,
142
+ feature: feature,
143
+ type: "2"
144
+ }));
145
+ };
146
+ export default DeviceTemplate;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ declare function CustomContent(props: any): React.JSX.Element;
4
+ declare namespace CustomContent {
5
+ var propTypes: {
6
+ dark: PropTypes.Requireable<boolean>;
7
+ type: PropTypes.Requireable<string>;
8
+ code: PropTypes.Requireable<string>;
9
+ params: PropTypes.Requireable<object>;
10
+ styleOption: PropTypes.Requireable<object>;
11
+ showModal: PropTypes.Requireable<(...args: any[]) => any>;
12
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
13
+ facilityDetail: PropTypes.Requireable<object>;
14
+ valueField: PropTypes.Requireable<string>;
15
+ customButton: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactElementLike | null | undefined>>;
16
+ popup: PropTypes.Requireable<object>;
17
+ detail: PropTypes.Requireable<object>;
18
+ };
19
+ }
20
+ export default CustomContent;