@vtx/cs-map-layer 1.0.10 → 1.0.11
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/lib/DeviceLayer/index.js +4 -4
- package/lib/_util/http.js +28 -22
- package/package.json +102 -102
package/lib/DeviceLayer/index.js
CHANGED
|
@@ -20,10 +20,10 @@ var DeviceLayer = function DeviceLayer(props) {
|
|
|
20
20
|
params = _props$params === void 0 ? {} : _props$params,
|
|
21
21
|
showModal = props.showModal,
|
|
22
22
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
23
|
-
var
|
|
24
|
-
name =
|
|
25
|
-
labelField =
|
|
26
|
-
icon =
|
|
23
|
+
var _ref = deviceCodeMap[code] || {},
|
|
24
|
+
name = _ref.name,
|
|
25
|
+
labelField = _ref.labelField,
|
|
26
|
+
icon = _ref.icon;
|
|
27
27
|
return /*#__PURE__*/React.createElement(FeatureLayer, _extends({
|
|
28
28
|
url: "/cloud/zhsw-jcyj/api/basicDevice/list",
|
|
29
29
|
params: _objectSpread({
|
package/lib/_util/http.js
CHANGED
|
@@ -9,21 +9,20 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
9
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
10
|
import axios from 'axios';
|
|
11
11
|
// 安装axios的同时会同步安装qs包 https://www.npmjs.com/package/qs
|
|
12
|
-
import {
|
|
12
|
+
import { trim } from '@vtx/utils';
|
|
13
13
|
import { message } from 'antd';
|
|
14
14
|
import isObject from 'lodash/isObject';
|
|
15
15
|
import pickBy from 'lodash/pickBy';
|
|
16
16
|
import qs from 'qs';
|
|
17
|
+
import { getVtxToken } from "@vtx/utils";
|
|
17
18
|
|
|
18
19
|
// 默认30秒超时
|
|
19
20
|
var SECOND = 30;
|
|
20
21
|
var MILL_SECOND = 1000;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
* axios文档 http://www.axios-js.com/zh-cn/docs/
|
|
26
|
-
* 支持 Get 和 Post 请求
|
|
22
|
+
/**
|
|
23
|
+
* 基于 axios 封装的请求封装
|
|
24
|
+
* axios文档 http://www.axios-js.com/zh-cn/docs/
|
|
25
|
+
* 支持 Get 和 Post 请求
|
|
27
26
|
*/
|
|
28
27
|
var Http = /*#__PURE__*/function () {
|
|
29
28
|
function Http(options) {
|
|
@@ -37,6 +36,11 @@ var Http = /*#__PURE__*/function () {
|
|
|
37
36
|
_createClass(Http, [{
|
|
38
37
|
key: "_createAxios",
|
|
39
38
|
value: function _createAxios(options) {
|
|
39
|
+
var _ref = getVtxToken() || {},
|
|
40
|
+
token = _ref.token,
|
|
41
|
+
tenantId = _ref.tenantId,
|
|
42
|
+
userId = _ref.userId;
|
|
43
|
+
|
|
40
44
|
// 创建实例
|
|
41
45
|
var instance = axios.create(_objectSpread({
|
|
42
46
|
// `timeout` 指定请求超时的毫秒数(0 表示无超时时间)
|
|
@@ -44,17 +48,19 @@ var Http = /*#__PURE__*/function () {
|
|
|
44
48
|
timeout: MILL_SECOND * SECOND,
|
|
45
49
|
headers: {
|
|
46
50
|
Authorization: token ? "Bearer ".concat(token) : '',
|
|
47
|
-
'Cache-Control': 'no-cache'
|
|
51
|
+
'Cache-Control': 'no-cache',
|
|
52
|
+
tenantId: tenantId,
|
|
53
|
+
userId: userId
|
|
48
54
|
}
|
|
49
55
|
}, options));
|
|
50
56
|
instance.interceptors.response.use(this._responseHandler, this._errorHandler);
|
|
51
57
|
return instance;
|
|
52
58
|
}
|
|
53
59
|
|
|
54
|
-
/**
|
|
55
|
-
* get 请求
|
|
56
|
-
* @param {*} url
|
|
57
|
-
* @param {*} options {body}
|
|
60
|
+
/**
|
|
61
|
+
* get 请求
|
|
62
|
+
* @param {*} url
|
|
63
|
+
* @param {*} options {body}
|
|
58
64
|
*/
|
|
59
65
|
}, {
|
|
60
66
|
key: "get",
|
|
@@ -72,10 +78,10 @@ var Http = /*#__PURE__*/function () {
|
|
|
72
78
|
});
|
|
73
79
|
}
|
|
74
80
|
|
|
75
|
-
/**
|
|
76
|
-
* post 请求
|
|
77
|
-
* @param {*} url
|
|
78
|
-
* @param {*} options
|
|
81
|
+
/**
|
|
82
|
+
* post 请求
|
|
83
|
+
* @param {*} url
|
|
84
|
+
* @param {*} options
|
|
79
85
|
*/
|
|
80
86
|
}, {
|
|
81
87
|
key: "post",
|
|
@@ -93,9 +99,9 @@ var Http = /*#__PURE__*/function () {
|
|
|
93
99
|
});
|
|
94
100
|
}
|
|
95
101
|
|
|
96
|
-
/**
|
|
97
|
-
* 响应数据的处理
|
|
98
|
-
* @param {*} response
|
|
102
|
+
/**
|
|
103
|
+
* 响应数据的处理
|
|
104
|
+
* @param {*} response
|
|
99
105
|
*/
|
|
100
106
|
}, {
|
|
101
107
|
key: "_responseHandler",
|
|
@@ -116,9 +122,9 @@ var Http = /*#__PURE__*/function () {
|
|
|
116
122
|
throw error;
|
|
117
123
|
}
|
|
118
124
|
|
|
119
|
-
/**
|
|
120
|
-
* 请求错误处理
|
|
121
|
-
* @param {*} error
|
|
125
|
+
/**
|
|
126
|
+
* 请求错误处理
|
|
127
|
+
* @param {*} error
|
|
122
128
|
*/
|
|
123
129
|
}, {
|
|
124
130
|
key: "_errorHandler",
|
package/package.json
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vtx/cs-map-layer",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "React components for Vortex",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"module": "lib/index.js",
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"lib"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "father build",
|
|
13
|
-
"build:watch": "father dev",
|
|
14
|
-
"dev": "npm run cesium:fix && dumi dev",
|
|
15
|
-
"docs:build": "npm run cesium:fix && dumi build",
|
|
16
|
-
"doctor": "father doctor",
|
|
17
|
-
"cesium:fix": "node ./scripts/cesium-fix.js",
|
|
18
|
-
"lint": "npm run lint:es && npm run lint:css",
|
|
19
|
-
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
20
|
-
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
21
|
-
"prepublishOnly": "father doctor && npm run build",
|
|
22
|
-
"start": "npm run dev"
|
|
23
|
-
},
|
|
24
|
-
"husky": {
|
|
25
|
-
"hooks": {
|
|
26
|
-
"pre-commit": "lint-staged",
|
|
27
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"commitlint": {
|
|
31
|
-
"extends": [
|
|
32
|
-
"@commitlint/config-conventional"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
"lint-staged": {
|
|
36
|
-
"*.{md,json}": [
|
|
37
|
-
"prettier --write --no-error-on-unmatched-pattern"
|
|
38
|
-
],
|
|
39
|
-
"*.{css,less}": [
|
|
40
|
-
"stylelint --fix",
|
|
41
|
-
"prettier --write"
|
|
42
|
-
],
|
|
43
|
-
"*.{js,jsx}": [
|
|
44
|
-
"eslint --fix",
|
|
45
|
-
"prettier --write"
|
|
46
|
-
],
|
|
47
|
-
"*.{ts,tsx}": [
|
|
48
|
-
"eslint --fix",
|
|
49
|
-
"prettier --parser=typescript --write"
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"@vtx/utils": "latest",
|
|
54
|
-
"cesium": "1.90.0",
|
|
55
|
-
"lodash": "^4.17.21",
|
|
56
|
-
"moment": "^2.29.1",
|
|
57
|
-
"qs": "^6.0.0"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@babel/runtime": "^7.6.3",
|
|
61
|
-
"@commitlint/cli": "^17.1.2",
|
|
62
|
-
"@commitlint/config-conventional": "^17.1.0",
|
|
63
|
-
"@types/lodash": "^4.14.202",
|
|
64
|
-
"@types/qs": "^6.9.11",
|
|
65
|
-
"@types/react": "^18.0.0",
|
|
66
|
-
"@types/react-dom": "^18.0.0",
|
|
67
|
-
"@umijs/lint": "^4.0.0",
|
|
68
|
-
"babel-plugin-import": "^1.13.8",
|
|
69
|
-
"dumi": "^2.2.13",
|
|
70
|
-
"eslint": "^8.23.0",
|
|
71
|
-
"father": "^4.1.0",
|
|
72
|
-
"husky": "^8.0.1",
|
|
73
|
-
"lint-staged": "^13.0.3",
|
|
74
|
-
"prettier": "^2.7.1",
|
|
75
|
-
"prettier-plugin-organize-imports": "^3.0.0",
|
|
76
|
-
"prettier-plugin-packagejson": "^2.2.18",
|
|
77
|
-
"react": "^18.0.0",
|
|
78
|
-
"react-dom": "^18.0.0",
|
|
79
|
-
"@ant-design/icons": "4.7.0",
|
|
80
|
-
"@vtx/cs-map": "
|
|
81
|
-
"@turf/turf": "^6.5.0",
|
|
82
|
-
"@vtx/map-icon": "^2.0.16",
|
|
83
|
-
"ahooks": "^3.1.5",
|
|
84
|
-
"axios": "^0.21.1",
|
|
85
|
-
"antd": "4.20.5",
|
|
86
|
-
"stylelint": "^14.9.1"
|
|
87
|
-
},
|
|
88
|
-
"peerDependencies": {
|
|
89
|
-
"antd": ">4.0.0",
|
|
90
|
-
"@vtx/map-icon": ">=2.0.0",
|
|
91
|
-
"@vtx/cs-map": ">=1.0.40",
|
|
92
|
-
"axios": ">=0.21.1",
|
|
93
|
-
"@ant-design/icons": ">=4.0.0",
|
|
94
|
-
"react": ">=16.9.0",
|
|
95
|
-
"react-dom": ">=16.9.0"
|
|
96
|
-
},
|
|
97
|
-
"publishConfig": {
|
|
98
|
-
"access": "public"
|
|
99
|
-
},
|
|
100
|
-
"authors": [],
|
|
101
|
-
"slideEffects": false
|
|
102
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@vtx/cs-map-layer",
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"description": "React components for Vortex",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"module": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "father build",
|
|
13
|
+
"build:watch": "father dev",
|
|
14
|
+
"dev": "npm run cesium:fix && dumi dev",
|
|
15
|
+
"docs:build": "npm run cesium:fix && dumi build",
|
|
16
|
+
"doctor": "father doctor",
|
|
17
|
+
"cesium:fix": "node ./scripts/cesium-fix.js",
|
|
18
|
+
"lint": "npm run lint:es && npm run lint:css",
|
|
19
|
+
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
20
|
+
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
21
|
+
"prepublishOnly": "father doctor && npm run build",
|
|
22
|
+
"start": "npm run dev"
|
|
23
|
+
},
|
|
24
|
+
"husky": {
|
|
25
|
+
"hooks": {
|
|
26
|
+
"pre-commit": "lint-staged",
|
|
27
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"commitlint": {
|
|
31
|
+
"extends": [
|
|
32
|
+
"@commitlint/config-conventional"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"lint-staged": {
|
|
36
|
+
"*.{md,json}": [
|
|
37
|
+
"prettier --write --no-error-on-unmatched-pattern"
|
|
38
|
+
],
|
|
39
|
+
"*.{css,less}": [
|
|
40
|
+
"stylelint --fix",
|
|
41
|
+
"prettier --write"
|
|
42
|
+
],
|
|
43
|
+
"*.{js,jsx}": [
|
|
44
|
+
"eslint --fix",
|
|
45
|
+
"prettier --write"
|
|
46
|
+
],
|
|
47
|
+
"*.{ts,tsx}": [
|
|
48
|
+
"eslint --fix",
|
|
49
|
+
"prettier --parser=typescript --write"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@vtx/utils": "latest",
|
|
54
|
+
"cesium": "1.90.0",
|
|
55
|
+
"lodash": "^4.17.21",
|
|
56
|
+
"moment": "^2.29.1",
|
|
57
|
+
"qs": "^6.0.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@babel/runtime": "^7.6.3",
|
|
61
|
+
"@commitlint/cli": "^17.1.2",
|
|
62
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
63
|
+
"@types/lodash": "^4.14.202",
|
|
64
|
+
"@types/qs": "^6.9.11",
|
|
65
|
+
"@types/react": "^18.0.0",
|
|
66
|
+
"@types/react-dom": "^18.0.0",
|
|
67
|
+
"@umijs/lint": "^4.0.0",
|
|
68
|
+
"babel-plugin-import": "^1.13.8",
|
|
69
|
+
"dumi": "^2.2.13",
|
|
70
|
+
"eslint": "^8.23.0",
|
|
71
|
+
"father": "^4.1.0",
|
|
72
|
+
"husky": "^8.0.1",
|
|
73
|
+
"lint-staged": "^13.0.3",
|
|
74
|
+
"prettier": "^2.7.1",
|
|
75
|
+
"prettier-plugin-organize-imports": "^3.0.0",
|
|
76
|
+
"prettier-plugin-packagejson": "^2.2.18",
|
|
77
|
+
"react": "^18.0.0",
|
|
78
|
+
"react-dom": "^18.0.0",
|
|
79
|
+
"@ant-design/icons": "4.7.0",
|
|
80
|
+
"@vtx/cs-map": "latest",
|
|
81
|
+
"@turf/turf": "^6.5.0",
|
|
82
|
+
"@vtx/map-icon": "^2.0.16",
|
|
83
|
+
"ahooks": "^3.1.5",
|
|
84
|
+
"axios": "^0.21.1",
|
|
85
|
+
"antd": "4.20.5",
|
|
86
|
+
"stylelint": "^14.9.1"
|
|
87
|
+
},
|
|
88
|
+
"peerDependencies": {
|
|
89
|
+
"antd": ">4.0.0",
|
|
90
|
+
"@vtx/map-icon": ">=2.0.0",
|
|
91
|
+
"@vtx/cs-map": ">=1.0.40",
|
|
92
|
+
"axios": ">=0.21.1",
|
|
93
|
+
"@ant-design/icons": ">=4.0.0",
|
|
94
|
+
"react": ">=16.9.0",
|
|
95
|
+
"react-dom": ">=16.9.0"
|
|
96
|
+
},
|
|
97
|
+
"publishConfig": {
|
|
98
|
+
"access": "public"
|
|
99
|
+
},
|
|
100
|
+
"authors": [],
|
|
101
|
+
"slideEffects": false
|
|
102
|
+
}
|