cloud-b2b 1.1.46 → 1.1.50
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/es/Area/Area.js +45 -16
- package/es/Card/Card.js +4 -3
- package/es/CodeInput/CodeInput.js +59 -30
- package/es/Control/Control.js +117 -58
- package/es/Control/event.js +14 -0
- package/es/Enhance/Dialogs.js +21 -6
- package/es/Enhance/Loading.js +46 -26
- package/es/Enhance/index.js +2 -0
- package/es/Header/Header.js +35 -3
- package/es/Header/Vertical.js +24 -1
- package/es/ImageView/ImageView.js +22 -5
- package/es/Indent/Indent.js +7 -3
- package/es/InpurCascader/InputCascader.js +36 -10
- package/es/InputEditor/InputEditor.js +52 -53
- package/es/InputSearch/InputSearch.js +71 -26
- package/es/InputSelect/InputSelect.js +48 -17
- package/es/InputTreeSelect/InputTreeSelect.js +147 -0
- package/es/InputTreeSelect/package.json +6 -0
- package/es/InputWriting/InputWriting.js +28 -6
- package/es/Layout/Layout.js +59 -28
- package/es/LayoutLink/LayoutLink.js +20 -11
- package/es/Link/Link.js +27 -4
- package/es/Loading/Loading.js +3 -1
- package/es/Loading2/Loading2.js +2 -0
- package/es/ModalWithDrag/ModalWithDrag.js +8 -3
- package/es/ModalWithDrag/drag.js +29 -12
- package/es/NumberInput/NumberInput.js +64 -24
- package/es/Search/Search.js +164 -54
- package/es/Sidebar/Sidebar.js +34 -13
- package/es/Sidebar2/Sidebar.js +30 -3
- package/es/SuperForm/SuperForm.js +164 -27
- package/es/SuperForm2/SuperForm.js +182 -31
- package/es/SuperIcon/SuperIcon.js +6 -3
- package/es/SuperPagination/SuperPagination.js +32 -15
- package/es/SuperTab/SuperTab.js +27 -4
- package/es/SuperTab2/SuperTab2.js +33 -11
- package/es/SuperTable/DragSortRow.js +34 -6
- package/es/SuperTable/FilterDropDown.js +34 -10
- package/es/SuperTable/SuperTable.js +216 -84
- package/es/SuperTable/fixed.js +9 -1
- package/es/SuperTable2/SuperTable2.js +226 -101
- package/es/SuperTable2/SuperTableCell.js +60 -16
- package/es/SuperTable3/FilterDropDown.js +34 -10
- package/es/SuperTable3/SuperTable.js +175 -50
- package/es/SuperTable3/fixed.js +9 -1
- package/es/SuperToolbar/SuperToolbar.js +49 -21
- package/es/SuperUpload/SuperUpload.js +233 -156
- package/es/Title/Title.js +15 -12
- package/es/Viewer/ImageViews.js +60 -7
- package/es/Viewer/Viewer.js +32 -5
- package/es/WingBlank/WingBlank.js +6 -2
- package/es/helper.js +29 -7
- package/es/history.js +2 -3
- package/lib/Area/Area.js +64 -16
- package/lib/Card/Card.js +13 -3
- package/lib/CodeInput/CodeInput.js +77 -30
- package/lib/Control/Control.js +160 -58
- package/lib/Control/event.js +16 -0
- package/lib/Enhance/Dialogs.js +32 -6
- package/lib/Enhance/Loading.js +62 -26
- package/lib/Enhance/index.js +9 -0
- package/lib/Header/Header.js +48 -3
- package/lib/Header/Vertical.js +36 -1
- package/lib/ImageView/ImageView.js +30 -5
- package/lib/Indent/Indent.js +13 -3
- package/lib/InpurCascader/InputCascader.js +50 -11
- package/lib/InputEditor/InputEditor.js +61 -53
- package/lib/InputSearch/InputSearch.js +78 -26
- package/lib/InputSelect/InputSelect.js +62 -17
- package/lib/InputTreeSelect/InputTreeSelect.js +169 -0
- package/lib/InputTreeSelect/package.json +6 -0
- package/lib/InputWriting/InputWriting.js +35 -6
- package/lib/Layout/Layout.js +76 -28
- package/lib/LayoutLink/LayoutLink.js +38 -11
- package/lib/Link/Link.js +40 -4
- package/lib/Loading/Loading.js +9 -1
- package/lib/Loading2/Loading2.js +8 -0
- package/lib/ModalWithDrag/ModalWithDrag.js +18 -3
- package/lib/ModalWithDrag/drag.js +34 -12
- package/lib/NumberInput/NumberInput.js +77 -24
- package/lib/Search/Search.js +171 -54
- package/lib/Sidebar/Sidebar.js +46 -13
- package/lib/Sidebar2/Sidebar.js +42 -3
- package/lib/SuperForm/SuperForm.js +162 -27
- package/lib/SuperForm2/SuperForm.js +175 -31
- package/lib/SuperIcon/SuperIcon.js +14 -3
- package/lib/SuperPagination/SuperPagination.js +42 -15
- package/lib/SuperTab/SuperTab.js +34 -4
- package/lib/SuperTab2/SuperTab2.js +48 -11
- package/lib/SuperTable/DragSortRow.js +42 -6
- package/lib/SuperTable/FilterDropDown.js +42 -10
- package/lib/SuperTable/SuperTable.js +211 -83
- package/lib/SuperTable/fixed.js +13 -1
- package/lib/SuperTable2/SuperTable2.js +240 -101
- package/lib/SuperTable2/SuperTableCell.js +67 -13
- package/lib/SuperTable3/FilterDropDown.js +42 -10
- package/lib/SuperTable3/SuperTable.js +170 -49
- package/lib/SuperTable3/fixed.js +13 -1
- package/lib/SuperToolbar/SuperToolbar.js +64 -20
- package/lib/SuperUpload/SuperUpload.js +267 -156
- package/lib/Title/Title.js +24 -12
- package/lib/Viewer/ImageViews.js +63 -7
- package/lib/Viewer/Viewer.js +41 -5
- package/lib/WingBlank/WingBlank.js +14 -2
- package/lib/helper.js +47 -6
- package/lib/history.js +5 -0
- package/lib/index.js +76 -0
- package/lib/variables.js +4 -0
- package/package.json +2 -2
package/es/Viewer/ImageViews.js
CHANGED
|
@@ -10,12 +10,17 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
|
10
10
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
11
11
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
12
12
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
13
|
+
|
|
13
14
|
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); }; }
|
|
15
|
+
|
|
14
16
|
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; } }
|
|
17
|
+
|
|
15
18
|
import React from "react";
|
|
16
19
|
import variables from '../variables';
|
|
20
|
+
|
|
17
21
|
var addEvent = function addEvent(el, event, handler) {
|
|
18
22
|
if (!el) return;
|
|
23
|
+
|
|
19
24
|
if (el.attachEvent) {
|
|
20
25
|
el.attachEvent('on' + event, handler);
|
|
21
26
|
} else if (el.addEventListener) {
|
|
@@ -24,8 +29,10 @@ var addEvent = function addEvent(el, event, handler) {
|
|
|
24
29
|
el['on' + event] = handler;
|
|
25
30
|
}
|
|
26
31
|
};
|
|
32
|
+
|
|
27
33
|
var removeEvent = function removeEvent(el, event, handler) {
|
|
28
34
|
if (!el) return;
|
|
35
|
+
|
|
29
36
|
if (el.detachEvent) {
|
|
30
37
|
el.detachEvent('on' + event, handler);
|
|
31
38
|
} else if (el.removeEventListener) {
|
|
@@ -34,48 +41,63 @@ var removeEvent = function removeEvent(el, event, handler) {
|
|
|
34
41
|
el['on' + event] = null;
|
|
35
42
|
}
|
|
36
43
|
};
|
|
44
|
+
|
|
37
45
|
var getCss = function getCss(o, key) {
|
|
38
46
|
return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
|
|
39
|
-
};
|
|
47
|
+
}; // 获取元素旋转的角度
|
|
48
|
+
|
|
40
49
|
|
|
41
|
-
// 获取元素旋转的角度
|
|
42
50
|
var getRotateDeg = function getRotateDeg(target) {
|
|
43
51
|
var rotateMatrix = getCss(target, 'transform');
|
|
52
|
+
|
|
44
53
|
var _rotateMatrix$split$ = rotateMatrix.split('(')[1].split(')')[0].split(','),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
_rotateMatrix$split$2 = _slicedToArray(_rotateMatrix$split$, 2),
|
|
55
|
+
a = _rotateMatrix$split$2[0],
|
|
56
|
+
b = _rotateMatrix$split$2[1];
|
|
57
|
+
|
|
48
58
|
return Math.round(Math.atan2(b, a) * (180 / Math.PI));
|
|
49
59
|
};
|
|
60
|
+
|
|
50
61
|
var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
51
62
|
_inherits(ImageViews, _React$Component);
|
|
63
|
+
|
|
52
64
|
var _super = _createSuper(ImageViews);
|
|
65
|
+
|
|
53
66
|
function ImageViews(props) {
|
|
54
67
|
var _this;
|
|
68
|
+
|
|
55
69
|
_classCallCheck(this, ImageViews);
|
|
70
|
+
|
|
56
71
|
_this = _super.call(this, props);
|
|
72
|
+
|
|
57
73
|
_defineProperty(_assertThisInitialized(_this), "_onwheel", function (e) {
|
|
58
74
|
var zoom = _this.state.zoom;
|
|
59
75
|
/*事件兼容*/
|
|
76
|
+
|
|
60
77
|
var event = e || window.event;
|
|
61
78
|
var imageDOM = _this.imgRef;
|
|
62
79
|
var delta;
|
|
80
|
+
|
|
63
81
|
if (event.nativeEvent.wheelDelta) {
|
|
64
82
|
delta = event.nativeEvent.wheelDelta / 1200;
|
|
65
83
|
} else if (event.nativeEvent.deltaY) {
|
|
66
84
|
delta = -event.nativeEvent.deltaY / 1200;
|
|
67
85
|
}
|
|
86
|
+
|
|
68
87
|
var zoomVal = zoom + delta;
|
|
88
|
+
|
|
69
89
|
if (zoomVal >= 0.2) {
|
|
70
90
|
imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
|
|
71
91
|
} else {
|
|
72
92
|
zoomVal = 0.2;
|
|
73
93
|
imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
|
|
74
94
|
}
|
|
95
|
+
|
|
75
96
|
_this.setState({
|
|
76
97
|
zoom: zoomVal
|
|
77
98
|
});
|
|
78
99
|
});
|
|
100
|
+
|
|
79
101
|
_defineProperty(_assertThisInitialized(_this), "_onMouseDown", function (e) {
|
|
80
102
|
/*事件兼容*/
|
|
81
103
|
var event = e || window.event;
|
|
@@ -84,74 +106,94 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
84
106
|
|
|
85
107
|
var startTouch = {};
|
|
86
108
|
startTouch.initiated = true; //initiated为true表示开始滑动
|
|
109
|
+
|
|
87
110
|
/*获取鼠标按下的地方距离元素左侧和上侧的距离*/
|
|
111
|
+
|
|
88
112
|
startTouch.startX = event.nativeEvent.clientX - imageDOM.offsetLeft;
|
|
89
113
|
startTouch.startY = event.nativeEvent.clientY - imageDOM.offsetTop;
|
|
114
|
+
|
|
90
115
|
_this.setState({
|
|
91
116
|
startTouch: startTouch
|
|
92
117
|
});
|
|
118
|
+
|
|
93
119
|
addEvent(document, 'mousemove', _this._onMouseMove);
|
|
94
120
|
addEvent(document, 'mouseup', _this._onMouseUp);
|
|
95
121
|
});
|
|
122
|
+
|
|
96
123
|
_defineProperty(_assertThisInitialized(_this), "_onMouseMove", function (e) {
|
|
97
124
|
var event = e || window.event;
|
|
98
125
|
var imageDOM = _this.imgRef;
|
|
99
126
|
var startTouch = _this.state.startTouch;
|
|
100
|
-
if (!startTouch.initiated) return;
|
|
101
|
-
|
|
127
|
+
if (!startTouch.initiated) return; //滑动距离
|
|
128
|
+
|
|
102
129
|
var deltaX = event.clientX - startTouch.startX;
|
|
103
130
|
var deltaY = event.clientY - startTouch.startY;
|
|
104
131
|
imageDOM.style.left = "".concat(deltaX, "px");
|
|
105
132
|
imageDOM.style.top = "".concat(deltaY, "px");
|
|
106
133
|
});
|
|
134
|
+
|
|
107
135
|
_defineProperty(_assertThisInitialized(_this), "_onMouseUp", function () {
|
|
108
136
|
var startTouch = _this.state.startTouch;
|
|
109
137
|
if (!startTouch.initiated) return;
|
|
110
138
|
var endTouch = JSON.parse(_JSON$stringify(startTouch));
|
|
111
139
|
endTouch.initiated = false;
|
|
140
|
+
|
|
112
141
|
_this.setState({
|
|
113
142
|
startTouch: startTouch
|
|
114
143
|
});
|
|
144
|
+
|
|
115
145
|
removeEvent(document, 'mousemove', _this._onMouseMove);
|
|
116
146
|
removeEvent(document, 'mouseup', _this._onMouseDown);
|
|
117
147
|
});
|
|
148
|
+
|
|
118
149
|
_defineProperty(_assertThisInitialized(_this), "_onPlus", function (event) {
|
|
119
150
|
var zoom = _this.state.zoom;
|
|
120
151
|
var imageDOM = _this.imgRef;
|
|
121
152
|
var zoomVal = zoom + 0.1;
|
|
122
153
|
var originDeg = getRotateDeg(imageDOM);
|
|
123
154
|
event.stopPropagation();
|
|
155
|
+
|
|
124
156
|
if (zoomVal >= 0.2) {
|
|
125
157
|
var _context;
|
|
158
|
+
|
|
126
159
|
imageDOM.style.transform = _concatInstanceProperty(_context = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context, originDeg, "deg)");
|
|
127
160
|
}
|
|
161
|
+
|
|
128
162
|
_this.setState({
|
|
129
163
|
zoom: zoomVal
|
|
130
164
|
});
|
|
131
165
|
});
|
|
166
|
+
|
|
132
167
|
_defineProperty(_assertThisInitialized(_this), "_onMinus", function () {
|
|
133
168
|
var _context2;
|
|
169
|
+
|
|
134
170
|
var zoom = _this.state.zoom;
|
|
135
171
|
var imageDOM = _this.imgRef;
|
|
136
172
|
var zoomVal = zoom - 0.1;
|
|
137
173
|
var originDeg = getRotateDeg(imageDOM);
|
|
174
|
+
|
|
138
175
|
if (zoomVal < 0.2) {
|
|
139
176
|
zoomVal = 0.2;
|
|
140
177
|
}
|
|
178
|
+
|
|
141
179
|
imageDOM.style.transform = _concatInstanceProperty(_context2 = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context2, originDeg, "deg)");
|
|
180
|
+
|
|
142
181
|
_this.setState({
|
|
143
182
|
zoom: zoomVal
|
|
144
183
|
});
|
|
145
184
|
});
|
|
185
|
+
|
|
146
186
|
_defineProperty(_assertThisInitialized(_this), "_reload", function () {
|
|
147
187
|
var imageDOM = _this.imgRef;
|
|
148
188
|
imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
|
|
149
189
|
imageDOM.style.left = "50%";
|
|
150
190
|
imageDOM.style.top = "50%";
|
|
191
|
+
|
|
151
192
|
_this.setState({
|
|
152
193
|
zoom: 1
|
|
153
194
|
});
|
|
154
195
|
});
|
|
196
|
+
|
|
155
197
|
_defineProperty(_assertThisInitialized(_this), "_arrowLeft", function () {
|
|
156
198
|
var onLeft = _this.props.onLeft;
|
|
157
199
|
onLeft && onLeft();
|
|
@@ -159,10 +201,12 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
159
201
|
imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
|
|
160
202
|
imageDOM.style.left = "50%";
|
|
161
203
|
imageDOM.style.top = "50%";
|
|
204
|
+
|
|
162
205
|
_this.setState({
|
|
163
206
|
zoom: 1
|
|
164
207
|
});
|
|
165
208
|
});
|
|
209
|
+
|
|
166
210
|
_defineProperty(_assertThisInitialized(_this), "_arrowRight", function () {
|
|
167
211
|
var onRight = _this.props.onRight;
|
|
168
212
|
onRight && onRight();
|
|
@@ -170,13 +214,16 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
170
214
|
imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
|
|
171
215
|
imageDOM.style.left = "50%";
|
|
172
216
|
imageDOM.style.top = "50%";
|
|
217
|
+
|
|
173
218
|
_this.setState({
|
|
174
219
|
zoom: 1
|
|
175
220
|
});
|
|
176
221
|
});
|
|
222
|
+
|
|
177
223
|
_defineProperty(_assertThisInitialized(_this), "rotate", function (isLeft) {
|
|
178
224
|
return function () {
|
|
179
225
|
var _context3;
|
|
226
|
+
|
|
180
227
|
var imageDOM = _this.imgRef;
|
|
181
228
|
var originDeg = getRotateDeg(imageDOM);
|
|
182
229
|
var zoom = _this.state.zoom;
|
|
@@ -184,16 +231,19 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
184
231
|
imageDOM.style.transform = _concatInstanceProperty(_context3 = "translate(-50%,-50%) rotate(".concat(rotateDeg, "deg) scale(")).call(_context3, zoom, ")");
|
|
185
232
|
};
|
|
186
233
|
});
|
|
234
|
+
|
|
187
235
|
_this.state = {
|
|
188
236
|
zoom: 1,
|
|
189
237
|
startTouch: {}
|
|
190
238
|
};
|
|
191
239
|
return _this;
|
|
192
240
|
}
|
|
241
|
+
|
|
193
242
|
_createClass(ImageViews, [{
|
|
194
243
|
key: "render",
|
|
195
244
|
value: function render() {
|
|
196
245
|
var _this2 = this;
|
|
246
|
+
|
|
197
247
|
var image = this.props.image;
|
|
198
248
|
return /*#__PURE__*/React.createElement("div", {
|
|
199
249
|
className: variables('ImageViews')
|
|
@@ -208,6 +258,7 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
208
258
|
onWheel: this._onwheel //缩放事件
|
|
209
259
|
,
|
|
210
260
|
onMouseDown: this._onMouseDown //拖拽事件
|
|
261
|
+
|
|
211
262
|
})), /*#__PURE__*/React.createElement("div", {
|
|
212
263
|
className: variables('ImageViews').footer
|
|
213
264
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -253,6 +304,8 @@ var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
|
253
304
|
}))))));
|
|
254
305
|
}
|
|
255
306
|
}]);
|
|
307
|
+
|
|
256
308
|
return ImageViews;
|
|
257
309
|
}(React.Component);
|
|
310
|
+
|
|
258
311
|
export default ImageViews;
|
package/es/Viewer/Viewer.js
CHANGED
|
@@ -10,72 +10,92 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
|
10
10
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
11
11
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
12
12
|
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
13
|
+
|
|
13
14
|
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); }; }
|
|
15
|
+
|
|
14
16
|
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; } }
|
|
17
|
+
|
|
15
18
|
import React from 'react';
|
|
16
19
|
import PropTypes from 'prop-types';
|
|
17
20
|
import ImageViews from "./ImageViews";
|
|
18
21
|
import variables from '../variables';
|
|
22
|
+
|
|
19
23
|
var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
20
24
|
_inherits(Viewers, _React$Component);
|
|
25
|
+
|
|
21
26
|
var _super = _createSuper(Viewers);
|
|
27
|
+
|
|
22
28
|
function Viewers(props) {
|
|
23
29
|
var _this;
|
|
30
|
+
|
|
24
31
|
_classCallCheck(this, Viewers);
|
|
32
|
+
|
|
25
33
|
_this = _super.call(this, props);
|
|
34
|
+
|
|
26
35
|
//修复Warning报错
|
|
27
36
|
_defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
|
|
28
37
|
_this.timeout = null;
|
|
29
38
|
});
|
|
39
|
+
|
|
30
40
|
_defineProperty(_assertThisInitialized(_this), "closeViewers", function () {
|
|
31
41
|
var _this$props = _this.props,
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
onCancel = _this$props.onCancel,
|
|
43
|
+
onClose = _this$props.onClose;
|
|
34
44
|
_this.containerRef.style['opacity'] = 0;
|
|
35
45
|
_this.timeout = _setTimeout(function () {
|
|
36
46
|
onCancel && onCancel(onClose);
|
|
37
47
|
}, 1000);
|
|
38
48
|
});
|
|
49
|
+
|
|
39
50
|
_defineProperty(_assertThisInitialized(_this), "_onLeft", function () {
|
|
40
51
|
var imageIndex = _this.state.imageIndex;
|
|
41
52
|
var images = _this.props.images;
|
|
42
53
|
var index = imageIndex - 1;
|
|
54
|
+
|
|
43
55
|
if (index < 0) {
|
|
44
56
|
index = images.length - 1;
|
|
45
57
|
}
|
|
58
|
+
|
|
46
59
|
_this.setState({
|
|
47
60
|
imageIndex: index
|
|
48
61
|
});
|
|
49
62
|
});
|
|
63
|
+
|
|
50
64
|
_defineProperty(_assertThisInitialized(_this), "_onRight", function () {
|
|
51
65
|
var imageIndex = _this.state.imageIndex;
|
|
52
66
|
var images = _this.props.images;
|
|
53
67
|
var index = imageIndex + 1;
|
|
68
|
+
|
|
54
69
|
if (index > images.length - 1) {
|
|
55
70
|
index = 0;
|
|
56
71
|
}
|
|
72
|
+
|
|
57
73
|
_this.setState({
|
|
58
74
|
imageIndex: index
|
|
59
75
|
});
|
|
60
76
|
});
|
|
77
|
+
|
|
61
78
|
_defineProperty(_assertThisInitialized(_this), "_onSelect", function (index) {
|
|
62
79
|
_this.setState({
|
|
63
80
|
imageIndex: index
|
|
64
81
|
});
|
|
65
82
|
});
|
|
83
|
+
|
|
66
84
|
_this.state = {
|
|
67
85
|
imageIndex: props.imageIndex
|
|
68
86
|
};
|
|
69
87
|
return _this;
|
|
70
88
|
}
|
|
89
|
+
|
|
71
90
|
_createClass(Viewers, [{
|
|
72
91
|
key: "render",
|
|
73
92
|
value: function render() {
|
|
74
93
|
var _this2 = this;
|
|
94
|
+
|
|
75
95
|
var _this$props2 = this.props,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
96
|
+
visible = _this$props2.visible,
|
|
97
|
+
images = _this$props2.images,
|
|
98
|
+
titles = _this$props2.titles;
|
|
79
99
|
var imageIndex = this.state.imageIndex;
|
|
80
100
|
return /*#__PURE__*/React.createElement("div", null, visible ? /*#__PURE__*/React.createElement("div", {
|
|
81
101
|
className: variables('Viewers'),
|
|
@@ -88,6 +108,7 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
|
88
108
|
className: variables('Viewers').title
|
|
89
109
|
}, _mapInstanceProperty(titles).call(titles, function (item, index) {
|
|
90
110
|
var _context;
|
|
111
|
+
|
|
91
112
|
return /*#__PURE__*/React.createElement("div", {
|
|
92
113
|
key: index,
|
|
93
114
|
onClick: _bindInstanceProperty(_context = _this2._onSelect).call(_context, _this2, index),
|
|
@@ -107,16 +128,22 @@ var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
|
107
128
|
}))) : null);
|
|
108
129
|
}
|
|
109
130
|
}]);
|
|
131
|
+
|
|
110
132
|
return Viewers;
|
|
111
133
|
}(React.Component);
|
|
134
|
+
|
|
112
135
|
_defineProperty(Viewers, "propTypes", {
|
|
113
136
|
/** viewer是否可见 */
|
|
114
137
|
visible: PropTypes.bool.isRequired,
|
|
138
|
+
|
|
115
139
|
/** 点击关闭按钮的回调 */
|
|
116
140
|
onCancel: PropTypes.func.isRequired,
|
|
141
|
+
|
|
117
142
|
/** 需要进行浏览的图片地址集合 */
|
|
118
143
|
images: PropTypes.array.isRequired,
|
|
144
|
+
|
|
119
145
|
/** 需要进行浏览的图片名称集合 */
|
|
120
146
|
titles: PropTypes.array.isRequired
|
|
121
147
|
});
|
|
148
|
+
|
|
122
149
|
export default Viewers;
|
|
@@ -4,13 +4,17 @@ var _excluded = ["className", "children"];
|
|
|
4
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import variables from '../variables';
|
|
7
|
+
|
|
7
8
|
function WingBlank(_ref) {
|
|
8
9
|
var _context;
|
|
10
|
+
|
|
9
11
|
var className = _ref.className,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
children = _ref.children,
|
|
13
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
|
|
12
15
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
13
16
|
className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('WingBlank'))
|
|
14
17
|
}, props), /*#__PURE__*/React.createElement("div", null, children));
|
|
15
18
|
}
|
|
19
|
+
|
|
16
20
|
export default WingBlank;
|
package/es/helper.js
CHANGED
|
@@ -9,35 +9,40 @@ import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
|
|
|
9
9
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
10
10
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
11
11
|
import message from 'antd/lib/message';
|
|
12
|
-
|
|
13
12
|
/**
|
|
14
13
|
* 功能:从obj中取出不包含keys指定的属性,并组成一个新的子对象
|
|
15
14
|
*/
|
|
15
|
+
|
|
16
16
|
var getObjectExclude = function getObjectExclude(obj, keys) {
|
|
17
17
|
var _context;
|
|
18
|
+
|
|
18
19
|
var inKeys = function inKeys(key) {
|
|
19
20
|
return _someInstanceProperty(keys).call(keys, function (k) {
|
|
20
21
|
return k === key;
|
|
21
22
|
});
|
|
22
23
|
};
|
|
24
|
+
|
|
23
25
|
return _reduceInstanceProperty(_context = _Object$keys(obj)).call(_context, function (newObj, key) {
|
|
24
26
|
!inKeys(key) && (newObj[key] = obj[key]);
|
|
25
27
|
return newObj;
|
|
26
28
|
}, {});
|
|
27
|
-
};
|
|
29
|
+
}; // 获取当前登录的用户名
|
|
30
|
+
|
|
28
31
|
|
|
29
|
-
// 获取当前登录的用户名
|
|
30
32
|
var getUsername = function getUsername() {
|
|
31
33
|
var username = 'username=';
|
|
32
34
|
var cookie = document.cookie;
|
|
33
35
|
var begin = _indexOfInstanceProperty(cookie).call(cookie, username) + username.length;
|
|
36
|
+
|
|
34
37
|
var end = _indexOfInstanceProperty(cookie).call(cookie, ';', begin);
|
|
38
|
+
|
|
35
39
|
return unescape(cookie.substring(begin, end < 0 ? cookie.length : end));
|
|
36
40
|
};
|
|
37
|
-
|
|
38
41
|
/**
|
|
39
42
|
* 确保path为数组
|
|
40
43
|
*/
|
|
44
|
+
|
|
45
|
+
|
|
41
46
|
var makeArray = function makeArray(path) {
|
|
42
47
|
if (_Array$isArray(path)) {
|
|
43
48
|
return path;
|
|
@@ -47,40 +52,46 @@ var makeArray = function makeArray(path) {
|
|
|
47
52
|
return [path];
|
|
48
53
|
}
|
|
49
54
|
};
|
|
50
|
-
|
|
51
55
|
/**
|
|
52
56
|
* 功能:获取对象关键路径的值,不存在则返回undefined
|
|
53
57
|
* obj:对象
|
|
54
58
|
* path:字符串或字符串数组,指定关键路径
|
|
55
59
|
*/
|
|
60
|
+
|
|
61
|
+
|
|
56
62
|
var getPathValue = function getPathValue(obj, path) {
|
|
57
63
|
if (!path) {
|
|
58
64
|
return undefined;
|
|
59
65
|
} else {
|
|
60
66
|
var _context2;
|
|
67
|
+
|
|
61
68
|
return _reduceInstanceProperty(_context2 = makeArray(path)).call(_context2, function (value, key) {
|
|
62
69
|
return _typeof(value) !== 'object' ? undefined : value[key];
|
|
63
70
|
}, obj);
|
|
64
71
|
}
|
|
65
72
|
};
|
|
66
|
-
|
|
67
73
|
/**
|
|
68
74
|
* 功能:判断一个值是否为空(null,undefined和''属于空)
|
|
69
75
|
*/
|
|
76
|
+
|
|
77
|
+
|
|
70
78
|
var isEmpty = function isEmpty(value) {
|
|
71
79
|
var type = _typeof(value);
|
|
80
|
+
|
|
72
81
|
if (type === 'number' || type === 'boolean') {
|
|
73
82
|
return false;
|
|
74
83
|
} else {
|
|
75
84
|
return !value;
|
|
76
85
|
}
|
|
77
86
|
};
|
|
78
|
-
|
|
79
87
|
/**
|
|
80
88
|
* 功能:判断一个值是否为空(null,undefined,''和[]属于空)
|
|
81
89
|
*/
|
|
90
|
+
|
|
91
|
+
|
|
82
92
|
var isEmpty2 = function isEmpty2(value) {
|
|
83
93
|
var type = _typeof(value);
|
|
94
|
+
|
|
84
95
|
if (type === 'number' || type === 'boolean') {
|
|
85
96
|
return false;
|
|
86
97
|
} else if (_Array$isArray(value)) {
|
|
@@ -89,14 +100,18 @@ var isEmpty2 = function isEmpty2(value) {
|
|
|
89
100
|
return !value;
|
|
90
101
|
}
|
|
91
102
|
};
|
|
103
|
+
|
|
92
104
|
var toThousands = function toThousands(number) {
|
|
93
105
|
var fractionDigits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
94
106
|
var removeTrailingZeros = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
107
|
+
|
|
95
108
|
if (!isNaN(Number(number))) {
|
|
96
109
|
var formattedNumber;
|
|
110
|
+
|
|
97
111
|
if (!_Number$isInteger(_parseFloat(number))) {
|
|
98
112
|
formattedNumber = Number(number).toFixed(fractionDigits);
|
|
99
113
|
}
|
|
114
|
+
|
|
100
115
|
if (removeTrailingZeros) {
|
|
101
116
|
//去除整数和小数部分末尾的零
|
|
102
117
|
formattedNumber = formattedNumber.replace(/(\.\d*?[1-9])0*$/, '$1').replace(/\.0*$/, '');
|
|
@@ -106,9 +121,11 @@ var toThousands = function toThousands(number) {
|
|
|
106
121
|
maximumFractionDigits: fractionDigits
|
|
107
122
|
});
|
|
108
123
|
}
|
|
124
|
+
|
|
109
125
|
return formattedNumber;
|
|
110
126
|
} else if (typeof number === 'string' && _includesInstanceProperty(number).call(number, '~')) {
|
|
111
127
|
var numberList = number.split('~');
|
|
128
|
+
|
|
112
129
|
var formattedArr = _mapInstanceProperty(numberList).call(numberList, function (num, index) {
|
|
113
130
|
if (index === numberList.length - 1) {
|
|
114
131
|
return _parseFloat(num).toFixed(fractionDigits);
|
|
@@ -116,22 +133,27 @@ var toThousands = function toThousands(number) {
|
|
|
116
133
|
return _parseFloat(num).toFixed(fractionDigits);
|
|
117
134
|
}
|
|
118
135
|
});
|
|
136
|
+
|
|
119
137
|
var result = formattedArr.join('~');
|
|
120
138
|
return result;
|
|
121
139
|
}
|
|
122
140
|
};
|
|
141
|
+
|
|
123
142
|
var showError = function showError(msg) {
|
|
124
143
|
message.error(msg);
|
|
125
144
|
};
|
|
145
|
+
|
|
126
146
|
var showSuccessMsg = function showSuccessMsg(msg) {
|
|
127
147
|
message.success(msg);
|
|
128
148
|
};
|
|
149
|
+
|
|
129
150
|
var getObject = function getObject(obj, keys) {
|
|
130
151
|
return _reduceInstanceProperty(keys).call(keys, function (newObj, key) {
|
|
131
152
|
newObj[key] = obj[key];
|
|
132
153
|
return newObj;
|
|
133
154
|
}, {});
|
|
134
155
|
};
|
|
156
|
+
|
|
135
157
|
var helper = {
|
|
136
158
|
getObjectExclude: getObjectExclude,
|
|
137
159
|
getUsername: getUsername,
|
package/es/history.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// import createBrowserHistory from 'history/createBrowserHistory';
|
|
2
|
-
import { createBrowserHistory } from 'history';
|
|
3
|
-
|
|
4
|
-
// Navigation manager, e.g. history.push('/home')
|
|
2
|
+
import { createBrowserHistory } from 'history'; // Navigation manager, e.g. history.push('/home')
|
|
5
3
|
// https://github.com/mjackson/history
|
|
4
|
+
|
|
6
5
|
export default process.env.BROWSER && createBrowserHistory();
|