@vtx/cs-map-layer 1.0.18 → 1.0.20

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 (76) hide show
  1. package/package.json +105 -102
  2. package/lib/ConfluenceLineLayer/index.d.ts +0 -4
  3. package/lib/ConfluenceLineLayer/index.js +0 -51
  4. package/lib/ConfluenceManholeLayer/index.d.ts +0 -4
  5. package/lib/ConfluenceManholeLayer/index.js +0 -51
  6. package/lib/ConfluencePointLayer/index.d.ts +0 -4
  7. package/lib/ConfluencePointLayer/index.js +0 -51
  8. package/lib/DeviceLayer/index.d.ts +0 -11
  9. package/lib/DeviceLayer/index.js +0 -155
  10. package/lib/DivisionLayer/index.d.ts +0 -4
  11. package/lib/DivisionLayer/index.js +0 -26
  12. package/lib/FacilityLayer/index.d.ts +0 -13
  13. package/lib/FacilityLayer/index.js +0 -72
  14. package/lib/Layer/index.d.ts +0 -5
  15. package/lib/Layer/index.js +0 -105
  16. package/lib/Layer/layerConfig.d.ts +0 -82
  17. package/lib/Layer/layerConfig.js +0 -370
  18. package/lib/RainLineLayer/index.d.ts +0 -4
  19. package/lib/RainLineLayer/index.js +0 -51
  20. package/lib/RainManholeLayer/index.d.ts +0 -4
  21. package/lib/RainManholeLayer/index.js +0 -51
  22. package/lib/RainPointLayer/index.d.ts +0 -4
  23. package/lib/RainPointLayer/index.js +0 -51
  24. package/lib/RawWaterLineLayer/index.d.ts +0 -4
  25. package/lib/RawWaterLineLayer/index.js +0 -57
  26. package/lib/RawWaterPointLayer/index.d.ts +0 -4
  27. package/lib/RawWaterPointLayer/index.js +0 -57
  28. package/lib/SewageLineLayer/index.d.ts +0 -4
  29. package/lib/SewageLineLayer/index.js +0 -51
  30. package/lib/SewageManholeLayer/index.d.ts +0 -4
  31. package/lib/SewageManholeLayer/index.js +0 -51
  32. package/lib/SewagePointLayer/index.d.ts +0 -4
  33. package/lib/SewagePointLayer/index.js +0 -51
  34. package/lib/WaterDrainLineLayer/index.d.ts +0 -4
  35. package/lib/WaterDrainLineLayer/index.js +0 -50
  36. package/lib/WaterDrainManholeLayer/index.d.ts +0 -4
  37. package/lib/WaterDrainManholeLayer/index.js +0 -50
  38. package/lib/WaterDrainPointLayer/index.d.ts +0 -4
  39. package/lib/WaterDrainPointLayer/index.js +0 -50
  40. package/lib/WaterSupplyLineLayer/index.d.ts +0 -4
  41. package/lib/WaterSupplyLineLayer/index.js +0 -91
  42. package/lib/WaterSupplyPointLayer/index.d.ts +0 -8
  43. package/lib/WaterSupplyPointLayer/index.js +0 -79
  44. package/lib/_components/Template/CloseBtn.d.ts +0 -8
  45. package/lib/_components/Template/CloseBtn.js +0 -21
  46. package/lib/_components/Template/CloseBtnV2.d.ts +0 -8
  47. package/lib/_components/Template/CloseBtnV2.js +0 -24
  48. package/lib/_components/Template/DeviceCustomContent.d.ts +0 -21
  49. package/lib/_components/Template/DeviceCustomContent.js +0 -96
  50. package/lib/_components/Template/DeviceTemplate.d.ts +0 -7
  51. package/lib/_components/Template/DeviceTemplate.js +0 -81
  52. package/lib/_components/Template/DeviceTemplateV2.d.ts +0 -7
  53. package/lib/_components/Template/DeviceTemplateV2.js +0 -151
  54. package/lib/_components/Template/FacilityCustomContent.d.ts +0 -20
  55. package/lib/_components/Template/FacilityCustomContent.js +0 -163
  56. package/lib/_components/Template/FacilityTemplate.d.ts +0 -12
  57. package/lib/_components/Template/FacilityTemplate.js +0 -100
  58. package/lib/_components/Template/FacilityTemplateV2.d.ts +0 -12
  59. package/lib/_components/Template/FacilityTemplateV2.js +0 -104
  60. package/lib/_components/Template/index.less +0 -10
  61. package/lib/_components/Template/indexV2.less +0 -567
  62. package/lib/_util/http.d.ts +0 -42
  63. package/lib/_util/http.js +0 -161
  64. package/lib/_util/interface.d.ts +0 -383
  65. package/lib/_util/interface.js +0 -110
  66. package/lib/_util/layerConfig.d.ts +0 -39
  67. package/lib/_util/layerConfig.js +0 -772
  68. package/lib/_util/transform.d.ts +0 -1
  69. package/lib/_util/transform.js +0 -111
  70. package/lib/_util/util.d.ts +0 -2
  71. package/lib/_util/util.js +0 -24
  72. package/lib/assets/address-dark.png +0 -0
  73. package/lib/assets/address.png +0 -0
  74. package/lib/index.d.ts +0 -22
  75. package/lib/index.js +0 -22
  76. package/lib/typings.d.ts +0 -4
@@ -1,50 +0,0 @@
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", "popup"];
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
- 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
- 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; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
- import { ImageLayer } from '@vtx/cs-map';
12
- import React from 'react';
13
- import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
- import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
15
- import { getTenantId } from "../_util/util";
16
- var WaterDrainPointLayer = function WaterDrainPointLayer(props) {
17
- var _props$params = props.params,
18
- params = _props$params === void 0 ? {} : _props$params,
19
- showModal = props.showModal,
20
- _props$popup = props.popup,
21
- popup = _props$popup === void 0 ? {
22
- version: '1'
23
- } : _props$popup,
24
- otherProps = _objectWithoutProperties(props, _excluded);
25
- var tenantId = getTenantId();
26
- return /*#__PURE__*/React.createElement(ImageLayer, _extends({
27
- url: "/geoserver/zhsw/wms",
28
- params: _objectSpread({
29
- typeName: 'zhsw:zhsw_point',
30
- viewparams: "tenantId:".concat(tenantId)
31
- }, params),
32
- name: "\u6392\u6C34\u7BA1\u70B9",
33
- labelField: "code",
34
- zIndex: 40,
35
- id: 'WaterDrainPointLayer',
36
- template: function template(feature) {
37
- if (popup.version == '2') {
38
- return /*#__PURE__*/React.createElement(FacilityTemplateV2, {
39
- feature: feature,
40
- showModal: showModal
41
- });
42
- }
43
- return /*#__PURE__*/React.createElement(FacilityTemplate, {
44
- feature: feature,
45
- showModal: showModal
46
- });
47
- }
48
- }, otherProps));
49
- };
50
- export default WaterDrainPointLayer;
@@ -1,4 +0,0 @@
1
- import { type FC } from 'react';
2
- import { CommonPropsI } from '../_util/interface';
3
- declare const WaterSupplyLineLayer: FC<CommonPropsI>;
4
- export default WaterSupplyLineLayer;
@@ -1,91 +0,0 @@
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", "popup"];
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
- 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
- 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; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
- import { ImageLayer } from '@vtx/cs-map';
12
- import React from 'react';
13
- import FacilityTemplate from "../_components/Template/FacilityTemplate";
14
- import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
15
- import { FACILITY_CODE } from "../_util/interface";
16
- import { facilityCodeMap } from "../_util/layerConfig";
17
- var WaterSupplyLineLayer = function WaterSupplyLineLayer(props) {
18
- var _props$params = props.params,
19
- params = _props$params === void 0 ? {} : _props$params,
20
- showModal = props.showModal,
21
- _props$customKeys = props.customKeys,
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,
27
- otherProps = _objectWithoutProperties(props, _excluded);
28
- var code = FACILITY_CODE.WATER_SUPPLY_LINE;
29
- var _facilityCodeMap$code = facilityCodeMap[code],
30
- name = _facilityCodeMap$code.name,
31
- labelField = _facilityCodeMap$code.labelField;
32
- return /*#__PURE__*/React.createElement(ImageLayer, _extends({
33
- url: "/geoserver/zhsw/wms",
34
- params: _objectSpread({
35
- typeName: 'zhsw:zhsw_water_supply_line'
36
- }, params),
37
- name: name,
38
- labelField: labelField,
39
- zIndex: 2,
40
- legend: "GD_GD",
41
- id: code,
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
- }
50
- return /*#__PURE__*/React.createElement(FacilityTemplate, {
51
- feature: feature,
52
- showModal: showModal,
53
- customKeys: customKeys
54
- });
55
- },
56
- group: [{
57
- name: '管径:0~400',
58
- key: 'JCSS_GD_GD_1',
59
- filter: '(ds < 400)',
60
- legend: {
61
- icon: 'GD_GD',
62
- color: '#df8787'
63
- }
64
- }, {
65
- name: '管径:400~600',
66
- key: 'JCSS_GD_GD_2',
67
- filter: '(ds < 600 and ds >= 400)',
68
- legend: {
69
- icon: 'GD_GD',
70
- color: '#9fd741'
71
- }
72
- }, {
73
- name: '管径:600~800',
74
- key: 'JCSS_GD_GD_3',
75
- filter: '(ds < 800 and ds >= 600)',
76
- legend: {
77
- icon: 'GD_GD',
78
- color: '#4143d7'
79
- }
80
- }, {
81
- name: '管径:800以上',
82
- key: 'JCSS_GD_GD_4',
83
- filter: '(ds > 800)',
84
- legend: {
85
- icon: 'GD_GD',
86
- color: '#d741bc'
87
- }
88
- }]
89
- }, otherProps));
90
- };
91
- export default WaterSupplyLineLayer;
@@ -1,8 +0,0 @@
1
- import { type FC } from 'react';
2
- import { CommonPropsI, POINT_CHARACTERISTICS } from '../_util/interface';
3
- interface PropsI {
4
- groupKey?: POINT_CHARACTERISTICS[] | false;
5
- customKeys?: any;
6
- }
7
- declare const WaterSupplyPointLayer: FC<CommonPropsI & PropsI>;
8
- export default WaterSupplyPointLayer;
@@ -1,79 +0,0 @@
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", "popup"];
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
- 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
- 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; }
6
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
- /**
12
- *供水管点
13
- */
14
- import { ImageLayer } from '@vtx/cs-map';
15
- import { isArray, isEmpty } from 'lodash';
16
- import React from 'react';
17
- import FacilityTemplate from "../_components/Template/FacilityTemplate";
18
- import FacilityTemplateV2 from "../_components/Template/FacilityTemplateV2";
19
- import { FACILITY_CODE, POINT_CHARACTERISTICS, POINT_CHARACTERISTICS_STR } from "../_util/interface";
20
- import { facilityCodeMap } from "../_util/layerConfig";
21
- var WaterSupplyPointLayer = function WaterSupplyPointLayer(props) {
22
- var _props$params = props.params,
23
- params = _props$params === void 0 ? {} : _props$params,
24
- showModal = props.showModal,
25
- groupKey = props.groupKey,
26
- _props$customKeys = props.customKeys,
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,
32
- otherProps = _objectWithoutProperties(props, _excluded);
33
- var code = FACILITY_CODE.WATER_SUPPLY_POINT;
34
- var _facilityCodeMap$code = facilityCodeMap[code],
35
- name = _facilityCodeMap$code.name,
36
- labelField = _facilityCodeMap$code.labelField;
37
- var newGroupKey = [POINT_CHARACTERISTICS.GD_BZ, POINT_CHARACTERISTICS.GD_CSK, POINT_CHARACTERISTICS.GD_BJG, POINT_CHARACTERISTICS.GD_FM, POINT_CHARACTERISTICS.GD_JCJ, POINT_CHARACTERISTICS.GD_PQF, POINT_CHARACTERISTICS.GD_PSF, POINT_CHARACTERISTICS.GD_SB, POINT_CHARACTERISTICS.GD_XFS, POINT_CHARACTERISTICS.GD_YLD, POINT_CHARACTERISTICS.GD_PNJ, POINT_CHARACTERISTICS.GD_PXJ, POINT_CHARACTERISTICS.GD_XSJ, POINT_CHARACTERISTICS.GD_DTFB];
38
- if (groupKey === false) {
39
- newGroupKey = [];
40
- } else if (isArray(groupKey) && !isEmpty(groupKey)) {
41
- newGroupKey = groupKey;
42
- }
43
- var group = newGroupKey.map(function (key) {
44
- var code = POINT_CHARACTERISTICS[key];
45
- return {
46
- name: POINT_CHARACTERISTICS_STR[code],
47
- key: code,
48
- filter: "append = ".concat(key),
49
- legend: code
50
- };
51
- });
52
- return /*#__PURE__*/React.createElement(ImageLayer, _extends({
53
- url: "/geoserver/zhsw/wms",
54
- params: _objectSpread({
55
- typeName: 'zhsw:zhsw_water_supply_point'
56
- }, params),
57
- name: name,
58
- labelField: labelField,
59
- zIndex: 2,
60
- legend: "GD_POINT",
61
- id: code,
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
- }
70
- return /*#__PURE__*/React.createElement(FacilityTemplate, {
71
- feature: feature,
72
- showModal: showModal,
73
- customKeys: customKeys
74
- });
75
- },
76
- group: group
77
- }, otherProps));
78
- };
79
- export default WaterSupplyPointLayer;
@@ -1,8 +0,0 @@
1
- import { type FC } from "react";
2
- import './index.less';
3
- declare const CloseBtn: FC<{
4
- feature: any;
5
- showModal: any;
6
- type: string;
7
- }>;
8
- export default CloseBtn;
@@ -1,21 +0,0 @@
1
- import { ExclamationCircleOutlined } from "@ant-design/icons";
2
- import React from "react";
3
- import "./index.less";
4
- import { useProps } from '@vtx/cs-map';
5
- var CloseBtn = function CloseBtn(props) {
6
- var feature = props.feature,
7
- type = props.type;
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);
14
- } else if (showModal) {
15
- showModal(feature, type);
16
- }
17
- },
18
- className: "close-btn"
19
- });
20
- };
21
- export default CloseBtn;
@@ -1,8 +0,0 @@
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;
@@ -1,24 +0,0 @@
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
- if (!props.showModal && !showModal) {
11
- return null;
12
- }
13
- return /*#__PURE__*/React.createElement(ExclamationCircleOutlined, {
14
- onClick: function onClick() {
15
- if (props.showModal) {
16
- props.showModal(feature, type, facilityDetail);
17
- } else if (showModal) {
18
- showModal(feature, type, facilityDetail);
19
- }
20
- },
21
- className: "close-btn"
22
- });
23
- };
24
- export default CloseBtn;
@@ -1,21 +0,0 @@
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;
@@ -1,96 +0,0 @@
1
- import { QuestionCircleOutlined } from '@ant-design/icons';
2
- import { getVtxToken } from '@vtx/utils';
3
- import classnames from 'classnames';
4
- import PropTypes from 'prop-types';
5
- import React from 'react';
6
- import { Tooltip } from "antd";
7
- function CustomContent(props) {
8
- var _ref = getVtxToken() || {},
9
- token = _ref.token,
10
- tenantId = _ref.tenantId,
11
- userId = _ref.userId;
12
- var _onClick = props.onClick,
13
- deviceDetail = props.deviceDetail,
14
- deviceData = props.deviceData,
15
- dark = props.dark;
16
- // console.log(showModal, valueField, customButton, popup, otherProps, 'CustomContent');
17
- var handleClassName = function handleClassName(str) {
18
- var commonClassnames = "device-layer-custom-content".concat(dark ? '-dark' : '');
19
- return str ? "".concat(commonClassnames, "-").concat(str) : commonClassnames;
20
- };
21
- var getLastUpdateTime = function getLastUpdateTime(arr) {
22
- var _arr$sort;
23
- return ((_arr$sort = arr.sort(function (a, b) {
24
- return new Date(b.updateTime).getTime() - new Date(a.updateTime).getTime();
25
- })) === null || _arr$sort === void 0 || (_arr$sort = _arr$sort[0]) === null || _arr$sort === void 0 ? void 0 : _arr$sort.updateTime) || '';
26
- };
27
- return /*#__PURE__*/React.createElement("div", {
28
- className: classnames(handleClassName()),
29
- onClick: function onClick() {
30
- _onClick && _onClick();
31
- }
32
- }, /*#__PURE__*/React.createElement("div", {
33
- className: classnames(handleClassName('title'))
34
- }, /*#__PURE__*/React.createElement("div", {
35
- className: classnames(handleClassName('title-left')),
36
- title: (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.name) || ''
37
- }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.name) || ''), /*#__PURE__*/React.createElement("div", {
38
- className: classnames(handleClassName('title-right'))
39
- }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.deviceTypeName) || '-')), /*#__PURE__*/React.createElement("div", {
40
- className: classnames(handleClassName('contentBox'))
41
- }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.installAddress) && /*#__PURE__*/React.createElement("div", {
42
- className: classnames(handleClassName('keyParam'))
43
- }, /*#__PURE__*/React.createElement("div", {
44
- className: classnames(handleClassName('keyParam-deviceDetail'))
45
- }, /*#__PURE__*/React.createElement("img", {
46
- src: require("../../assets/address".concat(dark ? '-dark' : '', ".png"))
47
- }), /*#__PURE__*/React.createElement("div", {
48
- className: classnames(handleClassName('keyParam-deviceDetail-address')),
49
- title: (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.installAddress) || ''
50
- }, (deviceDetail === null || deviceDetail === void 0 ? void 0 : deviceDetail.installAddress) || '')), /*#__PURE__*/React.createElement("div", {
51
- className: classnames(handleClassName('keyParam-line'))
52
- })), deviceData !== null && deviceData !== void 0 && deviceData.length ? /*#__PURE__*/React.createElement("div", {
53
- className: classnames(handleClassName('keyIndicators'))
54
- }, /*#__PURE__*/React.createElement("div", {
55
- className: classnames(handleClassName('keyIndicators-item'))
56
- }, getLastUpdateTime(deviceData.filter(function (v) {
57
- return v.updateTime;
58
- }) || [])), deviceData === null || deviceData === void 0 ? void 0 : deviceData.map(function (v) {
59
- return /*#__PURE__*/React.createElement("div", {
60
- key: v === null || v === void 0 ? void 0 : v.name,
61
- className: classnames(handleClassName('keyIndicators-item'))
62
- }, /*#__PURE__*/React.createElement("div", {
63
- className: classnames(handleClassName('keyIndicators-item-left'))
64
- }, /*#__PURE__*/React.createElement("div", {
65
- className: classnames(handleClassName('keyIndicators-item-round'))
66
- }), /*#__PURE__*/React.createElement("span", {
67
- className: classnames(handleClassName('keyIndicators-item-left-name'))
68
- }, v.name || ''), /*#__PURE__*/React.createElement("span", null, v.unit ? "\uFF08".concat(v.unit, "\uFF09") : '', ":"), /*#__PURE__*/React.createElement("span", {
69
- className: classnames(handleClassName('keyIndicators-item-left-value'), {
70
- 'is-alarm': v.onAlarm
71
- })
72
- }, v.value || v.value == 0 ? v.value : '', v.onAlarm ? /*#__PURE__*/React.createElement(React.Fragment, null, " (".concat(v.alarmLevel, "\u7EA7\u62A5\u8B66) "), /*#__PURE__*/React.createElement(Tooltip, {
73
- title: v.alarmDescription
74
- }, /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
75
- style: {
76
- color: '#fff'
77
- }
78
- }))) : '')));
79
- })) : null));
80
- }
81
- CustomContent.propTypes = {
82
- dark: PropTypes.bool,
83
- type: PropTypes.string,
84
- code: PropTypes.string,
85
- params: PropTypes.object,
86
- styleOption: PropTypes.object,
87
- showModal: PropTypes.func,
88
- onClick: PropTypes.func,
89
- deviceDetail: PropTypes.object,
90
- deviceData: PropTypes.object,
91
- valueField: PropTypes.string,
92
- customButton: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),
93
- popup: PropTypes.object,
94
- detail: PropTypes.object
95
- };
96
- export default CustomContent;
@@ -1,7 +0,0 @@
1
- import { FC } from 'react';
2
- import './index.less';
3
- declare const DeviceTemplate: FC<{
4
- feature: any;
5
- showModal: any;
6
- }>;
7
- export default DeviceTemplate;
@@ -1,81 +0,0 @@
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 { Col, Empty, Row, Spin } from 'antd';
12
- import React, { useEffect, useState } from 'react';
13
- import http from "../../_util/http";
14
- import CloseBtn from "./CloseBtn";
15
- import "./index.less";
16
- var DeviceTemplate = function DeviceTemplate(props) {
17
- var feature = props.feature,
18
- showModal = props.showModal;
19
- var _useState = useState(false),
20
- _useState2 = _slicedToArray(_useState, 2),
21
- loading = _useState2[0],
22
- setLoading = _useState2[1];
23
- var _useState3 = useState([]),
24
- _useState4 = _slicedToArray(_useState3, 2),
25
- deviceData = _useState4[0],
26
- setDeviceData = _useState4[1];
27
- var _ref = (feature === null || feature === void 0 ? void 0 : feature.values_) || {},
28
- id = _ref.id;
29
- var getDeviceData = function getDeviceData(id) {
30
- setLoading(true);
31
- http.get('/cloud/zhsw-jcyj/api/dataQuery/getFactorReal', {
32
- body: {
33
- deviceId: id
34
- }
35
- }).then(function (res) {
36
- var _res$data;
37
- setLoading(false);
38
- var data = [];
39
- if (String(res === null || res === void 0 ? void 0 : res.result) === '0') {
40
- data = res.data.map(function (item) {
41
- return {
42
- label: item !== null && item !== void 0 && item.unit ? "".concat(item.factorName, "(").concat(item === null || item === void 0 ? void 0 : item.unit, ")") : item.factorName,
43
- key: item.factorCode,
44
- value: item.monitorValue
45
- };
46
- });
47
- }
48
- // // 默认最多展示4条数据
49
- // if (data?.length > 4) {
50
- // data = data.slice(0, 4);
51
- // }
52
- // 固定加入
53
- setDeviceData([].concat(_toConsumableArray(data), [{
54
- label: '数据采集时间',
55
- key: 'monitorTime',
56
- 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
57
- }]));
58
- });
59
- };
60
- useEffect(function () {
61
- if (id) {
62
- getDeviceData(id);
63
- }
64
- }, [id]);
65
- return /*#__PURE__*/React.createElement("div", {
66
- className: "cesium-popup-v1"
67
- }, /*#__PURE__*/React.createElement(Spin, {
68
- spinning: loading,
69
- size: "small"
70
- }, /*#__PURE__*/React.createElement(Row, null, deviceData === null || deviceData === void 0 ? void 0 : deviceData.map(function (item, index) {
71
- return /*#__PURE__*/React.createElement(Col, {
72
- span: 24,
73
- key: index
74
- }, item.label, "\uFF1A", item.value || String(item.value) === '0' ? item.value : '--');
75
- })), !(deviceData !== null && deviceData !== void 0 && deviceData.length) && /*#__PURE__*/React.createElement(Empty, null)), /*#__PURE__*/React.createElement(CloseBtn, {
76
- showModal: showModal,
77
- feature: feature,
78
- type: "2"
79
- }));
80
- };
81
- export default DeviceTemplate;
@@ -1,7 +0,0 @@
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;