dlt-for-react 1.0.24 → 1.1.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 (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 +156 -120
  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,619 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _input = require('antd/lib/input');
8
+
9
+ var _input2 = _interopRequireDefault(_input);
10
+
11
+ var _inputNumber = require('antd/lib/input-number');
12
+
13
+ var _inputNumber2 = _interopRequireDefault(_inputNumber);
14
+
15
+ var _row = require('antd/lib/row');
16
+
17
+ var _row2 = _interopRequireDefault(_row);
18
+
19
+ var _col = require('antd/lib/col');
20
+
21
+ var _col2 = _interopRequireDefault(_col);
22
+
23
+ var _select = require('antd/lib/select');
24
+
25
+ var _select2 = _interopRequireDefault(_select);
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/input/style');
64
+
65
+ require('antd/lib/input-number/style');
66
+
67
+ require('antd/lib/row/style');
68
+
69
+ require('antd/lib/col/style');
70
+
71
+ require('antd/lib/select/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
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
84
+
85
+ var RadioGroup = _radio2.default.Group;
86
+
87
+ //最小宽度
88
+ var minWidth = 1;
89
+
90
+ /**
91
+ * 多行文本输入控件配置组件
92
+ * Author: zengxiangkai@ly-sky.com
93
+ * Created on: 2018-02-05 19:21:51
94
+ * Version: 1.0
95
+ * Modify log:
96
+ * 2019-03-21:1、增加validationValueType表单校验值类型属性
97
+ */
98
+
99
+ var SettingTextArea = function (_React$Component) {
100
+ (0, _inherits3.default)(SettingTextArea, _React$Component);
101
+
102
+ function SettingTextArea(props) {
103
+ (0, _classCallCheck3.default)(this, SettingTextArea);
104
+
105
+ var _this = (0, _possibleConstructorReturn3.default)(this, (SettingTextArea.__proto__ || (0, _getPrototypeOf2.default)(SettingTextArea)).call(this, props));
106
+
107
+ _this.getFeature = function () {
108
+ return _this.state.feature;
109
+ };
110
+
111
+ _this.handleWidthRadioChange = function (e) {
112
+ var widthType = e.target.value;
113
+
114
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
115
+ fp.widthType = widthType;
116
+ fp.widthStr = '';
117
+
118
+ _this.setState({ width: '', featureParams: fp });
119
+ _this.createFeature(fp);
120
+ };
121
+
122
+ _this.handleWidthChange = function (value) {
123
+ var widthStr = void 0;
124
+ var widthType = _this.state.featureParams.widthType;
125
+
126
+ if (widthType == _inputConst.WidthType.RELATIVE) {
127
+ widthStr = value + '%';
128
+ } else if (widthType == _inputConst.WidthType.FIXED) {
129
+ widthStr = value + 'px';
130
+ } else {
131
+ widthStr = '';
132
+ }
133
+
134
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
135
+ fp.widthStr = widthStr;
136
+
137
+ _this.setState({ width: value, featureParams: fp });
138
+ _this.createFeature(fp);
139
+ };
140
+
141
+ _this.handleRequiredRadioChange = function (e) {
142
+ var required = e.target.value;
143
+
144
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
145
+ fp.required = required;
146
+
147
+ _this.setState({ featureParams: fp });
148
+ _this.createFeature(fp);
149
+ };
150
+
151
+ _this.handleRegularChange = function (value) {
152
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
153
+ fp.patternTag = value;
154
+
155
+ _this.setState({ featureParams: fp });
156
+ _this.createFeature(fp);
157
+ };
158
+
159
+ _this.handlePlaceholderChange = function (e) {
160
+ var placeholder = e.target.value;
161
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
162
+ fp.placeholder = placeholder;
163
+ _this.setState({ featureParams: fp });
164
+ _this.createFeature(fp);
165
+ };
166
+
167
+ _this.handleDefaultValueChange = function (e) {
168
+ var defaultValue = e.target.value;
169
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
170
+ fp.defaultValue = defaultValue;
171
+ _this.setState({ featureParams: fp });
172
+ _this.createFeature(fp);
173
+ };
174
+
175
+ _this.createFeature = function (featureParams) {
176
+ try {
177
+ var feature = (0, _stringify2.default)(featureParams);
178
+ _this.setState({
179
+ feature: feature
180
+ });
181
+ _this.props.onChange(feature);
182
+ } catch (e) {
183
+ console.log(e);
184
+ _message3.default.error('生成控件配置参数出错!');
185
+ }
186
+ };
187
+
188
+ _this.handleMaxNumberChange = function (value) {
189
+ //value为输入的值
190
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
191
+ // console.log('fp',fp)
192
+ fp.maxRows = value ? value : '';
193
+ _this.setState({ featureParams: fp });
194
+ _this.createFeature(fp);
195
+ // minRows: 2, maxRows: 6
196
+ };
197
+
198
+ _this.handleMinNumberChange = function (value) {
199
+ //value为输入的值
200
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
201
+ // console.log('fp',fp)
202
+ fp.minRows = value ? value : '';
203
+ _this.setState({ featureParams: fp });
204
+ _this.createFeature(fp);
205
+ };
206
+
207
+ _this.handleMaxLengthChange = function (value) {
208
+ _this.setState({ spanDisplay: 'none' });
209
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
210
+ if (parseInt(fp.minLength) >= parseInt(value)) {
211
+ _this.setState({ spanDisplay: 'block' });
212
+ }
213
+ //value为输入的值
214
+ fp.maxLength = value ? value : '';
215
+ _this.setState({ featureParams: fp });
216
+ _this.createFeature(fp);
217
+ };
218
+
219
+ _this.handleMinLengthChange = function (value) {
220
+ _this.setState({ spanDisplay: 'none' });
221
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
222
+ if (parseInt(fp.maxLength) <= parseInt(value)) {
223
+ _this.setState({ spanDisplay: 'block' });
224
+ }
225
+ //value为输入的值
226
+ fp.minLength = value ? value : '';
227
+ _this.setState({ featureParams: fp });
228
+ _this.createFeature(fp);
229
+ };
230
+
231
+ _this.state = {
232
+ feature: '', //原参数json字符串
233
+ width: minWidth, //设置的宽度值,初始为最小宽度值
234
+ spanDisplay: 'none',
235
+ featureParams: {
236
+ name: '多行文本输入组件',
237
+ type: _inputConst.InputType.TEXTAREA, //控件类型,必须有此属性,用于渲染时期判断控件类型
238
+ widthType: _inputConst.WidthType.DEFAULT, //宽度类型:自适应'default'、百分比'relative'、固定值'fixed'
239
+ widthStr: '', //input宽度值
240
+ patternTag: '', //正则表达式标识
241
+ placeholder: '', //输入提示
242
+ required: false, //是否必须
243
+ defaultValue: '', //默认值
244
+ validationValueType: 'string', //用于校验的值的类型
245
+ maxRows: '', //最大值
246
+ minRows: '', //最小值
247
+ maxLength: '', //输入字数最大值
248
+ minLength: '' //输入字数最小值
249
+ },
250
+ selectOptions: []
251
+ };
252
+ return _this;
253
+ }
254
+
255
+ (0, _createClass3.default)(SettingTextArea, [{
256
+ key: 'componentWillMount',
257
+
258
+
259
+ //在渲染前调用,可在此最后一次初始化组件状态
260
+ value: function componentWillMount() {
261
+ //将输入控件配置参数设置到状态中
262
+ if (this.props.initFeature) {
263
+ try {
264
+ var initFeature = JSON.parse(this.props.initFeature);
265
+ if (initFeature.type == _inputConst.InputType.TEXTAREA) {
266
+ var widthType = initFeature.widthType,
267
+ _initFeature$widthStr = initFeature.widthStr,
268
+ widthStr = _initFeature$widthStr === undefined ? '' : _initFeature$widthStr,
269
+ _initFeature$patternT = initFeature.patternTag,
270
+ patternTag = _initFeature$patternT === undefined ? '' : _initFeature$patternT,
271
+ _initFeature$placehol = initFeature.placeholder,
272
+ placeholder = _initFeature$placehol === undefined ? '' : _initFeature$placehol,
273
+ _initFeature$required = initFeature.required,
274
+ required = _initFeature$required === undefined ? false : _initFeature$required,
275
+ _initFeature$defaultV = initFeature.defaultValue,
276
+ defaultValue = _initFeature$defaultV === undefined ? '' : _initFeature$defaultV,
277
+ _initFeature$maxRows = initFeature.maxRows,
278
+ maxRows = _initFeature$maxRows === undefined ? '' : _initFeature$maxRows,
279
+ _initFeature$minRows = initFeature.minRows,
280
+ minRows = _initFeature$minRows === undefined ? '' : _initFeature$minRows,
281
+ _initFeature$maxLengt = initFeature.maxLength,
282
+ maxLength = _initFeature$maxLengt === undefined ? '' : _initFeature$maxLengt,
283
+ _initFeature$minLengt = initFeature.minLength,
284
+ minLength = _initFeature$minLengt === undefined ? 0 : _initFeature$minLengt;
285
+
286
+
287
+ var width = '';
288
+
289
+ if (widthType == _inputConst.WidthType.RELATIVE) {
290
+ width = widthStr.replace('%', '');
291
+ } else if (widthType == _inputConst.WidthType.FIXED) {
292
+ width = widthStr.replace('px', '');
293
+ }
294
+ var fp = (0, _extends3.default)({}, this.state.featureParams);
295
+ fp.widthType = widthType;
296
+ fp.widthStr = widthStr;
297
+ fp.patternTag = patternTag;
298
+ fp.placeholder = placeholder;
299
+ fp.required = required;
300
+ fp.defaultValue = defaultValue;
301
+ fp.maxRows = maxRows;
302
+ fp.maxLength = maxLength;
303
+ fp.minLength = minLength;
304
+ fp.minRows = minRows;
305
+ this.setState({
306
+ feature: this.props.initFeature,
307
+ width: width,
308
+ featureParams: fp
309
+ });
310
+ }
311
+ } catch (e) {
312
+ console.log(e);
313
+ _message3.default.error('解析控件配置参数出错!');
314
+ }
315
+ } else {
316
+ try {
317
+ var feature = (0, _stringify2.default)(this.state.featureParams);
318
+ this.setState({
319
+ feature: feature
320
+ });
321
+ } catch (e) {
322
+ console.log(e);
323
+ _message3.default.error('生成控件配置参数出错!');
324
+ }
325
+ }
326
+ var Option = _select2.default.Option;
327
+ //构建正则表达式下拉数据
328
+ var selectOptions = [_react2.default.createElement(
329
+ Option,
330
+ { key: -1, value: '' },
331
+ '\u8BF7\u9009\u62E9...'
332
+ )];
333
+ for (var key in _inputConst.RegularExpression) {
334
+ var option = _react2.default.createElement(
335
+ Option,
336
+ { key: key, value: key },
337
+ _inputConst.RegularExpression[key].describe
338
+ );
339
+ selectOptions.push(option);
340
+ }
341
+ this.setState({ selectOptions: selectOptions });
342
+ }
343
+
344
+ //供父组件获取feature
345
+
346
+
347
+ //切换宽度类型radio时回调,清空之前的值
348
+
349
+
350
+ //宽度值改变的时候,同步更新状态参数
351
+
352
+
353
+ //是否必填
354
+
355
+
356
+ //当选中正则表达式改变后
357
+
358
+
359
+ //当输入的提示信息改变时
360
+
361
+
362
+ //当输入默认值改变时
363
+
364
+
365
+ //生成feature参数json字符串
366
+
367
+
368
+ //最大值改变的时候,同步更新状态参数
369
+
370
+
371
+ //最小值改变的时候,同步更新状态参数
372
+
373
+
374
+ //字数最大值限制
375
+
376
+
377
+ //字数最小值限制
378
+
379
+ }, {
380
+ key: 'render',
381
+ value: function render() {
382
+
383
+ var width = this.state.width;
384
+ var _state$featureParams = this.state.featureParams,
385
+ widthType = _state$featureParams.widthType,
386
+ patternTag = _state$featureParams.patternTag,
387
+ placeholder = _state$featureParams.placeholder,
388
+ required = _state$featureParams.required,
389
+ defaultValue = _state$featureParams.defaultValue,
390
+ minRows = _state$featureParams.minRows,
391
+ maxRows = _state$featureParams.maxRows,
392
+ maxLength = _state$featureParams.maxLength,
393
+ minLength = _state$featureParams.minLength;
394
+
395
+
396
+ return _react2.default.createElement(
397
+ 'div',
398
+ { id: 'textarea-setting-div' },
399
+ _react2.default.createElement(
400
+ _row2.default,
401
+ { type: 'flex' },
402
+ _react2.default.createElement(
403
+ _col2.default,
404
+ null,
405
+ _react2.default.createElement(
406
+ 'div',
407
+ { style: { margin: "16px 0" } },
408
+ '\u5BBD\u5EA6'
409
+ )
410
+ )
411
+ ),
412
+ _react2.default.createElement(
413
+ _row2.default,
414
+ { type: 'flex' },
415
+ _react2.default.createElement(
416
+ _col2.default,
417
+ null,
418
+ _react2.default.createElement(
419
+ RadioGroup,
420
+ { onChange: this.handleWidthRadioChange, name: 'widthradiogroup',
421
+ value: widthType },
422
+ _react2.default.createElement(
423
+ _radio2.default,
424
+ { value: _inputConst.WidthType.DEFAULT },
425
+ '\u81EA\u9002\u5E94'
426
+ ),
427
+ _react2.default.createElement(
428
+ _radio2.default,
429
+ { value: _inputConst.WidthType.RELATIVE },
430
+ '\u767E\u5206\u6BD4'
431
+ ),
432
+ _react2.default.createElement(
433
+ _radio2.default,
434
+ { value: _inputConst.WidthType.FIXED },
435
+ '\u56FA\u5B9A\u5BBD\u5EA6'
436
+ )
437
+ )
438
+ ),
439
+ _react2.default.createElement(
440
+ _col2.default,
441
+ null,
442
+ widthType == _inputConst.WidthType.RELATIVE ? _react2.default.createElement(_inputNumber2.default, { size: 'small',
443
+ min: minWidth,
444
+ formatter: function formatter(value) {
445
+ return value + '%';
446
+ },
447
+ parser: function parser(value) {
448
+ return value.replace('%', '');
449
+ },
450
+ onChange: this.handleWidthChange,
451
+ value: width }) : widthType == _inputConst.WidthType.FIXED ? _react2.default.createElement(_inputNumber2.default, { size: 'small',
452
+ min: minWidth,
453
+ formatter: function formatter(value) {
454
+ return value + 'px';
455
+ },
456
+ parser: function parser(value) {
457
+ return value.replace('px', '');
458
+ },
459
+ onChange: this.handleWidthChange,
460
+ value: width }) : null
461
+ )
462
+ ),
463
+ _react2.default.createElement(
464
+ _row2.default,
465
+ { type: 'flex' },
466
+ _react2.default.createElement(
467
+ _col2.default,
468
+ null,
469
+ _react2.default.createElement(
470
+ 'div',
471
+ { style: { margin: "16px 0" } },
472
+ '\u662F\u5426\u5FC5\u586B'
473
+ )
474
+ )
475
+ ),
476
+ _react2.default.createElement(
477
+ _row2.default,
478
+ { type: 'flex' },
479
+ _react2.default.createElement(
480
+ _col2.default,
481
+ null,
482
+ _react2.default.createElement(
483
+ RadioGroup,
484
+ { onChange: this.handleRequiredRadioChange, name: 'requiredradiogroup',
485
+ value: required },
486
+ _react2.default.createElement(
487
+ _radio2.default,
488
+ { value: false },
489
+ '\u975E\u5FC5\u586B'
490
+ ),
491
+ _react2.default.createElement(
492
+ _radio2.default,
493
+ { value: true },
494
+ '\u5FC5\u586B'
495
+ )
496
+ )
497
+ )
498
+ ),
499
+ _react2.default.createElement(
500
+ _row2.default,
501
+ { type: 'flex' },
502
+ _react2.default.createElement(
503
+ _col2.default,
504
+ { span: 24 },
505
+ _react2.default.createElement(
506
+ 'div',
507
+ { style: { margin: "16px 0" } },
508
+ '\u884C\u6570\u6700\u5C0F\u503C | \u884C\u6570\u6700\u5927\u503C'
509
+ )
510
+ )
511
+ ),
512
+ _react2.default.createElement(
513
+ _row2.default,
514
+ { type: 'flex' },
515
+ _react2.default.createElement(
516
+ _col2.default,
517
+ { span: 12 },
518
+ _react2.default.createElement(_inputNumber2.default, { min: 1, value: minRows, style: { width: '60%' }, placeholder: '\u8BF7\u8F93\u5165\u6700\u5C0F\u884C\u6570', onChange: this.handleMinNumberChange })
519
+ ),
520
+ _react2.default.createElement(
521
+ _col2.default,
522
+ { span: 12 },
523
+ _react2.default.createElement(_inputNumber2.default, { min: 1, value: maxRows, style: { width: '60%' }, placeholder: '\u8BF7\u8F93\u5165\u6700\u5927\u884C\u6570', onChange: this.handleMaxNumberChange })
524
+ )
525
+ ),
526
+ _react2.default.createElement(
527
+ _row2.default,
528
+ { type: 'flex' },
529
+ _react2.default.createElement(
530
+ _col2.default,
531
+ null,
532
+ _react2.default.createElement(
533
+ 'div',
534
+ { style: { margin: "16px 0" } },
535
+ '\u6240\u8F93\u5B57\u6570\u6700\u5C0F\u503C | \u6240\u8F93\u5B57\u6570\u6700\u5927\u503C'
536
+ )
537
+ )
538
+ ),
539
+ _react2.default.createElement(
540
+ _row2.default,
541
+ { type: 'flex' },
542
+ _react2.default.createElement(
543
+ _col2.default,
544
+ { span: 12 },
545
+ _react2.default.createElement(_inputNumber2.default, { placeholder: '\u8BF7\u8F93\u5165\u5B57\u6570\u6700\u5C0F\u503C\u9650\u5236', value: minLength, onChange: this.handleMinLengthChange })
546
+ ),
547
+ _react2.default.createElement(
548
+ _col2.default,
549
+ { span: 12 },
550
+ _react2.default.createElement(_inputNumber2.default, { placeholder: '\u8BF7\u8F93\u5165\u5B57\u6570\u6700\u5927\u503C\u9650\u5236', value: maxLength, onChange: this.handleMaxLengthChange })
551
+ )
552
+ ),
553
+ _react2.default.createElement(
554
+ 'span',
555
+ { style: { color: 'red', 'fontSize': '10px', display: this.state.spanDisplay } },
556
+ '\u6700\u5C0F\u503C\u4E0D\u53EF\u4EE5\u8D85\u8FC7\u6700\u5927\u503C!'
557
+ ),
558
+ _react2.default.createElement(
559
+ _row2.default,
560
+ { type: 'flex' },
561
+ _react2.default.createElement(
562
+ _col2.default,
563
+ null,
564
+ _react2.default.createElement(
565
+ 'div',
566
+ { style: { margin: "16px 0" } },
567
+ '\u6B63\u5219\u6821\u9A8C'
568
+ )
569
+ )
570
+ ),
571
+ _react2.default.createElement(
572
+ _row2.default,
573
+ { type: 'flex' },
574
+ _react2.default.createElement(
575
+ _col2.default,
576
+ { span: 12 },
577
+ _react2.default.createElement(
578
+ _select2.default,
579
+ { style: { width: '100%' }, defaultValue: patternTag, onChange: this.handleRegularChange },
580
+ this.state.selectOptions
581
+ )
582
+ )
583
+ ),
584
+ _react2.default.createElement(
585
+ _row2.default,
586
+ { type: 'flex' },
587
+ _react2.default.createElement(
588
+ _col2.default,
589
+ null,
590
+ _react2.default.createElement(
591
+ 'div',
592
+ { style: { margin: "16px 0" } },
593
+ '\u8F93\u5165\u63D0\u793A | \u9ED8\u8BA4\u503C'
594
+ )
595
+ )
596
+ ),
597
+ _react2.default.createElement(
598
+ _row2.default,
599
+ { type: 'flex' },
600
+ _react2.default.createElement(
601
+ _col2.default,
602
+ { span: 12 },
603
+ _react2.default.createElement(_input2.default, { placeholder: '\u8BF7\u8F93\u5165\u5B57\u6BB5\u9884\u671F\u503C\u7684\u63D0\u793A\u4FE1\u606F', onChange: this.handlePlaceholderChange, value: placeholder })
604
+ ),
605
+ _react2.default.createElement(
606
+ _col2.default,
607
+ { span: 12 },
608
+ _react2.default.createElement(_input2.default, { placeholder: '\u8BF7\u8F93\u5165\u9ED8\u8BA4\u503C', onChange: this.handleDefaultValueChange, value: defaultValue })
609
+ )
610
+ )
611
+ );
612
+ }
613
+ }]);
614
+ return SettingTextArea;
615
+ }(_react2.default.Component);
616
+
617
+ SettingTextArea.defaultProps = {
618
+ initFeature: '' };
619
+ exports.default = SettingTextArea;