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,188 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _toast = require('antd-mobile/lib/toast');
8
+
9
+ var _toast2 = _interopRequireDefault(_toast);
10
+
11
+ 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; };
12
+
13
+ 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; }; }();
14
+
15
+ require('antd-mobile/lib/toast/style/css');
16
+
17
+ var _react = require('react');
18
+
19
+ var _react2 = _interopRequireDefault(_react);
20
+
21
+ var _propTypes = require('prop-types');
22
+
23
+ var _propTypes2 = _interopRequireDefault(_propTypes);
24
+
25
+ var _NHFetch = require('../../../../utils/NHFetch');
26
+
27
+ var _NHFetch2 = _interopRequireDefault(_NHFetch);
28
+
29
+ var _EditForm = require('./EditForm');
30
+
31
+ var _EditForm2 = _interopRequireDefault(_EditForm);
32
+
33
+ var _moment = require('moment');
34
+
35
+ var _moment2 = _interopRequireDefault(_moment);
36
+
37
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
38
+
39
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
40
+
41
+ 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; }
42
+
43
+ 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; }
44
+
45
+ /**
46
+ * 请假申请自定义表单
47
+ * @author: zengxiangkai
48
+ * @date: 2020-06-04 16:26:49
49
+ */
50
+ var QjglEditForm = function (_React$Component) {
51
+ _inherits(QjglEditForm, _React$Component);
52
+
53
+ function QjglEditForm(props) {
54
+ _classCallCheck(this, QjglEditForm);
55
+
56
+ var _this = _possibleConstructorReturn(this, (QjglEditForm.__proto__ || Object.getPrototypeOf(QjglEditForm)).call(this, props));
57
+
58
+ _this.validate = function (func) {
59
+ _this.nhEditForm.validateFields(function (err, formData) {
60
+ if (err) {
61
+ func(false);
62
+ } else {
63
+ _this.setState({ formData: formData }, function () {
64
+ func(true);
65
+ });
66
+ }
67
+ });
68
+ };
69
+
70
+ _this.countTime = function (startDate, endDate) {
71
+ var stamp = new Date(endDate).getTime() - new Date(startDate).getTime();
72
+ var time = stamp / 1000;
73
+ if (null != time && "" != time) {
74
+ var qjsct = parseInt(time / 3600.0 / 24);
75
+ var qjscxs = parseInt((parseFloat(time / 3600.0 / 24) - parseInt(time / 3600.0 / 24)) * 24);
76
+ return [qjsct, qjscxs];
77
+ } else {
78
+ return [0, 0];
79
+ }
80
+ };
81
+
82
+ _this.save = function (func, failCallback) {
83
+ var _this$props = _this.props,
84
+ processApplyId = _this$props.processApplyId,
85
+ objId = _this$props.objId,
86
+ pkid = _this$props.pkid;
87
+ var formData = _this.state.formData;
88
+
89
+
90
+ if (formData.qjkssj > formData.qjjssj) {
91
+ failCallback && failCallback();
92
+ _toast2.default.fail("请假结束时间必须大于开始时间!");
93
+ return;
94
+ }
95
+
96
+ formData.pkid = pkid;
97
+ formData.xsid = objId;
98
+ formData.lcslid = processApplyId;
99
+
100
+ formData.qjlxm = formData.qjlxm ? formData.qjlxm[0] : '';
101
+ // 替换紧急联系人电话字符串中的空格
102
+ formData.jjlxrdh = formData.jjlxrdh ? formData.jjlxrdh.replace(/\s+/g, '') : '';
103
+ formData.sfxylx = formData.sfxylx ? '1' : '0';
104
+ // 转换时间格式
105
+ formData.qjkssj = formData.qjkssj ? (0, _moment2.default)(formData.qjkssj).format("YYYY-MM-DD HH:mm") : '';
106
+ formData.qjjssj = formData.qjjssj ? (0, _moment2.default)(formData.qjjssj).format("YYYY-MM-DD HH:mm") : '';
107
+
108
+ // 请假时长
109
+ // let qjsc = formData.qjsc ? formData.qjsc.split(",") : [];
110
+
111
+ // 回退给申请者,申请者重新提交时,如果没有重新选择请假开始和结束时间,就不会触发计算请假时长,所以此处需要重新计算一次
112
+ // if (qjsc.length > 0) {
113
+ // formData.qjsct = qjsc[0];
114
+ // formData.qjscxs = qjsc[1];
115
+ // } else {
116
+
117
+ // }
118
+ var list = [formData.fjid];
119
+ (0, _NHFetch2.default)('front/zhxg-unauth/dynamic/save', 'POST', list).then(function (res) {
120
+ if (res && res.code === 200) {
121
+ (0, _NHFetch2.default)('api/sm-holiday/openapi/saveQjsq', 'POST', formData).then(function (res) {
122
+ if (res && res.code === 200) {
123
+ func();
124
+ } else {
125
+ _toast2.default.fail("保存失败");
126
+ }
127
+ });
128
+ } else {
129
+ _toast2.default.fail("附件保存失败");
130
+ }
131
+ });
132
+ };
133
+
134
+ _this.state = {
135
+ formData: {}
136
+ };
137
+ return _this;
138
+ }
139
+
140
+ /**
141
+ * 校验该分类表单是否全部填写完成,该方法必须存在
142
+ */
143
+
144
+
145
+ /**
146
+ * * 计算请假时长
147
+ *
148
+ * @memberof EditInitForm
149
+ */
150
+
151
+
152
+ //保存
153
+
154
+
155
+ _createClass(QjglEditForm, [{
156
+ key: 'render',
157
+ value: function render() {
158
+ var _this2 = this;
159
+
160
+ return _react2.default.createElement(_EditForm2.default, _extends({
161
+ ref: function ref(form) {
162
+ _this2.nhEditForm = form;
163
+ }
164
+ }, this.props));
165
+ }
166
+ }]);
167
+
168
+ return QjglEditForm;
169
+ }(_react2.default.Component);
170
+
171
+ exports.default = QjglEditForm;
172
+
173
+
174
+ QjglEditForm.defaultProps = {
175
+ fieldMap: {},
176
+ params: {}
177
+ };
178
+
179
+ QjglEditForm.propTypes = {
180
+ pkid: _propTypes2.default.string, //业务表主键ID
181
+ objId: _propTypes2.default.string, //对象ID
182
+ processId: _propTypes2.default.string, //流程ID
183
+ processApplyId: _propTypes2.default.string, //流程申请主键ID
184
+ fieldMap: _propTypes2.default.object, //字段信息,可以通过该对象获取到该字段,是否可以显示(sfxs)、是否可以编辑(sfbj)、是否必填等信息(sfbt)
185
+ params: _propTypes2.default.object, //参数集合,主要通过该参数集合给自定义面板传参
186
+ isEdit: _propTypes2.default.bool, //是否是编辑状态
187
+ title: _propTypes2.default.string
188
+ };
@@ -0,0 +1,401 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _whiteSpace = require('antd-mobile/lib/white-space');
8
+
9
+ var _whiteSpace2 = _interopRequireDefault(_whiteSpace);
10
+
11
+ var _button = require('antd-mobile/lib/button');
12
+
13
+ var _button2 = _interopRequireDefault(_button);
14
+
15
+ var _card = require('antd-mobile/lib/card');
16
+
17
+ var _card2 = _interopRequireDefault(_card);
18
+
19
+ var _list = require('antd-mobile/lib/list');
20
+
21
+ var _list2 = _interopRequireDefault(_list);
22
+
23
+ var _toast = require('antd-mobile/lib/toast');
24
+
25
+ var _toast2 = _interopRequireDefault(_toast);
26
+
27
+ 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; };
28
+
29
+ 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; }; }();
30
+
31
+ require('antd-mobile/lib/white-space/style/css');
32
+
33
+ require('antd-mobile/lib/button/style/css');
34
+
35
+ require('antd-mobile/lib/card/style/css');
36
+
37
+ require('antd-mobile/lib/list/style/css');
38
+
39
+ require('antd-mobile/lib/toast/style/css');
40
+
41
+ var _react = require('react');
42
+
43
+ var _react2 = _interopRequireDefault(_react);
44
+
45
+ var _moment = require('moment');
46
+
47
+ var _moment2 = _interopRequireDefault(_moment);
48
+
49
+ var _render = require('../../../../NHInputPicker/render');
50
+
51
+ var _render2 = _interopRequireDefault(_render);
52
+
53
+ var _rcForm = require('rc-form');
54
+
55
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
56
+
57
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
58
+
59
+ 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; }
60
+
61
+ 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; }
62
+
63
+ var EditInitForm = function (_React$Component) {
64
+ _inherits(EditInitForm, _React$Component);
65
+
66
+ function EditInitForm(props) {
67
+ _classCallCheck(this, EditInitForm);
68
+
69
+ var _this = _possibleConstructorReturn(this, (EditInitForm.__proto__ || Object.getPrototypeOf(EditInitForm)).call(this, props));
70
+
71
+ _this.onChange = function (seq, v, t, item) {
72
+ var value = v;
73
+ var text = t;
74
+ //如果是级联,则只需要取最后的一个值
75
+ if (item.bdkjlx === 'nhcascader' && v != undefined) {
76
+ value = "";
77
+ text = "";
78
+ if (Array.isArray(t)) {
79
+ t.map(function (map) {
80
+ text += map.label;
81
+ value = map.value;
82
+ return map;
83
+ });
84
+ }
85
+ }
86
+ _this.props.onChange && _this.props.onChange(seq, value, text);
87
+ };
88
+
89
+ _this.getDataList = function (list) {
90
+ var dataList = [];
91
+ if (list == null) {
92
+ list = [];
93
+ }
94
+ list.map(function (item, index) {
95
+ //此处只展示sfxs为1(显示)的字段
96
+ if (item.sfxs === '1') {
97
+ var required = item.sfbt === '1' ? true : false;
98
+ var render = undefined;
99
+ var isUpload = false;
100
+ var deV = undefined;
101
+ var defaultValueText = void 0;
102
+ if (item.bdkjcs && item.bdkjcs !== "" && item.bdkjcs !== undefined) {
103
+ var parameter = JSON.parse(item.bdkjcs);
104
+ if (Array.isArray(parameter.defaultValue) === true) {
105
+ deV = "";
106
+ } else {
107
+ deV = parameter.defaultValue ? parameter.defaultValue : "";
108
+ }
109
+ if (item.bdkjlx === 'radio') {
110
+ var _ref = parameter || {},
111
+ _ref$options = _ref.options,
112
+ options = _ref$options === undefined ? [] : _ref$options;
113
+
114
+ defaultValueText = (options.find(function (item) {
115
+ return item.value === deV;
116
+ }) || {}).label;
117
+ }
118
+ }
119
+ var value = "";
120
+ var text = item.text;
121
+ if (item.value !== "" && item.value !== undefined && item.value) {
122
+ value = item.value;
123
+ } else {
124
+ value = deV;
125
+ text = defaultValueText;
126
+ if (value !== "" && value !== undefined && value) {
127
+ if (!item.text && item.text === "" && item.text === undefined) {
128
+ item.text = "";
129
+ }
130
+ _this.props.onChange && _this.props.onChange(item.seq, value, text, true);
131
+ }
132
+ }
133
+ if (item.bdkjlx === 'upload') {
134
+ isUpload = true;
135
+ }
136
+ //如果是日期(datepicker),初始化的值需要做处理
137
+ if (item.bdkjlx === 'datepicker') {
138
+ value = item.value ? new Date((0, _moment2.default)(item.value, 'YYYY-MM-DD').toDate()) : undefined;
139
+ }
140
+ //如果是日期时间(datetimepicker),初始化的值需要做处理
141
+ if (item.bdkjlx === 'datetimepicker') {
142
+ value = item.value ? new Date((0, _moment2.default)(item.value, 'YYYY-MM-DD HH:mm:ss').toDate()) : undefined;
143
+ }
144
+ if (item.bdkjlx === 'timepicker') {
145
+ value = item.value ? new Date((0, _moment2.default)(item.value, 'HH:mm:ss').toDate()) : undefined;
146
+ }
147
+ //如果是日期范围(rangepicker),暂时不支持
148
+ if (item.bdkjlx === 'rangepicker') {
149
+ _toast2.default.fail('表单不支持日期范围控件', 1);
150
+ }
151
+ var otherParams = {};
152
+ if (item.parentfieldid) {
153
+ var row = list.find(function (row) {
154
+ return row.id === item.parentfieldid;
155
+ });
156
+ if (row) {
157
+ otherParams.parentValue = row.value;
158
+ }
159
+ }
160
+
161
+ var formItemLayout = { wrapperCol: { span: 24 } };
162
+ // let disabled = this.props.isEdit&&item.sfbj==='1'?true:false;
163
+ //let disabled = false;
164
+ //是采集方式为表单控件,且是可编辑的状态
165
+ var isEdit = _this.props.isEdit && item.sfbj === '1' ? true : false;
166
+ // 纠错编辑模式下 需要开放纠错编辑才显示可编辑
167
+ if (_this.props.model == 'editCheck') {
168
+ isEdit = item.sfkfjc === '1' ? true : false;
169
+ };
170
+ if (item.sjcjfsdm === '01') {
171
+ //disabled = !(item.sfbj === '1');
172
+ if (item.sfbj === '1' && isEdit) {
173
+ render = function render() {
174
+ if (_this.props.model === 'editCheck' && !item.sfkfjc) {
175
+ // 如果是纠错编辑模式未开纠错字段 不显示编辑
176
+ return _react2.default.createElement(
177
+ _list2.default.Item,
178
+ { extra: item.text, key: item.id, wrap: true, multipleLine: true },
179
+ item.title
180
+ );
181
+ }
182
+ return _react2.default.createElement(_render2.default, _extends({
183
+ id: item.id,
184
+ key: item.id,
185
+ label: item.title,
186
+ value: value,
187
+ form: _this.props.form,
188
+ feature: item.bdkjcs,
189
+ required: required,
190
+ hideLabel: true,
191
+ isEdit: isEdit,
192
+ formItemLayout: formItemLayout
193
+ //disabled={disabled}
194
+ }, otherParams, {
195
+ onChange: function onChange(value, text) {
196
+ _this.onChange(item.seq, value, text, item);
197
+ }
198
+ }));
199
+ };
200
+ } else {
201
+ render = function render() {
202
+ if (isUpload) {
203
+ return _react2.default.createElement(_render2.default, {
204
+ label: item.title,
205
+ value: value,
206
+ feature: item.bdkjcs,
207
+ isEdit: isEdit
208
+ //disabled={disabled}
209
+ });
210
+ }
211
+ return _react2.default.createElement(
212
+ _list2.default.Item,
213
+ { extra: item.text, key: item.id, wrap: true, multipleLine: true },
214
+ item.title
215
+ );
216
+ };
217
+ }
218
+ }
219
+
220
+ var map = {
221
+ isUpload: isUpload,
222
+ title: _react2.default.createElement(
223
+ 'font',
224
+ { className: 'dynamic-label-' + item.blm },
225
+ item.title
226
+ ),
227
+ text: item.text,
228
+ required: required,
229
+ render: render,
230
+ id: item.id,
231
+ sfkfjc: item.sfkfjc,
232
+ sfxs: item.sfxs,
233
+ sfbj: item.sfbj
234
+ };
235
+ dataList.push(map);
236
+ }
237
+ });
238
+ return dataList;
239
+ };
240
+
241
+ _this.onEdit = function () {
242
+ _this.props.onEdit();
243
+ };
244
+
245
+ _this.onCacheSave = function () {
246
+ _this.props.form.validateFields(function (err, value) {
247
+ if (err) {
248
+ _toast2.default.info('请检查必填项是否填写!');
249
+ return;
250
+ }
251
+ _this.props.onClose();
252
+ });
253
+ };
254
+
255
+ _this.onCanCel = function () {
256
+ _this.props.onCacheBack();
257
+ };
258
+
259
+ _this.state = {
260
+ onpenEdit: false
261
+ };
262
+ return _this;
263
+ }
264
+ // editCheck模式下 开启编辑
265
+
266
+ // editCheck模式下 保存
267
+
268
+ // editCheck模式下 保存
269
+
270
+
271
+ _createClass(EditInitForm, [{
272
+ key: 'render',
273
+ value: function render() {
274
+ var _props = this.props,
275
+ form = _props.form,
276
+ isEdit = _props.isEdit,
277
+ list = _props.list,
278
+ title = _props.title,
279
+ model = _props.model;
280
+
281
+ var dataList = this.getDataList(list);
282
+ // 该分类是否存在可编辑的纠错字段
283
+ var hasJczd = dataList.filter(function (item) {
284
+ return item.sfkfjc === '1' && item.sfbj === '1' && item.sfxs === '1';
285
+ }).length > 0;
286
+ var cardExtra = model === 'editCheck' && hasJczd ? _react2.default.createElement('img', { src: require('../../../../../../assets/NHDynamicFormShow/edit.svg'), style: { width: "0.4rem", height: "0.4rem", margin: "0px 5px" },
287
+ onClick: this.onEdit }) : null;
288
+
289
+ return _react2.default.createElement(
290
+ _react.Fragment,
291
+ null,
292
+ isEdit ?
293
+ // <List renderHeader={() => title}>
294
+ // {
295
+ // dataList.map((item, index) => {
296
+ // return item.render !== undefined ? item.render() : <List.Item key={item.id} wrap extra={item.text}>{item.title}</List.Item>;
297
+ // })
298
+ // }
299
+ // </List>
300
+ _react2.default.createElement(
301
+ 'div',
302
+ null,
303
+ _react2.default.createElement(
304
+ _card2.default,
305
+ { full: true, className: 'editTypeCard' },
306
+ _react2.default.createElement(_card2.default.Header, {
307
+ title: _react2.default.createElement(
308
+ 'div',
309
+ { style: { borderLeft: '3px solid #1890ff', paddingLeft: '10px' } },
310
+ title
311
+ )
312
+ }),
313
+ _react2.default.createElement(
314
+ _card2.default.Body,
315
+ null,
316
+ dataList.map(function (item, index) {
317
+ return item.render !== undefined ? item.render() : _react2.default.createElement(
318
+ _list2.default.Item,
319
+ { key: item.id, wrap: true, extra: item.text },
320
+ item.title
321
+ );
322
+ }),
323
+ model === 'editCheck' && _react2.default.createElement(
324
+ 'div',
325
+ { style: { display: 'flex', justifyContent: 'space-around', margin: '10px 0px 5px 0' } },
326
+ _react2.default.createElement(
327
+ _button2.default,
328
+ { type: 'primary', inline: true, size: 'small', onClick: this.onCacheSave },
329
+ '\u4FDD\u5B58'
330
+ ),
331
+ _react2.default.createElement(
332
+ _button2.default,
333
+ { type: 'ghost', inline: true, size: 'small', onClick: this.onCanCel },
334
+ '\u53D6\u6D88'
335
+ )
336
+ )
337
+ )
338
+ )
339
+ ) : _react2.default.createElement(
340
+ 'div',
341
+ null,
342
+ _react2.default.createElement(
343
+ _card2.default,
344
+ { full: true },
345
+ _react2.default.createElement(_card2.default.Header, {
346
+ title: _react2.default.createElement(
347
+ 'div',
348
+ { style: { borderLeft: '3px solid #1890ff', paddingLeft: '10px' } },
349
+ title
350
+ ),
351
+ extra: cardExtra
352
+ }),
353
+ _react2.default.createElement(
354
+ _card2.default.Body,
355
+ null,
356
+ dataList.map(function (item) {
357
+ if (item.isUpload) {
358
+ return _react2.default.createElement(
359
+ 'div',
360
+ null,
361
+ _react2.default.createElement(
362
+ 'font',
363
+ { color: 'grey' },
364
+ item.title,
365
+ '\uFF1A '
366
+ ),
367
+ item.render(),
368
+ _react2.default.createElement('br', null)
369
+ );
370
+ }
371
+ return _react2.default.createElement(
372
+ 'div',
373
+ null,
374
+ _react2.default.createElement(
375
+ 'font',
376
+ { color: 'grey' },
377
+ item.title,
378
+ '\uFF1A '
379
+ ),
380
+ item.text,
381
+ _react2.default.createElement('br', null)
382
+ );
383
+ })
384
+ )
385
+ ),
386
+ _react2.default.createElement(_whiteSpace2.default, { size: 'lg' })
387
+ ),
388
+ _react2.default.createElement(
389
+ 'style',
390
+ { global: 'true', jsx: 'true' },
391
+ '\n .editTypeCard .am-card-body{\n padding: 0 !important;\n }\n .editTypeCard .am-card-body .nh-inputrender .am-list-item.am-list-item-middle .am-list-line{\n border-bottom: 1px solid #ddd;\n }\n '
392
+ )
393
+ );
394
+ }
395
+ }]);
396
+
397
+ return EditInitForm;
398
+ }(_react2.default.Component);
399
+
400
+ var EditForm = (0, _rcForm.createForm)()(EditInitForm);
401
+ exports.default = EditForm;