dlt-for-react 1.1.3 → 1.1.5

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 (188) hide show
  1. package/README.md +9 -1
  2. package/lib/components/KyContainerFrame/index.js +46 -39
  3. package/lib/index.js +7 -1
  4. package/lib/layouts/Top/index.js +1 -1
  5. package/lib/layouts/layout/index.js +77 -31
  6. package/lib/layouts/mixTop/index.js +3 -3
  7. package/lib/utils/createUuid.js +31 -11
  8. package/lib/utils/getLoginUser.js +1 -1
  9. package/lib/utils/getSize.js +11 -2
  10. package/lib/utils/index.js +35 -2
  11. package/package.json +1 -1
  12. package/lib/components/Button/index.js +0 -79
  13. package/lib/components/NHAuditPanel/config/Axios.js +0 -263
  14. package/lib/components/NHAuditPanel/config/api.js +0 -479
  15. package/lib/components/NHAuditPanel/config/data.js +0 -156
  16. package/lib/components/NHAuditPanel/config/typeMap.js +0 -1234
  17. package/lib/components/NHAuditPanel/config/uiValidate.js +0 -92
  18. package/lib/components/NHAuditPanel/index.js +0 -413
  19. package/lib/components/NHAuditPanel/node.js +0 -619
  20. package/lib/components/NHCascader/index.js +0 -355
  21. package/lib/components/NHCheckboxGroup/index.js +0 -135
  22. package/lib/components/NHDynamicFormShow/baseInfo/index.js +0 -194
  23. package/lib/components/NHDynamicFormShow/custom/index.js +0 -553
  24. package/lib/components/NHDynamicFormShow/customModule/common/CommonMethod.js +0 -43
  25. package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/EditForm.js +0 -1113
  26. package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/index.js +0 -263
  27. package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/EditForm.js +0 -880
  28. package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/index.js +0 -171
  29. package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/EditForm.js +0 -865
  30. package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/index.js +0 -138
  31. package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/EditForm.js +0 -571
  32. package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/index.js +0 -147
  33. package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/EditForm.js +0 -474
  34. package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/index.js +0 -139
  35. package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/EditForm.js +0 -506
  36. package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/index.js +0 -143
  37. package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/EditForm.js +0 -1074
  38. package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/index.js +0 -172
  39. package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/EditForm.js +0 -927
  40. package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/index.js +0 -195
  41. package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/EditForm.js +0 -1064
  42. package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/index.js +0 -183
  43. package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/EditForm.js +0 -763
  44. package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/index.js +0 -137
  45. package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/EditForm.js +0 -819
  46. package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/index.js +0 -137
  47. package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/EditForm.js +0 -700
  48. package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/index.js +0 -162
  49. package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/EditForm.js +0 -743
  50. package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/index.js +0 -177
  51. package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/EditForm.js +0 -848
  52. package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/index.js +0 -138
  53. package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/EditForm.js +0 -777
  54. package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/index.js +0 -161
  55. package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/EditForm.js +0 -706
  56. package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/index.js +0 -130
  57. package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/cfjcEditForm.js +0 -413
  58. package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/index.js +0 -135
  59. package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/EditForm.js +0 -1013
  60. package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/index.js +0 -175
  61. package/lib/components/NHDynamicFormShow/customModule/jjrlx/EditForm.js +0 -1345
  62. package/lib/components/NHDynamicFormShow/customModule/jjrlx/index.js +0 -274
  63. package/lib/components/NHDynamicFormShow/customModule/jxj/EditForm.js +0 -669
  64. package/lib/components/NHDynamicFormShow/customModule/jxj/index.js +0 -134
  65. package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/EditForm.js +0 -378
  66. package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/index.js +0 -120
  67. package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/EditForm.js +0 -638
  68. package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/index.js +0 -133
  69. package/lib/components/NHDynamicFormShow/customModule/qgzx/EditForm.js +0 -965
  70. package/lib/components/NHDynamicFormShow/customModule/qgzx/index.js +0 -237
  71. package/lib/components/NHDynamicFormShow/customModule/qjgl/EditForm.js +0 -823
  72. package/lib/components/NHDynamicFormShow/customModule/qjgl/index.js +0 -188
  73. package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/EditForm.js +0 -401
  74. package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/index.js +0 -472
  75. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/EditForm.js +0 -304
  76. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHCascader/index.js +0 -375
  77. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/RadioGroup.js +0 -118
  78. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/index.js +0 -62
  79. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/input-const.js +0 -55
  80. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/render.js +0 -1238
  81. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/index.js +0 -375
  82. package/lib/components/NHDynamicFormShow/customModule/rych/collective/EditForm.js +0 -554
  83. package/lib/components/NHDynamicFormShow/customModule/rych/collective/index.js +0 -130
  84. package/lib/components/NHDynamicFormShow/customModule/rych/personal/EditForm.js +0 -542
  85. package/lib/components/NHDynamicFormShow/customModule/rych/personal/index.js +0 -133
  86. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/EditForm.js +0 -575
  87. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/index.js +0 -130
  88. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/EditForm.js +0 -563
  89. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/index.js +0 -133
  90. package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/EditForm.js +0 -745
  91. package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/index.js +0 -164
  92. package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/EditForm.js +0 -587
  93. package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/index.js +0 -143
  94. package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/EditForm.js +0 -743
  95. package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/index.js +0 -172
  96. package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/EditForm.js +0 -1410
  97. package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/index.js +0 -274
  98. package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/EditForm.js +0 -755
  99. package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/index.js +0 -130
  100. package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/EditForm.js +0 -814
  101. package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/index.js +0 -188
  102. package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/EditForm.js +0 -769
  103. package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/index.js +0 -130
  104. package/lib/components/NHDynamicFormShow/customModule/whgcrych/EditForm.js +0 -1004
  105. package/lib/components/NHDynamicFormShow/customModule/whgcrych/index.js +0 -126
  106. package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/EditForm.js +0 -503
  107. package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/index.js +0 -149
  108. package/lib/components/NHDynamicFormShow/customModule/whtlyhk/EditForm.js +0 -379
  109. package/lib/components/NHDynamicFormShow/customModule/whtlyhk/index.js +0 -148
  110. package/lib/components/NHDynamicFormShow/customModule/whtlzxj/EditForm.js +0 -748
  111. package/lib/components/NHDynamicFormShow/customModule/whtlzxj/index.js +0 -135
  112. package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/EditForm.js +0 -762
  113. package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/index.js +0 -134
  114. package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/cfjcEditForm.js +0 -682
  115. package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/index.js +0 -135
  116. package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/index.js +0 -152
  117. package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/wjsbEditForm.js +0 -783
  118. package/lib/components/NHDynamicFormShow/customModule/zxj/EditForm.js +0 -764
  119. package/lib/components/NHDynamicFormShow/customModule/zxj/index.js +0 -138
  120. package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/cfjcEditForm.js +0 -677
  121. package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/index.js +0 -138
  122. package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/EditForm.js +0 -1173
  123. package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/index.js +0 -242
  124. package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistForm.js +0 -862
  125. package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistIndex.js +0 -201
  126. package/lib/components/NHDynamicFormShow/customModule/zzsd/stuinfo/messageInfo.js +0 -196
  127. package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/index.js +0 -167
  128. package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/wjsbEditForm.js +0 -1096
  129. package/lib/components/NHDynamicFormShow/index.js +0 -647
  130. package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/cardItem/index.js +0 -279
  131. package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/index.js +0 -206
  132. package/lib/components/NHDynamicFormShow/oneOnMany/index.js +0 -419
  133. package/lib/components/NHDynamicFormShow/oneOnOne/EditForm.js +0 -401
  134. package/lib/components/NHDynamicFormShow/oneOnOne/index.js +0 -271
  135. package/lib/components/NHImagePicker/index.js +0 -554
  136. package/lib/components/NHInputPicker/RadioGroup.js +0 -118
  137. package/lib/components/NHInputPicker/index.js +0 -62
  138. package/lib/components/NHInputPicker/input-const.js +0 -55
  139. package/lib/components/NHInputPicker/render.js +0 -1271
  140. package/lib/components/NHListView/index.js +0 -374
  141. package/lib/components/NHMapGeolocation/index.js +0 -537
  142. package/lib/components/NHMapGeolocation/initMap/initGdMap.js +0 -104
  143. package/lib/components/NHMapGeolocation/initMap/initTencentMap.js +0 -138
  144. package/lib/components/NHMapGeolocation/style.js +0 -51
  145. package/lib/components/NHMultiSelect/index.js +0 -272
  146. package/lib/components/NHRadioGroup/index.js +0 -118
  147. package/lib/components/NHSelect/index.js +0 -364
  148. package/lib/components/NHTreeMenu/index.js +0 -126
  149. package/lib/components/NHTreeMenu/treeNode.js +0 -164
  150. package/lib/components/StuSelector/index.js +0 -611
  151. package/lib/layouts/KyInputPicker/edit-page.js +0 -585
  152. package/lib/layouts/KyInputPicker/index.js +0 -220
  153. package/lib/layouts/KyInputPicker/input-const.js +0 -134
  154. package/lib/layouts/KyInputPicker/render.js +0 -2477
  155. package/lib/layouts/KyInputPicker/setting-checkbox.js +0 -850
  156. package/lib/layouts/KyInputPicker/setting-datepicker.js +0 -430
  157. package/lib/layouts/KyInputPicker/setting-datetimepicker.js +0 -443
  158. package/lib/layouts/KyInputPicker/setting-input.js +0 -555
  159. package/lib/layouts/KyInputPicker/setting-inputNumber.js +0 -612
  160. package/lib/layouts/KyInputPicker/setting-monthpicker.js +0 -434
  161. package/lib/layouts/KyInputPicker/setting-multiSelect.js +0 -532
  162. package/lib/layouts/KyInputPicker/setting-nhcascader.js +0 -584
  163. package/lib/layouts/KyInputPicker/setting-old-upload.js +0 -428
  164. package/lib/layouts/KyInputPicker/setting-radio.js +0 -468
  165. package/lib/layouts/KyInputPicker/setting-rangepicker.js +0 -466
  166. package/lib/layouts/KyInputPicker/setting-select.js +0 -534
  167. package/lib/layouts/KyInputPicker/setting-stu-selector.js +0 -507
  168. package/lib/layouts/KyInputPicker/setting-switch.js +0 -274
  169. package/lib/layouts/KyInputPicker/setting-tea-selector.js +0 -507
  170. package/lib/layouts/KyInputPicker/setting-textarea.js +0 -619
  171. package/lib/layouts/KyInputPicker/setting-timepicker.js +0 -437
  172. package/lib/layouts/KyInputPicker/setting-upload.js +0 -766
  173. package/lib/layouts/KyModal/buildTitle.js +0 -81
  174. package/lib/layouts/KyModal/dragM.js +0 -127
  175. package/lib/layouts/KyModal/index.js +0 -321
  176. package/lib/layouts/KyPreview/index.js +0 -219
  177. package/lib/layouts/KyUpload/index.js +0 -1155
  178. package/lib/utils/browserJudge.js +0 -33
  179. package/lib/utils/dynamicLoadCss.js +0 -14
  180. package/lib/utils/dynamicLoadJs.js +0 -21
  181. package/lib/utils/getStyle.js +0 -26
  182. package/lib/utils/getSuitHeight.js +0 -49
  183. package/lib/utils/hasAuth.js +0 -11
  184. package/lib/utils/loadJS.js +0 -40
  185. /package/lib/layouts/{login → Login}/index-pre.js +0 -0
  186. /package/lib/layouts/{login → Login}/index.js +0 -0
  187. /package/lib/layouts/{login → Login}/login.js +0 -0
  188. /package/lib/layouts/{login → Login}/lyPassword.js +0 -0
@@ -1,81 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
8
-
9
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
10
-
11
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
12
-
13
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
14
-
15
- var _createClass2 = require('babel-runtime/helpers/createClass');
16
-
17
- var _createClass3 = _interopRequireDefault(_createClass2);
18
-
19
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
20
-
21
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
22
-
23
- var _inherits2 = require('babel-runtime/helpers/inherits');
24
-
25
- var _inherits3 = _interopRequireDefault(_inherits2);
26
-
27
- var _react = require('react');
28
-
29
- var _react2 = _interopRequireDefault(_react);
30
-
31
- var _dragM = require('./dragM');
32
-
33
- var _dragM2 = _interopRequireDefault(_dragM);
34
-
35
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36
-
37
- var BuildTitle = function (_React$Component) {
38
- (0, _inherits3.default)(BuildTitle, _React$Component);
39
-
40
- function BuildTitle() {
41
- var _ref;
42
-
43
- var _temp, _this, _ret;
44
-
45
- (0, _classCallCheck3.default)(this, BuildTitle);
46
-
47
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
48
- args[_key] = arguments[_key];
49
- }
50
-
51
- return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = BuildTitle.__proto__ || (0, _getPrototypeOf2.default)(BuildTitle)).call.apply(_ref, [this].concat(args))), _this), _this.updateTransform = function (transformStr) {
52
- _this.modalDom.style.transform = transformStr;
53
- }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
54
- }
55
-
56
- (0, _createClass3.default)(BuildTitle, [{
57
- key: 'componentDidMount',
58
- value: function componentDidMount() {
59
- var modalList = document.getElementsByClassName('ant-modal'); //modal的class是ant-modal
60
- this.modalDom = modalList[modalList.length - 1];
61
- }
62
- }, {
63
- key: 'render',
64
- value: function render() {
65
- var title = this.props.title;
66
-
67
- return _react2.default.createElement(
68
- _dragM2.default,
69
- { updateTransform: this.updateTransform },
70
- _react2.default.createElement(
71
- 'div',
72
- null,
73
- title
74
- )
75
- );
76
- }
77
- }]);
78
- return BuildTitle;
79
- }(_react2.default.Component);
80
-
81
- exports.default = BuildTitle;
@@ -1,127 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _extends2 = require('babel-runtime/helpers/extends');
8
-
9
- var _extends3 = _interopRequireDefault(_extends2);
10
-
11
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
12
-
13
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
14
-
15
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
16
-
17
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
18
-
19
- var _createClass2 = require('babel-runtime/helpers/createClass');
20
-
21
- var _createClass3 = _interopRequireDefault(_createClass2);
22
-
23
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
24
-
25
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
26
-
27
- var _inherits2 = require('babel-runtime/helpers/inherits');
28
-
29
- var _inherits3 = _interopRequireDefault(_inherits2);
30
-
31
- var _react = require('react');
32
-
33
- var _react2 = _interopRequireDefault(_react);
34
-
35
- var _propTypes = require('prop-types');
36
-
37
- var _propTypes2 = _interopRequireDefault(_propTypes);
38
-
39
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
-
41
- var DragM = function (_React$Component) {
42
- (0, _inherits3.default)(DragM, _React$Component);
43
-
44
- function DragM() {
45
- var _ref;
46
-
47
- var _temp, _this, _ret;
48
-
49
- (0, _classCallCheck3.default)(this, DragM);
50
-
51
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
52
- args[_key] = arguments[_key];
53
- }
54
-
55
- return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = DragM.__proto__ || (0, _getPrototypeOf2.default)(DragM)).call.apply(_ref, [this].concat(args))), _this), _this.position = {
56
- startX: 0,
57
- startY: 0,
58
- dx: 0,
59
- dy: 0,
60
- tx: 0,
61
- ty: 0
62
- }, _this.start = function (event) {
63
- if (event.button != 0) {
64
- //只允许左键,右键问题在于不选择conextmenu就不会触发mouseup事件
65
- return;
66
- }
67
- document.addEventListener('mousemove', _this.docMove);
68
- _this.position.startX = event.pageX - _this.position.dx;
69
- _this.position.startY = event.pageY - _this.position.dy;
70
- }, _this.docMove = function (event) {
71
- var tx = event.pageX - _this.position.startX;
72
- var ty = event.pageY - _this.position.startY;
73
- var transformStr = 'translate(' + tx + 'px,' + ty + 'px)';
74
- _this.props.updateTransform(transformStr, tx, ty, _this.tdom);
75
- _this.position.dx = tx;
76
- _this.position.dy = ty;
77
- }, _this.docMouseUp = function (event) {
78
- document.removeEventListener('mousemove', _this.docMove);
79
- }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
80
- }
81
-
82
- (0, _createClass3.default)(DragM, [{
83
- key: 'componentDidMount',
84
- value: function componentDidMount() {
85
- this.tdom.addEventListener('mousedown', this.start);
86
- //用document移除对mousemove事件的监听
87
- document.addEventListener('mouseup', this.docMouseUp);
88
- }
89
- }, {
90
- key: 'componentWillUnmount',
91
- value: function componentWillUnmount() {
92
- this.tdom.removeEventListener('mousedown', this.start);
93
- document.removeEventListener('mouseup', this.docMouseUp);
94
- document.removeEventListener('mousemove', this.docMove);
95
- }
96
- }, {
97
- key: 'render',
98
- value: function render() {
99
- var _this2 = this;
100
-
101
- var children = this.props.children;
102
-
103
- var newStyle = (0, _extends3.default)({}, children.props.style, {
104
- cursor: 'move',
105
- userSelect: 'none'
106
- });
107
- return _react2.default.cloneElement(_react2.default.Children.only(children), {
108
- ref: function ref(tdom) {
109
- return _this2.tdom = tdom;
110
- },
111
- style: newStyle
112
- });
113
- }
114
- }]);
115
- return DragM;
116
- }(_react2.default.Component);
117
-
118
- DragM.propTypes = {
119
- children: _propTypes2.default.element.isRequired
120
- };
121
- DragM.defaultProps = {
122
- //默认是移动children dom,覆盖该方法,可以把tranform行为同步给外部
123
- updateTransform: function updateTransform(transformStr, tx, ty, tdom) {
124
- tdom.style.transform = transformStr;
125
- }
126
- };
127
- exports.default = DragM;
@@ -1,321 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.KyModal = undefined;
7
-
8
- var _button = require('antd/lib/button');
9
-
10
- var _button2 = _interopRequireDefault(_button);
11
-
12
- var _getIterator2 = require('babel-runtime/core-js/get-iterator');
13
-
14
- var _getIterator3 = _interopRequireDefault(_getIterator2);
15
-
16
- var _modal = require('antd/lib/modal');
17
-
18
- var _modal2 = _interopRequireDefault(_modal);
19
-
20
- var _extends2 = require('babel-runtime/helpers/extends');
21
-
22
- var _extends3 = _interopRequireDefault(_extends2);
23
-
24
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
25
-
26
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
27
-
28
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
29
-
30
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
31
-
32
- var _createClass2 = require('babel-runtime/helpers/createClass');
33
-
34
- var _createClass3 = _interopRequireDefault(_createClass2);
35
-
36
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
37
-
38
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
39
-
40
- var _inherits2 = require('babel-runtime/helpers/inherits');
41
-
42
- var _inherits3 = _interopRequireDefault(_inherits2);
43
-
44
- require('antd/lib/button/style');
45
-
46
- require('antd/lib/modal/style');
47
-
48
- var _react = require('react');
49
-
50
- var _react2 = _interopRequireDefault(_react);
51
-
52
- var _reactCustomScrollbars = require('react-custom-scrollbars');
53
-
54
- var _propTypes = require('prop-types');
55
-
56
- var _propTypes2 = _interopRequireDefault(_propTypes);
57
-
58
- var _buildTitle = require('./buildTitle');
59
-
60
- var _buildTitle2 = _interopRequireDefault(_buildTitle);
61
-
62
- require('../../../assets/components/KyModal/index.less');
63
-
64
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65
-
66
- //Modal的最大宽度、高度为屏幕宽度、高度的2/3
67
- var maxWidth = window.screen.width * 2 / 3; /**
68
- * @Description: 对话框二次封装
69
- * @Version: 1.0
70
- * @Author: 琴时
71
- * @Date: 2022-04-24 17:00:53
72
- * @LastEditors: 琴时
73
- * @LastEditTime: 2022-06-06 10:07:04
74
- * Modify log:
75
- * 1、解决控制台警告问题;
76
- * 2、对话框居中;
77
- * 3、点击保存按钮后,保存按钮默认变成loading状态,可在onOk回调方法中调用回调函数stopLoading来终止按钮的loading状态;
78
- */
79
-
80
- var maxHeight = window.screen.height * 2 / 3;
81
-
82
- var KyModal = exports.KyModal = function (_React$Component) {
83
- (0, _inherits3.default)(KyModal, _React$Component);
84
-
85
- function KyModal(props) {
86
- (0, _classCallCheck3.default)(this, KyModal);
87
-
88
- var _this = (0, _possibleConstructorReturn3.default)(this, (KyModal.__proto__ || (0, _getPrototypeOf2.default)(KyModal)).call(this, props));
89
-
90
- _this.show = function () {
91
- _this.setState({ visible: true });
92
- };
93
-
94
- _this.close = function () {
95
- _this.setState({ visible: false, confirmLoading: false });
96
- };
97
-
98
- _this.stopLoading = function () {
99
- _this.setState({ confirmLoading: false });
100
- };
101
-
102
- _this.handleOk = function () {
103
- _this.setState({ confirmLoading: true });
104
- _this.props.onOk(_this.stopLoading);
105
- };
106
-
107
- _this.handleCancel = function () {
108
- _this.close();
109
- _this.props.onCancel();
110
- };
111
-
112
- _this.state = {
113
- visible: false, //默认不可见
114
- confirmLoading: false //确定按钮 loading
115
- };
116
- return _this;
117
- }
118
-
119
- //显示
120
-
121
-
122
- //关闭
123
-
124
-
125
- //隐藏加载动画
126
-
127
-
128
- //确认
129
-
130
-
131
- //取消
132
-
133
-
134
- (0, _createClass3.default)(KyModal, [{
135
- key: 'render',
136
- value: function render() {
137
- var _state = this.state,
138
- visible = _state.visible,
139
- confirmLoading = _state.confirmLoading;
140
- var _props = this.props,
141
- title = _props.title,
142
- style = _props.style,
143
- bodyStyle = _props.bodyStyle,
144
- maxSize = _props.maxSize,
145
- destroyOnClose = _props.destroyOnClose,
146
- footer = _props.footer,
147
- afterClose = _props.afterClose,
148
- drag = _props.drag,
149
- okText = _props.okText,
150
- cancelText = _props.cancelText,
151
- height = _props.height;
152
-
153
- var width = this.props.width;
154
- var _title = title && drag ? _react2.default.createElement(_buildTitle2.default, { visible: visible, title: title }) : title;
155
- if (maxSize) {
156
- width = maxWidth;
157
- } else if (width > maxWidth) {
158
- width = maxWidth;
159
- }
160
- if (!visible) return null;
161
- //如果未定义页脚按钮,则使用默认按钮
162
- if (!footer) {
163
- return _react2.default.createElement(
164
- _modal2.default,
165
- (0, _extends3.default)({}, this.props, {
166
- title: _title,
167
- style: style,
168
- bodyStyle: bodyStyle,
169
- visible: visible,
170
- width: width,
171
- okText: okText,
172
- onOk: this.handleOk,
173
- cancelText: cancelText,
174
- onCancel: this.handleCancel,
175
- wrapClassName: 'vertical-center-modal',
176
- confirmLoading: confirmLoading,
177
- maskClosable: false,
178
- destroyOnClose: destroyOnClose,
179
- afterClose: afterClose
180
- }),
181
- _react2.default.createElement(
182
- 'div',
183
- { style: { maxHeight: height || maxHeight } },
184
- _react2.default.createElement(
185
- _reactCustomScrollbars.Scrollbars,
186
- { autoHide: true, autoHeight: true, autoHeightMax: maxHeight, style: { width: '100%' } },
187
- this.props.children
188
- )
189
- )
190
- );
191
- } else {
192
- //如果footer为null,则不显示页脚按钮
193
- var buttons = [];
194
- if (footer && footer.length > 0) {
195
- var buttonKey = 0;
196
- var _iteratorNormalCompletion = true;
197
- var _didIteratorError = false;
198
- var _iteratorError = undefined;
199
-
200
- try {
201
- for (var _iterator = (0, _getIterator3.default)(footer), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
202
- var buttonParam = _step.value;
203
-
204
- //text:按钮描述,type:按钮类型,icon:按钮图标,loading:加载状态,onClick:按钮点击事件
205
- var _buttonParam$text = buttonParam.text,
206
- text = _buttonParam$text === undefined ? '' : _buttonParam$text,
207
- _buttonParam$type = buttonParam.type,
208
- type = _buttonParam$type === undefined ? 'primary' : _buttonParam$type,
209
- _buttonParam$icon = buttonParam.icon,
210
- icon = _buttonParam$icon === undefined ? '' : _buttonParam$icon,
211
- _buttonParam$loading = buttonParam.loading,
212
- loading = _buttonParam$loading === undefined ? false : _buttonParam$loading,
213
- _buttonParam$onClick = buttonParam.onClick,
214
- onClick = _buttonParam$onClick === undefined ? function () {} : _buttonParam$onClick,
215
- _buttonParam$disabled = buttonParam.disabled,
216
- disabled = _buttonParam$disabled === undefined ? false : _buttonParam$disabled;
217
-
218
- var customButton = _react2.default.createElement(
219
- _button2.default,
220
- {
221
- key: buttonKey,
222
- type: type,
223
- icon: icon,
224
- loading: loading,
225
- onClick: onClick,
226
- disabled: disabled
227
- },
228
- text
229
- );
230
- buttons.push(customButton);
231
- buttonKey++;
232
- }
233
- } catch (err) {
234
- _didIteratorError = true;
235
- _iteratorError = err;
236
- } finally {
237
- try {
238
- if (!_iteratorNormalCompletion && _iterator.return) {
239
- _iterator.return();
240
- }
241
- } finally {
242
- if (_didIteratorError) {
243
- throw _iteratorError;
244
- }
245
- }
246
- }
247
- } else {
248
- buttons = null;
249
- }
250
-
251
- return _react2.default.createElement(
252
- _modal2.default,
253
- (0, _extends3.default)({}, this.props, {
254
- title: title,
255
- style: style,
256
- bodyStyle: bodyStyle,
257
- visible: visible,
258
- width: width,
259
- footer: buttons,
260
- onCancel: this.handleCancel,
261
- wrapClassName: 'vertical-center-modal',
262
- confirmLoading: confirmLoading,
263
- maskClosable: false,
264
- destroyOnClose: destroyOnClose,
265
- afterClose: afterClose
266
- }),
267
- _react2.default.createElement(
268
- 'div',
269
- { style: { maxHeight: maxHeight } },
270
- _react2.default.createElement(
271
- _reactCustomScrollbars.Scrollbars,
272
- { autoHide: true, autoHeight: true, autoHeightMax: maxHeight, style: { width: '100%' } },
273
- this.props.children
274
- )
275
- )
276
- );
277
- }
278
- }
279
- }]);
280
- return KyModal;
281
- }(_react2.default.Component);
282
-
283
- /**
284
- * KyModal默认属性
285
- */
286
-
287
-
288
- KyModal.defaultProps = {
289
- title: '标题',
290
- cancelText: '取消',
291
- okText: '确定',
292
- width: 520, //默认最小宽度
293
- maxSize: false, //是否最大化窗口
294
- height: undefined, //高度
295
- destroyOnClose: true, //关闭时销毁 Modal 里的子元素
296
- onOk: function onOk() {},
297
- onCancel: function onCancel() {},
298
- afterClose: function afterClose() {},
299
- drag: true
300
- };
301
-
302
- /**
303
- * KyModal属性检查
304
- */
305
- KyModal.propTypes = {
306
- title: _propTypes2.default.string, //对话框标题
307
- cancelText: _propTypes2.default.string, //返回按钮文字
308
- okText: _propTypes2.default.string, //确认按钮文字
309
- style: _propTypes2.default.object, //对话框样式
310
- bodyStyle: _propTypes2.default.object, //Modal body 样式
311
- width: _propTypes2.default.number, //宽度
312
- maxSize: _propTypes2.default.bool, //最大化窗口
313
- footer: _propTypes2.default.arrayOf(_propTypes2.default.object), //按钮组
314
- destroyOnClose: _propTypes2.default.bool, //关闭时销毁对话框内子元素
315
- onOk: _propTypes2.default.func, //保存事件回调方法
316
- onCancel: _propTypes2.default.func, //返回事件回调方法
317
- afterClose: _propTypes2.default.func, //Modal 完全关闭后的回调
318
- drag: _propTypes2.default.bool // 是否可拖拽
319
- };
320
-
321
- exports.default = KyModal;