@vtx/map 1.1.6 → 1.1.9

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 (63) hide show
  1. package/lib/VtxMap/AMap/AMap.js +3287 -2990
  2. package/lib/VtxMap/AMap/AMap.js.map +1 -0
  3. package/lib/VtxMap/BMap/Map.js +3517 -3146
  4. package/lib/VtxMap/BMap/Map.js.map +1 -0
  5. package/lib/VtxMap/GMap/Map.js +4572 -4021
  6. package/lib/VtxMap/GMap/Map.js.map +1 -0
  7. package/lib/VtxMap/Map.js +77 -63
  8. package/lib/VtxMap/Map.js.map +1 -0
  9. package/lib/VtxMap/MapToolFunction.js +422 -370
  10. package/lib/VtxMap/MapToolFunction.js.map +1 -0
  11. package/lib/VtxMap/OMap/Map.css +2 -2
  12. package/lib/VtxMap/OMap/Map.js +4345 -3782
  13. package/lib/VtxMap/OMap/Map.js.map +1 -0
  14. package/lib/VtxMap/OlMap/Map.css +4 -1
  15. package/lib/VtxMap/OlMap/Map.js +3921 -3181
  16. package/lib/VtxMap/OlMap/Map.js.map +1 -0
  17. package/lib/VtxMap/TMap/TMap.css +0 -1
  18. package/lib/VtxMap/TMap/TMap.js +3475 -3139
  19. package/lib/VtxMap/TMap/TMap.js.map +1 -0
  20. package/lib/VtxMap/index.js +37 -24
  21. package/lib/VtxMap/index.js.map +1 -0
  22. package/lib/VtxMap/mapPlayer.js +353 -308
  23. package/lib/VtxMap/mapPlayer.js.map +1 -0
  24. package/lib/VtxMap/optimizingPointMap.js +245 -205
  25. package/lib/VtxMap/optimizingPointMap.js.map +1 -0
  26. package/lib/VtxMap/style/css.js +16 -0
  27. package/lib/VtxMap/style/css.js.map +1 -0
  28. package/lib/VtxMap/style/index.js +16 -0
  29. package/lib/VtxMap/style/index.js.map +1 -0
  30. package/lib/VtxMap/zoomMap.js +120 -101
  31. package/lib/VtxMap/zoomMap.js.map +1 -0
  32. package/lib/VtxModal/VtxModal.css +62 -0
  33. package/lib/VtxModal/VtxModal.js +223 -213
  34. package/lib/VtxModal/VtxModal.js.map +1 -0
  35. package/lib/VtxModal/VtxModal.less +2 -2
  36. package/lib/VtxModal/VtxModalAntd3.css +62 -0
  37. package/lib/VtxModal/VtxModalAntd3.less +67 -0
  38. package/lib/VtxModal/draggableModal.js +138 -119
  39. package/lib/VtxModal/draggableModal.js.map +1 -0
  40. package/lib/VtxModal/index.js +21 -14
  41. package/lib/VtxModal/index.js.map +1 -0
  42. package/lib/VtxModal/style/css.js +21 -0
  43. package/lib/VtxModal/style/css.js.map +1 -0
  44. package/lib/VtxModal/style/index.js +21 -0
  45. package/lib/VtxModal/style/index.js.map +1 -0
  46. package/lib/VtxSearchMap/VtxSearchMap.css +171 -0
  47. package/lib/VtxSearchMap/VtxSearchMap.js +864 -819
  48. package/lib/VtxSearchMap/VtxSearchMap.js.map +1 -0
  49. package/lib/VtxSearchMap/VtxSearchMapAntd3.css +0 -0
  50. package/lib/VtxSearchMap/VtxSearchMapAntd3.less +1 -0
  51. package/lib/VtxSearchMap/index.js +9 -9
  52. package/lib/VtxSearchMap/index.js.map +1 -0
  53. package/lib/VtxSearchMap/mapping.js +15 -12
  54. package/lib/VtxSearchMap/mapping.js.map +1 -0
  55. package/lib/VtxSearchMap/style/css.js +47 -0
  56. package/lib/VtxSearchMap/style/css.js.map +1 -0
  57. package/lib/VtxSearchMap/style/index.js +47 -0
  58. package/lib/VtxSearchMap/style/index.js.map +1 -0
  59. package/lib/default.js +32 -27
  60. package/lib/default.js.map +1 -0
  61. package/lib/index.js +9 -10
  62. package/lib/index.js.map +1 -0
  63. package/package.json +25 -4
@@ -1,247 +1,257 @@
1
- 'use strict';
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
4
 
3
5
  Object.defineProperty(exports, "__esModule", {
4
- value: true
6
+ value: true
5
7
  });
8
+ exports["default"] = void 0;
6
9
 
7
- var _extends = Object.assign || 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; };
10
+ var _react = _interopRequireDefault(require("react"));
8
11
 
9
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
12
+ var _modal = _interopRequireDefault(require("antd/lib/modal"));
10
13
 
11
- var _react = require('react');
14
+ var _default2 = require("../default");
12
15
 
13
- var _react2 = _interopRequireDefault(_react);
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
17
 
15
- require('./VtxModal.less');
18
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
19
 
17
- var _modal = require('antd/lib/modal');
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
21
 
19
- var _modal2 = _interopRequireDefault(_modal);
22
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20
23
 
21
- require('antd/lib/modal/style');
24
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22
25
 
23
- require('antd/lib/icon/style');
26
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
24
27
 
25
- var _default = require('../default');
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
26
29
 
27
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
28
31
 
29
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
+
36
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
37
+
38
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
39
 
31
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
40
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
32
41
 
33
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
34
43
 
35
44
  var styles = {
36
- normal: 'vtx-ui-modal-normal',
37
- maxClass: 'vtx-ui-modal-maxClass',
38
- title: 'vtx-ui-modal-title',
39
- title_name: 'vtx-ui-modal-title_name',
40
- close: 'vtx-ui-modal-close',
41
- maximizeIcon: 'vtx-ui-modal-maximizeIcon'
45
+ normal: 'vtx-ui-modal-normal',
46
+ maxClass: 'vtx-ui-modal-maxClass',
47
+ title: 'vtx-ui-modal-title',
48
+ title_name: 'vtx-ui-modal-title_name',
49
+ close: 'vtx-ui-modal-close',
50
+ maximizeIcon: 'vtx-ui-modal-maximizeIcon'
42
51
  };
43
52
 
44
- var VtxModal = function (_React$Component) {
45
- _inherits(VtxModal, _React$Component);
53
+ var VtxModal = /*#__PURE__*/function (_React$Component) {
54
+ _inherits(VtxModal, _React$Component);
46
55
 
47
- function VtxModal(props) {
48
- _classCallCheck(this, VtxModal);
56
+ var _super = _createSuper(VtxModal);
49
57
 
50
- var _this = _possibleConstructorReturn(this, (VtxModal.__proto__ || Object.getPrototypeOf(VtxModal)).call(this, props));
58
+ function VtxModal(props) {
59
+ var _this;
51
60
 
52
- _this.classId = new Date().getTime() + Math.random();
53
- _this.isInit = false;
54
- _this.isCreate = props.visible;
55
- _this.state = {
56
- maximizable: false,
57
- maximizeClass: '',
61
+ _classCallCheck(this, VtxModal);
58
62
 
59
- init_x: 0,
60
- init_y: 0,
61
- x_move: 0,
62
- y_move: 0,
63
- documentMouseMove: null,
64
- documentMouseUp: null
65
- };
66
- _this.startDrag = _this.startDrag.bind(_this);
67
- return _this;
63
+ _this = _super.call(this, props);
64
+ _this.classId = new Date().getTime() + Math.random();
65
+ _this.isInit = false;
66
+ _this.isCreate = props.visible;
67
+ _this.state = {
68
+ maximizable: false,
69
+ maximizeClass: '',
70
+ init_x: 0,
71
+ init_y: 0,
72
+ x_move: 0,
73
+ y_move: 0,
74
+ documentMouseMove: null,
75
+ documentMouseUp: null
76
+ };
77
+ _this.startDrag = _this.startDrag.bind(_assertThisInitialized(_this));
78
+ return _this;
79
+ }
80
+
81
+ _createClass(VtxModal, [{
82
+ key: "componentWillReceiveProps",
83
+ value: function componentWillReceiveProps(nextProps) {
84
+ if (nextProps.visible && !this.isCreate) {
85
+ this.isCreate = true;
86
+ }
87
+
88
+ if (!this.props.visible && nextProps.visible) {
89
+ this.setState({
90
+ x_move: 0,
91
+ y_move: 0
92
+ });
93
+ }
68
94
  }
95
+ }, {
96
+ key: "componentDidUpdate",
97
+ value: function componentDidUpdate() {
98
+ var t = this;
69
99
 
70
- _createClass(VtxModal, [{
71
- key: 'componentWillReceiveProps',
72
- value: function componentWillReceiveProps(nextProps) {
73
- if (nextProps.visible && !this.isCreate) {
74
- this.isCreate = true;
75
- }
76
- if (!this.props.visible && nextProps.visible) {
77
- this.setState({
78
- x_move: 0,
79
- y_move: 0
80
- });
81
- }
82
- }
83
- }, {
84
- key: 'componentDidUpdate',
85
- value: function componentDidUpdate() {
86
- var t = this;
87
- if (!this.props.isNotMoving) {
88
- if (this.isCreate && !this.isInit) {
89
- this.isInit = true;
90
- try {
91
- this.timer = setTimeout(function () {
92
- var modalHead = document.getElementsByClassName(t.classId)[0].getElementsByClassName('ant-modal-header')[0];
93
- modalHead.style.cursor = 'move';
94
- modalHead.onmousedown = t.startDrag;
95
- }, 200);
96
- } catch (error) {
97
- console.error('VtxModal拖动功能异常,未获取到头部dom对象!');
98
- }
99
- }
100
- }
101
- }
102
- }, {
103
- key: 'componentWillUnmount',
104
- value: function componentWillUnmount() {
105
- if (this.timer) {
106
- clearTimeout(this.timer);
107
- }
108
- }
109
- }, {
110
- key: 'startDrag',
111
- value: function startDrag(e) {
112
- var _this2 = this;
113
-
114
- e.preventDefault();
115
- if (!this.state.maximizable) {
116
- this.setState({
117
- documentMouseUp: document.onmouseup,
118
- documentMouseMove: document.onmousemove,
119
- init_x: e.clientX - this.state.x_move,
120
- init_y: e.clientY - this.state.y_move
121
- });
122
- document.onmousemove = function (e) {
123
- _this2.setState({
124
- x_move: e.clientX - _this2.state.init_x,
125
- y_move: e.clientY - _this2.state.init_y
126
- });
127
- };
128
- document.onmouseup = function (e) {
129
- document.onmousemove = _this2.state.documentMouseMove;
130
- document.onmouseup = _this2.state.documentMouseUp;
131
- };
132
- }
133
- }
134
- }, {
135
- key: 'componentWillUnmount',
136
- value: function componentWillUnmount() {
137
- if (this.timer) {
138
- clearTimeout(this.timer);
139
- }
100
+ if (!this.props.isNotMoving) {
101
+ if (this.isCreate && !this.isInit) {
102
+ this.isInit = true;
103
+
104
+ try {
105
+ this.timer = setTimeout(function () {
106
+ var modalHead = document.getElementsByClassName(t.classId)[0].getElementsByClassName('ant-modal-header')[0];
107
+ modalHead.style.cursor = 'move';
108
+ modalHead.onmousedown = t.startDrag;
109
+ }, 200);
110
+ } catch (error) {
111
+ console.error('VtxModal拖动功能异常,未获取到头部dom对象!');
112
+ }
140
113
  }
141
- }, {
142
- key: 'render',
143
- value: function render() {
144
- var t = this;
145
- var _props = this.props,
146
- _props$closable = _props.closable,
147
- closable = _props$closable === undefined ? true : _props$closable,
148
- _props$maximize = _props.maximize,
149
- maximize = _props$maximize === undefined ? true : _props$maximize,
150
- _props$wrapClassName = _props.wrapClassName,
151
- wrapClassName = _props$wrapClassName === undefined ? '' : _props$wrapClassName,
152
- _props$title = _props.title,
153
- title = _props$title === undefined ? '' : _props$title;
154
- var _state = this.state,
155
- maximizable = _state.maximizable,
156
- maximizeClass = _state.maximizeClass;
157
-
158
- wrapClassName = styles.normal + ' ' + wrapClassName + ' ' + maximizeClass + ' ' + this.classId;
159
- var transformStyle = {
160
- transform: 'translate(' + this.state.x_move + 'px,' + this.state.y_move + 'px)'
161
- };
162
- title = function renderTitle() {
163
- return _react2.default.createElement(
164
- 'div',
165
- { className: styles.title, style: { paddingRight: closable ? '32px' : '0px' } },
166
- _react2.default.createElement(
167
- 'div',
168
- { className: styles.title_name },
169
- title
170
- ),
171
- maximize ? _react2.default.createElement(
172
- 'div',
173
- { className: styles.maximizeIcon },
174
- _react2.default.createElement(
175
- 'p',
176
- {
177
- onClick: function onClick() {
178
- var maximizeClass = '';
179
- if (!maximizable) {
180
- maximizeClass = styles.maxClass;
181
- }
182
- t.setState({
183
- maximizable: !maximizable,
184
- maximizeClass: maximizeClass
185
- }, function () {
186
- {/* 为arcgis设计 */}
187
- if (t.timer) {
188
- clearTimeout(t.timer);
189
- }
190
- t.timer = setTimeout(function () {
191
- if (window.onModalResize && typeof window.onModalResize == 'function') {
192
- window.onModalResize();
193
- }
194
- }, 100);
195
- });
196
- }
197
- },
198
- maximizable ? _react2.default.createElement(_default.VtxMapIcon, { type: 'icon-shrink' }) : _react2.default.createElement(_default.VtxMapIcon, { type: 'icon-arrawsalt' })
199
- )
200
- ) : null,
201
- closable ? _react2.default.createElement(
202
- 'div',
203
- { className: styles.close },
204
- _react2.default.createElement(
205
- 'p',
206
- { onClick: t.props.onCancel },
207
- _react2.default.createElement(_default.VtxMapIcon, { type: 'icon-close' })
208
- )
209
- ) : null
210
- );
211
- }();
212
- var bodyStyle = _extends({}, this.props.bodyStyle);
114
+ }
115
+ }
116
+ }, {
117
+ key: "componentWillUnmount",
118
+ value: function componentWillUnmount() {
119
+ if (this.timer) {
120
+ clearTimeout(this.timer);
121
+ }
122
+ }
123
+ }, {
124
+ key: "startDrag",
125
+ value: function startDrag(e) {
126
+ var _this2 = this;
127
+
128
+ e.preventDefault();
129
+
130
+ if (!this.state.maximizable) {
131
+ this.setState({
132
+ documentMouseUp: document.onmouseup,
133
+ documentMouseMove: document.onmousemove,
134
+ init_x: e.clientX - this.state.x_move,
135
+ init_y: e.clientY - this.state.y_move
136
+ });
137
+
138
+ document.onmousemove = function (e) {
139
+ _this2.setState({
140
+ x_move: e.clientX - _this2.state.init_x,
141
+ y_move: e.clientY - _this2.state.init_y
142
+ });
143
+ };
144
+
145
+ document.onmouseup = function (e) {
146
+ document.onmousemove = _this2.state.documentMouseMove;
147
+ document.onmouseup = _this2.state.documentMouseUp;
148
+ };
149
+ }
150
+ }
151
+ }, {
152
+ key: "render",
153
+ value: function render() {
154
+ var t = this;
155
+ var _this$props = this.props,
156
+ _this$props$closable = _this$props.closable,
157
+ closable = _this$props$closable === void 0 ? true : _this$props$closable,
158
+ _this$props$maximize = _this$props.maximize,
159
+ maximize = _this$props$maximize === void 0 ? true : _this$props$maximize,
160
+ _this$props$wrapClass = _this$props.wrapClassName,
161
+ wrapClassName = _this$props$wrapClass === void 0 ? '' : _this$props$wrapClass,
162
+ _this$props$title = _this$props.title,
163
+ title = _this$props$title === void 0 ? '' : _this$props$title;
164
+ var _this$state = this.state,
165
+ maximizable = _this$state.maximizable,
166
+ maximizeClass = _this$state.maximizeClass;
167
+ wrapClassName = "".concat(styles.normal, " ").concat(wrapClassName, " ").concat(maximizeClass, " ").concat(this.classId);
168
+ var transformStyle = {
169
+ transform: "translate(".concat(this.state.x_move, "px,").concat(this.state.y_move, "px)")
170
+ };
171
+
172
+ title = function renderTitle() {
173
+ return /*#__PURE__*/_react["default"].createElement("div", {
174
+ className: styles.title,
175
+ style: {
176
+ paddingRight: closable ? '32px' : '0px'
177
+ }
178
+ }, /*#__PURE__*/_react["default"].createElement("div", {
179
+ className: styles.title_name
180
+ }, title), maximize ? /*#__PURE__*/_react["default"].createElement("div", {
181
+ className: styles.maximizeIcon
182
+ }, /*#__PURE__*/_react["default"].createElement("p", {
183
+ onClick: function onClick() {
184
+ var maximizeClass = '';
185
+
213
186
  if (!maximizable) {
214
- bodyStyle = _extends({
215
- maxHeight: window.innerHeight * 0.7 + 'px'
216
- }, bodyStyle);
187
+ maximizeClass = styles.maxClass;
217
188
  }
218
- var props = _extends({
219
- closable: closable,
220
- maskClosable: false,
221
- width: 700
222
- }, this.props, {
223
- closable: false,
224
- title: title,
225
- wrapClassName: wrapClassName,
226
- bodyStyle: bodyStyle,
227
- style: _extends({}, this.props.style, maximizable ? {} : transformStyle)
189
+
190
+ t.setState({
191
+ maximizable: !maximizable,
192
+ maximizeClass: maximizeClass
193
+ }, function () {
194
+ {
195
+ /* 为arcgis设计 */
196
+ }
197
+
198
+ if (t.timer) {
199
+ clearTimeout(t.timer);
200
+ }
201
+
202
+ t.timer = setTimeout(function () {
203
+ if (window.onModalResize && typeof window.onModalResize == 'function') {
204
+ window.onModalResize();
205
+ }
206
+ }, 100);
228
207
  });
229
- return _react2.default.createElement(
230
- _modal2.default,
231
- props,
232
- this.props.children
233
- );
234
- }
235
- }]);
208
+ }
209
+ }, maximizable ? /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
210
+ type: "icon-shrink"
211
+ }) : /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
212
+ type: "icon-arrawsalt"
213
+ }))) : null, closable ? /*#__PURE__*/_react["default"].createElement("div", {
214
+ className: styles.close
215
+ }, /*#__PURE__*/_react["default"].createElement("p", {
216
+ onClick: t.props.onCancel
217
+ }, /*#__PURE__*/_react["default"].createElement(_default2.VtxMapIcon, {
218
+ type: "icon-close"
219
+ }))) : null);
220
+ }();
221
+
222
+ var bodyStyle = _objectSpread({}, this.props.bodyStyle);
223
+
224
+ if (!maximizable) {
225
+ bodyStyle = _objectSpread({
226
+ maxHeight: "".concat(window.innerHeight * 0.7, "px")
227
+ }, bodyStyle);
228
+ }
236
229
 
237
- return VtxModal;
238
- }(_react2.default.Component);
230
+ var props = _objectSpread(_objectSpread({
231
+ closable: closable,
232
+ maskClosable: false,
233
+ width: 700
234
+ }, this.props), {}, {
235
+ closable: false,
236
+ title: title,
237
+ wrapClassName: wrapClassName,
238
+ bodyStyle: bodyStyle,
239
+ style: _objectSpread(_objectSpread({}, this.props.style), maximizable ? {} : transformStyle)
240
+ });
241
+
242
+ return /*#__PURE__*/_react["default"].createElement(_modal["default"], props, this.props.children);
243
+ }
244
+ }]);
239
245
 
240
- VtxModal.info = _modal2.default.info;
241
- VtxModal.success = _modal2.default.success;
242
- VtxModal.error = _modal2.default.error;
243
- VtxModal.warning = _modal2.default.warning;
244
- VtxModal.confirm = _modal2.default.confirm;
246
+ return VtxModal;
247
+ }(_react["default"].Component);
245
248
 
246
- exports.default = VtxModal;
247
- module.exports = exports['default'];
249
+ VtxModal.info = _modal["default"].info;
250
+ VtxModal.success = _modal["default"].success;
251
+ VtxModal.error = _modal["default"].error;
252
+ VtxModal.warning = _modal["default"].warning;
253
+ VtxModal.confirm = _modal["default"].confirm;
254
+ var _default = VtxModal;
255
+ exports["default"] = _default;
256
+ module.exports = exports["default"];
257
+ //# sourceMappingURL=VtxModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VtxModal.js","names":["styles","normal","maxClass","title","title_name","close","maximizeIcon","VtxModal","props","classId","Date","getTime","Math","random","isInit","isCreate","visible","state","maximizable","maximizeClass","init_x","init_y","x_move","y_move","documentMouseMove","documentMouseUp","startDrag","bind","nextProps","setState","t","isNotMoving","timer","setTimeout","modalHead","document","getElementsByClassName","style","cursor","onmousedown","error","console","clearTimeout","e","preventDefault","onmouseup","onmousemove","clientX","clientY","closable","maximize","wrapClassName","transformStyle","transform","renderTitle","paddingRight","window","onModalResize","onCancel","bodyStyle","maxHeight","innerHeight","maskClosable","width","children","React","Component","info","Modal","success","warning","confirm"],"sources":["VtxModal/VtxModal.js"],"sourcesContent":["import React from 'react';\r\nimport Modal from 'antd/lib/modal';\r\nimport { VtxMapIcon } from '../default';\r\n\r\nconst styles = {\r\n normal: 'vtx-ui-modal-normal',\r\n maxClass: 'vtx-ui-modal-maxClass',\r\n title: 'vtx-ui-modal-title',\r\n title_name: 'vtx-ui-modal-title_name',\r\n close: 'vtx-ui-modal-close',\r\n maximizeIcon: 'vtx-ui-modal-maximizeIcon',\r\n}\r\n\r\nclass VtxModal extends React.Component{\r\n constructor(props){\r\n super(props);\r\n this.classId = new Date().getTime() + Math.random();\r\n this.isInit = false;\r\n this.isCreate = props.visible;\r\n this.state = {\r\n maximizable: false,\r\n maximizeClass: '',\r\n\r\n init_x: 0,\r\n init_y: 0,\r\n x_move: 0,\r\n y_move: 0,\r\n documentMouseMove: null,\r\n documentMouseUp:null,\r\n }\r\n this.startDrag = this.startDrag.bind(this);\r\n }\r\n componentWillReceiveProps(nextProps){\r\n if(nextProps.visible && !this.isCreate){\r\n this.isCreate = true;\r\n }\r\n if(!this.props.visible && nextProps.visible){\r\n this.setState({\r\n x_move: 0,\r\n y_move: 0\r\n })\r\n }\r\n }\r\n componentDidUpdate(){\r\n const t = this;\r\n if(!this.props.isNotMoving){\r\n if(this.isCreate && !this.isInit){\r\n this.isInit = true;\r\n try {\r\n this.timer = setTimeout(()=>{\r\n let modalHead = document.getElementsByClassName(t.classId)[0].getElementsByClassName('ant-modal-header')[0];\r\n modalHead.style.cursor = 'move';\r\n modalHead.onmousedown = t.startDrag;\r\n },200)\r\n } catch (error) {\r\n console.error('VtxModal拖动功能异常,未获取到头部dom对象!')\r\n }\r\n }\r\n }\r\n }\r\n componentWillUnmount(){\r\n if(this.timer){\r\n clearTimeout(this.timer);\r\n }\r\n }\r\n startDrag(e){ \r\n e.preventDefault();\r\n if(!this.state.maximizable){\r\n this.setState({\r\n documentMouseUp: document.onmouseup,\r\n documentMouseMove: document.onmousemove,\r\n init_x: e.clientX - this.state.x_move,\r\n init_y: e.clientY - this.state.y_move,\r\n });\r\n document.onmousemove = (e)=>{\r\n this.setState({\r\n x_move: e.clientX - this.state.init_x ,\r\n y_move: e.clientY - this.state.init_y ,\r\n }) \r\n }\r\n document.onmouseup = (e)=>{\r\n document.onmousemove = this.state.documentMouseMove;\r\n document.onmouseup = this.state.documentMouseUp;\r\n }\r\n }\r\n }\r\n componentWillUnmount(){\r\n if(this.timer){\r\n clearTimeout(this.timer)\r\n }\r\n }\r\n render(){\r\n const t = this;\r\n let {closable=true,maximize=true,wrapClassName='',title=''} = this.props;\r\n const {maximizable,maximizeClass} = this.state;\r\n wrapClassName = `${styles.normal} ${wrapClassName} ${maximizeClass} ${this.classId}`;\r\n const transformStyle = {\r\n transform: `translate(${this.state.x_move}px,${this.state.y_move}px)`, \r\n }\r\n title = (function renderTitle() {\r\n return (\r\n <div className={styles.title} style={{paddingRight: (closable?'32px':'0px')}}>\r\n <div className={styles.title_name}>\r\n {title}\r\n </div>\r\n {\r\n maximize?\r\n <div className={styles.maximizeIcon}>\r\n <p \r\n onClick={()=>{\r\n let maximizeClass = '';\r\n if(!maximizable){\r\n maximizeClass = styles.maxClass\r\n }\r\n t.setState({\r\n maximizable: !maximizable,\r\n maximizeClass\r\n },()=>{\r\n {/* 为arcgis设计 */}\r\n if(t.timer){\r\n clearTimeout(t.timer)\r\n }\r\n t.timer = setTimeout(()=>{\r\n if(window.onModalResize && typeof(window.onModalResize) == 'function'){\r\n window.onModalResize();\r\n }\r\n },100)\r\n })\r\n }}\r\n >\r\n {\r\n maximizable?\r\n <VtxMapIcon type=\"icon-shrink\" />\r\n :\r\n <VtxMapIcon type=\"icon-arrawsalt\" />\r\n }\r\n </p>\r\n </div>\r\n :null\r\n }\r\n {\r\n closable?\r\n <div className={styles.close}>\r\n <p onClick={t.props.onCancel}>\r\n <VtxMapIcon type=\"icon-close\" />\r\n </p>\r\n </div>:null\r\n }\r\n </div>\r\n );\r\n })();\r\n let bodyStyle = {\r\n ...this.props.bodyStyle,\r\n }\r\n if(!maximizable){\r\n bodyStyle = {\r\n maxHeight:`${window.innerHeight*0.7}px`,\r\n ...bodyStyle\r\n }\r\n }\r\n const props = {\r\n closable,\r\n maskClosable:false,\r\n width: 700,\r\n ...this.props,\r\n closable: false,\r\n title: title,\r\n wrapClassName: wrapClassName,\r\n bodyStyle: bodyStyle,\r\n style: {\r\n ...this.props.style,\r\n ...(maximizable?{}:transformStyle)\r\n }\r\n }\r\n return (\r\n <Modal {...props}>\r\n {\r\n this.props.children\r\n }\r\n </Modal>\r\n )\r\n }\r\n}\r\nVtxModal.info = Modal.info;\r\nVtxModal.success = Modal.success;\r\nVtxModal.error = Modal.error;\r\nVtxModal.warning = Modal.warning;\r\nVtxModal.confirm = Modal.confirm;\r\n\r\nexport default VtxModal;"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG;EACXC,MAAM,EAAE,qBADG;EAEXC,QAAQ,EAAE,uBAFC;EAGXC,KAAK,EAAE,oBAHI;EAIXC,UAAU,EAAE,yBAJD;EAKXC,KAAK,EAAE,oBALI;EAMXC,YAAY,EAAE;AANH,CAAf;;IASMC,Q;;;;;EACF,kBAAYC,KAAZ,EAAkB;IAAA;;IAAA;;IACd,0BAAMA,KAAN;IACA,MAAKC,OAAL,GAAe,IAAIC,IAAJ,GAAWC,OAAX,KAAuBC,IAAI,CAACC,MAAL,EAAtC;IACA,MAAKC,MAAL,GAAc,KA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4B,iBAAA,CAAM5B,KAAvB;AACAjC,QAAQ,CAAC+D,OAAT,GAAmBF,iBAAA,CAAME,OAAzB;AACA/D,QAAQ,CAACgE,OAAT,GAAmBH,iBAAA,CAAMG,OAAzB;eAEehE,Q"}
@@ -1,4 +1,4 @@
1
- @import (reference) '~antd/lib/style/themes/index.less';
1
+ @import (reference) '~antd/lib/style/themes/default.less';
2
2
 
3
3
  .vtx-ui-modal-normal{
4
4
  .ant-modal{
@@ -7,7 +7,7 @@
7
7
  .ant-modal-body{
8
8
  max-height: e('calc(100% - 108px)');
9
9
  overflow: auto;
10
- background-color: @table-expanded-row-bg;
10
+ background-color: @layout-body-background;
11
11
  }
12
12
  }
13
13
  }
@@ -0,0 +1,62 @@
1
+ .vtx-ui-modal-normal .ant-modal .ant-modal-content {
2
+ height: 100%;
3
+ }
4
+ .vtx-ui-modal-normal .ant-modal .ant-modal-content .ant-modal-body {
5
+ max-height: calc(100% - 108px);
6
+ overflow: auto;
7
+ background-color: #f0f2f5;
8
+ }
9
+ .vtx-ui-modal-normal .vtx-ui-modal-title {
10
+ position: relative;
11
+ width: 100%;
12
+ }
13
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-title_name {
14
+ width: 100%;
15
+ color: #1890ff;
16
+ }
17
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-close,
18
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon {
19
+ position: absolute;
20
+ top: -13px;
21
+ right: -16px;
22
+ }
23
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-close p,
24
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon p {
25
+ width: 36px;
26
+ height: 48px;
27
+ text-align: center;
28
+ line-height: 48px;
29
+ cursor: pointer;
30
+ border: 0;
31
+ background: transparent;
32
+ position: absolute;
33
+ right: 0;
34
+ top: 0;
35
+ z-index: 10;
36
+ font-weight: 700;
37
+ text-decoration: none;
38
+ -webkit-transition: color 0.3s ease;
39
+ transition: color 0.3s ease;
40
+ color: rgba(0, 0, 0, 0.85);
41
+ outline: 0;
42
+ display: inline-block;
43
+ }
44
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-close p:hover,
45
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon p:hover {
46
+ color: rgba(0, 0, 0, 0.45);
47
+ text-decoration: none;
48
+ }
49
+ .vtx-ui-modal-normal .vtx-ui-modal-title .vtx-ui-modal-maximizeIcon {
50
+ right: 20px;
51
+ }
52
+ .vtx-ui-modal-maxClass .ant-modal {
53
+ top: 0 !important;
54
+ left: 0 !important;
55
+ width: 100% !important;
56
+ height: 100% !important;
57
+ padding-bottom: 0 !important;
58
+ overflow: hidden;
59
+ }
60
+ .vtx-ui-modal-maxClass .ant-modal-body {
61
+ height: calc(100% - 108px) !important;
62
+ }