cloud-b2b 1.1.57 → 1.1.59
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/package.json +44 -22
- package/src/Area/Area.js +94 -0
- package/src/Card/Card.js +16 -0
- package/src/CodeInput/CodeInput.js +76 -0
- package/src/Control/Control.js +338 -0
- package/src/Control/event.js +45 -0
- package/src/Enhance/Dialogs.js +24 -0
- package/src/Enhance/Loading.js +83 -0
- package/{es → src}/Enhance/index.js +8 -6
- package/src/Header/Header.js +149 -0
- package/src/Header/Vertical.js +74 -0
- package/src/ImageView/ImageView.js +62 -0
- package/src/Indent/Indent.js +12 -0
- package/src/InpurCascader/InputCascader.js +83 -0
- package/src/InputEditor/InputEditor.js +93 -0
- package/src/InputSearch/InputSearch.js +186 -0
- package/src/InputSelect/InputSelect.js +103 -0
- package/src/InputTreeSelect/InputTreeSelect.js +87 -0
- package/src/InputWriting/InputWriting.js +65 -0
- package/src/Layout/Layout.js +121 -0
- package/src/LayoutLink/LayoutLink.js +59 -0
- package/src/Link/Link.js +57 -0
- package/src/Loading/Loading.js +15 -0
- package/src/Loading2/Loading2.js +15 -0
- package/src/ModalWithDrag/ModalWithDrag.js +17 -0
- package/{es → src}/ModalWithDrag/drag.js +128 -116
- package/src/NumberInput/NumberInput.js +137 -0
- package/src/Search/Search.js +368 -0
- package/src/Search2/Search.js +436 -0
- package/{lib/Search → src/Search2}/Search.less +65 -63
- package/{lib/Search → src/Search2}/package.json +6 -6
- package/src/Sidebar/Sidebar.js +111 -0
- package/src/Sidebar2/Sidebar.js +143 -0
- package/src/SuperForm/SuperForm.js +519 -0
- package/src/SuperForm2/SuperForm.js +588 -0
- package/src/SuperIcon/SuperIcon.js +14 -0
- package/src/SuperPagination/SuperPagination.js +65 -0
- package/src/SuperTab/SuperTab.js +84 -0
- package/src/SuperTab2/SuperTab2.js +94 -0
- package/src/SuperTable/DragSortRow.js +62 -0
- package/src/SuperTable/FilterDropDown.js +111 -0
- package/src/SuperTable/SuperTable.js +590 -0
- package/src/SuperTable/fixed.js +34 -0
- package/src/SuperTable2/SuperTable2.js +624 -0
- package/src/SuperTable2/SuperTableCell.js +175 -0
- package/src/SuperTable3/FilterDropDown.js +111 -0
- package/src/SuperTable3/SuperTable.js +498 -0
- package/src/SuperTable3/fixed.js +34 -0
- package/src/SuperToolbar/SuperToolbar.js +128 -0
- package/src/SuperUpload/SuperUpload.js +137 -0
- package/src/Title/Title.js +18 -0
- package/src/Viewer/ImageViews.js +220 -0
- package/src/Viewer/Viewer.js +97 -0
- package/src/WingBlank/WingBlank.js +14 -0
- package/src/helper.js +185 -0
- package/{es → src}/history.js +6 -6
- package/src/index.js +39 -0
- package/src/variables.js +5 -0
- package/test/index.html +10 -0
- package/test/test.js +16 -0
- package/test/test.less +12 -0
- package/test/webpack.config.js +71 -0
- package/tools/babel.config.js +14 -0
- package/tools/build.js +70 -0
- package/tools/publish.js +9 -0
- package/tools/util.js +53 -0
- package/es/Area/Area.js +0 -138
- package/es/Card/Card.js +0 -19
- package/es/CodeInput/CodeInput.js +0 -120
- package/es/Control/Control.js +0 -444
- package/es/Control/event.js +0 -43
- package/es/Enhance/Dialogs.js +0 -49
- package/es/Enhance/Loading.js +0 -128
- package/es/Header/Header.js +0 -159
- package/es/Header/Vertical.js +0 -103
- package/es/ImageView/ImageView.js +0 -97
- package/es/Indent/Indent.js +0 -19
- package/es/InpurCascader/InputCascader.js +0 -114
- package/es/InputEditor/InputEditor.js +0 -171
- package/es/InputSearch/InputSearch.js +0 -263
- package/es/InputSelect/InputSelect.js +0 -157
- package/es/InputTreeSelect/InputTreeSelect.js +0 -118
- package/es/InputWriting/InputWriting.js +0 -82
- package/es/Layout/Layout.js +0 -198
- package/es/LayoutLink/LayoutLink.js +0 -73
- package/es/Link/Link.js +0 -82
- package/es/Loading/Loading.js +0 -13
- package/es/Loading2/Loading2.js +0 -9
- package/es/ModalWithDrag/ModalWithDrag.js +0 -29
- package/es/NumberInput/NumberInput.js +0 -197
- package/es/Search/Search.js +0 -494
- package/es/Sidebar/Sidebar.js +0 -141
- package/es/Sidebar2/Sidebar.js +0 -162
- package/es/SuperForm/SuperForm.js +0 -593
- package/es/SuperForm2/SuperForm.js +0 -682
- package/es/SuperIcon/SuperIcon.js +0 -27
- package/es/SuperPagination/SuperPagination.js +0 -106
- package/es/SuperTab/SuperTab.js +0 -104
- package/es/SuperTab2/SuperTab2.js +0 -142
- package/es/SuperTable/DragSortRow.js +0 -94
- package/es/SuperTable/FilterDropDown.js +0 -161
- package/es/SuperTable/SuperTable.js +0 -805
- package/es/SuperTable/fixed.js +0 -34
- package/es/SuperTable2/SuperTable2.js +0 -923
- package/es/SuperTable2/SuperTableCell.js +0 -215
- package/es/SuperTable3/FilterDropDown.js +0 -161
- package/es/SuperTable3/SuperTable.js +0 -662
- package/es/SuperTable3/fixed.js +0 -34
- package/es/SuperToolbar/SuperToolbar.js +0 -192
- package/es/SuperUpload/SuperUpload.js +0 -356
- package/es/Title/Title.js +0 -33
- package/es/Viewer/ImageViews.js +0 -255
- package/es/Viewer/Viewer.js +0 -119
- package/es/WingBlank/WingBlank.js +0 -16
- package/es/helper.js +0 -241
- package/es/index.js +0 -37
- package/es/variables.js +0 -6
- package/lib/Area/Area.js +0 -146
- package/lib/Area/package.json +0 -6
- package/lib/Card/Card.js +0 -27
- package/lib/Card/package.json +0 -6
- package/lib/CodeInput/CodeInput.js +0 -128
- package/lib/CodeInput/package.json +0 -6
- package/lib/Control/Control.js +0 -450
- package/lib/Control/event.js +0 -51
- package/lib/Control/package.json +0 -6
- package/lib/Enhance/Dialogs.js +0 -57
- package/lib/Enhance/Loading.js +0 -135
- package/lib/Enhance/index.js +0 -25
- package/lib/Enhance/package.json +0 -6
- package/lib/Header/Header.js +0 -166
- package/lib/Header/Header.less +0 -95
- package/lib/Header/Vertical.js +0 -111
- package/lib/Header/Vertical.less +0 -60
- package/lib/Header/package.json +0 -6
- package/lib/ImageView/ImageView.js +0 -105
- package/lib/ImageView/ImageView.less +0 -14
- package/lib/ImageView/package.json +0 -6
- package/lib/Indent/Indent.js +0 -27
- package/lib/Indent/package.json +0 -6
- package/lib/InpurCascader/InputCascader.js +0 -121
- package/lib/InpurCascader/package.json +0 -6
- package/lib/InputEditor/InputEditor.js +0 -179
- package/lib/InputEditor/inputEditor.less +0 -8
- package/lib/InputEditor/package.json +0 -6
- package/lib/InputSearch/InputSearch.js +0 -271
- package/lib/InputSearch/package.json +0 -6
- package/lib/InputSelect/InputSelect.js +0 -165
- package/lib/InputSelect/package.json +0 -6
- package/lib/InputTreeSelect/InputTreeSelect.js +0 -125
- package/lib/InputTreeSelect/package.json +0 -6
- package/lib/InputWriting/InputWriting.js +0 -90
- package/lib/InputWriting/package.json +0 -6
- package/lib/Layout/Layout.js +0 -206
- package/lib/Layout/Layout.less +0 -28
- package/lib/Layout/package.json +0 -6
- package/lib/LayoutLink/LayoutLink.js +0 -85
- package/lib/LayoutLink/LayoutLink.less +0 -53
- package/lib/LayoutLink/package.json +0 -6
- package/lib/Link/Link.js +0 -90
- package/lib/Link/package.json +0 -6
- package/lib/Loading/Loading.js +0 -21
- package/lib/Loading/Loading.less +0 -13
- package/lib/Loading/package.json +0 -6
- package/lib/Loading2/Loading2.js +0 -17
- package/lib/Loading2/Loading2.less +0 -19
- package/lib/Loading2/package.json +0 -6
- package/lib/ModalWithDrag/ModalWithDrag.js +0 -37
- package/lib/ModalWithDrag/ModalWithDrag.less +0 -6
- package/lib/ModalWithDrag/drag.js +0 -124
- package/lib/ModalWithDrag/package.json +0 -6
- package/lib/NumberInput/NumberInput.js +0 -205
- package/lib/NumberInput/package.json +0 -6
- package/lib/Search/Search.js +0 -506
- package/lib/Sidebar/Sidebar.js +0 -149
- package/lib/Sidebar/Sidebar.less +0 -78
- package/lib/Sidebar/package.json +0 -6
- package/lib/Sidebar2/Sidebar.js +0 -170
- package/lib/Sidebar2/Sidebar.less +0 -153
- package/lib/Sidebar2/package.json +0 -6
- package/lib/SuperForm/SuperForm.js +0 -604
- package/lib/SuperForm/SuperForm.less +0 -52
- package/lib/SuperForm/package.json +0 -6
- package/lib/SuperForm2/SuperForm.js +0 -693
- package/lib/SuperForm2/SuperForm.less +0 -52
- package/lib/SuperForm2/package.json +0 -6
- package/lib/SuperIcon/SuperIcon.js +0 -35
- package/lib/SuperIcon/package.json +0 -6
- package/lib/SuperPagination/SuperPagination.js +0 -114
- package/lib/SuperPagination/package.json +0 -6
- package/lib/SuperTab/SuperTab.js +0 -112
- package/lib/SuperTab/SuperTab.less +0 -43
- package/lib/SuperTab/package.json +0 -6
- package/lib/SuperTab2/SuperTab2.js +0 -150
- package/lib/SuperTab2/SuperTab2.less +0 -18
- package/lib/SuperTab2/package.json +0 -6
- package/lib/SuperTable/DragSortRow.js +0 -102
- package/lib/SuperTable/DragSortRow.less +0 -17
- package/lib/SuperTable/FilterDropDown.js +0 -169
- package/lib/SuperTable/FilterDropDown.less +0 -30
- package/lib/SuperTable/SuperTable.js +0 -813
- package/lib/SuperTable/SuperTable.less +0 -132
- package/lib/SuperTable/fixed.js +0 -42
- package/lib/SuperTable/package.json +0 -6
- package/lib/SuperTable2/SuperTable2.js +0 -935
- package/lib/SuperTable2/SuperTable2.less +0 -118
- package/lib/SuperTable2/SuperTableCell.js +0 -220
- package/lib/SuperTable2/package.json +0 -6
- package/lib/SuperTable3/FilterDropDown.js +0 -169
- package/lib/SuperTable3/FilterDropDown.less +0 -29
- package/lib/SuperTable3/SuperTable.js +0 -670
- package/lib/SuperTable3/SuperTable.less +0 -99
- package/lib/SuperTable3/fixed.js +0 -42
- package/lib/SuperTable3/package.json +0 -6
- package/lib/SuperToolbar/SuperToolbar.js +0 -200
- package/lib/SuperToolbar/SuperToolbar.less +0 -17
- package/lib/SuperToolbar/package.json +0 -6
- package/lib/SuperUpload/SuperUpload.js +0 -367
- package/lib/SuperUpload/SuperUpload.less +0 -28
- package/lib/SuperUpload/package.json +0 -6
- package/lib/Title/Title.js +0 -41
- package/lib/Title/Title.less +0 -35
- package/lib/Title/package.json +0 -6
- package/lib/Viewer/ImageViews.js +0 -263
- package/lib/Viewer/Viewer.js +0 -127
- package/lib/Viewer/Viewer.less +0 -67
- package/lib/Viewer/imgView.less +0 -59
- package/lib/Viewer/package.json +0 -7
- package/lib/WingBlank/WingBlank.js +0 -24
- package/lib/WingBlank/WingBlank.less +0 -12
- package/lib/WingBlank/package.json +0 -6
- package/lib/adjust.less +0 -89
- package/lib/helper.js +0 -247
- package/lib/history.js +0 -12
- package/lib/index.js +0 -271
- package/lib/index.less +0 -31
- package/lib/style.less +0 -30
- package/lib/variables.js +0 -14
- package/lib/variables.less +0 -73
- /package/{es → src}/Area/package.json +0 -0
- /package/{es → src}/Card/package.json +0 -0
- /package/{es → src}/CodeInput/package.json +0 -0
- /package/{es → src}/Control/package.json +0 -0
- /package/{es → src}/Enhance/package.json +0 -0
- /package/{es → src}/Header/Header.less +0 -0
- /package/{es → src}/Header/Vertical.less +0 -0
- /package/{es → src}/Header/package.json +0 -0
- /package/{es → src}/ImageView/ImageView.less +0 -0
- /package/{es → src}/ImageView/package.json +0 -0
- /package/{es → src}/Indent/package.json +0 -0
- /package/{es → src}/InpurCascader/package.json +0 -0
- /package/{es → src}/InputEditor/inputEditor.less +0 -0
- /package/{es → src}/InputEditor/package.json +0 -0
- /package/{es → src}/InputSearch/package.json +0 -0
- /package/{es → src}/InputSelect/package.json +0 -0
- /package/{es → src}/InputTreeSelect/package.json +0 -0
- /package/{es → src}/InputWriting/package.json +0 -0
- /package/{es → src}/Layout/Layout.less +0 -0
- /package/{es → src}/Layout/package.json +0 -0
- /package/{es → src}/LayoutLink/LayoutLink.less +0 -0
- /package/{es → src}/LayoutLink/package.json +0 -0
- /package/{es → src}/Link/package.json +0 -0
- /package/{es → src}/Loading/Loading.less +0 -0
- /package/{es → src}/Loading/package.json +0 -0
- /package/{es → src}/Loading2/Loading2.less +0 -0
- /package/{es → src}/Loading2/package.json +0 -0
- /package/{es → src}/ModalWithDrag/ModalWithDrag.less +0 -0
- /package/{es → src}/ModalWithDrag/package.json +0 -0
- /package/{es → src}/NumberInput/package.json +0 -0
- /package/{es → src}/Search/Search.less +0 -0
- /package/{es → src}/Search/package.json +0 -0
- /package/{es → src}/Sidebar/Sidebar.less +0 -0
- /package/{es → src}/Sidebar/package.json +0 -0
- /package/{es → src}/Sidebar2/Sidebar.less +0 -0
- /package/{es → src}/Sidebar2/package.json +0 -0
- /package/{es → src}/SuperForm/SuperForm.less +0 -0
- /package/{es → src}/SuperForm/package.json +0 -0
- /package/{es → src}/SuperForm2/SuperForm.less +0 -0
- /package/{es → src}/SuperForm2/package.json +0 -0
- /package/{es → src}/SuperIcon/package.json +0 -0
- /package/{es → src}/SuperPagination/package.json +0 -0
- /package/{es → src}/SuperTab/SuperTab.less +0 -0
- /package/{es → src}/SuperTab/package.json +0 -0
- /package/{es → src}/SuperTab2/SuperTab2.less +0 -0
- /package/{es → src}/SuperTab2/package.json +0 -0
- /package/{es → src}/SuperTable/DragSortRow.less +0 -0
- /package/{es → src}/SuperTable/FilterDropDown.less +0 -0
- /package/{es → src}/SuperTable/SuperTable.less +0 -0
- /package/{es → src}/SuperTable/package.json +0 -0
- /package/{es → src}/SuperTable2/SuperTable2.less +0 -0
- /package/{es → src}/SuperTable2/package.json +0 -0
- /package/{es → src}/SuperTable3/FilterDropDown.less +0 -0
- /package/{es → src}/SuperTable3/SuperTable.less +0 -0
- /package/{es → src}/SuperTable3/package.json +0 -0
- /package/{es → src}/SuperToolbar/SuperToolbar.less +0 -0
- /package/{es → src}/SuperToolbar/package.json +0 -0
- /package/{es → src}/SuperUpload/SuperUpload.less +0 -0
- /package/{es → src}/SuperUpload/package.json +0 -0
- /package/{es → src}/Title/Title.less +0 -0
- /package/{es → src}/Title/package.json +0 -0
- /package/{es → src}/Viewer/Viewer.less +0 -0
- /package/{es → src}/Viewer/imgView.less +0 -0
- /package/{es → src}/Viewer/package.json +0 -0
- /package/{es → src}/WingBlank/WingBlank.less +0 -0
- /package/{es → src}/WingBlank/package.json +0 -0
- /package/{es → src}/adjust.less +0 -0
- /package/{es → src}/style.less +0 -0
- /package/{es → src}/variables.less +0 -0
package/es/Viewer/ImageViews.js
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
-
import _Icon from "antd/es/icon";
|
|
3
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
7
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
9
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
10
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js-stable/json/stringify";
|
|
11
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
12
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
import React from "react";
|
|
15
|
-
import variables from '../variables';
|
|
16
|
-
var addEvent = function addEvent(el, event, handler) {
|
|
17
|
-
if (!el) return;
|
|
18
|
-
if (el.attachEvent) {
|
|
19
|
-
el.attachEvent('on' + event, handler);
|
|
20
|
-
} else if (el.addEventListener) {
|
|
21
|
-
el.addEventListener(event, handler, false);
|
|
22
|
-
} else {
|
|
23
|
-
el['on' + event] = handler;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var removeEvent = function removeEvent(el, event, handler) {
|
|
27
|
-
if (!el) return;
|
|
28
|
-
if (el.detachEvent) {
|
|
29
|
-
el.detachEvent('on' + event, handler);
|
|
30
|
-
} else if (el.removeEventListener) {
|
|
31
|
-
el.removeEventListener(event, handler, false);
|
|
32
|
-
} else {
|
|
33
|
-
el['on' + event] = null;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var getCss = function getCss(o, key) {
|
|
37
|
-
return o.currentStyle ? o.currentStyle[key] : document.defaultView.getComputedStyle(o)[key];
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// 获取元素旋转的角度
|
|
41
|
-
var getRotateDeg = function getRotateDeg(target) {
|
|
42
|
-
var rotateMatrix = getCss(target, 'transform');
|
|
43
|
-
var _rotateMatrix$split$ = rotateMatrix.split('(')[1].split(')')[0].split(','),
|
|
44
|
-
_rotateMatrix$split$2 = _slicedToArray(_rotateMatrix$split$, 2),
|
|
45
|
-
a = _rotateMatrix$split$2[0],
|
|
46
|
-
b = _rotateMatrix$split$2[1];
|
|
47
|
-
return Math.round(Math.atan2(b, a) * (180 / Math.PI));
|
|
48
|
-
};
|
|
49
|
-
var ImageViews = /*#__PURE__*/function (_React$Component) {
|
|
50
|
-
function ImageViews(props) {
|
|
51
|
-
var _this;
|
|
52
|
-
_classCallCheck(this, ImageViews);
|
|
53
|
-
_this = _callSuper(this, ImageViews, [props]);
|
|
54
|
-
_defineProperty(_this, "_onwheel", function (e) {
|
|
55
|
-
var zoom = _this.state.zoom;
|
|
56
|
-
/*事件兼容*/
|
|
57
|
-
var event = e || window.event;
|
|
58
|
-
var imageDOM = _this.imgRef;
|
|
59
|
-
var delta;
|
|
60
|
-
if (event.nativeEvent.wheelDelta) {
|
|
61
|
-
delta = event.nativeEvent.wheelDelta / 1200;
|
|
62
|
-
} else if (event.nativeEvent.deltaY) {
|
|
63
|
-
delta = -event.nativeEvent.deltaY / 1200;
|
|
64
|
-
}
|
|
65
|
-
var zoomVal = zoom + delta;
|
|
66
|
-
if (zoomVal >= 0.2) {
|
|
67
|
-
imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
|
|
68
|
-
} else {
|
|
69
|
-
zoomVal = 0.2;
|
|
70
|
-
imageDOM.style.transform = "translate(-50%,-50%) scale(".concat(zoomVal, ")");
|
|
71
|
-
}
|
|
72
|
-
_this.setState({
|
|
73
|
-
zoom: zoomVal
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
_defineProperty(_this, "_onMouseDown", function (e) {
|
|
77
|
-
/*事件兼容*/
|
|
78
|
-
var event = e || window.event;
|
|
79
|
-
var imageDOM = _this.imgRef;
|
|
80
|
-
event.preventDefault(); //阻止浏览器的默认事件
|
|
81
|
-
|
|
82
|
-
var startTouch = {};
|
|
83
|
-
startTouch.initiated = true; //initiated为true表示开始滑动
|
|
84
|
-
/*获取鼠标按下的地方距离元素左侧和上侧的距离*/
|
|
85
|
-
startTouch.startX = event.nativeEvent.clientX - imageDOM.offsetLeft;
|
|
86
|
-
startTouch.startY = event.nativeEvent.clientY - imageDOM.offsetTop;
|
|
87
|
-
_this.setState({
|
|
88
|
-
startTouch: startTouch
|
|
89
|
-
});
|
|
90
|
-
addEvent(document, 'mousemove', _this._onMouseMove);
|
|
91
|
-
addEvent(document, 'mouseup', _this._onMouseUp);
|
|
92
|
-
});
|
|
93
|
-
_defineProperty(_this, "_onMouseMove", function (e) {
|
|
94
|
-
var event = e || window.event;
|
|
95
|
-
var imageDOM = _this.imgRef;
|
|
96
|
-
var startTouch = _this.state.startTouch;
|
|
97
|
-
if (!startTouch.initiated) return;
|
|
98
|
-
//滑动距离
|
|
99
|
-
var deltaX = event.clientX - startTouch.startX;
|
|
100
|
-
var deltaY = event.clientY - startTouch.startY;
|
|
101
|
-
imageDOM.style.left = "".concat(deltaX, "px");
|
|
102
|
-
imageDOM.style.top = "".concat(deltaY, "px");
|
|
103
|
-
});
|
|
104
|
-
_defineProperty(_this, "_onMouseUp", function () {
|
|
105
|
-
var startTouch = _this.state.startTouch;
|
|
106
|
-
if (!startTouch.initiated) return;
|
|
107
|
-
var endTouch = JSON.parse(_JSON$stringify(startTouch));
|
|
108
|
-
endTouch.initiated = false;
|
|
109
|
-
_this.setState({
|
|
110
|
-
startTouch: startTouch
|
|
111
|
-
});
|
|
112
|
-
removeEvent(document, 'mousemove', _this._onMouseMove);
|
|
113
|
-
removeEvent(document, 'mouseup', _this._onMouseDown);
|
|
114
|
-
});
|
|
115
|
-
_defineProperty(_this, "_onPlus", function (event) {
|
|
116
|
-
var zoom = _this.state.zoom;
|
|
117
|
-
var imageDOM = _this.imgRef;
|
|
118
|
-
var zoomVal = zoom + 0.1;
|
|
119
|
-
var originDeg = getRotateDeg(imageDOM);
|
|
120
|
-
event.stopPropagation();
|
|
121
|
-
if (zoomVal >= 0.2) {
|
|
122
|
-
var _context;
|
|
123
|
-
imageDOM.style.transform = _concatInstanceProperty(_context = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context, originDeg, "deg)");
|
|
124
|
-
}
|
|
125
|
-
_this.setState({
|
|
126
|
-
zoom: zoomVal
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
_defineProperty(_this, "_onMinus", function () {
|
|
130
|
-
var _context2;
|
|
131
|
-
var zoom = _this.state.zoom;
|
|
132
|
-
var imageDOM = _this.imgRef;
|
|
133
|
-
var zoomVal = zoom - 0.1;
|
|
134
|
-
var originDeg = getRotateDeg(imageDOM);
|
|
135
|
-
if (zoomVal < 0.2) {
|
|
136
|
-
zoomVal = 0.2;
|
|
137
|
-
}
|
|
138
|
-
imageDOM.style.transform = _concatInstanceProperty(_context2 = "translate(-50%,-50%) scale(".concat(zoomVal, ") rotate(")).call(_context2, originDeg, "deg)");
|
|
139
|
-
_this.setState({
|
|
140
|
-
zoom: zoomVal
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
_defineProperty(_this, "_reload", function () {
|
|
144
|
-
var imageDOM = _this.imgRef;
|
|
145
|
-
imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
|
|
146
|
-
imageDOM.style.left = "50%";
|
|
147
|
-
imageDOM.style.top = "50%";
|
|
148
|
-
_this.setState({
|
|
149
|
-
zoom: 1
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
_defineProperty(_this, "_arrowLeft", function () {
|
|
153
|
-
var onLeft = _this.props.onLeft;
|
|
154
|
-
onLeft && onLeft();
|
|
155
|
-
var imageDOM = _this.imgRef;
|
|
156
|
-
imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
|
|
157
|
-
imageDOM.style.left = "50%";
|
|
158
|
-
imageDOM.style.top = "50%";
|
|
159
|
-
_this.setState({
|
|
160
|
-
zoom: 1
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
_defineProperty(_this, "_arrowRight", function () {
|
|
164
|
-
var onRight = _this.props.onRight;
|
|
165
|
-
onRight && onRight();
|
|
166
|
-
var imageDOM = _this.imgRef;
|
|
167
|
-
imageDOM.style.transform = "translate(-50%,-50%) scale(1) rotate(0deg)";
|
|
168
|
-
imageDOM.style.left = "50%";
|
|
169
|
-
imageDOM.style.top = "50%";
|
|
170
|
-
_this.setState({
|
|
171
|
-
zoom: 1
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
_defineProperty(_this, "rotate", function (isLeft) {
|
|
175
|
-
return function () {
|
|
176
|
-
var _context3;
|
|
177
|
-
var imageDOM = _this.imgRef;
|
|
178
|
-
var originDeg = getRotateDeg(imageDOM);
|
|
179
|
-
var zoom = _this.state.zoom;
|
|
180
|
-
var rotateDeg = isLeft ? originDeg - 90 : originDeg + 90;
|
|
181
|
-
imageDOM.style.transform = _concatInstanceProperty(_context3 = "translate(-50%,-50%) rotate(".concat(rotateDeg, "deg) scale(")).call(_context3, zoom, ")");
|
|
182
|
-
};
|
|
183
|
-
});
|
|
184
|
-
_this.state = {
|
|
185
|
-
zoom: 1,
|
|
186
|
-
startTouch: {}
|
|
187
|
-
};
|
|
188
|
-
return _this;
|
|
189
|
-
}
|
|
190
|
-
_inherits(ImageViews, _React$Component);
|
|
191
|
-
return _createClass(ImageViews, [{
|
|
192
|
-
key: "render",
|
|
193
|
-
value: function render() {
|
|
194
|
-
var _this2 = this;
|
|
195
|
-
var image = this.props.image;
|
|
196
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
197
|
-
className: variables('ImageViews')
|
|
198
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
199
|
-
role: "imgWrapper"
|
|
200
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
201
|
-
src: image.src,
|
|
202
|
-
alt: image.alt,
|
|
203
|
-
ref: function ref(imgRef) {
|
|
204
|
-
_this2.imgRef = imgRef;
|
|
205
|
-
},
|
|
206
|
-
onWheel: this._onwheel //缩放事件
|
|
207
|
-
,
|
|
208
|
-
onMouseDown: this._onMouseDown //拖拽事件
|
|
209
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
210
|
-
className: variables('ImageViews').footer
|
|
211
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
212
|
-
className: variables('ImageViews').toolBar
|
|
213
|
-
}, /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", {
|
|
214
|
-
title: "\u653E\u5927",
|
|
215
|
-
onClick: this._onPlus,
|
|
216
|
-
onDoubleClick: function onDoubleClick(event) {
|
|
217
|
-
return event.preventDefault();
|
|
218
|
-
}
|
|
219
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
220
|
-
type: "plus"
|
|
221
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
222
|
-
title: "\u7F29\u5C0F",
|
|
223
|
-
onClick: this._onMinus
|
|
224
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
225
|
-
type: "minus"
|
|
226
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
227
|
-
title: "\u4E0A\u4E00\u5F20",
|
|
228
|
-
onClick: this._arrowLeft
|
|
229
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
230
|
-
type: "arrow-left"
|
|
231
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
232
|
-
title: "\u4E0B\u4E00\u5F20",
|
|
233
|
-
onClick: this._arrowRight
|
|
234
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
235
|
-
type: "arrow-right"
|
|
236
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
237
|
-
title: "\u5411\u5DE6\u65CB\u8F6C",
|
|
238
|
-
onClick: this.rotate(true)
|
|
239
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
240
|
-
type: "pld-rotateleft"
|
|
241
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
242
|
-
title: "\u5411\u53F3\u65CB\u8F6C",
|
|
243
|
-
onClick: this.rotate(false)
|
|
244
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
245
|
-
type: "pld-rotateright"
|
|
246
|
-
})), /*#__PURE__*/React.createElement("li", {
|
|
247
|
-
title: "\u590D\u539F",
|
|
248
|
-
onClick: this._reload
|
|
249
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
250
|
-
type: "delete"
|
|
251
|
-
}))))));
|
|
252
|
-
}
|
|
253
|
-
}]);
|
|
254
|
-
}(React.Component);
|
|
255
|
-
export default ImageViews;
|
package/es/Viewer/Viewer.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
-
import _Icon from "antd/es/icon";
|
|
3
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
7
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
9
|
-
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
10
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
11
|
-
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
12
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
16
|
-
import ImageViews from "./ImageViews";
|
|
17
|
-
import variables from '../variables';
|
|
18
|
-
var Viewers = /*#__PURE__*/function (_React$Component) {
|
|
19
|
-
function Viewers(props) {
|
|
20
|
-
var _this;
|
|
21
|
-
_classCallCheck(this, Viewers);
|
|
22
|
-
_this = _callSuper(this, Viewers, [props]);
|
|
23
|
-
//修复Warning报错
|
|
24
|
-
_defineProperty(_this, "componentWillUnmount", function () {
|
|
25
|
-
_this.timeout = null;
|
|
26
|
-
});
|
|
27
|
-
_defineProperty(_this, "closeViewers", function () {
|
|
28
|
-
var _this$props = _this.props,
|
|
29
|
-
onCancel = _this$props.onCancel,
|
|
30
|
-
onClose = _this$props.onClose;
|
|
31
|
-
_this.containerRef.style['opacity'] = 0;
|
|
32
|
-
_this.timeout = _setTimeout(function () {
|
|
33
|
-
onCancel && onCancel(onClose);
|
|
34
|
-
}, 1000);
|
|
35
|
-
});
|
|
36
|
-
_defineProperty(_this, "_onLeft", function () {
|
|
37
|
-
var imageIndex = _this.state.imageIndex;
|
|
38
|
-
var images = _this.props.images;
|
|
39
|
-
var index = imageIndex - 1;
|
|
40
|
-
if (index < 0) {
|
|
41
|
-
index = images.length - 1;
|
|
42
|
-
}
|
|
43
|
-
_this.setState({
|
|
44
|
-
imageIndex: index
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
_defineProperty(_this, "_onRight", function () {
|
|
48
|
-
var imageIndex = _this.state.imageIndex;
|
|
49
|
-
var images = _this.props.images;
|
|
50
|
-
var index = imageIndex + 1;
|
|
51
|
-
if (index > images.length - 1) {
|
|
52
|
-
index = 0;
|
|
53
|
-
}
|
|
54
|
-
_this.setState({
|
|
55
|
-
imageIndex: index
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
_defineProperty(_this, "_onSelect", function (index) {
|
|
59
|
-
_this.setState({
|
|
60
|
-
imageIndex: index
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
_this.state = {
|
|
64
|
-
imageIndex: props.imageIndex
|
|
65
|
-
};
|
|
66
|
-
return _this;
|
|
67
|
-
}
|
|
68
|
-
_inherits(Viewers, _React$Component);
|
|
69
|
-
return _createClass(Viewers, [{
|
|
70
|
-
key: "render",
|
|
71
|
-
value: function render() {
|
|
72
|
-
var _this2 = this;
|
|
73
|
-
var _this$props2 = this.props,
|
|
74
|
-
visible = _this$props2.visible,
|
|
75
|
-
images = _this$props2.images,
|
|
76
|
-
titles = _this$props2.titles;
|
|
77
|
-
var imageIndex = this.state.imageIndex;
|
|
78
|
-
return /*#__PURE__*/React.createElement("div", null, visible ? /*#__PURE__*/React.createElement("div", {
|
|
79
|
-
className: variables('Viewers'),
|
|
80
|
-
ref: function ref(container) {
|
|
81
|
-
_this2.containerRef = container;
|
|
82
|
-
}
|
|
83
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: variables('Viewers').mask
|
|
85
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
86
|
-
className: variables('Viewers').title
|
|
87
|
-
}, _mapInstanceProperty(titles).call(titles, function (item, index) {
|
|
88
|
-
var _context;
|
|
89
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
key: index,
|
|
91
|
-
onClick: _bindInstanceProperty(_context = _this2._onSelect).call(_context, _this2, index),
|
|
92
|
-
className: index === imageIndex ? variables('Viewers').selectTitle : ''
|
|
93
|
-
}, item);
|
|
94
|
-
})), /*#__PURE__*/React.createElement(ImageViews, {
|
|
95
|
-
image: images[imageIndex],
|
|
96
|
-
onLeft: this._onLeft,
|
|
97
|
-
onRight: this._onRight
|
|
98
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
99
|
-
className: variables('Viewers').close,
|
|
100
|
-
onClick: function onClick() {
|
|
101
|
-
return _this2.closeViewers();
|
|
102
|
-
}
|
|
103
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
104
|
-
type: "close"
|
|
105
|
-
}))) : null);
|
|
106
|
-
}
|
|
107
|
-
}]);
|
|
108
|
-
}(React.Component);
|
|
109
|
-
_defineProperty(Viewers, "propTypes", {
|
|
110
|
-
/** viewer是否可见 */
|
|
111
|
-
visible: PropTypes.bool.isRequired,
|
|
112
|
-
/** 点击关闭按钮的回调 */
|
|
113
|
-
onCancel: PropTypes.func.isRequired,
|
|
114
|
-
/** 需要进行浏览的图片地址集合 */
|
|
115
|
-
images: PropTypes.array.isRequired,
|
|
116
|
-
/** 需要进行浏览的图片名称集合 */
|
|
117
|
-
titles: PropTypes.array.isRequired
|
|
118
|
-
});
|
|
119
|
-
export default Viewers;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
4
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import variables from '../variables';
|
|
7
|
-
function WingBlank(_ref) {
|
|
8
|
-
var _context;
|
|
9
|
-
var className = _ref.className,
|
|
10
|
-
children = _ref.children,
|
|
11
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
13
|
-
className: _concatInstanceProperty(_context = "".concat(className, " ")).call(_context, variables('WingBlank'))
|
|
14
|
-
}, props), /*#__PURE__*/React.createElement("div", null, children));
|
|
15
|
-
}
|
|
16
|
-
export default WingBlank;
|
package/es/helper.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
2
|
-
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
4
|
-
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
|
5
|
-
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
6
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
7
|
-
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
8
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
|
9
|
-
import _Number$isInteger from "@babel/runtime-corejs3/core-js-stable/number/is-integer";
|
|
10
|
-
import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
|
|
11
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
12
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
13
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
14
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
15
|
-
import message from 'antd/lib/message';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 功能:从obj中取出不包含keys指定的属性,并组成一个新的子对象
|
|
19
|
-
*/
|
|
20
|
-
var getObjectExclude = function getObjectExclude(obj, keys) {
|
|
21
|
-
var _context;
|
|
22
|
-
var inKeys = function inKeys(key) {
|
|
23
|
-
return _someInstanceProperty(keys).call(keys, function (k) {
|
|
24
|
-
return k === key;
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
return _reduceInstanceProperty(_context = _Object$keys(obj)).call(_context, function (newObj, key) {
|
|
28
|
-
!inKeys(key) && (newObj[key] = obj[key]);
|
|
29
|
-
return newObj;
|
|
30
|
-
}, {});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// 获取当前登录的用户名
|
|
34
|
-
var getUsername = function getUsername() {
|
|
35
|
-
var username = 'username=';
|
|
36
|
-
var cookie = document.cookie;
|
|
37
|
-
var begin = _indexOfInstanceProperty(cookie).call(cookie, username) + username.length;
|
|
38
|
-
var end = _indexOfInstanceProperty(cookie).call(cookie, ';', begin);
|
|
39
|
-
return unescape(cookie.substring(begin, end < 0 ? cookie.length : end));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* 确保path为数组
|
|
44
|
-
*/
|
|
45
|
-
var makeArray = function makeArray(path) {
|
|
46
|
-
if (_Array$isArray(path)) {
|
|
47
|
-
return path;
|
|
48
|
-
} else if (!path) {
|
|
49
|
-
return [];
|
|
50
|
-
} else {
|
|
51
|
-
return [path];
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* 功能:获取对象关键路径的值,不存在则返回undefined
|
|
57
|
-
* obj:对象
|
|
58
|
-
* path:字符串或字符串数组,指定关键路径
|
|
59
|
-
*/
|
|
60
|
-
var getPathValue = function getPathValue(obj, path) {
|
|
61
|
-
if (!path) {
|
|
62
|
-
return undefined;
|
|
63
|
-
} else {
|
|
64
|
-
var _context2;
|
|
65
|
-
return _reduceInstanceProperty(_context2 = makeArray(path)).call(_context2, function (value, key) {
|
|
66
|
-
return _typeof(value) !== 'object' ? undefined : value[key];
|
|
67
|
-
}, obj);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 功能:判断一个值是否为空(null,undefined和''属于空)
|
|
73
|
-
*/
|
|
74
|
-
var isEmpty = function isEmpty(value) {
|
|
75
|
-
var type = _typeof(value);
|
|
76
|
-
if (type === 'number' || type === 'boolean') {
|
|
77
|
-
return false;
|
|
78
|
-
} else {
|
|
79
|
-
return !value;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 功能:判断一个值是否为空(null,undefined,''和[]属于空)
|
|
85
|
-
*/
|
|
86
|
-
var isEmpty2 = function isEmpty2(value) {
|
|
87
|
-
var type = _typeof(value);
|
|
88
|
-
if (type === 'number' || type === 'boolean') {
|
|
89
|
-
return false;
|
|
90
|
-
} else if (_Array$isArray(value)) {
|
|
91
|
-
return !value.length;
|
|
92
|
-
} else {
|
|
93
|
-
return !value;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
var toThousands = function toThousands(number) {
|
|
97
|
-
var fractionDigits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
98
|
-
var removeTrailingZeros = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
99
|
-
if (!isNaN(Number(number))) {
|
|
100
|
-
var formattedNumber;
|
|
101
|
-
if (!_Number$isInteger(_parseFloat(number))) {
|
|
102
|
-
formattedNumber = Number(number).toFixed(fractionDigits);
|
|
103
|
-
}
|
|
104
|
-
if (removeTrailingZeros) {
|
|
105
|
-
//去除整数和小数部分末尾的零
|
|
106
|
-
formattedNumber = formattedNumber.replace(/(\.\d*?[1-9])0*$/, '$1').replace(/\.0*$/, '');
|
|
107
|
-
} else {
|
|
108
|
-
formattedNumber = Number(number).toLocaleString(undefined, {
|
|
109
|
-
minimumFractionDigits: fractionDigits,
|
|
110
|
-
maximumFractionDigits: fractionDigits
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
return formattedNumber;
|
|
114
|
-
} else if (typeof number === 'string' && _includesInstanceProperty(number).call(number, '~')) {
|
|
115
|
-
var numberList = number.split('~');
|
|
116
|
-
var formattedArr = _mapInstanceProperty(numberList).call(numberList, function (num, index) {
|
|
117
|
-
if (index === numberList.length - 1) {
|
|
118
|
-
return _parseFloat(num).toFixed(fractionDigits);
|
|
119
|
-
} else {
|
|
120
|
-
return _parseFloat(num).toFixed(fractionDigits);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
var result = formattedArr.join('~');
|
|
124
|
-
return result;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
var showError = function showError(msg) {
|
|
128
|
-
message.error(msg);
|
|
129
|
-
};
|
|
130
|
-
var showSuccessMsg = function showSuccessMsg(msg) {
|
|
131
|
-
message.success(msg);
|
|
132
|
-
};
|
|
133
|
-
var getObject = function getObject(obj, keys) {
|
|
134
|
-
return _reduceInstanceProperty(keys).call(keys, function (newObj, key) {
|
|
135
|
-
newObj[key] = obj[key];
|
|
136
|
-
return newObj;
|
|
137
|
-
}, {});
|
|
138
|
-
};
|
|
139
|
-
export var fetchJson = /*#__PURE__*/function () {
|
|
140
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, option) {
|
|
141
|
-
var cookie,
|
|
142
|
-
jump,
|
|
143
|
-
res,
|
|
144
|
-
_context3,
|
|
145
|
-
json,
|
|
146
|
-
roleKey,
|
|
147
|
-
_args = arguments,
|
|
148
|
-
_t;
|
|
149
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
150
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
151
|
-
case 0:
|
|
152
|
-
cookie = _args.length > 2 && _args[2] !== undefined ? _args[2] : true;
|
|
153
|
-
jump = _args.length > 3 && _args[3] !== undefined ? _args[3] : true;
|
|
154
|
-
if (cookie) {
|
|
155
|
-
if (typeof option === 'undefined') {
|
|
156
|
-
option = {
|
|
157
|
-
credentials: 'include'
|
|
158
|
-
};
|
|
159
|
-
} else if (typeof option === 'string') {
|
|
160
|
-
option = {
|
|
161
|
-
method: option,
|
|
162
|
-
credentials: 'include'
|
|
163
|
-
};
|
|
164
|
-
} else if (!option.credentials) {
|
|
165
|
-
_Object$assign(option, {
|
|
166
|
-
credentials: 'include'
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
} else {
|
|
170
|
-
if (typeof option === 'string') {
|
|
171
|
-
option = {
|
|
172
|
-
method: option
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
_context4.prev = 1;
|
|
177
|
-
_context4.next = 2;
|
|
178
|
-
return fetch(url, option);
|
|
179
|
-
case 2:
|
|
180
|
-
res = _context4.sent;
|
|
181
|
-
if (res.ok) {
|
|
182
|
-
_context4.next = 3;
|
|
183
|
-
break;
|
|
184
|
-
}
|
|
185
|
-
return _context4.abrupt("return", {
|
|
186
|
-
returnCode: res.status,
|
|
187
|
-
returnMsg: _concatInstanceProperty(_context3 = "".concat(res.status, " - ")).call(_context3, res.statusText)
|
|
188
|
-
});
|
|
189
|
-
case 3:
|
|
190
|
-
_context4.next = 4;
|
|
191
|
-
return res.json();
|
|
192
|
-
case 4:
|
|
193
|
-
json = _context4.sent;
|
|
194
|
-
if (json.returnCode !== 0 && json.errorCode) {
|
|
195
|
-
json.returnCode = Number(json.errorCode) || 10001;
|
|
196
|
-
}
|
|
197
|
-
if (jump && json.returnCode === 9998) {
|
|
198
|
-
json.returnMsg = '登录超时,请重新登录';
|
|
199
|
-
window.localStorage.removeItem('login');
|
|
200
|
-
roleKey = getRoleKey();
|
|
201
|
-
if (roleKey) {
|
|
202
|
-
window.location.href = "/portal/".concat(roleKey, "_login");
|
|
203
|
-
} else {
|
|
204
|
-
window.location.href = "/";
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return _context4.abrupt("return", json);
|
|
208
|
-
case 5:
|
|
209
|
-
_context4.next = 7;
|
|
210
|
-
break;
|
|
211
|
-
case 6:
|
|
212
|
-
_context4.prev = 6;
|
|
213
|
-
_t = _context4["catch"](1);
|
|
214
|
-
return _context4.abrupt("return", {
|
|
215
|
-
returnCode: 10000,
|
|
216
|
-
returnMsg: '无法请求资源'
|
|
217
|
-
});
|
|
218
|
-
case 7:
|
|
219
|
-
case "end":
|
|
220
|
-
return _context4.stop();
|
|
221
|
-
}
|
|
222
|
-
}, _callee, null, [[1, 6]]);
|
|
223
|
-
}));
|
|
224
|
-
return function fetchJson(_x, _x2) {
|
|
225
|
-
return _ref.apply(this, arguments);
|
|
226
|
-
};
|
|
227
|
-
}();
|
|
228
|
-
var helper = {
|
|
229
|
-
getObjectExclude: getObjectExclude,
|
|
230
|
-
getUsername: getUsername,
|
|
231
|
-
getPathValue: getPathValue,
|
|
232
|
-
isEmpty: isEmpty,
|
|
233
|
-
isEmpty2: isEmpty2,
|
|
234
|
-
showError: showError,
|
|
235
|
-
showSuccessMsg: showSuccessMsg,
|
|
236
|
-
toThousands: toThousands,
|
|
237
|
-
getObject: getObject,
|
|
238
|
-
fetchJson: fetchJson
|
|
239
|
-
};
|
|
240
|
-
export { getObject, getObjectExclude, getUsername, getPathValue, isEmpty, isEmpty2, showError, showSuccessMsg, toThousands };
|
|
241
|
-
export default helper;
|
package/es/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { EnhanceLoading, EnhanceDialogs, EnhanceEditDialog } from './Enhance';
|
|
2
|
-
export { EnhanceLoading, EnhanceDialogs, EnhanceEditDialog };
|
|
3
|
-
export { default as Title } from './Title';
|
|
4
|
-
export { default as Card } from './Card';
|
|
5
|
-
export { default as Control } from './Control';
|
|
6
|
-
export { default as Header } from './Header';
|
|
7
|
-
export { default as ImageView } from './ImageView';
|
|
8
|
-
export { default as InpurCascader } from './InpurCascader';
|
|
9
|
-
export { default as InputSearch } from './InputSearch';
|
|
10
|
-
export { default as InputSelect } from './InputSelect';
|
|
11
|
-
export { default as InputEditor } from './InputEditor';
|
|
12
|
-
export { default as InputWriting } from './InputWriting';
|
|
13
|
-
export { default as Layout } from './Layout';
|
|
14
|
-
export { default as LayoutLink } from './LayoutLink';
|
|
15
|
-
export { default as Link } from './Link';
|
|
16
|
-
export { default as Loading } from './Loading';
|
|
17
|
-
export { default as Loading2 } from './Loading2';
|
|
18
|
-
export { default as ModalWithDrag } from './ModalWithDrag';
|
|
19
|
-
export { default as NumberInput } from './NumberInput';
|
|
20
|
-
export { default as Search } from './Search';
|
|
21
|
-
export { default as Sidebar } from './Sidebar';
|
|
22
|
-
export { default as Sidebar2 } from './Sidebar2';
|
|
23
|
-
export { default as SuperForm } from './SuperForm';
|
|
24
|
-
export { default as SuperForm2 } from './SuperForm2';
|
|
25
|
-
export { default as SuperIcon } from './SuperIcon';
|
|
26
|
-
export { default as SuperToolbar } from './SuperToolbar';
|
|
27
|
-
export { default as SuperUpload } from './SuperUpload';
|
|
28
|
-
export { default as Viewer } from './Viewer';
|
|
29
|
-
export { default as WingBlank } from './WingBlank';
|
|
30
|
-
export { default as Area } from './Area';
|
|
31
|
-
export { default as SuperTable3 } from './SuperTable3';
|
|
32
|
-
export { default as SuperTable2 } from './SuperTable2';
|
|
33
|
-
export { default as SuperTable } from './SuperTable';
|
|
34
|
-
export { default as SuperPagination } from './SuperPagination';
|
|
35
|
-
export { default as SuperTab } from './SuperTab';
|
|
36
|
-
export { default as SuperTab2 } from './SuperTab2';
|
|
37
|
-
export { default as Indent } from './Indent';
|
package/es/variables.js
DELETED