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,468 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _row = require('antd/lib/row');
8
+
9
+ var _row2 = _interopRequireDefault(_row);
10
+
11
+ var _col = require('antd/lib/col');
12
+
13
+ var _col2 = _interopRequireDefault(_col);
14
+
15
+ var _getIterator2 = require('babel-runtime/core-js/get-iterator');
16
+
17
+ var _getIterator3 = _interopRequireDefault(_getIterator2);
18
+
19
+ var _message2 = require('antd/lib/message');
20
+
21
+ var _message3 = _interopRequireDefault(_message2);
22
+
23
+ var _stringify = require('babel-runtime/core-js/json/stringify');
24
+
25
+ var _stringify2 = _interopRequireDefault(_stringify);
26
+
27
+ var _extends2 = require('babel-runtime/helpers/extends');
28
+
29
+ var _extends3 = _interopRequireDefault(_extends2);
30
+
31
+ var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
32
+
33
+ var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
34
+
35
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
36
+
37
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
38
+
39
+ var _createClass2 = require('babel-runtime/helpers/createClass');
40
+
41
+ var _createClass3 = _interopRequireDefault(_createClass2);
42
+
43
+ var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
44
+
45
+ var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
46
+
47
+ var _inherits2 = require('babel-runtime/helpers/inherits');
48
+
49
+ var _inherits3 = _interopRequireDefault(_inherits2);
50
+
51
+ var _input = require('antd/lib/input');
52
+
53
+ var _input2 = _interopRequireDefault(_input);
54
+
55
+ var _radio = require('antd/lib/radio');
56
+
57
+ var _radio2 = _interopRequireDefault(_radio);
58
+
59
+ require('antd/lib/row/style');
60
+
61
+ require('antd/lib/col/style');
62
+
63
+ require('antd/lib/message/style');
64
+
65
+ require('antd/lib/input/style');
66
+
67
+ require('antd/lib/radio/style');
68
+
69
+ var _react = require('react');
70
+
71
+ var _react2 = _interopRequireDefault(_react);
72
+
73
+ var _inputConst = require('./input-const');
74
+
75
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
76
+
77
+ var RadioGroup = _radio2.default.Group;
78
+ var TextArea = _input2.default.TextArea;
79
+
80
+ /**
81
+ * 单选框输入控件配置组件
82
+ * Author: zengxiangkai@ly-sky.com
83
+ * Created on: 2018-02-05 19:21:51
84
+ * Version: 1.0
85
+ * Modify log:
86
+ * 2019-03-21:1、增加validationValueType表单校验值类型属性
87
+ */
88
+
89
+ var SettingRadio = function (_React$Component) {
90
+ (0, _inherits3.default)(SettingRadio, _React$Component);
91
+
92
+ function SettingRadio(props) {
93
+ (0, _classCallCheck3.default)(this, SettingRadio);
94
+
95
+ var _this = (0, _possibleConstructorReturn3.default)(this, (SettingRadio.__proto__ || (0, _getPrototypeOf2.default)(SettingRadio)).call(this, props));
96
+
97
+ _this.getFeature = function () {
98
+ return _this.state.feature;
99
+ };
100
+
101
+ _this.handleRadioLabelChange = function (e) {
102
+ var labels = e.target.value;
103
+ var labelArray = [];
104
+ if (labels.length > 0) {
105
+ //去除末尾的中英文逗号
106
+ var endChar = labels.charAt(labels.length - 1);
107
+ var tempLabels = labels;
108
+ if (endChar == ',' || endChar == ',') {
109
+ tempLabels = tempLabels.substring(0, labels.length - 1);
110
+ }
111
+ labelArray = tempLabels.trim().split(/,|,/);
112
+ console.info(labelArray);
113
+ }
114
+
115
+ if (labelArray.length > 0) {
116
+
117
+ var values = _this.state.radioValues;
118
+ var valueArray = [];
119
+ if (values.length > 0) {
120
+ //去除末尾的中英文逗号
121
+ var _endChar = values.charAt(values.length - 1);
122
+ if (_endChar == ',' || _endChar == ',') {
123
+ values = values.substring(0, values.length - 1);
124
+ }
125
+ valueArray = values.trim().split(/,|,/);
126
+ }
127
+
128
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
129
+ fp.options.splice(0, fp.options.length);
130
+
131
+ //当label的个数与value不相等时,以较少的为准,多余的将不纳入参数
132
+ var indexRange = labelArray.length > valueArray.length ? valueArray.length : labelArray.length;
133
+
134
+ //构建radio的options值,方便render以options形式渲染单选框
135
+ for (var index = 0; index < indexRange; index++) {
136
+ var option = {};
137
+ option.label = labelArray[index];
138
+ option.value = valueArray[index];
139
+ fp.options.push(option);
140
+ }
141
+ _this.setState({ featureParams: fp });
142
+ _this.createFeature(fp);
143
+ }
144
+ _this.setState({ radioLabels: labels });
145
+ };
146
+
147
+ _this.handleRadioValueChange = function (e) {
148
+ var values = e.target.value;
149
+ var valueArray = [];
150
+ if (values.length > 0) {
151
+ //去除末尾的中英文逗号
152
+ var endChar = values.charAt(values.length - 1);
153
+ var tempValues = values;
154
+ if (endChar == ',' || endChar == ',') {
155
+ tempValues = tempValues.substring(0, values.length - 1);
156
+ }
157
+ valueArray = tempValues.trim().split(/,|,/);
158
+ console.info(valueArray);
159
+ }
160
+
161
+ if (valueArray.length > 0) {
162
+
163
+ var labels = _this.state.radioLabels;
164
+ var labelArray = [];
165
+ if (labels.length > 0) {
166
+ //去除末尾的中英文逗号
167
+ var _endChar2 = labels.charAt(labels.length - 1);
168
+ if (_endChar2 == ',' || _endChar2 == ',') {
169
+ labels = labels.substring(0, labels.length - 1);
170
+ }
171
+ labelArray = labels.trim().split(/,|,/);
172
+ }
173
+
174
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
175
+ fp.options.splice(0, fp.options.length);
176
+
177
+ //当label的个数与value不相等时,以较少的为准,多余的将不纳入参数
178
+ var indexRange = labelArray.length > valueArray.length ? valueArray.length : labelArray.length;
179
+
180
+ //构建radio的options值,方便render以options形式渲染单选框
181
+ for (var index = 0; index < indexRange; index++) {
182
+ var option = {};
183
+ option.label = labelArray[index];
184
+ option.value = valueArray[index];
185
+ fp.options.push(option);
186
+ }
187
+ _this.setState({ featureParams: fp });
188
+ _this.createFeature(fp);
189
+ }
190
+ _this.setState({ radioValues: values });
191
+ };
192
+
193
+ _this.handleRequiredRadioChange = function (e) {
194
+ var required = e.target.value;
195
+
196
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
197
+ fp.required = required;
198
+
199
+ _this.setState({ featureParams: fp });
200
+ _this.createFeature(fp);
201
+ };
202
+
203
+ _this.handleDefaultValueChange = function (e) {
204
+ var defaultValue = e.target.value;
205
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
206
+ fp.defaultValue = defaultValue;
207
+ _this.setState({ featureParams: fp });
208
+ _this.createFeature(fp);
209
+ };
210
+
211
+ _this.createFeature = function (featureParams) {
212
+
213
+ try {
214
+ var feature = (0, _stringify2.default)(featureParams);
215
+ _this.setState({
216
+ feature: feature
217
+ });
218
+ _this.props.onChange(feature);
219
+ } catch (e) {
220
+ console.log(e);
221
+ _message3.default.error('生成控件配置参数出错!');
222
+ }
223
+ };
224
+
225
+ _this.state = {
226
+ feature: '', //原参数json字符串
227
+ radioLabels: '', //label textarea文本域的值
228
+ radioValues: '', //value textarea文本域的值
229
+ featureParams: {
230
+ name: '单选框组合组件',
231
+ type: _inputConst.InputType.RADIO, //控件类型,必须有此属性,用于渲染时期判断控件类型
232
+ options: [],
233
+ required: false, //是否必须
234
+ defaultValue: '', //默认值
235
+ validationValueType: 'string' //用于校验的值的类型
236
+ }
237
+ };
238
+ return _this;
239
+ }
240
+
241
+ (0, _createClass3.default)(SettingRadio, [{
242
+ key: 'componentWillMount',
243
+
244
+
245
+ //在渲染前调用,可在此最后一次初始化组件状态
246
+ value: function componentWillMount() {
247
+ //将输入控件配置参数设置到状态中
248
+ if (this.props.initFeature) {
249
+ try {
250
+ var initFeature = JSON.parse(this.props.initFeature);
251
+ if (initFeature.type == _inputConst.InputType.RADIO) {
252
+ var _initFeature$options = initFeature.options,
253
+ options = _initFeature$options === undefined ? [] : _initFeature$options,
254
+ _initFeature$required = initFeature.required,
255
+ required = _initFeature$required === undefined ? false : _initFeature$required,
256
+ _initFeature$defaultV = initFeature.defaultValue,
257
+ defaultValue = _initFeature$defaultV === undefined ? '' : _initFeature$defaultV;
258
+
259
+
260
+ var radioLabels = '';
261
+ var radioValues = '';
262
+ var _iteratorNormalCompletion = true;
263
+ var _didIteratorError = false;
264
+ var _iteratorError = undefined;
265
+
266
+ try {
267
+ for (var _iterator = (0, _getIterator3.default)(options), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
268
+ var radioParam = _step.value;
269
+
270
+ radioLabels += radioParam.label + ",";
271
+ radioValues += radioParam.value + ",";
272
+ }
273
+ } catch (err) {
274
+ _didIteratorError = true;
275
+ _iteratorError = err;
276
+ } finally {
277
+ try {
278
+ if (!_iteratorNormalCompletion && _iterator.return) {
279
+ _iterator.return();
280
+ }
281
+ } finally {
282
+ if (_didIteratorError) {
283
+ throw _iteratorError;
284
+ }
285
+ }
286
+ }
287
+
288
+ if (radioLabels.length > 0) {
289
+ radioLabels = radioLabels.substring(0, radioLabels.length - 1);
290
+ }
291
+ if (radioValues.length > 0) {
292
+ radioValues = radioValues.substring(0, radioValues.length - 1);
293
+ }
294
+
295
+ var fp = (0, _extends3.default)({}, this.state.featureParams);
296
+ fp.options = options;
297
+ fp.required = required;
298
+ fp.defaultValue = defaultValue;
299
+
300
+ this.setState({
301
+ feature: this.props.initFeature,
302
+ radioLabels: radioLabels,
303
+ radioValues: radioValues,
304
+ featureParams: fp
305
+ });
306
+ }
307
+ } catch (e) {
308
+ console.log(e);
309
+ _message3.default.error('解析控件配置参数出错!');
310
+ }
311
+ } else {
312
+ try {
313
+ var feature = (0, _stringify2.default)(this.state.featureParams);
314
+ this.setState({
315
+ feature: feature
316
+ });
317
+ } catch (e) {
318
+ console.log(e);
319
+ _message3.default.error('生成控件配置参数出错!');
320
+ }
321
+ }
322
+ }
323
+
324
+ //供父组件获取feature
325
+
326
+
327
+ //单选框标签值
328
+
329
+
330
+ //单选框真实值
331
+
332
+
333
+ //是否必填
334
+
335
+
336
+ //默认值
337
+
338
+
339
+ //生成feature参数json字符串
340
+
341
+ }, {
342
+ key: 'render',
343
+ value: function render() {
344
+
345
+ var radioLabels = this.state.radioLabels;
346
+ var radioValues = this.state.radioValues;
347
+ var _state$featureParams = this.state.featureParams,
348
+ required = _state$featureParams.required,
349
+ defaultValue = _state$featureParams.defaultValue;
350
+
351
+
352
+ return _react2.default.createElement(
353
+ 'div',
354
+ { id: 'input-setting-div' },
355
+ _react2.default.createElement(
356
+ _row2.default,
357
+ { type: 'flex' },
358
+ _react2.default.createElement(
359
+ _col2.default,
360
+ null,
361
+ _react2.default.createElement(
362
+ 'div',
363
+ { style: { margin: "16px 0" } },
364
+ '\u5355\u9009\u6846\u914D\u7F6E\u4FE1\u606F'
365
+ )
366
+ )
367
+ ),
368
+ _react2.default.createElement(
369
+ _row2.default,
370
+ { type: 'flex', gutter: 8 },
371
+ _react2.default.createElement(
372
+ _col2.default,
373
+ { span: 12 },
374
+ _react2.default.createElement(
375
+ 'div',
376
+ { style: { marginBottom: "5px" } },
377
+ '\u5355\u9009\u6846\u6807\u7B7E'
378
+ ),
379
+ _react2.default.createElement(TextArea, {
380
+ rows: 3,
381
+ placeholder: '\u8BF7\u8F93\u5165\u4E00\u7EC4\u5355\u9009\u6846\u6807\u7B7E\uFF0C\u4EE5\u9017\u53F7\',\'\u9694\u5F00\u3002\u5982\uFF1A\'\u6807\u7B7E1,\u6807\u7B7E2,\u6807\u7B7E3\'\uFF0C\u4E0D\u5B9C\u8D85\u8FC75\u9879',
382
+ onChange: this.handleRadioLabelChange,
383
+ value: radioLabels
384
+ })
385
+ ),
386
+ _react2.default.createElement(
387
+ _col2.default,
388
+ { span: 12 },
389
+ _react2.default.createElement(
390
+ 'div',
391
+ { style: { marginBottom: "5px" } },
392
+ '\u5355\u9009\u6846\u503C'
393
+ ),
394
+ _react2.default.createElement(TextArea, {
395
+ rows: 3,
396
+ placeholder: '\u8BF7\u8F93\u5165\u4E00\u7EC4\u5355\u9009\u6846\u503C\uFF0C\u4EE5\u9017\u53F7\',\'\u9694\u5F00\u3002\u5982\uFF1A\'\u503C1,\u503C2,\u503C3\'\uFF0C\u4E0D\u5B9C\u8D85\u8FC75\u9879',
397
+ onChange: this.handleRadioValueChange,
398
+ value: radioValues
399
+ })
400
+ )
401
+ ),
402
+ _react2.default.createElement(
403
+ _row2.default,
404
+ { type: 'flex' },
405
+ _react2.default.createElement(
406
+ _col2.default,
407
+ null,
408
+ _react2.default.createElement(
409
+ 'div',
410
+ { style: { margin: "16px 0" } },
411
+ '\u662F\u5426\u5FC5\u586B'
412
+ )
413
+ )
414
+ ),
415
+ _react2.default.createElement(
416
+ _row2.default,
417
+ { type: 'flex' },
418
+ _react2.default.createElement(
419
+ _col2.default,
420
+ null,
421
+ _react2.default.createElement(
422
+ RadioGroup,
423
+ { onChange: this.handleRequiredRadioChange, name: 'requiredradiogroup',
424
+ value: required },
425
+ _react2.default.createElement(
426
+ _radio2.default,
427
+ { value: false },
428
+ '\u975E\u5FC5\u586B'
429
+ ),
430
+ _react2.default.createElement(
431
+ _radio2.default,
432
+ { value: true },
433
+ '\u5FC5\u586B'
434
+ )
435
+ )
436
+ )
437
+ ),
438
+ _react2.default.createElement(
439
+ _row2.default,
440
+ { type: 'flex' },
441
+ _react2.default.createElement(
442
+ _col2.default,
443
+ { span: 24 },
444
+ _react2.default.createElement(
445
+ 'div',
446
+ { style: { margin: "16px 0" } },
447
+ '\u9ED8\u8BA4\u503C'
448
+ )
449
+ )
450
+ ),
451
+ _react2.default.createElement(
452
+ _row2.default,
453
+ { type: 'flex' },
454
+ _react2.default.createElement(
455
+ _col2.default,
456
+ { span: 12 },
457
+ _react2.default.createElement(_input2.default, { placeholder: '\u8BF7\u8F93\u5165\u9ED8\u8BA4\u9009\u4E2D\u9879\u7684\u503C', onChange: this.handleDefaultValueChange, value: defaultValue })
458
+ )
459
+ )
460
+ );
461
+ }
462
+ }]);
463
+ return SettingRadio;
464
+ }(_react2.default.Component);
465
+
466
+ SettingRadio.defaultProps = {
467
+ initFeature: '' };
468
+ exports.default = SettingRadio;