dlt-for-react 1.0.23 → 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 (213) 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 +13 -21
  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 +161 -116
  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/base64.js +238 -0
  199. package/lib/utils/browserJudge.js +33 -0
  200. package/lib/utils/common.js +18 -20
  201. package/lib/utils/createUuid.js +11 -31
  202. package/lib/utils/device.js +44 -0
  203. package/lib/utils/dynamicLoadCss.js +14 -0
  204. package/lib/utils/dynamicLoadJs.js +21 -0
  205. package/lib/utils/getLoginUser.js +1 -1
  206. package/lib/utils/getSize.js +2 -11
  207. package/lib/utils/getStyle.js +26 -0
  208. package/lib/utils/getSuitHeight.js +49 -0
  209. package/lib/utils/hasAuth.js +11 -0
  210. package/lib/utils/index.js +1 -34
  211. package/lib/utils/loadJS.js +40 -0
  212. package/package.json +1 -1
  213. /package/lib/layouts/{Login → login}/lyPassword.js +0 -0
@@ -0,0 +1,647 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _list = require("antd-mobile/lib/list");
8
+
9
+ var _list2 = _interopRequireDefault(_list);
10
+
11
+ var _toast = require("antd-mobile/lib/toast");
12
+
13
+ var _toast2 = _interopRequireDefault(_toast);
14
+
15
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
16
+
17
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
18
+
19
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
20
+
21
+ require("antd-mobile/lib/list/style/css");
22
+
23
+ require("antd-mobile/lib/toast/style/css");
24
+
25
+ var _antd = require("antd");
26
+
27
+ var _baseInfo = require("./baseInfo");
28
+
29
+ var _baseInfo2 = _interopRequireDefault(_baseInfo);
30
+
31
+ var _react = require("react");
32
+
33
+ var _react2 = _interopRequireDefault(_react);
34
+
35
+ var _NHFetch = require("../../utils/NHFetch");
36
+
37
+ var _NHFetch2 = _interopRequireDefault(_NHFetch);
38
+
39
+ var _propTypes = require("prop-types");
40
+
41
+ var _propTypes2 = _interopRequireDefault(_propTypes);
42
+
43
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
44
+
45
+ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
46
+
47
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
48
+
49
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
50
+
51
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
52
+
53
+ function getBase64(img, callback) {
54
+ var reader = new FileReader();
55
+ reader.addEventListener("load", function () {
56
+ return callback(reader.result);
57
+ });
58
+ reader.readAsDataURL(img);
59
+ }
60
+
61
+ function beforeUpload(file) {
62
+ var isJPG = file.type === "image/jpeg";
63
+ if (!isJPG) {
64
+ _toast2.default.fail("You can only upload JPG file!");
65
+ }
66
+ var isLt2M = file.size / 1024 / 1024 < 2;
67
+ if (!isLt2M) {
68
+ _toast2.default.fail("Image must smaller than 2MB!");
69
+ }
70
+ return isJPG && isLt2M;
71
+ }
72
+
73
+ var getHashParam = function getHashParam(name) {
74
+ var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'),
75
+ queryString = window.location.hash.split('?')[1] || '',
76
+ result = queryString.match(reg);
77
+ return result ? decodeURIComponent(result[2]) : null;
78
+ };
79
+
80
+ var NHDynamicFormShow = function (_React$Component) {
81
+ _inherits(NHDynamicFormShow, _React$Component);
82
+
83
+ function NHDynamicFormShow(props) {
84
+ _classCallCheck(this, NHDynamicFormShow);
85
+
86
+ var _this = _possibleConstructorReturn(this, (NHDynamicFormShow.__proto__ || Object.getPrototypeOf(NHDynamicFormShow)).call(this, props));
87
+
88
+ _this.InitialMobileInfo = function () {
89
+ var params = {
90
+ id: _this.props.objId,
91
+ bdid: _this.props.formId,
92
+ isExistMuitLayout: "0"
93
+ };
94
+ if (_this.props.pkid !== undefined) {
95
+ params.pkid = _this.props.pkid;
96
+ }
97
+ (0, _NHFetch2.default)("api/sm-dynamic-form/dynamicShow/queryZdflInfo", "GET", params).then(function (res) {
98
+ if (res) {
99
+ //把通过接口方式获取的功能实现
100
+ if (res.data) {
101
+ _this.setState({ data: res.data });
102
+ }
103
+ if (res.data.flstdm == "stu") {
104
+ _this.setState({ imageUrl: "api/sm-student/openapi/getStudentPhoto?xsid=" + _this.props.objId });
105
+ console.log("api/sm-student/openapi/getStudentPhoto?xsid=" + _this.props.objId);
106
+ } else if (res.data.flstdm == "tea") {
107
+ _this.setState({ imageUrl: "api/zhxg-xgdw/openapi/queryImgByJsid?jsid=" + _this.props.objId });
108
+ console.log("api/zhxg-xgdw/openapi/queryImgByJsid?jsid=" + _this.props.objId);
109
+ }
110
+ }
111
+ });
112
+ };
113
+
114
+ _this.getStuPhoto = function () {
115
+ var xsid = _this.props.objId;
116
+ (0, _NHFetch2.default)("api/sm-student/openapi/getStuPhoto", "GET", { xsid: xsid }).then(function (res) {
117
+ if (res && res.data > 0) {
118
+ _this.setState({
119
+ xszpcz: true
120
+ });
121
+ } else {
122
+ _this.setState({
123
+ xszpcz: false
124
+ });
125
+ }
126
+ });
127
+ };
128
+
129
+ _this.handlOneOnDetail = function (detail, cacheList) {
130
+ if (_this.state.oneONOneDetail.length > 0) {
131
+ var flid = detail.flid;
132
+ for (var i = 0; i < _this.state.oneONOneDetail.length; i++) {
133
+ if (flid === _this.state.oneONOneDetail[i].flid) {
134
+ _this.state.oneONOneDetail.splice(i, 1);
135
+ _this.setState({
136
+ oneONOneDetail: [].concat(_toConsumableArray(_this.state.oneONOneDetail), [detail])
137
+ });
138
+ } else {
139
+ _this.setState({
140
+ oneONOneDetail: [].concat(_toConsumableArray(_this.state.oneONOneDetail), [detail])
141
+ });
142
+ }
143
+ }
144
+ } else {
145
+ var oneONOneDetail = [].concat(_toConsumableArray(_this.state.oneONOneDetail), [detail]);
146
+ _this.setState({
147
+ oneONOneDetail: oneONOneDetail
148
+ });
149
+ }
150
+ if (_this.props.model === 'editCheck') {
151
+ _this.cacheEditOneOnOne(detail, cacheList);
152
+ }
153
+ };
154
+
155
+ _this.cacheEditOneOnOne = function (detail, cacheList) {
156
+ var _this$state$jczdList = _this.state.jczdList,
157
+ jczdList = _this$state$jczdList === undefined ? [] : _this$state$jczdList;
158
+
159
+ detail && detail.dto.length > 0 && detail.dto.map(function (item) {
160
+ // 找到当前改变字段的 初始数据
161
+ var cacheItem = cacheList.find(function (citem) {
162
+ return citem.id == item.id;
163
+ });
164
+ //若字段改变后的值与初始数据的值不一致 则说明该字段有修改过,把数据放到jczdList中
165
+ if (item.value !== cacheItem.value) {
166
+ var idx = jczdList.findIndex(function (idxitem) {
167
+ return idxitem.zdid == item.id;
168
+ });
169
+ if (idx !== -1) {
170
+ jczdList.splice(idx, 1);
171
+ }
172
+ jczdList.push({
173
+ xz: item.value, //新值
174
+ xzwb: item.text, //新值 显示值
175
+ yz: cacheItem.initValue, //原值
176
+ yzwb: cacheItem.initText, //原值 显示值
177
+ zdid: item.id, //字段id
178
+ sfydd: '0', //是否一对多
179
+ jlpkid: '' //一对多记录的pkid
180
+ });
181
+ } else {
182
+ // 若字段改变后的值与初始数据的值一致时,判断在jczdList中是否有改字段如果有的话就删除
183
+ var _idx = jczdList.findIndex(function (idxitem) {
184
+ return idxitem.zdid == item.id;
185
+ });
186
+ if (_idx !== -1) {
187
+ jczdList.splice(_idx, 1);
188
+ }
189
+ }
190
+ });
191
+ _this.setState({
192
+ jczdList: jczdList
193
+ });
194
+ };
195
+
196
+ _this.cacheEditOneOnMany = function () {
197
+ var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
198
+ var cacheList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
199
+ var _this$state = _this.state,
200
+ _this$state$jczdList2 = _this$state.jczdList,
201
+ jczdList = _this$state$jczdList2 === undefined ? [] : _this$state$jczdList2,
202
+ _this$state$zdfls = _this$state.zdfls,
203
+ zdfls = _this$state$zdfls === undefined ? [] : _this$state$zdfls,
204
+ categoryList = _this$state.data.categoryList;
205
+ var dataList = detail.dataList,
206
+ deletList = detail.deletList,
207
+ titleList = detail.titleList,
208
+ flid = detail.flid;
209
+
210
+ var flmc = categoryList.filter(function (caItem) {
211
+ return caItem.flid === flid;
212
+ })[0].flmc; //分类名称
213
+ zdfls = zdfls.length > 0 ? zdfls.filter(function (zdItem) {
214
+ return zdItem.zdflid !== flid;
215
+ }) : [];
216
+ // 删除的数据 暂不考虑删除
217
+
218
+ //遍历一对多的值,判断值是否改变
219
+ dataList.length > 0 && dataList.map(function (item) {
220
+ if (item.id) {
221
+ var _loop = function _loop(i) {
222
+ if (_typeof(item[i]) == 'object') {
223
+ var zdid = titleList.filter(function (zdItem) {
224
+ return zdItem.fieldName == i;
225
+ })[0].id;
226
+ var jlpkid = item.id;
227
+ var _item$i = item[i],
228
+ value = _item$i.value,
229
+ text = _item$i.text,
230
+ initValue = _item$i.initValue,
231
+ inittext = _item$i.inittext;
232
+ //若字段改变后的值与初始数据的值不一致时,则说明字段有修改,把数据放到
233
+
234
+ if (value !== initValue) {
235
+ var idx = jczdList.findIndex(function (idxitem) {
236
+ return idxitem.zdid == zdid && idxitem.jlpkid == jlpkid;
237
+ });
238
+ if (idx !== -1) {
239
+ jczdList.splice(idx, 1);
240
+ }
241
+ jczdList.push({
242
+ xz: value, //新值
243
+ xzwb: text, //新值 显示值
244
+ yz: initValue, //原值
245
+ yzwb: inittext, //原值 显示值
246
+ zdid: zdid, //字段id
247
+ sfydd: '1', //是否一对多
248
+ jlpkid: jlpkid //一对多记录的pkid
249
+ });
250
+ } else {
251
+ // 若字段改变后的值与初始数据的值一致时,判断在jczdList中是否有改字段如果有的话就删除
252
+ var _idx2 = jczdList.findIndex(function (idxitem) {
253
+ return idxitem.zdid == zdid && idxitem.jlpkid == jlpkid;
254
+ });
255
+ if (_idx2 !== -1) {
256
+ jczdList.splice(_idx2, 1);
257
+ }
258
+ }
259
+ }
260
+ };
261
+
262
+ // 若item.id为true 则此时为修改
263
+ for (var i in item) {
264
+ _loop(i);
265
+ }
266
+ } else {
267
+ // 若item.id非true 则此时为补录
268
+ var zdflsIndex = zdfls.findIndex(function (zdflsItem) {
269
+ return zdflsItem.fieldPrefix === item.fieldPrefix;
270
+ });
271
+ var zds_add = [];
272
+ // 遍历该字段分类下的补录字段信息
273
+
274
+ var _loop2 = function _loop2(i) {
275
+ if (_typeof(item[i]) === 'object') {
276
+ var zdInfo = titleList.filter(function (zdItem) {
277
+ return zdItem.fieldName == i;
278
+ })[0];
279
+ var _item$i2 = item[i],
280
+ value = _item$i2.value,
281
+ text = _item$i2.text;
282
+ var id = zdInfo.id,
283
+ title = zdInfo.title;
284
+
285
+ zds_add.push({
286
+ zdid: id,
287
+ zdmc: title,
288
+ value: value,
289
+ text: text
290
+ });
291
+ }
292
+ };
293
+
294
+ for (var i in item) {
295
+ _loop2(i);
296
+ }
297
+ if (zdflsIndex === -1) {
298
+ zdfls.push({
299
+ zdflid: flid,
300
+ zdflmc: flmc,
301
+ zds: zds_add,
302
+ fieldPrefix: item.fieldPrefix
303
+ });
304
+ } else {
305
+ zdfls[zdflsIndex].zds = zds_add;
306
+ }
307
+ }
308
+ });
309
+ _this.setState({
310
+ jczdList: jczdList,
311
+ zdfls: zdfls
312
+ });
313
+ };
314
+
315
+ _this.handlOneOnManyDetail = function (detail, cacheList) {
316
+ if (_this.state.oneOnManyDetail.length > 0) {
317
+ var flid = detail.flid;
318
+ for (var i = 0; i < _this.state.oneOnManyDetail.length; i++) {
319
+ if (flid === _this.state.oneOnManyDetail[i].flid) {
320
+ _this.state.oneOnManyDetail.splice(i, 1);
321
+ _this.setState({
322
+ oneOnManyDetail: [].concat(_toConsumableArray(_this.state.oneOnManyDetail), [detail])
323
+ });
324
+ } else {
325
+ _this.setState({
326
+ oneOnManyDetail: [].concat(_toConsumableArray(_this.state.oneOnManyDetail), [detail])
327
+ });
328
+ }
329
+ }
330
+ } else {
331
+ var oneOnManyDetail = [].concat(_toConsumableArray(_this.state.oneOnManyDetail), [detail]);
332
+ _this.setState({ oneOnManyDetail: oneOnManyDetail });
333
+ }
334
+
335
+ if (_this.props.model === 'editCheck') {
336
+ _this.cacheEditOneOnMany(detail, cacheList);
337
+ }
338
+ };
339
+
340
+ _this.handlOneOnManyDataList = function (dataList) {
341
+ if (_this.state.oneOnManyDataList.length > 0) {
342
+ var flid = dataList.flid;
343
+ var index = _this.state.oneOnManyDataList.findIndex(function (item) {
344
+ return item.flid === flid;
345
+ });
346
+ // 已经存在,删除添加新的
347
+ if (index !== -1) {
348
+ _this.state.oneOnManyDataList.splice(index, 1);
349
+ }
350
+ }
351
+ _this.setState({ oneOnManyDataList: [].concat(_toConsumableArray(_this.state.oneOnManyDataList), [dataList]) });
352
+ };
353
+
354
+ _this.saveAllInfo = function (successCallback, failCallback) {
355
+
356
+ //如果是查看模式(view),此时不需要保存操作
357
+ if (_this.props.model === 'view') {
358
+ if (successCallback && typeof successCallback === 'function') {
359
+ successCallback();
360
+ }
361
+ return;
362
+ }
363
+ //先对表单信息做校验,校验成功才能执行保存操作
364
+ _this.nhBaseInfo.validate(function () {
365
+ var onedetail = _this.state.oneONOneDetail;
366
+ var manydetail = _this.state.oneOnManyDetail;
367
+ var oneOnManyDataList = _this.state.oneOnManyDataList;
368
+ //校验图片是否提交
369
+ if (_this.state.data.isBxImg === '1') {
370
+ //如果上传照片是必选
371
+ if (!_this.state.xszpcz && (!_this.state.uuid || _this.state.uuid == '' || typeof _this.state.uuid == "undefined")) {
372
+ _toast2.default.fail("照片不能为空!");
373
+ if (failCallback && typeof failCallback === 'function') {
374
+ failCallback();
375
+ }
376
+ return;
377
+ }
378
+ }
379
+ // 校验一对多的条数限制
380
+ var data = _this.state.data;
381
+
382
+ var _loop3 = function _loop3(i) {
383
+ var dataItem = data.categoryList.find(function (item) {
384
+ return item.flid === oneOnManyDataList[i].flid;
385
+ });
386
+ if (dataItem !== undefined && oneOnManyDataList[i].dataList.length < dataItem.tsxzzxz) {
387
+ _toast2.default.fail(dataItem.flmc + "\u81F3\u5C11\u9700\u8981" + dataItem.tsxzzxz + "\u6761");
388
+ if (failCallback && typeof failCallback === 'function') {
389
+ failCallback();
390
+ }
391
+ return {
392
+ v: void 0
393
+ };
394
+ }
395
+ };
396
+
397
+ for (var i = 0; i < oneOnManyDataList.length; i++) {
398
+ var _ret3 = _loop3(i);
399
+
400
+ if ((typeof _ret3 === "undefined" ? "undefined" : _typeof(_ret3)) === "object") return _ret3.v;
401
+ }
402
+ onedetail.sort(function (a, b) {
403
+ return a.pxh - b.pxh;
404
+ });
405
+ //先保存自定义模块的信息
406
+ _this.nhBaseInfo.saveCustomInfo(function () {
407
+ _this.saveAll({
408
+ onedto: onedetail,
409
+ manydto: manydetail,
410
+ rwid: _this.props.rwid,
411
+ userId: _this.props.objId
412
+ }, successCallback, failCallback);
413
+ }, failCallback);
414
+ if (_this.state.data.isShowImg === '1' && _this.state.data.isEditImg === '1') {
415
+ if (_this.state.data.flstdm == "stu") {
416
+ (0, _NHFetch2.default)("api/sm-student/openapi/saveStudentPhoto?xsid=" + _this.props.objId + "&photoUUID=" + _this.state.uuid, "POST").then(function (res) {
417
+ if (res && res.code === 200) {}
418
+ _this.getStuPhoto();
419
+ });
420
+ } else if (_this.state.data.flstdm == "tea") {
421
+ (0, _NHFetch2.default)("api/zhxg-xgdw/openapi/uploadSingleTeacherPhoto?photoUUID=" + _this.state.uuid + "&jsid=" + _this.props.objId, "POST").then(function (res) {
422
+ if (res && res.code === 200) {}
423
+ });
424
+ }
425
+ }
426
+ }, failCallback);
427
+ };
428
+
429
+ _this.validate = function (successCallback, failCallback) {
430
+ if (_this.props.model === 'view') {
431
+ if (typeof successCallback === 'function') {
432
+ successCallback();
433
+ }
434
+ return;
435
+ }
436
+ _this.nhBaseInfo.validate(successCallback, failCallback);
437
+ };
438
+
439
+ _this.saveAll = function (params, successCallback, failCallback) {
440
+ (0, _NHFetch2.default)("api/sm-dynamic-form/openapi/dynamic/save/all", "POST", params).then(function (res) {
441
+ if (res) {
442
+ if (res && res.code === 200) {
443
+ if (successCallback && typeof successCallback === 'function') {
444
+ successCallback();
445
+ }
446
+ } else {
447
+ _toast2.default.fail("保存表单数据失败,请联系管理员!");
448
+ if (failCallback && typeof failCallback === 'function') {
449
+ failCallback();
450
+ }
451
+ }
452
+ } else {
453
+ if (failCallback && typeof failCallback === 'function') {
454
+ failCallback();
455
+ }
456
+ }
457
+ }).catch(function () {
458
+ if (failCallback && typeof failCallback === 'function') {
459
+ failCallback();
460
+ }
461
+ });
462
+ };
463
+
464
+ _this.handleChange = function (info) {
465
+ if (info.file.status === "uploading") {
466
+ _this.setState({ loading: true });
467
+ return;
468
+ }
469
+ if (info.file.status === "done" && info.file.response.data) {
470
+ _toast2.default.success(info.file.name + " \u4E0A\u4F20\u6210\u529F");
471
+ getBase64(info.file.originFileObj, function (imageUrl) {
472
+ return _this.setState({
473
+ imageUrl: imageUrl,
474
+ loading: false,
475
+ img: false
476
+ });
477
+ });
478
+ _this.setState({ uuid: info.file.response.data });
479
+ } else if (info.file.status === 'error' || info.file.status === 'done' && !info.file.response.data) {
480
+ _toast2.default.fail(info.file.name + " \u4E0A\u4F20\u5931\u8D25");
481
+ }
482
+ };
483
+
484
+ _this.editCheckCloseAll = function () {
485
+ _this.nhBaseInfo.editCheckCloseAll();
486
+ };
487
+
488
+ _this.getCustomAuditList = function () {
489
+ return _this.nhBaseInfo.getCustomAuditList();
490
+ };
491
+
492
+ _this.state = {
493
+ data: {
494
+ categoryList: [],
495
+ objInfo: {},
496
+ imageUrl: '', //图片地址
497
+ uuid: '', //存到redis后返回的uuid
498
+ img: false
499
+ },
500
+ // data: {//根据表单ID查询出来的数据
501
+ // isShowImg: '1',//是否显示照片,只有是学生或者教师的时候才能显示照片
502
+ // objInfo: {//显示图片的时候用户需要显示的信息
503
+ // xm: '百里屠苏',
504
+ // xmb: '1',
505
+ // sszz: '信本1101班'//所属组织,如果是学生就是班级,是教师就是部门
506
+ // },
507
+ // isEditImg:'1',//图片是否可以编辑
508
+ // flstdm: 'stu',//分类实体代码
509
+ // categoryList: [//分类信息
510
+ // { flid: '1', flmc: '个人基本信息', fllxdm: '1', ssfl: 'base',baseUrl:'api/pub-stuinfo' },
511
+ // { flid: '2', flmc: '学籍信息', fllxdm: '1', ssfl: 'base',baseUrl:'api/pub-stuinfo' },
512
+ // { flid: '3', flmc: '入学信息', fllxdm: '1', ssfl: 'base',baseUrl:'api/pub-stuinfo' },
513
+ // { flid: '4', flmc: '联系信息', fllxdm: '1', ssfl: 'base',baseUrl:'api/pub-stuinfo' },
514
+ // { flid: '5', flmc: '家庭成员', fllxdm: '2', ssfl: 'base',baseUrl:'api/pub-stuinfo',isEdit:'0' },
515
+ // { flid: '6', flmc: '教育经历', fllxdm: '2', ssfl: 'extend',baseUrl:'api/pub-stuinfo',isEdit:'1' },
516
+ // { flid: '7', flmc: '培训经历', fllxdm: '2', ssfl: 'extend',baseUrl:'api/pub-stuinfo',isEdit:'1' },
517
+ // { flid: '8', flmc: '学生干部任职', fllxdm: '2', ssfl: 'extend',baseUrl:'api/pub-stuinfo',isEdit:'1' },
518
+ // { flid: '9', flmc: '校外奖励', fllxdm: '2', ssfl: 'extend',baseUrl:'api/pub-stuinfo',isEdit:'1' },
519
+ // { flid: '10', flmc: '扩展信息', fllxdm: '1', ssfl: 'extend',baseUrl:'api/pub-stuinfo' },
520
+ // ]
521
+ // }
522
+ oneONOneDetail: [], //一开始就是编辑模式下一对一字段的保存集合
523
+ oneOnManyDetail: [], //一开始就是编辑模式下一对多字段的保存集合
524
+ oneOnManyDataList: [], //一开始就是编辑模式下一对多字段的集合
525
+ key: '', //自定义参数
526
+ xszpcz: true, //学生照片存在
527
+
528
+ jczdList: [], //纠错list
529
+ zdfls: [] //纠错补录list(一对多)
530
+ };
531
+ return _this;
532
+ }
533
+
534
+ _createClass(NHDynamicFormShow, [{
535
+ key: "UNSAFE_componentWillMount",
536
+ value: function UNSAFE_componentWillMount() {
537
+ this.InitialMobileInfo();
538
+ var key = getHashParam("key");
539
+ if (typeof key !== "undefined" && key !== null && key !== "") {
540
+ this.setState({ key: key });
541
+ }
542
+ }
543
+ }, {
544
+ key: "componentDidMount",
545
+ value: function componentDidMount() {
546
+ // this.autoFocusInst.focus();
547
+ this.getStuPhoto();
548
+ }
549
+ /**缓存一对一纠错列表 */
550
+
551
+ //缓存一对多纠错列表
552
+
553
+ // 保存一对多的真实集合
554
+
555
+
556
+ // 保存所有,不再进行循环回调
557
+
558
+
559
+ /** 关闭所有编辑 */
560
+
561
+
562
+ /** 获取自定义表单设置的审核人 */
563
+
564
+ }, {
565
+ key: "render",
566
+ value: function render() {
567
+ var _this2 = this;
568
+
569
+ var data = this.state.data;
570
+ var imageUrl = this.state.imageUrl;
571
+ // console.log(data);
572
+ // console.log(this.props.model);
573
+ return _react2.default.createElement(
574
+ "div",
575
+ { className: "nh-dynamic-Form" },
576
+ data.isShowImg === '1' && this.props.model !== 'editCheck' ? _react2.default.createElement(
577
+ _list2.default,
578
+ { renderHeader: function renderHeader() {
579
+ return '个人照片';
580
+ }, style: {} },
581
+ this.props.model !== 'view' && data.isEditImg === '1' ? _react2.default.createElement(
582
+ "div",
583
+ { style: { display: 'flex', justifyContent: 'center' } },
584
+ _react2.default.createElement(
585
+ "span",
586
+ { style: { padding: '4px', border: '1px dashed #d9d9d9' } },
587
+ _react2.default.createElement(
588
+ _antd.Upload,
589
+ {
590
+ name: "photo",
591
+ listType: "picture-card",
592
+ action: "api/sm-student/openapi/cacheStudentPhoto",
593
+ accept: 'image/*',
594
+ showUploadList: false,
595
+ beforeUpload: beforeUpload,
596
+ onChange: this.handleChange
597
+ },
598
+ _react2.default.createElement("img", { alt: "example", style: { width: '2rem', maxWidth: '2rem', maxHeight: '2.6rem', objectFit: 'contain' }, src: imageUrl })
599
+ )
600
+ )
601
+ ) : _react2.default.createElement(
602
+ "div",
603
+ { style: { display: 'flex', justifyContent: 'center' } },
604
+ _react2.default.createElement(
605
+ "span",
606
+ { style: { padding: '4px', border: '1px dashed #ffffff' } },
607
+ _react2.default.createElement("img", { alt: "example", style: { width: '2rem', maxWidth: '2rem', maxHeight: '2.6rem', objectFit: 'contain' }, src: imageUrl })
608
+ )
609
+ )
610
+ ) : null,
611
+ _react2.default.createElement(_baseInfo2.default, _extends({ ref: function ref(ele) {
612
+ return _this2.nhBaseInfo = ele;
613
+ }, flstdm: data.flstdm }, this.props, { handlOneOnManyDataList: this.handlOneOnManyDataList, handlOneOnDetail: this.handlOneOnDetail, handlOneOnManyDetail: this.handlOneOnManyDetail, categoryList: data.categoryList }))
614
+ );
615
+ }
616
+ }]);
617
+
618
+ return NHDynamicFormShow;
619
+ }(_react2.default.Component);
620
+
621
+ //默认属性值
622
+
623
+
624
+ NHDynamicFormShow.defaultProps = {
625
+ formId: undefined, //动态表单ID,此值可以唯一表示一个动态表单
626
+ objId: undefined, //对象ID
627
+ pkid: undefined, //业务表主键ID
628
+ params: undefined, //参数集合,主要通过该参数集合给自定义面板传参
629
+ showHeader: true, //是否隐藏标题头部,不过当editSave模式时,不能设置为true
630
+ model: 'edit', //模式:
631
+ //view:查看模式
632
+ //edit:编辑模式(进入后直接把所有可以编辑的字段变成可编辑额状态)
633
+ //editCheck:(华农)纠错编辑模式(进入后是显示的页面 点击编辑按钮后变成可编辑状态)editCheck暂不支持自定义模块
634
+ processId: undefined //流程ID
635
+
636
+
637
+ //属性检查
638
+ };NHDynamicFormShow.propTypes = {
639
+ formId: _propTypes2.default.string.isRequired,
640
+ objId: _propTypes2.default.string.isRequired,
641
+ pkid: _propTypes2.default.string,
642
+ showHeader: _propTypes2.default.bool,
643
+ model: _propTypes2.default.string.isRequired,
644
+ processId: _propTypes2.default.string
645
+ };
646
+
647
+ exports.default = NHDynamicFormShow;