fan-standard-comp 3.1.9 → 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.
Files changed (176) hide show
  1. package/Readme.md +35 -0
  2. package/dist/fan-standard-comp.umd.js +15 -10
  3. package/es/ButtonGroup/ButtonList.js +0 -3
  4. package/es/ButtonGroup/ButtonMenu.js +0 -3
  5. package/es/ButtonGroup/PopConfirmTitle.js +5 -15
  6. package/es/ButtonGroup/index.d.ts +2 -0
  7. package/es/ButtonGroup/index.js +223 -193
  8. package/es/ButtonGroup/style/index.less +1 -1
  9. package/es/DragContent/DragBar.js +2 -6
  10. package/es/DragContent/index.js +44 -75
  11. package/es/FormComp/ChunkUploader/api.js +6 -10
  12. package/es/FormComp/ChunkUploader/index.js +105 -171
  13. package/es/FormComp/ChunkUploader/lib.js +4 -17
  14. package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
  15. package/es/FormComp/ChunkUploader/worker.js +0 -3
  16. package/es/FormComp/EditButton/index.js +24 -49
  17. package/es/FormComp/FieldComponent/ReUpload.js +18 -38
  18. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
  19. package/es/FormComp/FieldComponent/TitleNode.js +1 -3
  20. package/es/FormComp/FieldComponent/index.js +38 -74
  21. package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
  22. package/es/FormComp/FieldComponent/style/index.less +6 -0
  23. package/es/FormComp/RenderItemGroup/index.js +46 -74
  24. package/es/FormComp/Uploader/index.js +36 -77
  25. package/es/FormComp/Uploader/util.js +0 -6
  26. package/es/FormComp/VarTemplate/index.js +58 -96
  27. package/es/NavLeafScroll/index.js +172 -154
  28. package/es/NavLeafScroll/style/index.less +33 -1
  29. package/es/RefactorTree/index.js +36 -53
  30. package/es/RefactorTree/indexTreeNode.js +35 -68
  31. package/es/RefactorTree/util.js +9 -43
  32. package/es/SpecIcon/fonts/iconfont.js +7 -12
  33. package/es/SpecIcon/index.js +16 -25
  34. package/es/SplitterLayout/Pane.js +2 -5
  35. package/es/SplitterLayout/index.js +20 -70
  36. package/es/StandardContent/SplitterLayout/Pane.js +6 -10
  37. package/es/StandardContent/SplitterLayout/index.js +12 -63
  38. package/es/StandardContent/SubfieldContent.js +12 -14
  39. package/es/StandardContent/WrapperContent.js +8 -10
  40. package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  41. package/es/StandardDragModal/ChangeStandardModal.js +493 -0
  42. package/es/StandardDragModal/DraggableModal.d.ts +7 -0
  43. package/es/StandardDragModal/DraggableModal.js +31 -0
  44. package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
  45. package/es/StandardDragModal/DraggableModalContext.js +5 -0
  46. package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
  47. package/es/StandardDragModal/DraggableModalInner.js +114 -0
  48. package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  49. package/es/StandardDragModal/DraggableModalProvider.js +40 -0
  50. package/es/StandardDragModal/Modal.d.ts +11 -0
  51. package/es/StandardDragModal/Modal.js +24 -0
  52. package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
  53. package/es/StandardDragModal/ResizeHandle.js +8 -0
  54. package/es/StandardDragModal/clamp.d.ts +1 -0
  55. package/es/StandardDragModal/clamp.js +3 -0
  56. package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
  57. package/es/StandardDragModal/draggableModalReducer.js +157 -0
  58. package/es/StandardDragModal/getWindowSize.d.ts +4 -0
  59. package/es/StandardDragModal/getWindowSize.js +6 -0
  60. package/es/StandardDragModal/index.d.ts +3 -11
  61. package/es/StandardDragModal/index.js +3 -30
  62. package/es/StandardDragModal/index.less +65 -0
  63. package/es/StandardDragModal/useDrag.d.ts +5 -0
  64. package/es/StandardDragModal/useDrag.js +66 -0
  65. package/es/StandardDragModal/usePrevious.d.ts +1 -0
  66. package/es/StandardDragModal/usePrevious.js +8 -0
  67. package/es/StandardDragModal/useResize.d.ts +7 -0
  68. package/es/StandardDragModal/useResize.js +74 -0
  69. package/es/StandardFilter/index.d.ts +1 -0
  70. package/es/StandardFilter/index.js +32 -70
  71. package/es/StandardForm/ActionList.js +5 -7
  72. package/es/StandardForm/StepForm.js +50 -71
  73. package/es/StandardForm/TabForm.js +58 -70
  74. package/es/StandardForm/index.js +37 -56
  75. package/es/StandardModal/UpdateFormRef.js +1 -4
  76. package/es/StandardModal/index.d.ts +0 -1
  77. package/es/StandardModal/index.js +115 -159
  78. package/es/StandardPanel/index.js +19 -35
  79. package/es/StandardTable/index.js +20 -30
  80. package/es/components/IconNode/index.js +0 -4
  81. package/es/index.d.ts +1 -0
  82. package/es/index.js +15 -14
  83. package/es/utils/ValueFormat.js +0 -9
  84. package/es/utils/dictSelectUtil.js +153 -0
  85. package/es/utils/filterPermission.js +16 -34
  86. package/es/utils/getParentNodes.js +24 -47
  87. package/es/utils/index.js +2 -1
  88. package/lib/ButtonGroup/ButtonList.js +1 -13
  89. package/lib/ButtonGroup/ButtonMenu.js +1 -8
  90. package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
  91. package/lib/ButtonGroup/index.d.ts +2 -0
  92. package/lib/ButtonGroup/index.js +226 -216
  93. package/lib/ButtonGroup/style/index.less +1 -1
  94. package/lib/DragContent/DragBar.js +2 -10
  95. package/lib/DragContent/index.js +47 -85
  96. package/lib/FormComp/ChunkUploader/api.js +6 -15
  97. package/lib/FormComp/ChunkUploader/index.js +107 -185
  98. package/lib/FormComp/ChunkUploader/lib.js +8 -27
  99. package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
  100. package/lib/FormComp/ChunkUploader/worker.js +1 -5
  101. package/lib/FormComp/EditButton/index.js +26 -60
  102. package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
  103. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
  104. package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
  105. package/lib/FormComp/FieldComponent/index.js +38 -110
  106. package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
  107. package/lib/FormComp/FieldComponent/style/index.less +6 -0
  108. package/lib/FormComp/RenderItemGroup/index.js +46 -87
  109. package/lib/FormComp/Uploader/index.js +38 -95
  110. package/lib/FormComp/Uploader/util.js +1 -9
  111. package/lib/FormComp/VarTemplate/index.js +62 -106
  112. package/lib/FormComp/index.js +0 -2
  113. package/lib/NavLeafScroll/index.js +174 -165
  114. package/lib/NavLeafScroll/style/index.less +33 -1
  115. package/lib/RefactorTree/index.js +36 -67
  116. package/lib/RefactorTree/indexTreeNode.js +37 -83
  117. package/lib/RefactorTree/util.js +11 -45
  118. package/lib/SpecIcon/fonts/iconfont.js +7 -12
  119. package/lib/SpecIcon/index.js +16 -30
  120. package/lib/SplitterLayout/Pane.js +0 -7
  121. package/lib/SplitterLayout/index.js +18 -72
  122. package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
  123. package/lib/StandardContent/SplitterLayout/index.js +12 -68
  124. package/lib/StandardContent/SubfieldContent.js +12 -21
  125. package/lib/StandardContent/WrapperContent.js +8 -16
  126. package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  127. package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
  128. package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
  129. package/lib/StandardDragModal/DraggableModal.js +40 -0
  130. package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
  131. package/lib/StandardDragModal/DraggableModalContext.js +15 -0
  132. package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
  133. package/lib/StandardDragModal/DraggableModalInner.js +124 -0
  134. package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  135. package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
  136. package/lib/StandardDragModal/Modal.d.ts +11 -0
  137. package/lib/StandardDragModal/Modal.js +32 -0
  138. package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
  139. package/lib/StandardDragModal/ResizeHandle.js +18 -0
  140. package/lib/StandardDragModal/clamp.d.ts +1 -0
  141. package/lib/StandardDragModal/clamp.js +10 -0
  142. package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
  143. package/lib/StandardDragModal/draggableModalReducer.js +167 -0
  144. package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
  145. package/lib/StandardDragModal/getWindowSize.js +13 -0
  146. package/lib/StandardDragModal/index.d.ts +3 -11
  147. package/lib/StandardDragModal/index.js +33 -38
  148. package/lib/StandardDragModal/index.less +65 -0
  149. package/lib/StandardDragModal/useDrag.d.ts +5 -0
  150. package/lib/StandardDragModal/useDrag.js +73 -0
  151. package/lib/StandardDragModal/usePrevious.d.ts +1 -0
  152. package/lib/StandardDragModal/usePrevious.js +15 -0
  153. package/lib/StandardDragModal/useResize.d.ts +7 -0
  154. package/lib/StandardDragModal/useResize.js +81 -0
  155. package/lib/StandardFilter/index.d.ts +1 -0
  156. package/lib/StandardFilter/index.js +30 -78
  157. package/lib/StandardForm/ActionList.js +5 -12
  158. package/lib/StandardForm/StepForm.js +52 -90
  159. package/lib/StandardForm/TabForm.js +61 -88
  160. package/lib/StandardForm/index.js +40 -75
  161. package/lib/StandardModal/UpdateFormRef.js +4 -12
  162. package/lib/StandardModal/index.d.ts +0 -1
  163. package/lib/StandardModal/index.js +117 -184
  164. package/lib/StandardPanel/index.js +22 -48
  165. package/lib/StandardTable/index.js +20 -39
  166. package/lib/components/IconNode/index.js +0 -7
  167. package/lib/components/index.js +0 -2
  168. package/lib/data/index.js +4 -7
  169. package/lib/index.d.ts +1 -0
  170. package/lib/index.js +50 -68
  171. package/lib/utils/ValueFormat.js +0 -10
  172. package/lib/utils/dictSelectUtil.js +161 -0
  173. package/lib/utils/filterPermission.js +15 -39
  174. package/lib/utils/getParentNodes.js +25 -52
  175. package/lib/utils/index.js +24 -9
  176. package/package.json +6 -5
@@ -1,96 +1,72 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
10
  var _DragBar = _interopRequireDefault(require("./DragBar"));
15
-
16
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
19
-
20
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
-
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
14
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
-
24
15
  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."); }
25
-
26
16
  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); }
27
-
28
17
  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; }
29
-
30
- 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; }
31
-
18
+ 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; } }
32
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
-
34
20
  var DragContent = function DragContent(props) {
35
21
  var children = props.children,
36
- className = props.className,
37
- direction = props.direction,
38
- _props$moveMaxWidth = props.moveMaxWidth,
39
- moveMaxWidth = _props$moveMaxWidth === void 0 ? 0 : _props$moveMaxWidth,
40
- _props$moveMaxHeight = props.moveMaxHeight,
41
- moveMaxHeight = _props$moveMaxHeight === void 0 ? 0 : _props$moveMaxHeight,
42
- style = props.style,
43
- dragMouseDown = props.dragMouseDown,
44
- dragMouseMove = props.dragMouseMove,
45
- dragMouseUp = props.dragMouseUp;
22
+ className = props.className,
23
+ direction = props.direction,
24
+ _props$moveMaxWidth = props.moveMaxWidth,
25
+ moveMaxWidth = _props$moveMaxWidth === void 0 ? 0 : _props$moveMaxWidth,
26
+ _props$moveMaxHeight = props.moveMaxHeight,
27
+ moveMaxHeight = _props$moveMaxHeight === void 0 ? 0 : _props$moveMaxHeight,
28
+ style = props.style,
29
+ dragMouseDown = props.dragMouseDown,
30
+ dragMouseMove = props.dragMouseMove,
31
+ dragMouseUp = props.dragMouseUp;
46
32
  var divRef = (0, _react.useRef)();
47
-
48
33
  var _useState = (0, _react.useState)(0),
49
- _useState2 = _slicedToArray(_useState, 2),
50
- targetWidth = _useState2[0],
51
- setTargetWidth = _useState2[1];
52
-
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ targetWidth = _useState2[0],
36
+ setTargetWidth = _useState2[1];
53
37
  var _useState3 = (0, _react.useState)(0),
54
- _useState4 = _slicedToArray(_useState3, 2),
55
- targetHeight = _useState4[0],
56
- setTargetHeight = _useState4[1];
57
-
38
+ _useState4 = _slicedToArray(_useState3, 2),
39
+ targetHeight = _useState4[0],
40
+ setTargetHeight = _useState4[1];
58
41
  (0, _react.useEffect)(function () {
59
42
  setTargetWidth(divRef.current.offsetWidth);
60
43
  setTargetHeight(divRef.current.offsetHeight);
61
44
  }, []);
62
-
63
45
  var onmousedown = function onmousedown(e, direction) {
64
46
  var parent = divRef.current;
65
47
  var nextNode = parent.nextSibling; //相邻兄弟节点
66
-
67
48
  var prevNode = parent.previousSibling; //相邻兄弟节点
68
49
  //获取前后兄弟节点宽高
69
-
70
50
  var prevWidth = 0,
71
- prevHeight = 0,
72
- nextWidth = 0,
73
- nextHeight = 0;
74
-
51
+ prevHeight = 0,
52
+ nextWidth = 0,
53
+ nextHeight = 0;
75
54
  if (prevNode) {
76
55
  prevWidth = prevNode.offsetWidth;
77
56
  prevHeight = prevNode.offsetHeight;
78
57
  }
79
-
80
58
  if (nextNode) {
81
59
  nextWidth = nextNode.offsetWidth;
82
60
  nextHeight = nextNode.offsetHeight;
83
- } //鼠标按下
84
-
85
-
61
+ }
62
+ //鼠标按下
86
63
  if (dragMouseDown) dragMouseDown(e, direction);
87
64
  var initWidth = parent.offsetWidth;
88
- var initHeight = parent.offsetHeight; // let initLeft = parent.offsetLeft;
65
+ var initHeight = parent.offsetHeight;
66
+ // let initLeft = parent.offsetLeft;
89
67
  // let initTop = parent.offsetTop;
90
-
91
68
  var startX = e.clientX;
92
69
  var startY = e.clientY;
93
-
94
70
  document.onmousemove = function (e) {
95
71
  var currX = e.clientX;
96
72
  var currY = e.clientY;
@@ -100,80 +76,67 @@ var DragContent = function DragContent(props) {
100
76
  var hasB = /bottom/.test(direction);
101
77
  var hasL = /left/.test(direction);
102
78
  var hasR = /right/.test(direction);
103
-
104
79
  if (hasL || hasR) {
105
80
  var newWidth = initWidth + (hasL ? -disX : hasR ? disX : 0);
106
- var width = newWidth > 0 ? newWidth : 0; //获取兄弟节点可变动的宽度
107
-
81
+ var width = newWidth > 0 ? newWidth : 0;
82
+ //获取兄弟节点可变动的宽度
108
83
  var changeWidth = hasL ? prevWidth : hasR ? nextWidth : 0;
109
84
  var maxWidth = changeWidth + initWidth;
110
-
111
85
  if (moveMaxWidth > 0 && maxWidth > moveMaxWidth) {
112
86
  maxWidth = moveMaxWidth;
113
- } //拉伸容器宽度不可小于初始宽度
87
+ }
88
+ //拉伸容器宽度不可小于初始宽度
114
89
  //判断拉伸宽度不可超过 拉伸容器宽度+变动的兄弟容器宽度或设置的最大宽度
115
-
116
-
117
90
  if (width > targetWidth && width <= maxWidth) {
118
91
  //左拉且有前兄弟节点即变化其宽度
119
92
  if (hasL && prevNode) {
120
93
  var newPrevWidth = prevWidth + (hasL ? disX : hasR ? -disX : 0);
121
94
  prevNode.style.width = newPrevWidth + 'px';
122
- } //右拉且有后兄弟节点即变化其宽度
123
-
124
-
95
+ }
96
+ //右拉且有后兄弟节点即变化其宽度
125
97
  if (hasR && nextNode) {
126
98
  var newNextWidth = nextWidth + (hasL ? disX : hasR ? -disX : 0);
127
99
  nextNode.style.width = newNextWidth + 'px';
128
- } //设置拉伸容器的宽度
129
-
130
-
100
+ }
101
+ //设置拉伸容器的宽度
131
102
  parent.style.width = width + "px";
132
103
  }
133
104
  }
134
-
135
105
  if (hasT || hasB) {
136
106
  var newHeight = initHeight + (hasT ? -disY : hasB ? disY : 0);
137
- var height = newHeight > 0 ? newHeight : 0; //获取兄弟节点需要变动的高度
138
-
107
+ var height = newHeight > 0 ? newHeight : 0;
108
+ //获取兄弟节点需要变动的高度
139
109
  var changeHeight = hasT ? prevHeight : hasB ? nextHeight : 0;
140
110
  var maxHeight = changeHeight + initHeight;
141
-
142
111
  if (moveMaxHeight > 0 && maxHeight > moveMaxHeight) {
143
112
  maxHeight = moveMaxHeight;
144
- } //拉伸容器高度不可小于初始高度
113
+ }
114
+ //拉伸容器高度不可小于初始高度
145
115
  //判断拉伸高度不可超过 拉伸容器高度+变动的兄弟容器高度或设置的最大高度
146
-
147
-
148
116
  if (height > targetHeight && height <= maxHeight) {
149
117
  //上拉且有前兄弟节点即变化其高度
150
118
  if (hasT && prevNode) {
151
119
  var newPrevHeight = prevHeight + (hasT ? disY : hasB ? -disY : 0);
152
120
  prevNode.style.height = newPrevHeight + 'px';
153
- } //下拉且有后兄弟节点即变化其高度
154
-
155
-
121
+ }
122
+ //下拉且有后兄弟节点即变化其高度
156
123
  if (hasB && nextNode) {
157
124
  var newNextHeight = nextHeight + (hasT ? disY : hasB ? -disY : 0);
158
125
  nextNode.style.height = newNextHeight + 'px';
159
- } //设置拉伸容器的高度
160
-
161
-
126
+ }
127
+ //设置拉伸容器的高度
162
128
  parent.style.height = height + "px";
163
129
  }
164
- } //鼠标按下
165
-
166
-
130
+ }
131
+ //鼠标按下
167
132
  if (dragMouseMove) dragMouseMove(e, direction);
168
133
  };
169
-
170
134
  document.onmouseup = function (e) {
171
- document.onmousemove = document.onmouseup = null; //鼠标按下
172
-
135
+ document.onmousemove = document.onmouseup = null;
136
+ //鼠标按下
173
137
  if (dragMouseUp) dragMouseUp(e, direction);
174
138
  };
175
139
  };
176
-
177
140
  return /*#__PURE__*/_react.default.createElement("div", {
178
141
  ref: divRef,
179
142
  className: (0, _classnames.default)("spec-grid-dragContent", className),
@@ -186,6 +149,5 @@ var DragContent = function DragContent(props) {
186
149
  });
187
150
  }));
188
151
  };
189
-
190
152
  var _default = DragContent;
191
153
  exports.default = _default;
@@ -3,18 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.lockChunk = lockChunk;
6
7
  exports.queryFileInfo = queryFileInfo;
7
8
  exports.uploadChunk = uploadChunk;
8
- exports.lockChunk = lockChunk;
9
-
10
9
  var _axios = _interopRequireDefault(require("axios"));
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
11
  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); } }
15
-
16
12
  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); }); }; }
17
-
18
13
  /**
19
14
  * 查询文件上传情况
20
15
  * @param {String} fileHash 文件内容Hash
@@ -23,10 +18,10 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
23
18
  */
24
19
  function queryFileInfo(_ref) {
25
20
  var fileHash = _ref.fileHash,
26
- fileName = _ref.fileName,
27
- size = _ref.size,
28
- sizeStr = _ref.sizeStr,
29
- chunksLength = _ref.chunksLength;
21
+ fileName = _ref.fileName,
22
+ size = _ref.size,
23
+ sizeStr = _ref.sizeStr,
24
+ chunksLength = _ref.chunksLength;
30
25
  console.log('queryFileInfo ==> 查询文件上传情况');
31
26
  return _axios.default.get('/getFileInfo', {
32
27
  params: {
@@ -41,14 +36,13 @@ function queryFileInfo(_ref) {
41
36
  return data;
42
37
  });
43
38
  }
39
+
44
40
  /**
45
41
  * 上传文件分片
46
42
  * @param {String} fileContentHash 文件的Hash
47
43
  * @param {Number} chunkIndex 分片序号
48
44
  * @param {Blob} chunk 文件分片
49
45
  */
50
-
51
-
52
46
  function uploadChunk(fileContentHash, chunkIndex, chunk) {
53
47
  var formData = new FormData();
54
48
  formData.append('fileContentHash', fileContentHash);
@@ -59,7 +53,6 @@ function uploadChunk(fileContentHash, chunkIndex, chunk) {
59
53
  return result;
60
54
  });
61
55
  }
62
-
63
56
  function lockChunk(fileHash, chunkIndex) {
64
57
  return _axios.default.post('/lockChunk', {
65
58
  fileHash: fileHash,
@@ -73,7 +66,6 @@ function lockChunk(fileHash, chunkIndex) {
73
66
  case 0:
74
67
  result = _ref4.data;
75
68
  return _context.abrupt("return", result);
76
-
77
69
  case 2:
78
70
  case "end":
79
71
  return _context.stop();
@@ -81,7 +73,6 @@ function lockChunk(fileHash, chunkIndex) {
81
73
  }
82
74
  }, _callee);
83
75
  }));
84
-
85
76
  return function (_x) {
86
77
  return _ref5.apply(this, arguments);
87
78
  };