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,428 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _select = require('antd/lib/select');
8
+
9
+ var _select2 = _interopRequireDefault(_select);
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 _extends2 = require('babel-runtime/helpers/extends');
24
+
25
+ var _extends3 = _interopRequireDefault(_extends2);
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 _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
36
+
37
+ var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
38
+
39
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
40
+
41
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
42
+
43
+ var _createClass2 = require('babel-runtime/helpers/createClass');
44
+
45
+ var _createClass3 = _interopRequireDefault(_createClass2);
46
+
47
+ var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
48
+
49
+ var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
50
+
51
+ var _inherits2 = require('babel-runtime/helpers/inherits');
52
+
53
+ var _inherits3 = _interopRequireDefault(_inherits2);
54
+
55
+ var _radio = require('antd/lib/radio');
56
+
57
+ var _radio2 = _interopRequireDefault(_radio);
58
+
59
+ require('antd/lib/select/style');
60
+
61
+ require('antd/lib/input-number/style');
62
+
63
+ require('antd/lib/row/style');
64
+
65
+ require('antd/lib/col/style');
66
+
67
+ require('antd/lib/message/style');
68
+
69
+ require('antd/lib/radio/style');
70
+
71
+ var _react = require('react');
72
+
73
+ var _react2 = _interopRequireDefault(_react);
74
+
75
+ var _inputConst = require('./input-const');
76
+
77
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
78
+
79
+ var RadioGroup = _radio2.default.Group;
80
+
81
+ //文件上传默认最大值10M
82
+ var defaultFileSize = 10;
83
+
84
+ /**
85
+ * @author weishihuai
86
+ * @date 2018/8/2
87
+ * @time 14:26
88
+ * @Description: 文件上传控件配置组件
89
+ */
90
+
91
+ var SettingUpload = function (_React$Component) {
92
+ (0, _inherits3.default)(SettingUpload, _React$Component);
93
+
94
+ function SettingUpload(props) {
95
+ (0, _classCallCheck3.default)(this, SettingUpload);
96
+
97
+ var _this = (0, _possibleConstructorReturn3.default)(this, (SettingUpload.__proto__ || (0, _getPrototypeOf2.default)(SettingUpload)).call(this, props));
98
+
99
+ _this.getFeature = function () {
100
+ return _this.state.feature;
101
+ };
102
+
103
+ _this.createFeature = function (featureParams) {
104
+ try {
105
+ var feature = (0, _stringify2.default)(featureParams);
106
+ _this.setState({
107
+ feature: feature
108
+ });
109
+ _this.props.onChange(feature);
110
+ } catch (e) {
111
+ _message3.default.error('生成控件配置参数出错!');
112
+ }
113
+ };
114
+
115
+ _this.handleSizeChange = function (value) {
116
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
117
+ fp.size = value;
118
+ _this.setState({ fileSize: value, featureParams: fp });
119
+ _this.createFeature(fp);
120
+ };
121
+
122
+ _this.handleRequiredRadioChange = function (e) {
123
+ var required = e.target.value;
124
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
125
+ fp.required = required;
126
+ _this.setState({
127
+ featureParams: fp
128
+ });
129
+ _this.createFeature(fp);
130
+ };
131
+
132
+ _this.handleFileTypeRadioChange = function (e) {
133
+ var fileType = e.target.value;
134
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
135
+ fp.fileType = fileType;
136
+ fp.mode = 'file';
137
+ if (fileType === 'image') {
138
+ fp.validationValueType = 'array';
139
+ } else {
140
+ fp.validationValueType = 'string';
141
+ }
142
+ _this.setState({
143
+ featureParams: fp
144
+ });
145
+ _this.createFeature(fp);
146
+ };
147
+
148
+ _this.handeModeChange = function (value) {
149
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
150
+ fp.mode = value;
151
+ _this.setState({ featureParams: fp });
152
+ _this.createFeature(fp);
153
+ };
154
+
155
+ _this.handleNumberLimitChange = function (value) {
156
+ var fp = (0, _extends3.default)({}, _this.state.featureParams);
157
+ fp.numberLimit = value;
158
+ _this.setState({ featureParams: fp });
159
+ _this.createFeature(fp);
160
+ };
161
+
162
+ _this.state = {
163
+ feature: '', //原参数json字符串
164
+ fileSize: defaultFileSize,
165
+ featureParams: {
166
+ size: defaultFileSize, //上传文件默认限制最大为10M
167
+ fileType: 'image', //文件类型
168
+ mode: 'file',
169
+ numberLimit: 1,
170
+ type: _inputConst.InputType.OLDUPLOAD, //控件类型,必须有此属性,用于渲染时期判断控件类型
171
+ required: false, //是否必须(默认非必填)
172
+ validationValueType: 'array' //指定async-validator校验时值的类型(默认type是string,文件上传不能使用string,不然会报错form value is not string)
173
+ }
174
+ };
175
+ return _this;
176
+ }
177
+
178
+ (0, _createClass3.default)(SettingUpload, [{
179
+ key: 'componentWillMount',
180
+
181
+
182
+ //在渲染前调用,可在此最后一次初始化组件状态
183
+ value: function componentWillMount() {
184
+ //将输入控件配置参数设置到状态中
185
+ if (this.props.initFeature) {
186
+ try {
187
+ var initFeature = JSON.parse(this.props.initFeature);
188
+ if (initFeature.type == _inputConst.InputType.UPLOAD) {
189
+ //定义文件上传的参数默认值
190
+ var _initFeature$required = initFeature.required,
191
+ required = _initFeature$required === undefined ? false : _initFeature$required,
192
+ _initFeature$fileType = initFeature.fileType,
193
+ fileType = _initFeature$fileType === undefined ? 'image' : _initFeature$fileType,
194
+ _initFeature$size = initFeature.size,
195
+ size = _initFeature$size === undefined ? defaultFileSize : _initFeature$size;
196
+
197
+ var fp = (0, _extends3.default)({}, this.state.featureParams);
198
+ fp.required = required;
199
+ fp.fileType = fileType;
200
+ fp.size = size;
201
+ this.setState({
202
+ feature: this.props.initFeature,
203
+ featureParams: fp
204
+ });
205
+ }
206
+ } catch (e) {
207
+ console.log(e);
208
+ _message3.default.error('解析控件配置参数出错!');
209
+ }
210
+ } else {
211
+ try {
212
+ var feature = (0, _stringify2.default)(this.state.featureParams);
213
+ this.setState({
214
+ feature: feature
215
+ });
216
+ } catch (e) {
217
+ console.log(e);
218
+ _message3.default.error('生成控件配置参数出错!');
219
+ }
220
+ }
221
+ }
222
+
223
+ //供父组件获取feature
224
+
225
+
226
+ //生成feature参数json字符串
227
+
228
+
229
+ //修改文件上传大小,同步更新控件参数
230
+
231
+
232
+ //切换是否必填,同步更新控件参数
233
+
234
+
235
+ //切换文件类型,同步更新控件参数
236
+
237
+ }, {
238
+ key: 'render',
239
+ value: function render() {
240
+ var fileSize = this.state.fileSize;
241
+ var _state$featureParams = this.state.featureParams,
242
+ required = _state$featureParams.required,
243
+ fileType = _state$featureParams.fileType,
244
+ mode = _state$featureParams.mode,
245
+ numberLimit = _state$featureParams.numberLimit;
246
+
247
+ return _react2.default.createElement(
248
+ 'div',
249
+ { id: 'input-setting-div' },
250
+ _react2.default.createElement(
251
+ _row2.default,
252
+ { type: 'flex' },
253
+ _react2.default.createElement(
254
+ _col2.default,
255
+ null,
256
+ _react2.default.createElement(
257
+ 'div',
258
+ { style: { margin: "16px 0" } },
259
+ '\u6587\u4EF6\u4E0A\u4F20\u914D\u7F6E\u4FE1\u606F'
260
+ )
261
+ )
262
+ ),
263
+ _react2.default.createElement(
264
+ _row2.default,
265
+ { type: 'flex' },
266
+ _react2.default.createElement(
267
+ _col2.default,
268
+ null,
269
+ _react2.default.createElement(
270
+ 'div',
271
+ { style: { margin: "16px 0" } },
272
+ '\u6587\u4EF6\u7C7B\u578B'
273
+ )
274
+ )
275
+ ),
276
+ _react2.default.createElement(
277
+ _row2.default,
278
+ { type: 'flex' },
279
+ _react2.default.createElement(
280
+ _col2.default,
281
+ null,
282
+ _react2.default.createElement(
283
+ RadioGroup,
284
+ { onChange: this.handleFileTypeRadioChange, value: fileType },
285
+ _react2.default.createElement(
286
+ _radio2.default,
287
+ { value: 'image' },
288
+ '\u56FE\u7247'
289
+ ),
290
+ _react2.default.createElement(
291
+ _radio2.default,
292
+ { value: 'file' },
293
+ '\u6587\u4EF6'
294
+ )
295
+ )
296
+ )
297
+ ),
298
+ _react2.default.createElement(
299
+ _row2.default,
300
+ { type: 'flex' },
301
+ _react2.default.createElement(
302
+ _col2.default,
303
+ null,
304
+ _react2.default.createElement(
305
+ 'div',
306
+ { style: { margin: "16px 0" } },
307
+ '\u6587\u4EF6\u4E0A\u4F20\u6700\u5927\u503C'
308
+ )
309
+ )
310
+ ),
311
+ _react2.default.createElement(
312
+ _row2.default,
313
+ { type: 'flex' },
314
+ _react2.default.createElement(
315
+ _col2.default,
316
+ null,
317
+ _react2.default.createElement(_inputNumber2.default, { size: 'small',
318
+ min: 0,
319
+ formatter: function formatter(value) {
320
+ return value + 'M';
321
+ },
322
+ parser: function parser(value) {
323
+ return value.replace('M', '');
324
+ },
325
+ value: fileSize,
326
+ onChange: this.handleSizeChange
327
+ })
328
+ )
329
+ ),
330
+ _react2.default.createElement(
331
+ _row2.default,
332
+ { type: 'flex' },
333
+ _react2.default.createElement(
334
+ _col2.default,
335
+ null,
336
+ _react2.default.createElement(
337
+ 'div',
338
+ { style: { margin: "16px 0" } },
339
+ '\u4E0A\u4F20\u6A21\u5F0F'
340
+ )
341
+ )
342
+ ),
343
+ _react2.default.createElement(
344
+ _row2.default,
345
+ { type: 'flex' },
346
+ _react2.default.createElement(
347
+ _col2.default,
348
+ null,
349
+ _react2.default.createElement(
350
+ _select2.default,
351
+ { style: { width: 120 }, onChange: this.handeModeChange, value: mode },
352
+ _react2.default.createElement(
353
+ _select2.default.Option,
354
+ { value: 'file' },
355
+ 'file'
356
+ ),
357
+ _react2.default.createElement(
358
+ _select2.default.Option,
359
+ { value: 'redis' },
360
+ 'redis'
361
+ ),
362
+ fileType === 'image' ? _react2.default.createElement(
363
+ _select2.default.Option,
364
+ { value: 'base64' },
365
+ 'base64'
366
+ ) : null
367
+ )
368
+ )
369
+ ),
370
+ _react2.default.createElement(
371
+ _row2.default,
372
+ { align: 'middle', type: 'flex', style: { margin: '16px 0px 0px 0px' } },
373
+ _react2.default.createElement(
374
+ _col2.default,
375
+ { span: 8 },
376
+ '\u6587\u4EF6\u4E0A\u4F20\u4E2A\u6570\u9650\u5236\uFF1A'
377
+ ),
378
+ _react2.default.createElement(
379
+ _col2.default,
380
+ { span: 16 },
381
+ _react2.default.createElement(_inputNumber2.default, { value: numberLimit, min: 1, onChange: this.handleNumberLimitChange })
382
+ )
383
+ ),
384
+ _react2.default.createElement(
385
+ _row2.default,
386
+ { type: 'flex' },
387
+ _react2.default.createElement(
388
+ _col2.default,
389
+ null,
390
+ _react2.default.createElement(
391
+ 'div',
392
+ { style: { margin: "16px 0" } },
393
+ '\u662F\u5426\u5FC5\u586B'
394
+ )
395
+ )
396
+ ),
397
+ _react2.default.createElement(
398
+ _row2.default,
399
+ { type: 'flex' },
400
+ _react2.default.createElement(
401
+ _col2.default,
402
+ null,
403
+ _react2.default.createElement(
404
+ RadioGroup,
405
+ { onChange: this.handleRequiredRadioChange, value: required },
406
+ _react2.default.createElement(
407
+ _radio2.default,
408
+ { value: false },
409
+ '\u975E\u5FC5\u586B'
410
+ ),
411
+ _react2.default.createElement(
412
+ _radio2.default,
413
+ { value: true },
414
+ '\u5FC5\u586B'
415
+ )
416
+ )
417
+ )
418
+ )
419
+ );
420
+ }
421
+ }]);
422
+ return SettingUpload;
423
+ }(_react2.default.Component);
424
+
425
+ SettingUpload.defaultProps = {
426
+ initFeature: ''
427
+ };
428
+ exports.default = SettingUpload;