@vtx/cs-map-layer 1.0.22 → 1.0.24

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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,40 +1,40 @@
1
- # @vtx/cs-map-layer
2
-
3
- [![NPM version](https://img.shields.io/npm/v/@vtx/cs-map-layer.svg?style=flat)](https://npmjs.org/package/@vtx/cs-map-layer)
4
- [![NPM downloads](http://img.shields.io/npm/dm/@vtx/cs-map-layer.svg?style=flat)](https://npmjs.org/package/@vtx/cs-map-layer)
5
-
6
- React components for Vortex
7
-
8
- ## Usage
9
-
10
- TODO
11
-
12
- ## Options
13
-
14
- TODO
15
-
16
- ## Development
17
-
18
- ```bash
19
- # install dependencies
20
- $ yarn install
21
-
22
- # develop library by docs demo
23
- $ yarn start
24
-
25
- # build library source code
26
- $ yarn run build
27
-
28
- # build library source code in watch mode
29
- $ yarn run build:watch
30
-
31
- # build docs
32
- $ yarn run docs:build
33
-
34
- # check your project for potential problems
35
- $ yarn run doctor
36
- ```
37
-
38
- ## LICENSE
39
-
40
- MIT
1
+ # @vtx/cs-map-layer
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/@vtx/cs-map-layer.svg?style=flat)](https://npmjs.org/package/@vtx/cs-map-layer)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/@vtx/cs-map-layer.svg?style=flat)](https://npmjs.org/package/@vtx/cs-map-layer)
5
+
6
+ React components for Vortex
7
+
8
+ ## Usage
9
+
10
+ TODO
11
+
12
+ ## Options
13
+
14
+ TODO
15
+
16
+ ## Development
17
+
18
+ ```bash
19
+ # install dependencies
20
+ $ yarn install
21
+
22
+ # develop library by docs demo
23
+ $ yarn start
24
+
25
+ # build library source code
26
+ $ yarn run build
27
+
28
+ # build library source code in watch mode
29
+ $ yarn run build:watch
30
+
31
+ # build docs
32
+ $ yarn run docs:build
33
+
34
+ # check your project for potential problems
35
+ $ yarn run doctor
36
+ ```
37
+
38
+ ## LICENSE
39
+
40
+ MIT
@@ -102,6 +102,9 @@ var DeviceLayer = function DeviceLayer(props) {
102
102
  var _icon = icon || styleOption.icon;
103
103
  var getProps = function getProps(status) {
104
104
  var color = deviceColorMap[status];
105
+ if (status == 1) {
106
+ color = styleOption.color || deviceColorMap[status];
107
+ }
105
108
  var _legend = {
106
109
  color: color,
107
110
  icon: _icon
@@ -3,8 +3,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  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; }
4
4
  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; }
5
5
  /* eslint-disable @typescript-eslint/no-use-before-define */
6
- /*
7
- * @description: 排水-雨水管线图层
6
+ /*
7
+ * @description: 排水-雨水管线图层
8
8
  */
9
9
  import { FeatureLayer, GroupLayer, ImageLayer } from '@vtx/cs-map';
10
10
  import React from 'react';
@@ -1,9 +1,9 @@
1
- /* type:类型 FacilityLayer-设施 DeviceLayer-设备 排水管点-WaterDrainPointLayer 排水管线-WaterDrainLineLayer 排水窨井-WaterSupplyPointLayer
2
- 视频-VideoLayer 行政区划-DivisionLayer 排水-雨水-管点-RainPointLayer 排水-雨水-管线-RainLineLayer 排水-雨水-窨井-RainManholeLayer
3
- 排水-污水-管点-SewagePointLayer 排水-污水-管线-SewageLineLayer 排水-污水-窨井-SewageManholeLayer 排水-合流-管点-ConfluencePointLayer
4
- 排水-合流-管线-ConfluenceLineLayer 排水-合流-窨井-ConfluenceManholeLayer 供水-管点-WaterSupplyPointLayer 供水-管线-WaterSupplyLineLayer
5
- 原水-管点-RawWaterPointLayer 原水-管线-RawWaterLineLayer
6
- 自定义图层-CustomLayer
1
+ /* type:类型 FacilityLayer-设施 DeviceLayer-设备 排水管点-WaterDrainPointLayer 排水管线-WaterDrainLineLayer 排水窨井-WaterSupplyPointLayer
2
+ 视频-VideoLayer 行政区划-DivisionLayer 排水-雨水-管点-RainPointLayer 排水-雨水-管线-RainLineLayer 排水-雨水-窨井-RainManholeLayer
3
+ 排水-污水-管点-SewagePointLayer 排水-污水-管线-SewageLineLayer 排水-污水-窨井-SewageManholeLayer 排水-合流-管点-ConfluencePointLayer
4
+ 排水-合流-管线-ConfluenceLineLayer 排水-合流-窨井-ConfluenceManholeLayer 供水-管点-WaterSupplyPointLayer 供水-管线-WaterSupplyLineLayer
5
+ 原水-管点-RawWaterPointLayer 原水-管线-RawWaterLineLayer
6
+ 自定义图层-CustomLayer
7
7
  */
8
8
 
9
9
  var layerConfig = [{
@@ -8,8 +8,8 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
8
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
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
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
- *供水管点
11
+ /**
12
+ *供水管点
13
13
  */
14
14
  import { ImageLayer } from '@vtx/cs-map';
15
15
  import { isArray, isEmpty } from 'lodash';
@@ -1,7 +1,7 @@
1
1
  import { ExclamationCircleOutlined } from "@ant-design/icons";
2
+ import React from "react";
2
3
  import "./index.less";
3
4
  import { useProps } from '@vtx/cs-map';
4
- import React from 'react';
5
5
  var CloseBtn = function CloseBtn(props) {
6
6
  var feature = props.feature,
7
7
  type = props.type;
@@ -16,6 +16,7 @@ declare namespace CustomContent {
16
16
  popup: PropTypes.Requireable<object>;
17
17
  detail: PropTypes.Requireable<object>;
18
18
  extraKeyParamList: PropTypes.Requireable<any[]>;
19
+ customFactorValuesList: PropTypes.Requireable<any[]>;
19
20
  };
20
21
  }
21
22
  export default CustomContent;
@@ -23,7 +23,9 @@ function CustomContent(props) {
23
23
  facilityDetail = props.facilityDetail,
24
24
  dark = props.dark,
25
25
  _props$extraKeyParamL = props.extraKeyParamList,
26
- extraKeyParamList = _props$extraKeyParamL === void 0 ? [] : _props$extraKeyParamL;
26
+ extraKeyParamList = _props$extraKeyParamL === void 0 ? [] : _props$extraKeyParamL,
27
+ _props$customFactorVa = props.customFactorValuesList,
28
+ customFactorValuesList = _props$customFactorVa === void 0 ? [] : _props$customFactorVa;
27
29
  // !-解决因子不能及时更新问题
28
30
  var _useState = useState(0),
29
31
  _useState2 = _slicedToArray(_useState, 2),
@@ -127,7 +129,22 @@ function CustomContent(props) {
127
129
  }, v.label || '', "\xA0: \xA0", v.label == '所属河道' ? (facilityDetail === null || facilityDetail === void 0 || (_facilityDetail$dataJ = facilityDetail.dataJson) === null || _facilityDetail$dataJ === void 0 ? void 0 : _facilityDetail$dataJ.regionTypeValue) == '河道' ? (facilityDetail === null || facilityDetail === void 0 || (_facilityDetail$dataJ2 = facilityDetail.dataJson) === null || _facilityDetail$dataJ2 === void 0 ? void 0 : _facilityDetail$dataJ2.regionObjectName) || '' : '' : (facilityDetail === null || facilityDetail === void 0 || (_facilityDetail$dataJ3 = facilityDetail.dataJson) === null || _facilityDetail$dataJ3 === void 0 ? void 0 : _facilityDetail$dataJ3[v.value]) || '');
128
130
  }), item !== null && item !== void 0 && (_item$keyParamList2 = item.keyParamList) !== null && _item$keyParamList2 !== void 0 && _item$keyParamList2.length ? /*#__PURE__*/React.createElement("div", {
129
131
  className: classnames(handleClassName('keyParam-line'))
130
- }) : null), item !== null && item !== void 0 && (_item$factorValuesLis = item.factorValuesList) !== null && _item$factorValuesLis !== void 0 && _item$factorValuesLis.length ? /*#__PURE__*/React.createElement("div", {
132
+ }) : null), customFactorValuesList !== null && customFactorValuesList !== void 0 && customFactorValuesList.length ? /*#__PURE__*/React.createElement("div", {
133
+ className: classnames(handleClassName('keyIndicators'))
134
+ }, customFactorValuesList === null || customFactorValuesList === void 0 ? void 0 : customFactorValuesList.map(function (v) {
135
+ return /*#__PURE__*/React.createElement("div", {
136
+ key: v === null || v === void 0 ? void 0 : v.name,
137
+ className: classnames(handleClassName('keyIndicators-item'))
138
+ }, /*#__PURE__*/React.createElement("div", {
139
+ className: classnames(handleClassName('keyIndicators-item-left'))
140
+ }, /*#__PURE__*/React.createElement("div", {
141
+ className: classnames(handleClassName('keyIndicators-item-round'))
142
+ }), /*#__PURE__*/React.createElement("span", {
143
+ className: classnames(handleClassName('keyIndicators-item-left-name'))
144
+ }, v.name || ''), /*#__PURE__*/React.createElement("span", null, v.unit ? "\uFF08".concat(v.unit, "\uFF09") : '', ":"), /*#__PURE__*/React.createElement("span", {
145
+ className: classnames(handleClassName('keyIndicators-item-left-value'))
146
+ }, v.value || v.value == 0 ? v.value : '')));
147
+ })) : item !== null && item !== void 0 && (_item$factorValuesLis = item.factorValuesList) !== null && _item$factorValuesLis !== void 0 && _item$factorValuesLis.length ? /*#__PURE__*/React.createElement("div", {
131
148
  className: classnames(handleClassName('keyIndicators'))
132
149
  }, /*#__PURE__*/React.createElement("div", {
133
150
  className: classnames(handleClassName('keyIndicators-item'))
@@ -166,6 +183,7 @@ CustomContent.propTypes = {
166
183
  customButton: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),
167
184
  popup: PropTypes.object,
168
185
  detail: PropTypes.object,
169
- extraKeyParamList: PropTypes.array
186
+ extraKeyParamList: PropTypes.array,
187
+ customFactorValuesList: PropTypes.array
170
188
  };
171
189
  export default CustomContent;
@@ -10,5 +10,6 @@ declare const FacilityTemplate: FC<{
10
10
  */
11
11
  customKeys?: any;
12
12
  extraKeyParamList?: any[];
13
+ customFactorValuesList?: any[];
13
14
  }>;
14
15
  export default FacilityTemplate;
@@ -17,7 +17,9 @@ var FacilityTemplate = function FacilityTemplate(props) {
17
17
  customKeys = props.customKeys,
18
18
  customButton = props.customButton,
19
19
  _props$extraKeyParamL = props.extraKeyParamList,
20
- extraKeyParamList = _props$extraKeyParamL === void 0 ? [] : _props$extraKeyParamL;
20
+ extraKeyParamList = _props$extraKeyParamL === void 0 ? [] : _props$extraKeyParamL,
21
+ _props$customFactorVa = props.customFactorValuesList,
22
+ customFactorValuesList = _props$customFactorVa === void 0 ? [] : _props$customFactorVa;
21
23
  var _useState = useState([]),
22
24
  _useState2 = _slicedToArray(_useState, 2),
23
25
  list = _useState2[0],
@@ -91,6 +93,7 @@ var FacilityTemplate = function FacilityTemplate(props) {
91
93
  className: customButton ? 'facility-layer-custom-panel facility-layer-custom-panel-has-button' : 'facility-layer-custom-panel'
92
94
  }, /*#__PURE__*/React.createElement(CustomContent, {
93
95
  extraKeyParamList: extraKeyParamList,
96
+ customFactorValuesList: customFactorValuesList,
94
97
  dark: true,
95
98
  facilityDetail: facilityDetail,
96
99
  onClick: function onClick() {
@@ -1,15 +1,15 @@
1
- .close-btn {
2
- position: absolute;
3
- top: 12px;
4
- right: 30px;
5
- cursor: pointer;
6
- }
7
-
8
- .cesium-popup-v1{
9
- width: 300px;
10
- }
11
-
12
- .facility-layer-custom-button {
13
- padding: 8px 10px 0;
14
- text-align: right;
15
- }
1
+ .close-btn {
2
+ position: absolute;
3
+ top: 12px;
4
+ right: 30px;
5
+ cursor: pointer;
6
+ }
7
+
8
+ .cesium-popup-v1{
9
+ width: 300px;
10
+ }
11
+
12
+ .facility-layer-custom-button {
13
+ padding: 8px 10px 0;
14
+ text-align: right;
15
+ }
package/lib/_util/http.js CHANGED
@@ -19,10 +19,10 @@ import { getVtxToken } from "@vtx/utils";
19
19
  // 默认30秒超时
20
20
  var SECOND = 30;
21
21
  var MILL_SECOND = 1000;
22
- /**
23
- * 基于 axios 封装的请求封装
24
- * axios文档 http://www.axios-js.com/zh-cn/docs/
25
- * 支持 Get 和 Post 请求
22
+ /**
23
+ * 基于 axios 封装的请求封装
24
+ * axios文档 http://www.axios-js.com/zh-cn/docs/
25
+ * 支持 Get 和 Post 请求
26
26
  */
27
27
  var Http = /*#__PURE__*/function () {
28
28
  function Http(options) {
@@ -57,10 +57,10 @@ var Http = /*#__PURE__*/function () {
57
57
  return instance;
58
58
  }
59
59
 
60
- /**
61
- * get 请求
62
- * @param {*} url
63
- * @param {*} options {body}
60
+ /**
61
+ * get 请求
62
+ * @param {*} url
63
+ * @param {*} options {body}
64
64
  */
65
65
  }, {
66
66
  key: "get",
@@ -78,10 +78,10 @@ var Http = /*#__PURE__*/function () {
78
78
  });
79
79
  }
80
80
 
81
- /**
82
- * post 请求
83
- * @param {*} url
84
- * @param {*} options
81
+ /**
82
+ * post 请求
83
+ * @param {*} url
84
+ * @param {*} options
85
85
  */
86
86
  }, {
87
87
  key: "post",
@@ -99,9 +99,9 @@ var Http = /*#__PURE__*/function () {
99
99
  });
100
100
  }
101
101
 
102
- /**
103
- * 响应数据的处理
104
- * @param {*} response
102
+ /**
103
+ * 响应数据的处理
104
+ * @param {*} response
105
105
  */
106
106
  }, {
107
107
  key: "_responseHandler",
@@ -122,9 +122,9 @@ var Http = /*#__PURE__*/function () {
122
122
  throw error;
123
123
  }
124
124
 
125
- /**
126
- * 请求错误处理
127
- * @param {*} error
125
+ /**
126
+ * 请求错误处理
127
+ * @param {*} error
128
128
  */
129
129
  }, {
130
130
  key: "_errorHandler",
@@ -71,8 +71,8 @@ export var DEVICE_CODE = /*#__PURE__*/function (DEVICE_CODE) {
71
71
  return DEVICE_CODE;
72
72
  }({});
73
73
 
74
- /**
75
- * 管点特征枚举
74
+ /**
75
+ * 管点特征枚举
76
76
  */
77
77
  export var POINT_CHARACTERISTICS = /*#__PURE__*/function (POINT_CHARACTERISTICS) {
78
78
  POINT_CHARACTERISTICS[POINT_CHARACTERISTICS["GD_BZ"] = 1] = "GD_BZ";
package/lib/typings.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module '@vtx/cs-map'
2
- declare module '@vtx/utils'
3
- declare module '@vtx/map-icon'
4
- declare module '@ant-design/icons'
1
+ declare module '@vtx/cs-map'
2
+ declare module '@vtx/utils'
3
+ declare module '@vtx/map-icon'
4
+ declare module '@ant-design/icons'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtx/cs-map-layer",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "React components for Vortex",
5
5
  "license": "MIT",
6
6
  "module": "lib/index.js",