fan-standard-comp 3.1.10 → 3.2.0
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/Readme.md +35 -0
- package/dist/fan-standard-comp.umd.js +15 -15
- package/es/ButtonGroup/ButtonList.js +0 -3
- package/es/ButtonGroup/ButtonMenu.js +0 -3
- package/es/ButtonGroup/PopConfirmTitle.js +5 -15
- package/es/ButtonGroup/index.js +212 -216
- package/es/ButtonGroup/style/index.less +1 -1
- package/es/DragContent/DragBar.js +2 -6
- package/es/DragContent/index.js +44 -75
- package/es/FormComp/ChunkUploader/api.js +6 -10
- package/es/FormComp/ChunkUploader/index.js +105 -171
- package/es/FormComp/ChunkUploader/lib.js +4 -17
- package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
- package/es/FormComp/ChunkUploader/worker.js +0 -3
- package/es/FormComp/EditButton/index.js +24 -49
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +36 -74
- package/es/FormComp/FieldComponent/TitleNode.js +1 -3
- package/es/FormComp/FieldComponent/index.js +38 -74
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
- package/es/FormComp/RenderItemGroup/index.js +46 -74
- package/es/FormComp/Uploader/index.js +36 -77
- package/es/FormComp/Uploader/util.js +0 -6
- package/es/FormComp/VarTemplate/index.js +58 -96
- package/es/NavLeafScroll/index.js +172 -154
- package/es/NavLeafScroll/style/index.less +33 -1
- package/es/RefactorTree/index.js +36 -53
- package/es/RefactorTree/indexTreeNode.js +35 -68
- package/es/RefactorTree/util.js +9 -43
- package/es/SpecIcon/fonts/iconfont.js +7 -12
- package/es/SpecIcon/index.js +16 -25
- package/es/SplitterLayout/Pane.js +2 -5
- package/es/SplitterLayout/index.js +20 -70
- package/es/StandardContent/SplitterLayout/Pane.js +6 -10
- package/es/StandardContent/SplitterLayout/index.js +12 -63
- package/es/StandardContent/SubfieldContent.js +12 -14
- package/es/StandardContent/WrapperContent.js +8 -10
- package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/es/StandardDragModal/ChangeStandardModal.js +493 -0
- package/es/StandardDragModal/DraggableModal.d.ts +7 -0
- package/es/StandardDragModal/DraggableModal.js +31 -0
- package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/es/StandardDragModal/DraggableModalContext.js +5 -0
- package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/es/StandardDragModal/DraggableModalInner.js +114 -0
- package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/es/StandardDragModal/DraggableModalProvider.js +40 -0
- package/es/StandardDragModal/Modal.d.ts +11 -0
- package/es/StandardDragModal/Modal.js +24 -0
- package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/es/StandardDragModal/ResizeHandle.js +8 -0
- package/es/StandardDragModal/clamp.d.ts +1 -0
- package/es/StandardDragModal/clamp.js +3 -0
- package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/es/StandardDragModal/draggableModalReducer.js +157 -0
- package/es/StandardDragModal/getWindowSize.d.ts +4 -0
- package/es/StandardDragModal/getWindowSize.js +6 -0
- package/es/StandardDragModal/index.d.ts +3 -11
- package/es/StandardDragModal/index.js +3 -30
- package/es/StandardDragModal/index.less +65 -0
- package/es/StandardDragModal/useDrag.d.ts +5 -0
- package/es/StandardDragModal/useDrag.js +66 -0
- package/es/StandardDragModal/usePrevious.d.ts +1 -0
- package/es/StandardDragModal/usePrevious.js +8 -0
- package/es/StandardDragModal/useResize.d.ts +7 -0
- package/es/StandardDragModal/useResize.js +74 -0
- package/es/StandardFilter/index.js +30 -70
- package/es/StandardForm/ActionList.js +5 -7
- package/es/StandardForm/StepForm.js +50 -71
- package/es/StandardForm/TabForm.js +58 -70
- package/es/StandardForm/index.js +37 -56
- package/es/StandardModal/UpdateFormRef.js +1 -4
- package/es/StandardModal/index.d.ts +0 -1
- package/es/StandardModal/index.js +113 -157
- package/es/StandardPanel/index.js +19 -35
- package/es/StandardTable/index.js +18 -29
- package/es/components/IconNode/index.js +0 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +15 -14
- package/es/utils/ValueFormat.js +0 -9
- package/es/utils/dictSelectUtil.js +153 -0
- package/es/utils/filterPermission.js +16 -34
- package/es/utils/getParentNodes.js +24 -47
- package/es/utils/index.js +2 -1
- package/lib/ButtonGroup/ButtonList.js +1 -13
- package/lib/ButtonGroup/ButtonMenu.js +1 -8
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
- package/lib/ButtonGroup/index.js +215 -239
- package/lib/ButtonGroup/style/index.less +1 -1
- package/lib/DragContent/DragBar.js +2 -10
- package/lib/DragContent/index.js +47 -85
- package/lib/FormComp/ChunkUploader/api.js +6 -15
- package/lib/FormComp/ChunkUploader/index.js +107 -185
- package/lib/FormComp/ChunkUploader/lib.js +8 -27
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
- package/lib/FormComp/ChunkUploader/worker.js +1 -5
- package/lib/FormComp/EditButton/index.js +26 -60
- package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +38 -89
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
- package/lib/FormComp/FieldComponent/index.js +38 -110
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
- package/lib/FormComp/RenderItemGroup/index.js +46 -87
- package/lib/FormComp/Uploader/index.js +38 -95
- package/lib/FormComp/Uploader/util.js +1 -9
- package/lib/FormComp/VarTemplate/index.js +62 -106
- package/lib/FormComp/index.js +0 -2
- package/lib/NavLeafScroll/index.js +174 -165
- package/lib/NavLeafScroll/style/index.less +33 -1
- package/lib/RefactorTree/index.js +36 -67
- package/lib/RefactorTree/indexTreeNode.js +37 -83
- package/lib/RefactorTree/util.js +11 -45
- package/lib/SpecIcon/fonts/iconfont.js +7 -12
- package/lib/SpecIcon/index.js +16 -30
- package/lib/SplitterLayout/Pane.js +0 -7
- package/lib/SplitterLayout/index.js +18 -72
- package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
- package/lib/StandardContent/SplitterLayout/index.js +12 -68
- package/lib/StandardContent/SubfieldContent.js +12 -21
- package/lib/StandardContent/WrapperContent.js +8 -16
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
- package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
- package/lib/StandardDragModal/DraggableModal.js +40 -0
- package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/lib/StandardDragModal/DraggableModalContext.js +15 -0
- package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/lib/StandardDragModal/DraggableModalInner.js +124 -0
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
- package/lib/StandardDragModal/Modal.d.ts +11 -0
- package/lib/StandardDragModal/Modal.js +32 -0
- package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/lib/StandardDragModal/ResizeHandle.js +18 -0
- package/lib/StandardDragModal/clamp.d.ts +1 -0
- package/lib/StandardDragModal/clamp.js +10 -0
- package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/lib/StandardDragModal/draggableModalReducer.js +167 -0
- package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
- package/lib/StandardDragModal/getWindowSize.js +13 -0
- package/lib/StandardDragModal/index.d.ts +3 -11
- package/lib/StandardDragModal/index.js +33 -38
- package/lib/StandardDragModal/index.less +65 -0
- package/lib/StandardDragModal/useDrag.d.ts +5 -0
- package/lib/StandardDragModal/useDrag.js +73 -0
- package/lib/StandardDragModal/usePrevious.d.ts +1 -0
- package/lib/StandardDragModal/usePrevious.js +15 -0
- package/lib/StandardDragModal/useResize.d.ts +7 -0
- package/lib/StandardDragModal/useResize.js +81 -0
- package/lib/StandardFilter/index.js +28 -78
- package/lib/StandardForm/ActionList.js +5 -12
- package/lib/StandardForm/StepForm.js +52 -90
- package/lib/StandardForm/TabForm.js +61 -88
- package/lib/StandardForm/index.js +40 -75
- package/lib/StandardModal/UpdateFormRef.js +4 -12
- package/lib/StandardModal/index.d.ts +0 -1
- package/lib/StandardModal/index.js +115 -182
- package/lib/StandardPanel/index.js +22 -48
- package/lib/StandardTable/index.js +18 -38
- package/lib/components/IconNode/index.js +0 -7
- package/lib/components/index.js +0 -2
- package/lib/data/index.js +4 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +50 -68
- package/lib/utils/ValueFormat.js +0 -10
- package/lib/utils/dictSelectUtil.js +161 -0
- package/lib/utils/filterPermission.js +15 -39
- package/lib/utils/getParentNodes.js +25 -52
- package/lib/utils/index.js +24 -9
- package/package.json +5 -4
package/es/DragContent/index.js
CHANGED
|
@@ -1,79 +1,62 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useEffect, useRef, useState } from 'react';
|
|
14
8
|
import classNames from 'classnames';
|
|
15
9
|
import DragBar from './DragBar';
|
|
16
|
-
|
|
17
10
|
var DragContent = function DragContent(props) {
|
|
18
11
|
var children = props.children,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
className = props.className,
|
|
13
|
+
direction = props.direction,
|
|
14
|
+
_props$moveMaxWidth = props.moveMaxWidth,
|
|
15
|
+
moveMaxWidth = _props$moveMaxWidth === void 0 ? 0 : _props$moveMaxWidth,
|
|
16
|
+
_props$moveMaxHeight = props.moveMaxHeight,
|
|
17
|
+
moveMaxHeight = _props$moveMaxHeight === void 0 ? 0 : _props$moveMaxHeight,
|
|
18
|
+
style = props.style,
|
|
19
|
+
dragMouseDown = props.dragMouseDown,
|
|
20
|
+
dragMouseMove = props.dragMouseMove,
|
|
21
|
+
dragMouseUp = props.dragMouseUp;
|
|
29
22
|
var divRef = useRef();
|
|
30
|
-
|
|
31
23
|
var _useState = useState(0),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
targetWidth = _useState2[0],
|
|
26
|
+
setTargetWidth = _useState2[1];
|
|
36
27
|
var _useState3 = useState(0),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
targetHeight = _useState4[0],
|
|
30
|
+
setTargetHeight = _useState4[1];
|
|
41
31
|
useEffect(function () {
|
|
42
32
|
setTargetWidth(divRef.current.offsetWidth);
|
|
43
33
|
setTargetHeight(divRef.current.offsetHeight);
|
|
44
34
|
}, []);
|
|
45
|
-
|
|
46
35
|
var onmousedown = function onmousedown(e, direction) {
|
|
47
36
|
var parent = divRef.current;
|
|
48
37
|
var nextNode = parent.nextSibling; //相邻兄弟节点
|
|
49
|
-
|
|
50
38
|
var prevNode = parent.previousSibling; //相邻兄弟节点
|
|
51
39
|
//获取前后兄弟节点宽高
|
|
52
|
-
|
|
53
40
|
var prevWidth = 0,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
prevHeight = 0,
|
|
42
|
+
nextWidth = 0,
|
|
43
|
+
nextHeight = 0;
|
|
58
44
|
if (prevNode) {
|
|
59
45
|
prevWidth = prevNode.offsetWidth;
|
|
60
46
|
prevHeight = prevNode.offsetHeight;
|
|
61
47
|
}
|
|
62
|
-
|
|
63
48
|
if (nextNode) {
|
|
64
49
|
nextWidth = nextNode.offsetWidth;
|
|
65
50
|
nextHeight = nextNode.offsetHeight;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
}
|
|
52
|
+
//鼠标按下
|
|
69
53
|
if (dragMouseDown) dragMouseDown(e, direction);
|
|
70
54
|
var initWidth = parent.offsetWidth;
|
|
71
|
-
var initHeight = parent.offsetHeight;
|
|
55
|
+
var initHeight = parent.offsetHeight;
|
|
56
|
+
// let initLeft = parent.offsetLeft;
|
|
72
57
|
// let initTop = parent.offsetTop;
|
|
73
|
-
|
|
74
58
|
var startX = e.clientX;
|
|
75
59
|
var startY = e.clientY;
|
|
76
|
-
|
|
77
60
|
document.onmousemove = function (e) {
|
|
78
61
|
var currX = e.clientX;
|
|
79
62
|
var currY = e.clientY;
|
|
@@ -83,80 +66,67 @@ var DragContent = function DragContent(props) {
|
|
|
83
66
|
var hasB = /bottom/.test(direction);
|
|
84
67
|
var hasL = /left/.test(direction);
|
|
85
68
|
var hasR = /right/.test(direction);
|
|
86
|
-
|
|
87
69
|
if (hasL || hasR) {
|
|
88
70
|
var newWidth = initWidth + (hasL ? -disX : hasR ? disX : 0);
|
|
89
|
-
var width = newWidth > 0 ? newWidth : 0;
|
|
90
|
-
|
|
71
|
+
var width = newWidth > 0 ? newWidth : 0;
|
|
72
|
+
//获取兄弟节点可变动的宽度
|
|
91
73
|
var changeWidth = hasL ? prevWidth : hasR ? nextWidth : 0;
|
|
92
74
|
var maxWidth = changeWidth + initWidth;
|
|
93
|
-
|
|
94
75
|
if (moveMaxWidth > 0 && maxWidth > moveMaxWidth) {
|
|
95
76
|
maxWidth = moveMaxWidth;
|
|
96
|
-
}
|
|
77
|
+
}
|
|
78
|
+
//拉伸容器宽度不可小于初始宽度
|
|
97
79
|
//判断拉伸宽度不可超过 拉伸容器宽度+变动的兄弟容器宽度或设置的最大宽度
|
|
98
|
-
|
|
99
|
-
|
|
100
80
|
if (width > targetWidth && width <= maxWidth) {
|
|
101
81
|
//左拉且有前兄弟节点即变化其宽度
|
|
102
82
|
if (hasL && prevNode) {
|
|
103
83
|
var newPrevWidth = prevWidth + (hasL ? disX : hasR ? -disX : 0);
|
|
104
84
|
prevNode.style.width = newPrevWidth + 'px';
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
85
|
+
}
|
|
86
|
+
//右拉且有后兄弟节点即变化其宽度
|
|
108
87
|
if (hasR && nextNode) {
|
|
109
88
|
var newNextWidth = nextWidth + (hasL ? disX : hasR ? -disX : 0);
|
|
110
89
|
nextNode.style.width = newNextWidth + 'px';
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
90
|
+
}
|
|
91
|
+
//设置拉伸容器的宽度
|
|
114
92
|
parent.style.width = width + "px";
|
|
115
93
|
}
|
|
116
94
|
}
|
|
117
|
-
|
|
118
95
|
if (hasT || hasB) {
|
|
119
96
|
var newHeight = initHeight + (hasT ? -disY : hasB ? disY : 0);
|
|
120
|
-
var height = newHeight > 0 ? newHeight : 0;
|
|
121
|
-
|
|
97
|
+
var height = newHeight > 0 ? newHeight : 0;
|
|
98
|
+
//获取兄弟节点需要变动的高度
|
|
122
99
|
var changeHeight = hasT ? prevHeight : hasB ? nextHeight : 0;
|
|
123
100
|
var maxHeight = changeHeight + initHeight;
|
|
124
|
-
|
|
125
101
|
if (moveMaxHeight > 0 && maxHeight > moveMaxHeight) {
|
|
126
102
|
maxHeight = moveMaxHeight;
|
|
127
|
-
}
|
|
103
|
+
}
|
|
104
|
+
//拉伸容器高度不可小于初始高度
|
|
128
105
|
//判断拉伸高度不可超过 拉伸容器高度+变动的兄弟容器高度或设置的最大高度
|
|
129
|
-
|
|
130
|
-
|
|
131
106
|
if (height > targetHeight && height <= maxHeight) {
|
|
132
107
|
//上拉且有前兄弟节点即变化其高度
|
|
133
108
|
if (hasT && prevNode) {
|
|
134
109
|
var newPrevHeight = prevHeight + (hasT ? disY : hasB ? -disY : 0);
|
|
135
110
|
prevNode.style.height = newPrevHeight + 'px';
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
111
|
+
}
|
|
112
|
+
//下拉且有后兄弟节点即变化其高度
|
|
139
113
|
if (hasB && nextNode) {
|
|
140
114
|
var newNextHeight = nextHeight + (hasT ? disY : hasB ? -disY : 0);
|
|
141
115
|
nextNode.style.height = newNextHeight + 'px';
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
116
|
+
}
|
|
117
|
+
//设置拉伸容器的高度
|
|
145
118
|
parent.style.height = height + "px";
|
|
146
119
|
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
120
|
+
}
|
|
121
|
+
//鼠标按下
|
|
150
122
|
if (dragMouseMove) dragMouseMove(e, direction);
|
|
151
123
|
};
|
|
152
|
-
|
|
153
124
|
document.onmouseup = function (e) {
|
|
154
|
-
document.onmousemove = document.onmouseup = null;
|
|
155
|
-
|
|
125
|
+
document.onmousemove = document.onmouseup = null;
|
|
126
|
+
//鼠标按下
|
|
156
127
|
if (dragMouseUp) dragMouseUp(e, direction);
|
|
157
128
|
};
|
|
158
129
|
};
|
|
159
|
-
|
|
160
130
|
return /*#__PURE__*/React.createElement("div", {
|
|
161
131
|
ref: divRef,
|
|
162
132
|
className: classNames("spec-grid-dragContent", className),
|
|
@@ -169,5 +139,4 @@ var DragContent = function DragContent(props) {
|
|
|
169
139
|
});
|
|
170
140
|
}));
|
|
171
141
|
};
|
|
172
|
-
|
|
173
142
|
export default DragContent;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
-
|
|
3
2
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4
|
-
|
|
5
3
|
import axios from 'axios';
|
|
4
|
+
|
|
6
5
|
/**
|
|
7
6
|
* 查询文件上传情况
|
|
8
7
|
* @param {String} fileHash 文件内容Hash
|
|
9
8
|
* @param {String} fileName 文件名
|
|
10
9
|
* @param {Number} chunksLength 分片数量
|
|
11
10
|
*/
|
|
12
|
-
|
|
13
11
|
export function queryFileInfo(_ref) {
|
|
14
12
|
var fileHash = _ref.fileHash,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
fileName = _ref.fileName,
|
|
14
|
+
size = _ref.size,
|
|
15
|
+
sizeStr = _ref.sizeStr,
|
|
16
|
+
chunksLength = _ref.chunksLength;
|
|
19
17
|
console.log('queryFileInfo ==> 查询文件上传情况');
|
|
20
18
|
return axios.get('/getFileInfo', {
|
|
21
19
|
params: {
|
|
@@ -30,13 +28,13 @@ export function queryFileInfo(_ref) {
|
|
|
30
28
|
return data;
|
|
31
29
|
});
|
|
32
30
|
}
|
|
31
|
+
|
|
33
32
|
/**
|
|
34
33
|
* 上传文件分片
|
|
35
34
|
* @param {String} fileContentHash 文件的Hash
|
|
36
35
|
* @param {Number} chunkIndex 分片序号
|
|
37
36
|
* @param {Blob} chunk 文件分片
|
|
38
37
|
*/
|
|
39
|
-
|
|
40
38
|
export function uploadChunk(fileContentHash, chunkIndex, chunk) {
|
|
41
39
|
var formData = new FormData();
|
|
42
40
|
formData.append('fileContentHash', fileContentHash);
|
|
@@ -60,7 +58,6 @@ export function lockChunk(fileHash, chunkIndex) {
|
|
|
60
58
|
case 0:
|
|
61
59
|
result = _ref4.data;
|
|
62
60
|
return _context.abrupt("return", result);
|
|
63
|
-
|
|
64
61
|
case 2:
|
|
65
62
|
case "end":
|
|
66
63
|
return _context.stop();
|
|
@@ -68,7 +65,6 @@ export function lockChunk(fileHash, chunkIndex) {
|
|
|
68
65
|
}
|
|
69
66
|
}, _callee);
|
|
70
67
|
}));
|
|
71
|
-
|
|
72
68
|
return function (_x) {
|
|
73
69
|
return _ref5.apply(this, arguments);
|
|
74
70
|
};
|