dlt-for-react 1.0.24 → 1.1.1

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 (212) hide show
  1. package/README.md +12 -2
  2. package/lib/components/Button/index.js +79 -0
  3. package/lib/components/HqSelector/HqLsrySelector/index.js +3 -5
  4. package/lib/components/HqSelector/HqRySelector/index.js +3 -5
  5. package/lib/components/HqSelector/HqWzSelector/index.js +3 -5
  6. package/lib/components/KyEditableTable/component.js +3 -5
  7. package/lib/components/KyEditableTable/index.js +7 -13
  8. package/lib/components/KyExcel/index.js +3 -5
  9. package/lib/components/KyInputPicker/render.js +13 -43
  10. package/lib/components/KyInputPicker/setting-checkbox.js +3 -5
  11. package/lib/components/KyInputPicker/setting-multiSelect.js +3 -5
  12. package/lib/components/KyInputPicker/setting-nhcascader.js +3 -5
  13. package/lib/components/KyInputPicker/setting-select.js +3 -5
  14. package/lib/components/KyInputPicker/setting-stu-selector.js +3 -5
  15. package/lib/components/KyInputPicker/setting-tea-selector.js +3 -5
  16. package/lib/components/KyTable/checkButtons.js +4 -7
  17. package/lib/components/KyTree/index.js +6 -16
  18. package/lib/components/KyUpload/index.js +10 -20
  19. package/lib/components/NHAuditPanel/config/Axios.js +263 -0
  20. package/lib/components/NHAuditPanel/config/api.js +479 -0
  21. package/lib/components/NHAuditPanel/config/data.js +156 -0
  22. package/lib/components/NHAuditPanel/config/typeMap.js +1234 -0
  23. package/lib/components/NHAuditPanel/config/uiValidate.js +92 -0
  24. package/lib/components/NHAuditPanel/index.js +413 -0
  25. package/lib/components/NHAuditPanel/node.js +619 -0
  26. package/lib/components/NHCascader/index.js +355 -0
  27. package/lib/components/NHCheckboxGroup/index.js +135 -0
  28. package/lib/components/NHDynamicFormShow/baseInfo/index.js +194 -0
  29. package/lib/components/NHDynamicFormShow/custom/index.js +553 -0
  30. package/lib/components/NHDynamicFormShow/customModule/common/CommonMethod.js +43 -0
  31. package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/EditForm.js +1113 -0
  32. package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/index.js +263 -0
  33. package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/EditForm.js +880 -0
  34. package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/index.js +171 -0
  35. package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/EditForm.js +865 -0
  36. package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/index.js +138 -0
  37. package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/EditForm.js +571 -0
  38. package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/index.js +147 -0
  39. package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/EditForm.js +474 -0
  40. package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/index.js +139 -0
  41. package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/EditForm.js +506 -0
  42. package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/index.js +143 -0
  43. package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/EditForm.js +1074 -0
  44. package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/index.js +172 -0
  45. package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/EditForm.js +927 -0
  46. package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/index.js +195 -0
  47. package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/EditForm.js +1064 -0
  48. package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/index.js +183 -0
  49. package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/EditForm.js +763 -0
  50. package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/index.js +137 -0
  51. package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/EditForm.js +819 -0
  52. package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/index.js +137 -0
  53. package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/EditForm.js +700 -0
  54. package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/index.js +162 -0
  55. package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/EditForm.js +743 -0
  56. package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/index.js +177 -0
  57. package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/EditForm.js +848 -0
  58. package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/index.js +138 -0
  59. package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/EditForm.js +777 -0
  60. package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/index.js +161 -0
  61. package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/EditForm.js +706 -0
  62. package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/index.js +130 -0
  63. package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/cfjcEditForm.js +413 -0
  64. package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/index.js +135 -0
  65. package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/EditForm.js +1013 -0
  66. package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/index.js +175 -0
  67. package/lib/components/NHDynamicFormShow/customModule/jjrlx/EditForm.js +1345 -0
  68. package/lib/components/NHDynamicFormShow/customModule/jjrlx/index.js +274 -0
  69. package/lib/components/NHDynamicFormShow/customModule/jxj/EditForm.js +669 -0
  70. package/lib/components/NHDynamicFormShow/customModule/jxj/index.js +134 -0
  71. package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/EditForm.js +378 -0
  72. package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/index.js +120 -0
  73. package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/EditForm.js +638 -0
  74. package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/index.js +133 -0
  75. package/lib/components/NHDynamicFormShow/customModule/qgzx/EditForm.js +965 -0
  76. package/lib/components/NHDynamicFormShow/customModule/qgzx/index.js +237 -0
  77. package/lib/components/NHDynamicFormShow/customModule/qjgl/EditForm.js +823 -0
  78. package/lib/components/NHDynamicFormShow/customModule/qjgl/index.js +188 -0
  79. package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/EditForm.js +401 -0
  80. package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/index.js +472 -0
  81. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/EditForm.js +304 -0
  82. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHCascader/index.js +375 -0
  83. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/RadioGroup.js +118 -0
  84. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/index.js +62 -0
  85. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/input-const.js +55 -0
  86. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/render.js +1238 -0
  87. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/index.js +375 -0
  88. package/lib/components/NHDynamicFormShow/customModule/rych/collective/EditForm.js +554 -0
  89. package/lib/components/NHDynamicFormShow/customModule/rych/collective/index.js +130 -0
  90. package/lib/components/NHDynamicFormShow/customModule/rych/personal/EditForm.js +542 -0
  91. package/lib/components/NHDynamicFormShow/customModule/rych/personal/index.js +133 -0
  92. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/EditForm.js +575 -0
  93. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/index.js +130 -0
  94. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/EditForm.js +563 -0
  95. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/index.js +133 -0
  96. package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/EditForm.js +745 -0
  97. package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/index.js +164 -0
  98. package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/EditForm.js +587 -0
  99. package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/index.js +143 -0
  100. package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/EditForm.js +743 -0
  101. package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/index.js +172 -0
  102. package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/EditForm.js +1410 -0
  103. package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/index.js +274 -0
  104. package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/EditForm.js +755 -0
  105. package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/index.js +130 -0
  106. package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/EditForm.js +814 -0
  107. package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/index.js +188 -0
  108. package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/EditForm.js +769 -0
  109. package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/index.js +130 -0
  110. package/lib/components/NHDynamicFormShow/customModule/whgcrych/EditForm.js +1004 -0
  111. package/lib/components/NHDynamicFormShow/customModule/whgcrych/index.js +126 -0
  112. package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/EditForm.js +503 -0
  113. package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/index.js +149 -0
  114. package/lib/components/NHDynamicFormShow/customModule/whtlyhk/EditForm.js +379 -0
  115. package/lib/components/NHDynamicFormShow/customModule/whtlyhk/index.js +148 -0
  116. package/lib/components/NHDynamicFormShow/customModule/whtlzxj/EditForm.js +748 -0
  117. package/lib/components/NHDynamicFormShow/customModule/whtlzxj/index.js +135 -0
  118. package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/EditForm.js +762 -0
  119. package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/index.js +134 -0
  120. package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/cfjcEditForm.js +682 -0
  121. package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/index.js +135 -0
  122. package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/index.js +152 -0
  123. package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/wjsbEditForm.js +783 -0
  124. package/lib/components/NHDynamicFormShow/customModule/zxj/EditForm.js +764 -0
  125. package/lib/components/NHDynamicFormShow/customModule/zxj/index.js +138 -0
  126. package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/cfjcEditForm.js +677 -0
  127. package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/index.js +138 -0
  128. package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/EditForm.js +1173 -0
  129. package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/index.js +242 -0
  130. package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistForm.js +862 -0
  131. package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistIndex.js +201 -0
  132. package/lib/components/NHDynamicFormShow/customModule/zzsd/stuinfo/messageInfo.js +196 -0
  133. package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/index.js +167 -0
  134. package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/wjsbEditForm.js +1096 -0
  135. package/lib/components/NHDynamicFormShow/index.js +647 -0
  136. package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/cardItem/index.js +279 -0
  137. package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/index.js +206 -0
  138. package/lib/components/NHDynamicFormShow/oneOnMany/index.js +419 -0
  139. package/lib/components/NHDynamicFormShow/oneOnOne/EditForm.js +401 -0
  140. package/lib/components/NHDynamicFormShow/oneOnOne/index.js +271 -0
  141. package/lib/components/NHImagePicker/index.js +554 -0
  142. package/lib/components/NHInputPicker/RadioGroup.js +118 -0
  143. package/lib/components/NHInputPicker/index.js +62 -0
  144. package/lib/components/NHInputPicker/input-const.js +55 -0
  145. package/lib/components/NHInputPicker/render.js +1271 -0
  146. package/lib/components/NHListView/index.js +374 -0
  147. package/lib/components/NHMapGeolocation/index.js +537 -0
  148. package/lib/components/NHMapGeolocation/initMap/initGdMap.js +104 -0
  149. package/lib/components/NHMapGeolocation/initMap/initTencentMap.js +138 -0
  150. package/lib/components/NHMapGeolocation/style.js +51 -0
  151. package/lib/components/NHMultiSelect/index.js +272 -0
  152. package/lib/components/NHRadioGroup/index.js +118 -0
  153. package/lib/components/NHSelect/index.js +364 -0
  154. package/lib/components/NHTreeMenu/index.js +126 -0
  155. package/lib/components/NHTreeMenu/treeNode.js +164 -0
  156. package/lib/components/StuSelector/index.js +611 -0
  157. package/lib/index.js +187 -118
  158. package/lib/layouts/KyInputPicker/edit-page.js +585 -0
  159. package/lib/layouts/KyInputPicker/index.js +220 -0
  160. package/lib/layouts/KyInputPicker/input-const.js +134 -0
  161. package/lib/layouts/KyInputPicker/render.js +2477 -0
  162. package/lib/layouts/KyInputPicker/setting-checkbox.js +850 -0
  163. package/lib/layouts/KyInputPicker/setting-datepicker.js +430 -0
  164. package/lib/layouts/KyInputPicker/setting-datetimepicker.js +443 -0
  165. package/lib/layouts/KyInputPicker/setting-input.js +555 -0
  166. package/lib/layouts/KyInputPicker/setting-inputNumber.js +612 -0
  167. package/lib/layouts/KyInputPicker/setting-monthpicker.js +434 -0
  168. package/lib/layouts/KyInputPicker/setting-multiSelect.js +532 -0
  169. package/lib/layouts/KyInputPicker/setting-nhcascader.js +584 -0
  170. package/lib/layouts/KyInputPicker/setting-old-upload.js +428 -0
  171. package/lib/layouts/KyInputPicker/setting-radio.js +468 -0
  172. package/lib/layouts/KyInputPicker/setting-rangepicker.js +466 -0
  173. package/lib/layouts/KyInputPicker/setting-select.js +534 -0
  174. package/lib/layouts/KyInputPicker/setting-stu-selector.js +507 -0
  175. package/lib/layouts/KyInputPicker/setting-switch.js +274 -0
  176. package/lib/layouts/KyInputPicker/setting-tea-selector.js +507 -0
  177. package/lib/layouts/KyInputPicker/setting-textarea.js +619 -0
  178. package/lib/layouts/KyInputPicker/setting-timepicker.js +437 -0
  179. package/lib/layouts/KyInputPicker/setting-upload.js +766 -0
  180. package/lib/layouts/KyModal/buildTitle.js +81 -0
  181. package/lib/layouts/KyModal/dragM.js +127 -0
  182. package/lib/layouts/KyModal/index.js +321 -0
  183. package/lib/layouts/KyPreview/index.js +219 -0
  184. package/lib/layouts/KyUpload/index.js +1155 -0
  185. package/lib/layouts/LeftMenu/index.js +5 -11
  186. package/lib/layouts/NavigationBar/index.js +4 -10
  187. package/lib/layouts/Top/editPassWord.js +5 -7
  188. package/lib/layouts/Top/index.js +6 -20
  189. package/lib/layouts/TopMenu/index.js +11 -14
  190. package/lib/layouts/layout/index.js +7 -13
  191. package/lib/layouts/{Login → login}/index-pre.js +3 -5
  192. package/lib/layouts/{Login → login}/index.js +6 -8
  193. package/lib/layouts/{Login → login}/login.js +8 -17
  194. package/lib/layouts/mixTop/index.js +13 -28
  195. package/lib/layouts/settingDrawer/index.js +3 -5
  196. package/lib/routes/AuthorizedRoute.js +7 -13
  197. package/lib/utils/NHCore.js +46 -2
  198. package/lib/utils/browserJudge.js +33 -0
  199. package/lib/utils/common.js +18 -20
  200. package/lib/utils/createUuid.js +11 -31
  201. package/lib/utils/device.js +44 -0
  202. package/lib/utils/dynamicLoadCss.js +14 -0
  203. package/lib/utils/dynamicLoadJs.js +21 -0
  204. package/lib/utils/getLoginUser.js +1 -1
  205. package/lib/utils/getSize.js +2 -11
  206. package/lib/utils/getStyle.js +26 -0
  207. package/lib/utils/getSuitHeight.js +49 -0
  208. package/lib/utils/hasAuth.js +11 -0
  209. package/lib/utils/index.js +1 -34
  210. package/lib/utils/loadJS.js +40 -0
  211. package/package.json +1 -1
  212. /package/lib/layouts/{Login → login}/lyPassword.js +0 -0
@@ -0,0 +1,612 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _tooltip = require('antd/lib/tooltip');
8
+
9
+ var _tooltip2 = _interopRequireDefault(_tooltip);
10
+
11
+ var _icon = require('antd/lib/icon');
12
+
13
+ var _icon2 = _interopRequireDefault(_icon);
14
+
15
+ var _inputNumber = require('antd/lib/input-number');
16
+
17
+ var _inputNumber2 = _interopRequireDefault(_inputNumber);
18
+
19
+ var _row = require('antd/lib/row');
20
+
21
+ var _row2 = _interopRequireDefault(_row);
22
+
23
+ var _col = require('antd/lib/col');
24
+
25
+ var _col2 = _interopRequireDefault(_col);
26
+
27
+ var _message2 = require('antd/lib/message');
28
+
29
+ var _message3 = _interopRequireDefault(_message2);
30
+
31
+ var _stringify = require('babel-runtime/core-js/json/stringify');
32
+
33
+ var _stringify2 = _interopRequireDefault(_stringify);
34
+
35
+ var _extends2 = require('babel-runtime/helpers/extends');
36
+
37
+ var _extends3 = _interopRequireDefault(_extends2);
38
+
39
+ var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
40
+
41
+ var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
42
+
43
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
44
+
45
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
46
+
47
+ var _createClass2 = require('babel-runtime/helpers/createClass');
48
+
49
+ var _createClass3 = _interopRequireDefault(_createClass2);
50
+
51
+ var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
52
+
53
+ var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
54
+
55
+ var _inherits2 = require('babel-runtime/helpers/inherits');
56
+
57
+ var _inherits3 = _interopRequireDefault(_inherits2);
58
+
59
+ var _radio = require('antd/lib/radio');
60
+
61
+ var _radio2 = _interopRequireDefault(_radio);
62
+
63
+ require('antd/lib/tooltip/style');
64
+
65
+ require('antd/lib/icon/style');
66
+
67
+ require('antd/lib/input-number/style');
68
+
69
+ require('antd/lib/row/style');
70
+
71
+ require('antd/lib/col/style');
72
+
73
+ require('antd/lib/message/style');
74
+
75
+ require('antd/lib/radio/style');
76
+
77
+ var _react = require('react');
78
+
79
+ var _react2 = _interopRequireDefault(_react);
80
+
81
+ var _inputConst = require('./input-const');
82
+
83
+ var _reactCustomScrollbars = require('react-custom-scrollbars');
84
+
85
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
86
+
87
+ var RadioGroup = _radio2.default.Group;
88
+
89
+ //最小宽度
90
+ var minWidth = 1;
91
+
92
+ var SettingInputNumber = function (_React$Component) {
93
+ (0, _inherits3.default)(SettingInputNumber, _React$Component);
94
+
95
+ function SettingInputNumber(props) {
96
+ (0, _classCallCheck3.default)(this, SettingInputNumber);
97
+
98
+ var _this = (0, _possibleConstructorReturn3.default)(this, (SettingInputNumber.__proto__ || (0, _getPrototypeOf2.default)(SettingInputNumber)).call(this, props));
99
+
100
+ _this.getFeature = function () {
101
+ return _this.state.feature;
102
+ };
103
+
104
+ _this.handleSizeRadioChange = function (e) {
105
+ var size = e.target.value;
106
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
107
+ fp.size = size;
108
+
109
+ _this.setState({
110
+ featureParams: fp
111
+ });
112
+ _this.createFeature(fp);
113
+ };
114
+
115
+ _this.createFeature = function (featureParams) {
116
+ try {
117
+ var feature = (0, _stringify2.default)(featureParams);
118
+ _this.setState({
119
+ feature: feature
120
+ });
121
+ _this.props.onChange(feature);
122
+ } catch (e) {
123
+ console.log(e);
124
+ _message3.default.error('生成控件配置参数出错!');
125
+ }
126
+ };
127
+
128
+ _this.handleWidthRadioChange = function (e) {
129
+ var widthType = e.target.value;
130
+
131
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
132
+ fp.widthType = widthType;
133
+ fp.widthStr = '';
134
+
135
+ _this.setState({ width: '', featureParams: fp });
136
+ _this.createFeature(fp);
137
+ };
138
+
139
+ _this.handleRequiredRadioChange = function (e) {
140
+ var required = e.target.value;
141
+
142
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
143
+ fp.required = required;
144
+
145
+ _this.setState({ featureParams: fp });
146
+ _this.createFeature(fp);
147
+ };
148
+
149
+ _this.handleWidthChange = function (value) {
150
+ var widthStr = void 0;
151
+ var widthType = _this.state.featureParams.widthType;
152
+
153
+ if (widthType == _inputConst.WidthType.RELATIVE) {
154
+ widthStr = value + '%';
155
+ } else if (widthType == _inputConst.WidthType.FIXED) {
156
+ widthStr = value + 'px';
157
+ } else {
158
+ widthStr = '';
159
+ }
160
+
161
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
162
+ fp.widthStr = widthStr;
163
+
164
+ _this.setState({ width: value, featureParams: fp });
165
+ _this.createFeature(fp);
166
+ };
167
+
168
+ _this.handleDefaultValueChange = function (value) {
169
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
170
+ fp.defaultValue = value ? value : '';;
171
+ _this.setState({ featureParams: fp });
172
+ _this.createFeature(fp);
173
+ };
174
+
175
+ _this.handleNumberLimitChange = function (value) {
176
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
177
+ fp.step = value;
178
+ _this.setState({ featureParams: fp });
179
+ _this.createFeature(fp);
180
+ };
181
+
182
+ _this.handleMaxNumberChange = function (value) {
183
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
184
+ fp.max = value ? value : '';
185
+ _this.setState({ featureParams: fp });
186
+ _this.createFeature(fp);
187
+ };
188
+
189
+ _this.handleMinNumberChange = function (value) {
190
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
191
+ fp.min = value ? value : '';
192
+ _this.setState({ featureParams: fp });
193
+ _this.createFeature(fp);
194
+ };
195
+
196
+ _this.handleIntegerLimitChange = function (value) {
197
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
198
+ fp.integerLength = value ? value : '';
199
+ _this.setState({ featureParams: fp });
200
+ _this.createFeature(fp);
201
+ };
202
+
203
+ _this.handleDecimalLimitChange = function (value) {
204
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
205
+ fp.decimalLength = value ? value : '';
206
+ _this.setState({ featureParams: fp });
207
+ _this.createFeature(fp);
208
+ };
209
+
210
+ _this.state = {
211
+ feature: '', //原参数json字符串
212
+ width: minWidth, //设置的宽度值,初始为最小宽度值
213
+ featureParams: {
214
+ name: '数字输入框组件',
215
+ type: _inputConst.InputType.INPUTNUMBER, //控件类型,必须有此属性,用于渲染时期判断控件类型
216
+ widthType: _inputConst.WidthType.DEFAULT, //宽度类型:自适应'default'、百分比'relative'、固定值'fixed'
217
+ widthStr: '', //input宽度值
218
+ required: false, //是否必须
219
+ defaultValue: '', //默认值
220
+ size: 'default', //输入框大小
221
+ step: '1', //步长
222
+ max: '', //最大值
223
+ min: '', //最小值
224
+ validationValueType: 'number',
225
+ integerLength: null, // 整数位数
226
+ decimalLength: null // 整数位数
227
+ }
228
+
229
+ };
230
+ return _this;
231
+ }
232
+
233
+ (0, _createClass3.default)(SettingInputNumber, [{
234
+ key: 'componentWillMount',
235
+
236
+
237
+ //在渲染前调用,可在此最后一次初始化组件状态
238
+ value: function componentWillMount() {
239
+ //将输入控件配置参数设置到状态中
240
+ if (this.props.initFeature) {
241
+ try {
242
+ var initFeature = JSON.parse(this.props.initFeature);
243
+ if (initFeature.type == _inputConst.InputType.INPUTNUMBER) {
244
+ var widthType = initFeature.widthType,
245
+ _initFeature$widthStr = initFeature.widthStr,
246
+ widthStr = _initFeature$widthStr === undefined ? '' : _initFeature$widthStr,
247
+ _initFeature$size = initFeature.size,
248
+ size = _initFeature$size === undefined ? '' : _initFeature$size,
249
+ _initFeature$step = initFeature.step,
250
+ step = _initFeature$step === undefined ? '' : _initFeature$step,
251
+ _initFeature$max = initFeature.max,
252
+ max = _initFeature$max === undefined ? '' : _initFeature$max,
253
+ _initFeature$min = initFeature.min,
254
+ min = _initFeature$min === undefined ? '' : _initFeature$min,
255
+ _initFeature$required = initFeature.required,
256
+ required = _initFeature$required === undefined ? false : _initFeature$required,
257
+ _initFeature$defaultV = initFeature.defaultValue,
258
+ defaultValue = _initFeature$defaultV === undefined ? '' : _initFeature$defaultV,
259
+ integerLength = initFeature.integerLength,
260
+ decimalLength = initFeature.decimalLength;
261
+
262
+ var width = '';
263
+
264
+ if (widthType == _inputConst.WidthType.RELATIVE) {
265
+ width = widthStr.replace('%', '');
266
+ } else if (widthType == _inputConst.WidthType.FIXED) {
267
+ width = widthStr.replace('px', '');
268
+ }
269
+ var fp = (0, _extends3.default)({}, this.state.featureParams);
270
+ fp.widthType = widthType;
271
+ fp.widthStr = widthStr;
272
+ fp.size = size;
273
+ fp.step = step;
274
+ fp.max = max;
275
+ fp.min = min;
276
+ fp.required = required;
277
+ fp.defaultValue = defaultValue;
278
+ fp.integerLength = integerLength;
279
+ fp.decimalLength = decimalLength;
280
+ this.setState({
281
+ feature: this.props.initFeature,
282
+ width: width,
283
+ featureParams: fp
284
+ });
285
+ }
286
+ } catch (e) {
287
+ console.log(e);
288
+ _message3.default.error('解析控件配置参数出错!');
289
+ }
290
+ } else {
291
+ try {
292
+ var feature = (0, _stringify2.default)(this.state.featureParams);
293
+ this.setState({
294
+ feature: feature
295
+ });
296
+ } catch (e) {
297
+ console.log(e);
298
+ _message3.default.error('生成控件配置参数出错!');
299
+ }
300
+ }
301
+ }
302
+
303
+ //供父组件获取feature
304
+
305
+
306
+ //切换输入框大小类型radio时回调,清空之前的值
307
+
308
+
309
+ //生成feature参数json字符串
310
+
311
+
312
+ //切换宽度类型radio时回调,清空之前的值
313
+
314
+
315
+ //是否必填
316
+
317
+
318
+ //宽度值改变的时候,同步更新状态参数
319
+
320
+
321
+ //当输入默认值改变时
322
+
323
+
324
+ //步长值改变的时候,同步更新状态参数
325
+
326
+
327
+ //最大值改变的时候,同步更新状态参数
328
+
329
+
330
+ //最小值改变的时候,同步更新状态参数
331
+
332
+
333
+ //整数位数最大值改变的时候,同步更新状态参数
334
+
335
+ //小数位数最大值改变的时候,同步更新状态参数
336
+
337
+ }, {
338
+ key: 'render',
339
+ value: function render() {
340
+
341
+ var width = this.state.width;
342
+ var _state$featureParams = this.state.featureParams,
343
+ widthType = _state$featureParams.widthType,
344
+ required = _state$featureParams.required,
345
+ defaultValue = _state$featureParams.defaultValue,
346
+ size = _state$featureParams.size,
347
+ step = _state$featureParams.step,
348
+ max = _state$featureParams.max,
349
+ min = _state$featureParams.min,
350
+ integerLength = _state$featureParams.integerLength,
351
+ decimalLength = _state$featureParams.decimalLength;
352
+
353
+
354
+ return _react2.default.createElement(
355
+ _reactCustomScrollbars.Scrollbars,
356
+ { style: { height: "500px" } },
357
+ _react2.default.createElement(
358
+ 'div',
359
+ { id: 'input-setting-div', style: { paddingBottom: "30px" } },
360
+ _react2.default.createElement(
361
+ _row2.default,
362
+ { type: 'flex' },
363
+ _react2.default.createElement(
364
+ _col2.default,
365
+ null,
366
+ _react2.default.createElement(
367
+ 'div',
368
+ { style: { margin: "16px 0" } },
369
+ '\u5BBD\u5EA6'
370
+ )
371
+ )
372
+ ),
373
+ _react2.default.createElement(
374
+ _row2.default,
375
+ { type: 'flex' },
376
+ _react2.default.createElement(
377
+ _col2.default,
378
+ null,
379
+ _react2.default.createElement(
380
+ RadioGroup,
381
+ { onChange: this.handleWidthRadioChange, name: 'widthradiogroup',
382
+ value: widthType },
383
+ _react2.default.createElement(
384
+ _radio2.default,
385
+ { value: _inputConst.WidthType.DEFAULT },
386
+ '\u81EA\u9002\u5E94'
387
+ ),
388
+ _react2.default.createElement(
389
+ _radio2.default,
390
+ { value: _inputConst.WidthType.RELATIVE },
391
+ '\u767E\u5206\u6BD4'
392
+ ),
393
+ _react2.default.createElement(
394
+ _radio2.default,
395
+ { value: _inputConst.WidthType.FIXED },
396
+ '\u56FA\u5B9A\u5BBD\u5EA6'
397
+ )
398
+ )
399
+ ),
400
+ _react2.default.createElement(
401
+ _col2.default,
402
+ null,
403
+ widthType == _inputConst.WidthType.RELATIVE ? _react2.default.createElement(_inputNumber2.default, { size: 'small',
404
+ min: minWidth,
405
+ formatter: function formatter(value) {
406
+ return value + '%';
407
+ },
408
+ parser: function parser(value) {
409
+ return value.replace('%', '');
410
+ },
411
+ onChange: this.handleWidthChange,
412
+ value: width }) : widthType == _inputConst.WidthType.FIXED ? _react2.default.createElement(_inputNumber2.default, { size: 'small',
413
+ min: minWidth,
414
+ formatter: function formatter(value) {
415
+ return value + 'px';
416
+ },
417
+ parser: function parser(value) {
418
+ return value.replace('px', '');
419
+ },
420
+ onChange: this.handleWidthChange,
421
+ value: width }) : null
422
+ )
423
+ ),
424
+ _react2.default.createElement(
425
+ _row2.default,
426
+ { type: 'flex' },
427
+ _react2.default.createElement(
428
+ _col2.default,
429
+ null,
430
+ _react2.default.createElement(
431
+ 'div',
432
+ { style: { margin: "16px 0" } },
433
+ '\u662F\u5426\u5FC5\u586B'
434
+ )
435
+ )
436
+ ),
437
+ _react2.default.createElement(
438
+ _row2.default,
439
+ { type: 'flex' },
440
+ _react2.default.createElement(
441
+ _col2.default,
442
+ null,
443
+ _react2.default.createElement(
444
+ RadioGroup,
445
+ { onChange: this.handleRequiredRadioChange, name: 'requiredradiogroup',
446
+ value: required },
447
+ _react2.default.createElement(
448
+ _radio2.default,
449
+ { value: false },
450
+ '\u975E\u5FC5\u586B'
451
+ ),
452
+ _react2.default.createElement(
453
+ _radio2.default,
454
+ { value: true },
455
+ '\u5FC5\u586B'
456
+ )
457
+ )
458
+ )
459
+ ),
460
+ _react2.default.createElement(
461
+ _row2.default,
462
+ { type: 'flex' },
463
+ _react2.default.createElement(
464
+ _col2.default,
465
+ { span: 24 },
466
+ _react2.default.createElement(
467
+ 'div',
468
+ { style: { margin: "16px 0" } },
469
+ '\u6700\u5927\u503C | \u6700\u5C0F\u503C'
470
+ )
471
+ )
472
+ ),
473
+ _react2.default.createElement(
474
+ _row2.default,
475
+ { type: 'flex' },
476
+ _react2.default.createElement(
477
+ _col2.default,
478
+ { span: 12 },
479
+ _react2.default.createElement(_inputNumber2.default, { min: 1, value: max, style: { width: '60%' }, placeholder: '\u8BF7\u8F93\u5165\u6700\u5927\u503C', onChange: this.handleMaxNumberChange })
480
+ ),
481
+ _react2.default.createElement(
482
+ _col2.default,
483
+ { span: 12 },
484
+ _react2.default.createElement(_inputNumber2.default, { min: 1, value: min, style: { width: '60%' }, placeholder: '\u8BF7\u8F93\u5165\u6700\u5C0F\u503C', onChange: this.handleMinNumberChange })
485
+ )
486
+ ),
487
+ _react2.default.createElement(
488
+ _row2.default,
489
+ { type: 'flex' },
490
+ _react2.default.createElement(
491
+ _col2.default,
492
+ { span: 24 },
493
+ _react2.default.createElement(
494
+ 'div',
495
+ { style: { margin: "16px 0" } },
496
+ '\u6574\u6570\u4F4D\u6570 | \u5C0F\u6570\u4F4D\u6570'
497
+ )
498
+ )
499
+ ),
500
+ _react2.default.createElement(
501
+ _row2.default,
502
+ { type: 'flex' },
503
+ _react2.default.createElement(
504
+ _col2.default,
505
+ { span: 12 },
506
+ _react2.default.createElement(_inputNumber2.default, { min: 1, value: integerLength, style: { width: '60%' }, placeholder: '\u8BF7\u8F93\u5165\u6574\u6570\u4F4D\u6570\u6700\u5927\u503C', onChange: this.handleIntegerLimitChange })
507
+ ),
508
+ _react2.default.createElement(
509
+ _col2.default,
510
+ { span: 12 },
511
+ _react2.default.createElement(_inputNumber2.default, { min: 1, value: decimalLength, style: { width: '60%' }, placeholder: '\u8BF7\u8F93\u5165\u5C0F\u6570\u4F4D\u6570\u6700\u5927\u503C', onChange: this.handleDecimalLimitChange })
512
+ )
513
+ ),
514
+ _react2.default.createElement(
515
+ _row2.default,
516
+ { type: 'flex' },
517
+ _react2.default.createElement(
518
+ _col2.default,
519
+ null,
520
+ _react2.default.createElement(
521
+ 'div',
522
+ { style: { margin: "16px 0" } },
523
+ '\u6B65\u957F ',
524
+ _react2.default.createElement(
525
+ _tooltip2.default,
526
+ { title: '即每次增加或递减的大小', placement: 'top' },
527
+ _react2.default.createElement(_icon2.default, { type: 'question-circle' })
528
+ )
529
+ )
530
+ )
531
+ ),
532
+ _react2.default.createElement(
533
+ _row2.default,
534
+ { type: 'flex' },
535
+ _react2.default.createElement(
536
+ _col2.default,
537
+ { span: 12 },
538
+ _react2.default.createElement(_inputNumber2.default, { min: 0, style: { width: '60%' }, placeholder: '\u8BF7\u8F93\u5165\u6B65\u957F', onChange: this.handleNumberLimitChange, value: step })
539
+ )
540
+ ),
541
+ _react2.default.createElement(
542
+ _row2.default,
543
+ { type: 'flex' },
544
+ _react2.default.createElement(
545
+ _col2.default,
546
+ null,
547
+ _react2.default.createElement(
548
+ 'div',
549
+ { style: { margin: "16px 0" } },
550
+ '\u8F93\u5165\u6846\u5927\u5C0F'
551
+ )
552
+ )
553
+ ),
554
+ _react2.default.createElement(
555
+ _row2.default,
556
+ { type: 'flex' },
557
+ _react2.default.createElement(
558
+ _col2.default,
559
+ { style: { align: "center" } },
560
+ _react2.default.createElement(
561
+ RadioGroup,
562
+ { value: size, onChange: this.handleSizeRadioChange },
563
+ _react2.default.createElement(
564
+ _radio2.default,
565
+ { value: 'large' },
566
+ '\u5927'
567
+ ),
568
+ _react2.default.createElement(
569
+ _radio2.default,
570
+ { value: 'default' },
571
+ '\u9ED8\u8BA4'
572
+ ),
573
+ _react2.default.createElement(
574
+ _radio2.default,
575
+ { value: 'small' },
576
+ '\u5C0F'
577
+ )
578
+ )
579
+ )
580
+ ),
581
+ _react2.default.createElement(
582
+ _row2.default,
583
+ { type: 'flex' },
584
+ _react2.default.createElement(
585
+ _col2.default,
586
+ null,
587
+ _react2.default.createElement(
588
+ 'div',
589
+ { style: { margin: "16px 0" } },
590
+ '\u9ED8\u8BA4\u503C'
591
+ )
592
+ )
593
+ ),
594
+ _react2.default.createElement(
595
+ _row2.default,
596
+ { type: 'flex' },
597
+ _react2.default.createElement(
598
+ _col2.default,
599
+ { span: 12 },
600
+ _react2.default.createElement(_inputNumber2.default, { placeholder: '\u8BF7\u8F93\u5165\u9ED8\u8BA4\u503C', min: 1, style: { width: '60%' }, onChange: this.handleDefaultValueChange, value: defaultValue })
601
+ )
602
+ )
603
+ )
604
+ );
605
+ }
606
+ }]);
607
+ return SettingInputNumber;
608
+ }(_react2.default.Component);
609
+
610
+ SettingInputNumber.defaultProps = {
611
+ initFeature: '' };
612
+ exports.default = SettingInputNumber;