dlt-for-react 1.1.2 → 1.1.4

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