@vtx/cs-map-layer 1.0.12 → 1.0.14

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
@@ -3,6 +3,9 @@ import { CommonPropsI, DEVICE_CODE } from '../_util/interface';
3
3
  interface PropsI {
4
4
  code?: keyof typeof DEVICE_CODE;
5
5
  styleOption?: any;
6
+ dataField: string;
7
+ name?: string;
8
+ legend?: string | object;
6
9
  }
7
10
  declare const DeviceLayer: FC<CommonPropsI & PropsI>;
8
11
  export default DeviceLayer;
@@ -1,18 +1,24 @@
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 = ["code", "params", "showModal", "styleOption"];
2
+ var _excluded = ["code", "params", "showModal", "styleOption", "name", "legend"];
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
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
5
  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
6
  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
7
  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
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
9
  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); }
10
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
11
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
9
12
  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
13
  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 { FeatureLayer } from '@vtx/cs-map';
12
- import React from 'react';
14
+ import { FeatureLayer, GroupLayer } from '@vtx/cs-map';
15
+ import React, { useMemo } from 'react';
13
16
  import DeviceTemplate from "../_components/Template/DeviceTemplate";
14
17
  import { DEVICE_CODE } from "../_util/interface";
15
- import { deviceCodeMap, getDeviceStyle } from "../_util/layerConfig";
18
+ import { deviceCodeMap, getDeviceStyle, deviceColorMap, deviceStatusNameMap } from "../_util/layerConfig";
19
+ import http from "../_util/http";
20
+ import { useRequest } from 'ahooks';
21
+ import { cloneDeep, isEmpty, isObject } from 'lodash';
16
22
  var DeviceLayer = function DeviceLayer(props) {
17
23
  var _props$code = props.code,
18
24
  code = _props$code === void 0 ? DEVICE_CODE.DEFAULT : _props$code,
@@ -21,30 +27,116 @@ var DeviceLayer = function DeviceLayer(props) {
21
27
  showModal = props.showModal,
22
28
  _props$styleOption = props.styleOption,
23
29
  styleOption = _props$styleOption === void 0 ? {} : _props$styleOption,
30
+ name = props.name,
31
+ legend = props.legend,
24
32
  otherProps = _objectWithoutProperties(props, _excluded);
25
- var _ref = deviceCodeMap[code] || {},
26
- name = _ref.name,
33
+ var _ref = deviceCodeMap[code] || {
34
+ name: name
35
+ },
36
+ _name = _ref.name,
27
37
  labelField = _ref.labelField,
28
38
  icon = _ref.icon;
29
- return /*#__PURE__*/React.createElement(FeatureLayer, _extends({
30
- url: "/cloud/zhsw-jcyj/api/basicDevice/list",
31
- params: _objectSpread({
32
- deviceTypeId: code
33
- }, params),
34
- style: function style(f) {
35
- return getDeviceStyle(f, icon || '', styleOption);
36
- },
37
- name: name,
38
- labelField: labelField,
39
- legend: icon || (styleOption === null || styleOption === void 0 ? void 0 : styleOption.icon),
40
- zIndex: 4,
41
- id: code,
42
- template: function template(feature) {
43
- return /*#__PURE__*/React.createElement(DeviceTemplate, {
44
- feature: feature,
45
- showModal: showModal
39
+ var _useRequest = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
40
+ var res;
41
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
42
+ while (1) switch (_context.prev = _context.next) {
43
+ case 0:
44
+ _context.next = 2;
45
+ return http.post('/cloud/device/deviceMap/list', {
46
+ body: JSON.stringify(_objectSpread({
47
+ deviceTypeId: code
48
+ }, params))
49
+ });
50
+ case 2:
51
+ res = _context.sent;
52
+ return _context.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || []);
53
+ case 4:
54
+ case "end":
55
+ return _context.stop();
56
+ }
57
+ }, _callee);
58
+ })), {
59
+ refreshDeps: [code, JSON.stringify(params)]
60
+ }),
61
+ _useRequest$data = _useRequest.data,
62
+ data = _useRequest$data === void 0 ? [] : _useRequest$data;
63
+ var _useMemo = useMemo(function () {
64
+ var onlineData = [];
65
+ var offlineData = [];
66
+ var alarmData = [];
67
+ var errorData = [];
68
+ data.forEach(function (item) {
69
+ var newItem = cloneDeep(item);
70
+ var status = item.status;
71
+ newItem.geometryInfo = newItem[props.dataField || 'geometryInfo'];
72
+ newItem.geometryInfo.coordType = newItem.geometryInfo.coordinateType || newItem.geometryInfo.coordType;
73
+ newItem.geometryInfo.type = newItem.geometryInfo.shapeType || newItem.geometryInfo.type;
74
+ if (status === 1) {
75
+ onlineData.push(newItem);
76
+ } else if (status === 2) {
77
+ alarmData.push(newItem);
78
+ } else if (status === 3) {
79
+ offlineData.push(newItem);
80
+ } else if (status === 4) {
81
+ errorData.push(newItem);
82
+ }
46
83
  });
84
+ return {
85
+ onlineData: onlineData,
86
+ offlineData: offlineData,
87
+ alarmData: alarmData,
88
+ errorData: errorData
89
+ };
90
+ }, [data]),
91
+ offlineData = _useMemo.offlineData,
92
+ onlineData = _useMemo.onlineData,
93
+ alarmData = _useMemo.alarmData,
94
+ errorData = _useMemo.errorData;
95
+ var _icon = icon || styleOption.icon;
96
+ var getProps = function getProps(status) {
97
+ var color = deviceColorMap[status];
98
+ var _legend = {
99
+ color: color,
100
+ icon: _icon
101
+ };
102
+ if (legend) {
103
+ _legend = isObject(legend) ? _objectSpread(_objectSpread({}, _legend), legend) : legend;
47
104
  }
48
- }, otherProps));
105
+ return _objectSpread({
106
+ style: function style(f) {
107
+ return getDeviceStyle(f, icon || '', styleOption);
108
+ },
109
+ name: "".concat(_name, "-").concat(deviceStatusNameMap[status]),
110
+ labelField: labelField,
111
+ valueField: 'id',
112
+ zIndex: 60,
113
+ id: "".concat(code, "_").concat(status),
114
+ cluster: {
115
+ style: {
116
+ color: color,
117
+ icon: _icon
118
+ }
119
+ },
120
+ legend: _legend,
121
+ template: function template(feature) {
122
+ return /*#__PURE__*/React.createElement(DeviceTemplate, {
123
+ feature: feature,
124
+ showModal: showModal
125
+ });
126
+ }
127
+ }, otherProps);
128
+ };
129
+ return /*#__PURE__*/React.createElement(GroupLayer, {
130
+ name: _name,
131
+ id: code
132
+ }, !isEmpty(onlineData) && /*#__PURE__*/React.createElement(FeatureLayer, _extends({
133
+ data: onlineData
134
+ }, getProps(1))), !isEmpty(offlineData) && /*#__PURE__*/React.createElement(FeatureLayer, _extends({
135
+ data: offlineData
136
+ }, getProps(3))), !isEmpty(alarmData) && /*#__PURE__*/React.createElement(FeatureLayer, _extends({
137
+ data: alarmData
138
+ }, getProps(2))), !isEmpty(errorData) && /*#__PURE__*/React.createElement(FeatureLayer, _extends({
139
+ data: errorData
140
+ }, getProps(4))));
49
141
  };
50
142
  export default DeviceLayer;
@@ -4,6 +4,10 @@ interface PropsI {
4
4
  code?: keyof typeof FACILITY_CODE;
5
5
  styleOption?: any;
6
6
  valueField?: string;
7
+ /**
8
+ * 接收自定义字段显示
9
+ */
10
+ customKeys?: any;
7
11
  }
8
12
  declare const FacilityLayer: FC<CommonPropsI & PropsI>;
9
13
  export default FacilityLayer;
@@ -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 = ["code", "params", "styleOption", "showModal", "valueField"];
2
+ var _excluded = ["code", "params", "styleOption", "showModal", "valueField", "customKeys"];
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; }
@@ -22,6 +22,8 @@ var FacilityLayer = function FacilityLayer(props) {
22
22
  styleOption = _props$styleOption === void 0 ? {} : _props$styleOption,
23
23
  showModal = props.showModal,
24
24
  valueField = props.valueField,
25
+ _props$customKeys = props.customKeys,
26
+ customKeys = _props$customKeys === void 0 ? [] : _props$customKeys,
25
27
  otherProps = _objectWithoutProperties(props, _excluded);
26
28
  var newCode = code.toLocaleUpperCase();
27
29
  var _ref = facilityCodeMap[newCode] || {},
@@ -48,7 +50,8 @@ var FacilityLayer = function FacilityLayer(props) {
48
50
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
49
51
  feature: feature,
50
52
  showModal: showModal,
51
- valueField: valueField
53
+ valueField: valueField,
54
+ customKeys: customKeys
52
55
  });
53
56
  }
54
57
  }, otherProps));
@@ -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 = [{
@@ -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", "customKeys"];
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; }
@@ -17,6 +17,8 @@ var WaterSupplyLineLayer = function WaterSupplyLineLayer(props) {
17
17
  var _props$params = props.params,
18
18
  params = _props$params === void 0 ? {} : _props$params,
19
19
  showModal = props.showModal,
20
+ _props$customKeys = props.customKeys,
21
+ customKeys = _props$customKeys === void 0 ? [] : _props$customKeys,
20
22
  otherProps = _objectWithoutProperties(props, _excluded);
21
23
  var code = FACILITY_CODE.WATER_SUPPLY_LINE;
22
24
  var _facilityCodeMap$code = facilityCodeMap[code],
@@ -35,7 +37,8 @@ var WaterSupplyLineLayer = function WaterSupplyLineLayer(props) {
35
37
  template: function template(feature) {
36
38
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
37
39
  feature: feature,
38
- showModal: showModal
40
+ showModal: showModal,
41
+ customKeys: customKeys
39
42
  });
40
43
  },
41
44
  group: [{
@@ -2,6 +2,7 @@ import { type FC } from 'react';
2
2
  import { CommonPropsI, POINT_CHARACTERISTICS } from '../_util/interface';
3
3
  interface PropsI {
4
4
  groupKey?: POINT_CHARACTERISTICS[] | false;
5
+ customKeys?: any;
5
6
  }
6
7
  declare const WaterSupplyPointLayer: FC<CommonPropsI & PropsI>;
7
8
  export default WaterSupplyPointLayer;
@@ -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"];
2
+ var _excluded = ["params", "showModal", "groupKey", "customKeys"];
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; }
@@ -8,20 +8,22 @@ 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
+ import { isArray, isEmpty } from 'lodash';
15
16
  import React from 'react';
16
17
  import FacilityTemplate from "../_components/Template/FacilityTemplate";
17
18
  import { FACILITY_CODE, POINT_CHARACTERISTICS, POINT_CHARACTERISTICS_STR } from "../_util/interface";
18
19
  import { facilityCodeMap } from "../_util/layerConfig";
19
- import { isArray, isEmpty } from 'lodash';
20
20
  var WaterSupplyPointLayer = function WaterSupplyPointLayer(props) {
21
21
  var _props$params = props.params,
22
22
  params = _props$params === void 0 ? {} : _props$params,
23
23
  showModal = props.showModal,
24
24
  groupKey = props.groupKey,
25
+ _props$customKeys = props.customKeys,
26
+ customKeys = _props$customKeys === void 0 ? [] : _props$customKeys,
25
27
  otherProps = _objectWithoutProperties(props, _excluded);
26
28
  var code = FACILITY_CODE.WATER_SUPPLY_POINT;
27
29
  var _facilityCodeMap$code = facilityCodeMap[code],
@@ -55,7 +57,8 @@ var WaterSupplyPointLayer = function WaterSupplyPointLayer(props) {
55
57
  template: function template(feature) {
56
58
  return /*#__PURE__*/React.createElement(FacilityTemplate, {
57
59
  feature: feature,
58
- showModal: showModal
60
+ showModal: showModal,
61
+ customKeys: customKeys
59
62
  });
60
63
  },
61
64
  group: group
@@ -7,7 +7,6 @@ var CloseBtn = function CloseBtn(props) {
7
7
  type = props.type;
8
8
  var _useProps = useProps(),
9
9
  showModal = _useProps.showModal;
10
- console.log(showModal);
11
10
  return /*#__PURE__*/React.createElement(ExclamationCircleOutlined, {
12
11
  onClick: function onClick() {
13
12
  if (props.showModal) {
@@ -1,3 +1,7 @@
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); }
1
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
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."); }
3
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); }
@@ -28,6 +32,7 @@ var DeviceTemplate = function DeviceTemplate(props) {
28
32
  deviceId: id
29
33
  }
30
34
  }).then(function (res) {
35
+ var _res$data;
31
36
  setLoading(false);
32
37
  var data = [];
33
38
  if (String(res === null || res === void 0 ? void 0 : res.result) === '0') {
@@ -43,7 +48,12 @@ var DeviceTemplate = function DeviceTemplate(props) {
43
48
  // if (data?.length > 4) {
44
49
  // data = data.slice(0, 4);
45
50
  // }
46
- setDeviceData(data);
51
+ // 固定加入
52
+ setDeviceData([].concat(_toConsumableArray(data), [{
53
+ label: '数据采集时间',
54
+ key: 'monitorTime',
55
+ 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
56
+ }]));
47
57
  });
48
58
  };
49
59
  useEffect(function () {
@@ -3,5 +3,9 @@ declare const FacilityTemplate: FC<{
3
3
  feature: any;
4
4
  valueField?: string;
5
5
  showModal?: any;
6
+ /**
7
+ * 接收自定义字段显示
8
+ */
9
+ customKeys?: any;
6
10
  }>;
7
11
  export default FacilityTemplate;
@@ -16,7 +16,8 @@ import CloseBtn from "./CloseBtn";
16
16
  var FacilityTemplate = function FacilityTemplate(props) {
17
17
  var feature = props.feature,
18
18
  showModal = props.showModal,
19
- valueField = props.valueField;
19
+ valueField = props.valueField,
20
+ customKeys = props.customKeys;
20
21
  var _useState = useState([]),
21
22
  _useState2 = _slicedToArray(_useState, 2),
22
23
  list = _useState2[0],
@@ -38,13 +39,17 @@ var FacilityTemplate = function FacilityTemplate(props) {
38
39
  }).then(function (res) {
39
40
  var _list = [];
40
41
  if (String(res === null || res === void 0 ? void 0 : res.result) === '0' && res.data) {
41
- var _res$data$baseFields = res.data.baseFields,
42
- baseFields = _res$data$baseFields === void 0 ? [] : _res$data$baseFields;
43
- baseFields = baseFields.filter(function (r) {
44
- return r.tableShow;
42
+ var _res$data = res.data,
43
+ _res$data$baseFields = _res$data.baseFields,
44
+ baseFields = _res$data$baseFields === void 0 ? [] : _res$data$baseFields,
45
+ _res$data$customField = _res$data.customFields,
46
+ customFields = _res$data$customField === void 0 ? [] : _res$data$customField;
47
+ var _list2 = [].concat(_toConsumableArray(baseFields), _toConsumableArray(customFields)).filter(function (r) {
48
+ return (customKeys === null || customKeys === void 0 ? void 0 : customKeys.includes(r.showKey)) || r.tableShow;
45
49
  }) || [];
46
- if (baseFields.length) {
47
- _list = transform(_toConsumableArray(baseFields), facilityDetail);
50
+ console.log(_list2);
51
+ if (_list2.length) {
52
+ _list = transform(_toConsumableArray(_list2), facilityDetail);
48
53
  }
49
54
  }
50
55
  setList(_list);
@@ -1,6 +1,6 @@
1
- .close-btn {
2
- position: absolute;
3
- top: 12px;
4
- right: 30px;
5
- cursor: pointer;
6
- }
1
+ .close-btn {
2
+ position: absolute;
3
+ top: 12px;
4
+ right: 30px;
5
+ cursor: pointer;
6
+ }
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  interface OptionI {
3
- body?: object;
3
+ body?: object | string;
4
4
  extraHeader?: {
5
5
  msg?: string;
6
6
  };
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",
@@ -229,6 +229,10 @@ export declare enum DEVICE_CODE {
229
229
  * 水质检测仪
230
230
  */
231
231
  WATER_QUALITY_DETECTOR = "WATER_QUALITY_DETECTOR",
232
+ /**
233
+ * 泵房设备
234
+ */
235
+ BF_STATION = "BF_STATION",
232
236
  /**
233
237
  * 甲烷气体传感器
234
238
  */
@@ -368,4 +372,5 @@ export declare enum POINT_CHARACTERISTICS_STR {
368
372
  export interface CommonPropsI {
369
373
  params?: object;
370
374
  showModal?: (feature: any) => any;
375
+ customKeys?: any;
371
376
  }
@@ -63,6 +63,7 @@ export var DEVICE_CODE = /*#__PURE__*/function (DEVICE_CODE) {
63
63
  DEVICE_CODE["LEVEL_SENSOR"] = "LEVEL_SENSOR";
64
64
  DEVICE_CODE["MANOMETER"] = "MANOMETER";
65
65
  DEVICE_CODE["WATER_QUALITY_DETECTOR"] = "WATER_QUALITY_DETECTOR";
66
+ DEVICE_CODE["BF_STATION"] = "BF_STATION";
66
67
  DEVICE_CODE["WATER_JWQTCGQ"] = "WATER_JWQTCGQ";
67
68
  DEVICE_CODE["INCLINOMETER"] = "INCLINOMETER";
68
69
  DEVICE_CODE["INTEGRATED_LEVEL_SENSOR"] = "INTEGRATED_LEVEL_SENSOR";
@@ -70,8 +71,8 @@ export var DEVICE_CODE = /*#__PURE__*/function (DEVICE_CODE) {
70
71
  return DEVICE_CODE;
71
72
  }({});
72
73
 
73
- /**
74
- * 管点特征枚举
74
+ /**
75
+ * 管点特征枚举
75
76
  */
76
77
  export var POINT_CHARACTERISTICS = /*#__PURE__*/function (POINT_CHARACTERISTICS) {
77
78
  POINT_CHARACTERISTICS[POINT_CHARACTERISTICS["GD_BZ"] = 1] = "GD_BZ";
@@ -15,6 +15,18 @@ type DeviceI = {
15
15
  };
16
16
  declare const facilityCodeMap: FacilityI;
17
17
  declare const deviceCodeMap: DeviceI;
18
+ export declare const deviceColorMap: {
19
+ 1: string;
20
+ 2: string;
21
+ 3: string;
22
+ 4: string;
23
+ };
24
+ export declare const deviceStatusNameMap: {
25
+ 1: string;
26
+ 2: string;
27
+ 3: string;
28
+ 4: string;
29
+ };
18
30
  export declare const getDeviceStyle: (f: any, icon: string, styleOption?: {}) => {
19
31
  type: string;
20
32
  style: {
@@ -249,8 +249,31 @@ var deviceCodeMap = {
249
249
  icon: 'SZZ',
250
250
  name: '噪声传感器',
251
251
  labelField: 'name'
252
+ },
253
+ BF_STATION: {
254
+ icon: 'BF',
255
+ name: '泵房设备',
256
+ labelField: 'name'
252
257
  }
253
258
  };
259
+ export var deviceColorMap = {
260
+ 1: '#119FFB',
261
+ // 正常/在线
262
+ 2: '#CE3739',
263
+ // 报警/异常
264
+ 3: '#AAAAAD',
265
+ // 离线
266
+ 4: '#CE3739' // 故障/堵塞
267
+ };
268
+ export var deviceStatusNameMap = {
269
+ 1: '在线',
270
+ // 正常/在线
271
+ 2: '报警',
272
+ // 报警/异常
273
+ 3: '离线',
274
+ // 离线
275
+ 4: '故障' // 故障/堵塞
276
+ };
254
277
  export var getDeviceStyle = function getDeviceStyle(f, icon) {
255
278
  var styleOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
256
279
  var value = f._properties.properties._value;
package/lib/typings.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- declare module '@vtx/cs-map'
2
- declare module '@vtx/utils'
3
- declare module '@vtx/map-icon'
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.12",
3
+ "version": "1.0.14",
4
4
  "description": "React components for Vortex",
5
5
  "license": "MIT",
6
6
  "module": "lib/index.js",
@@ -54,7 +54,8 @@
54
54
  "cesium": "1.90.0",
55
55
  "lodash": "^4.17.21",
56
56
  "moment": "^2.29.1",
57
- "qs": "^6.0.0"
57
+ "qs": "^6.0.0",
58
+ "ahooks": "^3.1.5"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@ant-design/icons": "4.7.0",
@@ -69,7 +70,6 @@
69
70
  "@umijs/lint": "^4.0.0",
70
71
  "@vtx/cs-map": "latest",
71
72
  "@vtx/map-icon": "^2.0.16",
72
- "ahooks": "^3.1.5",
73
73
  "antd": "4.20.5",
74
74
  "axios": "^0.21.1",
75
75
  "babel-plugin-import": "^1.13.8",