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,611 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _drawer = require("antd-mobile/lib/drawer");
8
-
9
- var _drawer2 = _interopRequireDefault(_drawer);
10
-
11
- var _button = require("antd-mobile/lib/button");
12
-
13
- var _button2 = _interopRequireDefault(_button);
14
-
15
- var _searchBar = require("antd-mobile/lib/search-bar");
16
-
17
- var _searchBar2 = _interopRequireDefault(_searchBar);
18
-
19
- var _listView = require("antd-mobile/lib/list-view");
20
-
21
- var _listView2 = _interopRequireDefault(_listView);
22
-
23
- var _checkbox = require("antd-mobile/lib/checkbox");
24
-
25
- var _checkbox2 = _interopRequireDefault(_checkbox);
26
-
27
- var _radio = require("antd-mobile/lib/radio");
28
-
29
- var _radio2 = _interopRequireDefault(_radio);
30
-
31
- var _list = require("antd-mobile/lib/list");
32
-
33
- var _list2 = _interopRequireDefault(_list);
34
-
35
- var _toast = require("antd-mobile/lib/toast");
36
-
37
- var _toast2 = _interopRequireDefault(_toast);
38
-
39
- 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; }; }();
40
-
41
- require("antd-mobile/lib/drawer/style/css");
42
-
43
- require("antd-mobile/lib/button/style/css");
44
-
45
- require("antd-mobile/lib/search-bar/style/css");
46
-
47
- require("antd-mobile/lib/list-view/style/css");
48
-
49
- require("antd-mobile/lib/checkbox/style/css");
50
-
51
- require("antd-mobile/lib/radio/style/css");
52
-
53
- require("antd-mobile/lib/list/style/css");
54
-
55
- require("antd-mobile/lib/toast/style/css");
56
-
57
- var _react = require("react");
58
-
59
- var _react2 = _interopRequireDefault(_react);
60
-
61
- var _propTypes = require("prop-types");
62
-
63
- var _propTypes2 = _interopRequireDefault(_propTypes);
64
-
65
- var _NHFetch = require("../../utils/NHFetch");
66
-
67
- var _NHFetch2 = _interopRequireDefault(_NHFetch);
68
-
69
- var _index = require("../NHTreeMenu/index");
70
-
71
- var _index2 = _interopRequireDefault(_index);
72
-
73
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
74
-
75
- 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); } }
76
-
77
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
78
-
79
- 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; }
80
-
81
- 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; }
82
-
83
- var smMobileUrl = "api/sm-mobile";
84
-
85
- var StuSelector = function (_Component) {
86
- _inherits(StuSelector, _Component);
87
-
88
- // 学生选择器
89
- function StuSelector(props) {
90
- _classCallCheck(this, StuSelector);
91
-
92
- var _this = _possibleConstructorReturn(this, (StuSelector.__proto__ || Object.getPrototypeOf(StuSelector)).call(this, props));
93
-
94
- _this.queryStudents = function () {
95
- var _this$state = _this.state,
96
- isLoading = _this$state.isLoading,
97
- pageSize = _this$state.pageSize,
98
- page = _this$state.page,
99
- keyword = _this$state.keyword,
100
- selectedData = _this$state.selectedData;
101
-
102
- var params = {
103
- pageSize: pageSize,
104
- page: page,
105
- keyword: keyword,
106
- rangeFilter: _this.props.rangeFilter,
107
- tier: selectedData
108
- };
109
- _this.setState({ isLoading: true });
110
- (0, _NHFetch2.default)(smMobileUrl + "/openapi/stuSelector", "POST", params).then(function (res) {
111
- if (res && res.code === 200) {
112
- var newData = [].concat(_toConsumableArray(_this.state.data), _toConsumableArray(res.data.list));
113
- _this.setState({
114
- data: newData,
115
- total: res.data.total,
116
- dataSource: _this.state.dataSource.cloneWithRows(newData),
117
- isLoading: false,
118
- hasMore: res.data.pageCount > res.data.pageNum
119
- });
120
- } else {
121
- _toast2.default.fail("查询数据失败");
122
- _this.setState({ isLoading: false });
123
- }
124
- }).catch(function (err) {
125
- _toast2.default.fail("查询数据失败");
126
- _this.setState({ isLoading: false });
127
- });
128
- };
129
-
130
- _this.querySchoolTierInfo = function () {
131
- var params = {
132
- rangeFilter: _this.props.rangeFilter
133
- };
134
- (0, _NHFetch2.default)(smMobileUrl + "/openapi/getSchoolTierInfo", "GET", params).then(function (res) {
135
- if (res && res.code === 200) {
136
- _this.setState({
137
- selectorData: res.data
138
- });
139
- } else {
140
- _toast2.default.fail("查询筛选数据失败");
141
- }
142
- }).catch(function (err) {
143
- _toast2.default.fail("查询筛选数据失败");
144
- });
145
- };
146
-
147
- _this.renderFooter = function () {
148
- if (_this.state.isLoading) {
149
- return _react2.default.createElement(
150
- "div",
151
- { style: { padding: 30, textAlign: "center" } },
152
- "\u52A0\u8F7D\u4E2D..."
153
- );
154
- }
155
- return null;
156
- };
157
-
158
- _this.handelRadioChange = function (newuser) {
159
- var _this$state2 = _this.state,
160
- dataSource = _this$state2.dataSource,
161
- data = _this$state2.data,
162
- _this$state2$user = _this$state2.user,
163
- user = _this$state2$user === undefined ? {} : _this$state2$user;
164
-
165
- var index = data.findIndex(function (row) {
166
- return row.xsid === user.xsid;
167
- });
168
- var newData = [].concat(_toConsumableArray(data));
169
- if (index > -1) {
170
- // 改变row的引用,使其重新渲染
171
- newData[index] = JSON.parse(JSON.stringify(user));
172
- }
173
- var index2 = data.findIndex(function (row) {
174
- return row.xsid === newuser.xsid;
175
- });
176
- if (index2 > -1) {
177
- // 改变row的引用,使其重新渲染
178
- newData[index2] = JSON.parse(JSON.stringify(newuser));
179
- }
180
- _this.setState({
181
- user: newuser,
182
- dataSource: dataSource.cloneWithRows(newData)
183
- });
184
- };
185
-
186
- _this.handelCheckboxChange = function (newuser) {
187
- var _this$state3 = _this.state,
188
- dataSource = _this$state3.dataSource,
189
- data = _this$state3.data,
190
- _this$state3$user = _this$state3.user,
191
- user = _this$state3$user === undefined ? [] : _this$state3$user;
192
- // const index = data.findIndex( )
193
-
194
- var newData = [].concat(_toConsumableArray(data));
195
- var userIndex = user.findIndex(function (item) {
196
- return item.xsid == newuser.xsid;
197
- });
198
- if (userIndex > -1) {
199
- user.splice(userIndex, 1);
200
- } else {
201
- user.push(newuser);
202
- }
203
- // const index = data.findIndex(row => row.xsid === user.xsid);
204
- // if( index > -1 ) {
205
- // // 改变row的引用,使其重新渲染
206
- // newData[index] = JSON.parse(JSON.stringify(user));
207
- // }
208
- var index2 = data.findIndex(function (row) {
209
- return row.xsid === newuser.xsid;
210
- });
211
- if (index2 > -1) {
212
- // 改变row的引用,使其重新渲染
213
- newData[index2] = JSON.parse(JSON.stringify(newuser));
214
- }
215
-
216
- _this.setState({
217
- user: user,
218
- dataSource: dataSource.cloneWithRows(newData)
219
- });
220
- };
221
-
222
- _this.renderRow = function (rowData, sectionID, rowID) {
223
- var selectType = _this.props.selectType;
224
-
225
- if (selectType == "single") {
226
- // 单选
227
- var _this$state$user = _this.state.user,
228
- user = _this$state$user === undefined ? {} : _this$state$user;
229
-
230
- return _react2.default.createElement(
231
- "div",
232
- { onChange: function onChange() {
233
- return _this.handelRadioChange(rowData);
234
- } },
235
- _react2.default.createElement(
236
- _radio2.default.RadioItem,
237
- {
238
- key: rowData.xsid,
239
- checked: user.xsid === rowData.xsid
240
- },
241
- rowData.xm,
242
- "-",
243
- rowData.xh,
244
- _react2.default.createElement(
245
- _list2.default.Item.Brief,
246
- null,
247
- rowData.bmmc,
248
- "/",
249
- rowData.zymc,
250
- "/",
251
- rowData.bjmc
252
- )
253
- )
254
- );
255
- } else if (selectType == "multi") {
256
- var _this$state$user2 = _this.state.user,
257
- _user = _this$state$user2 === undefined ? [] : _this$state$user2;
258
- // 多选
259
-
260
-
261
- return _react2.default.createElement(
262
- "div",
263
- { onChange: function onChange() {
264
- return _this.handelCheckboxChange(rowData);
265
- } },
266
- _react2.default.createElement(
267
- _checkbox2.default.CheckboxItem,
268
- {
269
- key: rowData.xsid,
270
- checked: _user.filter(function (item) {
271
- return item.xsid == rowData.xsid;
272
- }).length > 0,
273
- multipleLine: true
274
- },
275
- rowData.xm,
276
- "-",
277
- rowData.xh,
278
- _react2.default.createElement(
279
- _list2.default.Item.Brief,
280
- null,
281
- rowData.bmmc,
282
- "/",
283
- rowData.zymc,
284
- "/",
285
- rowData.bjmc
286
- )
287
- )
288
- );
289
- }
290
- };
291
-
292
- _this.onEndReached = function (event) {
293
- var hasMore = _this.state.hasMore;
294
-
295
- if (hasMore) {
296
- _this.loadMore();
297
- } else {
298
- _toast2.default.info("已加载所有数据", 1);
299
- }
300
- };
301
-
302
- _this.loadMore = function () {
303
- var page = _this.state.page;
304
-
305
- _this.setState({
306
- page: page + 1
307
- }, function () {
308
- _this.queryStudents();
309
- });
310
- };
311
-
312
- _this.onSearch = function (value) {
313
- var page = _this.state.page;
314
-
315
- _this.setState({
316
- keyword: value,
317
- page: 1,
318
- data: []
319
- }, function () {
320
- _this.queryStudents();
321
- });
322
- };
323
-
324
- _this.handleSearchClear = function () {
325
- _this.setState({
326
- page: 1,
327
- data: []
328
- }, function () {
329
- _this.queryStudents();
330
- });
331
- };
332
-
333
- _this.onOpenChange = function () {
334
- var _this$state4 = _this.state,
335
- ifDrawerOpen = _this$state4.ifDrawerOpen,
336
- disabledSearchBar = _this$state4.disabledSearchBar;
337
-
338
- _this.setState({
339
- ifDrawerOpen: !ifDrawerOpen,
340
- disabledSearchBar: !disabledSearchBar
341
- });
342
- };
343
-
344
- _this.onTreeSelect = function (item) {
345
- /* let newSelected = {
346
- id: "",
347
- type: "",
348
- };
349
- let { selectedData } = this.props;
350
- if (selectedData && selectedData.id == item.id) {
351
- newSelected.id = "";
352
- newSelected.type = "";
353
- } else {
354
- newSelected.id = item.id;
355
- newSelected.type = item.type;
356
- }
357
- this.setState({
358
- selectedData: newSelected,
359
- }); */
360
- var defaultValue = _this.state.defaultValue;
361
-
362
- var newSelected = [];
363
- var _this$state$selectedD = _this.state.selectedData,
364
- selectedData = _this$state$selectedD === undefined ? [] : _this$state$selectedD;
365
-
366
- if (selectedData.length > 0 && selectedData.findIndex(function (row) {
367
- return row.id == item.id;
368
- }) !== -1) {
369
- newSelected.push(defaultValue);
370
- } else {
371
- newSelected.push({
372
- type: item.type,
373
- id: item.id
374
- });
375
- }
376
- console.log("树选择的值", newSelected);
377
- _this.setState({
378
- selectedData: newSelected
379
- });
380
- };
381
-
382
- _this.onComfirm = function () {
383
- // 关闭抽屉
384
- _this.onOpenChange();
385
- _this.setState({
386
- data: []
387
- });
388
- // 重新刷新学生列表数据
389
- _this.queryStudents();
390
- };
391
-
392
- _this.onReset = function () {
393
- // 重置
394
- var defaultValue = _this.state.defaultValue;
395
-
396
- var newSelected = [];
397
- newSelected.push(defaultValue);
398
- _this.setState({
399
- selectedData: newSelected,
400
- data: []
401
- }, function () {
402
- // 重新刷新学生列表数据
403
- _this.queryStudents();
404
- });
405
- };
406
-
407
- _this.handleOkClick = function () {
408
- var handleOkClick = _this.props.handleOkClick;
409
- var user = _this.state.user;
410
-
411
- if (handleOkClick && typeof handleOkClick == "function") {
412
- // 将所选中的user传给父组件
413
- handleOkClick(user);
414
- }
415
- };
416
-
417
- _this.state = {
418
- dataSource: new _listView2.default.DataSource({
419
- rowHasChanged: function rowHasChanged(row1, row2) {
420
- return row1 !== row2;
421
- }
422
- }),
423
- isLoading: false,
424
- total: 0,
425
- pageSize: 20, //当前页默认多少条数据
426
- page: 1,
427
- pageCount: 0,
428
- data: [],
429
- hasMore: false,
430
- user: props.user,
431
- keyword: "",
432
- ifDrawerOpen: false, //是否展示筛选抽屉
433
- selectorData: [], //Tree筛选器的数据
434
- selectedData: [
435
- //Tree选中的数据
436
- {
437
- type: "",
438
- id: ""
439
- }],
440
- disabledSearchBar: false, //是否禁用SearchBar
441
- defaultValue: {
442
- id: "",
443
- type: ""
444
- }
445
- };
446
- return _this;
447
- }
448
-
449
- _createClass(StuSelector, [{
450
- key: "componentDidMount",
451
- value: function componentDidMount() {
452
- this.queryStudents();
453
- this.props.ifShowFilter && this.querySchoolTierInfo();
454
- }
455
-
456
- // 查询学生列表
457
-
458
-
459
- // 查询学生列表
460
-
461
-
462
- // 单选
463
-
464
- // 多选
465
-
466
- // 所有数据已经渲染完,需要获取新的数据
467
-
468
- // 打开/关闭筛选抽屉
469
-
470
- // 树筛选器选择
471
-
472
- }, {
473
- key: "render",
474
- value: function render() {
475
- var _state = this.state,
476
- dataSource = _state.dataSource,
477
- ifDrawerOpen = _state.ifDrawerOpen,
478
- selectorData = _state.selectorData,
479
- _state$selectedData = _state.selectedData,
480
- selectedData = _state$selectedData === undefined ? [] : _state$selectedData,
481
- disabledSearchBar = _state.disabledSearchBar,
482
- height = _state.height;
483
- var ifShowFilter = this.props.ifShowFilter;
484
-
485
- var ifShowHeader = sessionStorage.getItem("showHeaderConfig");
486
- var fullHeight = document.body.clientHeight;
487
- var sidebar = _react2.default.createElement(
488
- "div",
489
- { className: "dropContainer" },
490
- _react2.default.createElement(_index2.default, {
491
- dataList: selectorData,
492
- onSelected: this.onTreeSelect,
493
- onComfirm: this.onComfirm,
494
- onReset: this.onReset,
495
- selectedData: selectedData,
496
- height: fullHeight
497
- })
498
- );
499
- return _react2.default.createElement(
500
- "div",
501
- null,
502
- _react2.default.createElement(
503
- "div",
504
- {
505
- style: {
506
- display: "flex",
507
- justifyContent: "center",
508
- alignItems: "center",
509
- height: "0.88rem"
510
- }
511
- },
512
- _react2.default.createElement(_searchBar2.default, {
513
- style: { flex: "1 1" },
514
- placeholder: "\u8BF7\u8F93\u5165\u5B66\u53F7\u6216\u59D3\u540D",
515
- onSubmit: this.onSearch,
516
- onClear: this.handleSearchClear,
517
- disabled: disabledSearchBar
518
- }),
519
- ifShowFilter &&
520
- // <Icon
521
- // type="ellipsis"
522
- // onClick={this.onOpenChange}
523
- // style={{ margin: "0px 5px" }}
524
- // />
525
- _react2.default.createElement("img", {
526
- style: { width: "0.4rem", height: "0.4rem", margin: "0px 5px" },
527
- src: require("../../../assets/NHTreeMenu/Selector.svg"),
528
- onClick: this.onOpenChange
529
- })
530
- // <Selector
531
- // style={{ margin: "0px 5px", width: "24px", height: "24px" }}
532
- // onClick={this.onOpenChange}
533
- // />
534
-
535
- ),
536
- _react2.default.createElement(
537
- _drawer2.default,
538
- {
539
- className: "my-drawer",
540
- style: {
541
- minHeight: ifShowHeader ? "calc(" + fullHeight + "px - 0.88rem - 0.88rem)" : "calc(" + fullHeight + "px - 0.88rem)"
542
- },
543
- sidebarStyle: { width: "80%" },
544
- enableDragHandle: true,
545
- contentStyle: {
546
- color: "#666666",
547
- textAlign: "center",
548
- paddingTop: 0
549
- },
550
- sidebar: sidebar,
551
- position: "right",
552
- open: ifDrawerOpen,
553
- touch: false,
554
- onOpenChange: this.onOpenChange
555
- },
556
- _react2.default.createElement(_listView2.default, {
557
- style: {
558
- height: ifShowHeader ? "calc(" + fullHeight + "px - 0.88rem - 0.88rem - 0.88rem)" : "calc(" + fullHeight + "px - 0.88rem - 0.88rem)",
559
- overflow: "auto"
560
- },
561
- dataSource: dataSource
562
- // renderHeader={renderHeader}
563
- , renderFooter: this.renderFooter,
564
- renderRow: this.renderRow,
565
- className: "am-list",
566
- pageSize: 20,
567
- onEndReached: this.onEndReached
568
- }),
569
- _react2.default.createElement(
570
- "div",
571
- { style: { width: "100%", height: "0.88rem" } },
572
- _react2.default.createElement(
573
- _button2.default,
574
- {
575
- style: { height: "100%" },
576
- type: "primary",
577
- onClick: this.handleOkClick
578
- },
579
- "\u786E\u5B9A"
580
- )
581
- )
582
- ),
583
- _react2.default.createElement(
584
- "style",
585
- { global: "true", jsx: "true" },
586
- "\n .my-drawer {\n position: relative;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n }\n .my-drawer .am-drawer-sidebar {\n background-color: #fff;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n }\n .my-drawer .am-drawer-sidebar .am-list {\n width: 100%;\n padding: 0;\n }\n "
587
- )
588
- );
589
- }
590
- }]);
591
-
592
- return StuSelector;
593
- }(_react.Component);
594
-
595
- //属性默认值
596
-
597
-
598
- exports.default = StuSelector;
599
- StuSelector.defaultProps = {
600
- selectType: "single", //单选或多选,单选singel/多选multi
601
- user: undefined, //当前所选用户
602
- ifShowFilter: false, //是否展示抽屉筛选项, 默认为false
603
- rangeFilter: false //接口查询是否开启职务过滤
604
- };
605
-
606
- StuSelector.propTypes = {
607
- selectType: _propTypes2.default.string, //单选或多选,单选singel/多选multi
608
- ifShowFilter: _propTypes2.default.bool, //是否展示抽屉筛选项, 默认为false
609
- handleOkClick: _propTypes2.default.func, //当前选择器的确定按钮事件
610
- rangeFilter: _propTypes2.default.bool //接口查询是否开启职务过滤
611
- };