dlt-for-react 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +9 -1
  2. package/lib/components/KyContainerFrame/index.js +46 -39
  3. package/lib/index.js +7 -1
  4. package/lib/layouts/Top/index.js +1 -1
  5. package/lib/layouts/layout/index.js +77 -31
  6. package/lib/layouts/mixTop/index.js +3 -3
  7. package/lib/utils/createUuid.js +31 -11
  8. package/lib/utils/getLoginUser.js +1 -1
  9. package/lib/utils/getSize.js +11 -2
  10. package/lib/utils/index.js +35 -2
  11. package/package.json +1 -1
  12. package/lib/components/Button/index.js +0 -79
  13. package/lib/components/NHAuditPanel/config/Axios.js +0 -263
  14. package/lib/components/NHAuditPanel/config/api.js +0 -479
  15. package/lib/components/NHAuditPanel/config/data.js +0 -156
  16. package/lib/components/NHAuditPanel/config/typeMap.js +0 -1234
  17. package/lib/components/NHAuditPanel/config/uiValidate.js +0 -92
  18. package/lib/components/NHAuditPanel/index.js +0 -413
  19. package/lib/components/NHAuditPanel/node.js +0 -619
  20. package/lib/components/NHCascader/index.js +0 -355
  21. package/lib/components/NHCheckboxGroup/index.js +0 -135
  22. package/lib/components/NHDynamicFormShow/baseInfo/index.js +0 -194
  23. package/lib/components/NHDynamicFormShow/custom/index.js +0 -553
  24. package/lib/components/NHDynamicFormShow/customModule/common/CommonMethod.js +0 -43
  25. package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/EditForm.js +0 -1113
  26. package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/index.js +0 -263
  27. package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/EditForm.js +0 -880
  28. package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/index.js +0 -171
  29. package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/EditForm.js +0 -865
  30. package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/index.js +0 -138
  31. package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/EditForm.js +0 -571
  32. package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/index.js +0 -147
  33. package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/EditForm.js +0 -474
  34. package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/index.js +0 -139
  35. package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/EditForm.js +0 -506
  36. package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/index.js +0 -143
  37. package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/EditForm.js +0 -1074
  38. package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/index.js +0 -172
  39. package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/EditForm.js +0 -927
  40. package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/index.js +0 -195
  41. package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/EditForm.js +0 -1064
  42. package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/index.js +0 -183
  43. package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/EditForm.js +0 -763
  44. package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/index.js +0 -137
  45. package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/EditForm.js +0 -819
  46. package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/index.js +0 -137
  47. package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/EditForm.js +0 -700
  48. package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/index.js +0 -162
  49. package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/EditForm.js +0 -743
  50. package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/index.js +0 -177
  51. package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/EditForm.js +0 -848
  52. package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/index.js +0 -138
  53. package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/EditForm.js +0 -777
  54. package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/index.js +0 -161
  55. package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/EditForm.js +0 -706
  56. package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/index.js +0 -130
  57. package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/cfjcEditForm.js +0 -413
  58. package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/index.js +0 -135
  59. package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/EditForm.js +0 -1013
  60. package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/index.js +0 -175
  61. package/lib/components/NHDynamicFormShow/customModule/jjrlx/EditForm.js +0 -1345
  62. package/lib/components/NHDynamicFormShow/customModule/jjrlx/index.js +0 -274
  63. package/lib/components/NHDynamicFormShow/customModule/jxj/EditForm.js +0 -669
  64. package/lib/components/NHDynamicFormShow/customModule/jxj/index.js +0 -134
  65. package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/EditForm.js +0 -378
  66. package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/index.js +0 -120
  67. package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/EditForm.js +0 -638
  68. package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/index.js +0 -133
  69. package/lib/components/NHDynamicFormShow/customModule/qgzx/EditForm.js +0 -965
  70. package/lib/components/NHDynamicFormShow/customModule/qgzx/index.js +0 -237
  71. package/lib/components/NHDynamicFormShow/customModule/qjgl/EditForm.js +0 -823
  72. package/lib/components/NHDynamicFormShow/customModule/qjgl/index.js +0 -188
  73. package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/EditForm.js +0 -401
  74. package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/index.js +0 -472
  75. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/EditForm.js +0 -304
  76. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHCascader/index.js +0 -375
  77. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/RadioGroup.js +0 -118
  78. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/index.js +0 -62
  79. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/input-const.js +0 -55
  80. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/render.js +0 -1238
  81. package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/index.js +0 -375
  82. package/lib/components/NHDynamicFormShow/customModule/rych/collective/EditForm.js +0 -554
  83. package/lib/components/NHDynamicFormShow/customModule/rych/collective/index.js +0 -130
  84. package/lib/components/NHDynamicFormShow/customModule/rych/personal/EditForm.js +0 -542
  85. package/lib/components/NHDynamicFormShow/customModule/rych/personal/index.js +0 -133
  86. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/EditForm.js +0 -575
  87. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/index.js +0 -130
  88. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/EditForm.js +0 -563
  89. package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/index.js +0 -133
  90. package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/EditForm.js +0 -745
  91. package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/index.js +0 -164
  92. package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/EditForm.js +0 -587
  93. package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/index.js +0 -143
  94. package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/EditForm.js +0 -743
  95. package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/index.js +0 -172
  96. package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/EditForm.js +0 -1410
  97. package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/index.js +0 -274
  98. package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/EditForm.js +0 -755
  99. package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/index.js +0 -130
  100. package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/EditForm.js +0 -814
  101. package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/index.js +0 -188
  102. package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/EditForm.js +0 -769
  103. package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/index.js +0 -130
  104. package/lib/components/NHDynamicFormShow/customModule/whgcrych/EditForm.js +0 -1004
  105. package/lib/components/NHDynamicFormShow/customModule/whgcrych/index.js +0 -126
  106. package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/EditForm.js +0 -503
  107. package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/index.js +0 -149
  108. package/lib/components/NHDynamicFormShow/customModule/whtlyhk/EditForm.js +0 -379
  109. package/lib/components/NHDynamicFormShow/customModule/whtlyhk/index.js +0 -148
  110. package/lib/components/NHDynamicFormShow/customModule/whtlzxj/EditForm.js +0 -748
  111. package/lib/components/NHDynamicFormShow/customModule/whtlzxj/index.js +0 -135
  112. package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/EditForm.js +0 -762
  113. package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/index.js +0 -134
  114. package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/cfjcEditForm.js +0 -682
  115. package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/index.js +0 -135
  116. package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/index.js +0 -152
  117. package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/wjsbEditForm.js +0 -783
  118. package/lib/components/NHDynamicFormShow/customModule/zxj/EditForm.js +0 -764
  119. package/lib/components/NHDynamicFormShow/customModule/zxj/index.js +0 -138
  120. package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/cfjcEditForm.js +0 -677
  121. package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/index.js +0 -138
  122. package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/EditForm.js +0 -1173
  123. package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/index.js +0 -242
  124. package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistForm.js +0 -862
  125. package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistIndex.js +0 -201
  126. package/lib/components/NHDynamicFormShow/customModule/zzsd/stuinfo/messageInfo.js +0 -196
  127. package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/index.js +0 -167
  128. package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/wjsbEditForm.js +0 -1096
  129. package/lib/components/NHDynamicFormShow/index.js +0 -647
  130. package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/cardItem/index.js +0 -279
  131. package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/index.js +0 -206
  132. package/lib/components/NHDynamicFormShow/oneOnMany/index.js +0 -419
  133. package/lib/components/NHDynamicFormShow/oneOnOne/EditForm.js +0 -401
  134. package/lib/components/NHDynamicFormShow/oneOnOne/index.js +0 -271
  135. package/lib/components/NHImagePicker/index.js +0 -554
  136. package/lib/components/NHInputPicker/RadioGroup.js +0 -118
  137. package/lib/components/NHInputPicker/index.js +0 -62
  138. package/lib/components/NHInputPicker/input-const.js +0 -55
  139. package/lib/components/NHInputPicker/render.js +0 -1271
  140. package/lib/components/NHListView/index.js +0 -374
  141. package/lib/components/NHMapGeolocation/index.js +0 -537
  142. package/lib/components/NHMapGeolocation/initMap/initGdMap.js +0 -104
  143. package/lib/components/NHMapGeolocation/initMap/initTencentMap.js +0 -138
  144. package/lib/components/NHMapGeolocation/style.js +0 -51
  145. package/lib/components/NHMultiSelect/index.js +0 -272
  146. package/lib/components/NHRadioGroup/index.js +0 -118
  147. package/lib/components/NHSelect/index.js +0 -364
  148. package/lib/components/NHTreeMenu/index.js +0 -126
  149. package/lib/components/NHTreeMenu/treeNode.js +0 -164
  150. package/lib/components/StuSelector/index.js +0 -611
  151. package/lib/layouts/KyInputPicker/edit-page.js +0 -585
  152. package/lib/layouts/KyInputPicker/index.js +0 -220
  153. package/lib/layouts/KyInputPicker/input-const.js +0 -134
  154. package/lib/layouts/KyInputPicker/render.js +0 -2477
  155. package/lib/layouts/KyInputPicker/setting-checkbox.js +0 -850
  156. package/lib/layouts/KyInputPicker/setting-datepicker.js +0 -430
  157. package/lib/layouts/KyInputPicker/setting-datetimepicker.js +0 -443
  158. package/lib/layouts/KyInputPicker/setting-input.js +0 -555
  159. package/lib/layouts/KyInputPicker/setting-inputNumber.js +0 -612
  160. package/lib/layouts/KyInputPicker/setting-monthpicker.js +0 -434
  161. package/lib/layouts/KyInputPicker/setting-multiSelect.js +0 -532
  162. package/lib/layouts/KyInputPicker/setting-nhcascader.js +0 -584
  163. package/lib/layouts/KyInputPicker/setting-old-upload.js +0 -428
  164. package/lib/layouts/KyInputPicker/setting-radio.js +0 -468
  165. package/lib/layouts/KyInputPicker/setting-rangepicker.js +0 -466
  166. package/lib/layouts/KyInputPicker/setting-select.js +0 -534
  167. package/lib/layouts/KyInputPicker/setting-stu-selector.js +0 -507
  168. package/lib/layouts/KyInputPicker/setting-switch.js +0 -274
  169. package/lib/layouts/KyInputPicker/setting-tea-selector.js +0 -507
  170. package/lib/layouts/KyInputPicker/setting-textarea.js +0 -619
  171. package/lib/layouts/KyInputPicker/setting-timepicker.js +0 -437
  172. package/lib/layouts/KyInputPicker/setting-upload.js +0 -766
  173. package/lib/layouts/KyModal/buildTitle.js +0 -81
  174. package/lib/layouts/KyModal/dragM.js +0 -127
  175. package/lib/layouts/KyModal/index.js +0 -321
  176. package/lib/layouts/KyPreview/index.js +0 -219
  177. package/lib/layouts/KyUpload/index.js +0 -1155
  178. package/lib/utils/browserJudge.js +0 -33
  179. package/lib/utils/dynamicLoadCss.js +0 -14
  180. package/lib/utils/dynamicLoadJs.js +0 -21
  181. package/lib/utils/getStyle.js +0 -26
  182. package/lib/utils/getSuitHeight.js +0 -49
  183. package/lib/utils/hasAuth.js +0 -11
  184. package/lib/utils/loadJS.js +0 -40
  185. /package/lib/layouts/{login → Login}/index-pre.js +0 -0
  186. /package/lib/layouts/{login → Login}/index.js +0 -0
  187. /package/lib/layouts/{login → Login}/login.js +0 -0
  188. /package/lib/layouts/{login → Login}/lyPassword.js +0 -0
@@ -1,468 +0,0 @@
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;