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,364 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _picker = require('antd-mobile/lib/picker');
8
-
9
- var _picker2 = _interopRequireDefault(_picker);
10
-
11
- var _list = require('antd-mobile/lib/list');
12
-
13
- var _list2 = _interopRequireDefault(_list);
14
-
15
- 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; }; }();
16
-
17
- require('antd-mobile/lib/picker/style/css');
18
-
19
- require('antd-mobile/lib/list/style/css');
20
-
21
- var _NHFetch = require('../../utils/NHFetch');
22
-
23
- var _NHFetch2 = _interopRequireDefault(_NHFetch);
24
-
25
- var _propTypes = require('prop-types');
26
-
27
- var _propTypes2 = _interopRequireDefault(_propTypes);
28
-
29
- var _react = require('react');
30
-
31
- var _react2 = _interopRequireDefault(_react);
32
-
33
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
34
-
35
- 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); } }
36
-
37
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
38
-
39
- 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; }
40
-
41
- 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; } /*
42
- * @Description: 下拉框
43
- * @Author: zengweijin
44
- * @Date: 2019-07-11 09:04:46
45
- * @LastEditors: zengweijin
46
- * @LastEditTime: 2020-10-22 13:47:11
47
- */
48
-
49
- // import NHFetch from '../../utils/NHFetch'
50
-
51
-
52
- var NHSelect = function (_React$Component) {
53
- _inherits(NHSelect, _React$Component);
54
-
55
- function NHSelect(props) {
56
- _classCallCheck(this, NHSelect);
57
-
58
- var _this = _possibleConstructorReturn(this, (NHSelect.__proto__ || Object.getPrototypeOf(NHSelect)).call(this, props));
59
-
60
- _this.loadRemoteDataUseUrl = function (flexibleUrl) {
61
- var _this$props = _this.props,
62
- params = _this$props.params,
63
- baseUrl = _this$props.baseUrl;
64
-
65
- (0, _NHFetch2.default)(baseUrl + flexibleUrl, 'GET', params).then(function (res) {
66
- if (res) {
67
- _this.parseData(res.data);
68
- }
69
- });
70
- };
71
-
72
- _this.loadRemoteDataUseSign = function (sign) {
73
- var baseUrl = _this.props.baseUrl;
74
- (0, _NHFetch2.default)((baseUrl ? baseUrl : '') + "/proData/selectDataList", 'GET', { sign: sign }).then(function (res) {
75
- if (res) {
76
- _this.parseData(res.data);
77
- }
78
- });
79
- };
80
-
81
- _this.loadLocalData = function () {
82
- if (_this.props.dataSource) {
83
- var nullOption = [{ value: '', label: '请选择...' }];
84
- var newData = [].concat(nullOption, _toConsumableArray(_this.props.dataSource));
85
- var realData = [].concat(nullOption, _toConsumableArray(_this.props.dataSource));
86
- if ('parentValue' in _this.props) {
87
- realData = newData.filter(function (item) {
88
- // 因为nextProps.parentValue 的值可能是undefined
89
- if ('PARENTVALUE' in item) {
90
- return item.PARENTVALUE === _this.props.parentValue;
91
- }
92
- if ('parentValue' in item) {
93
- return item.parentValue === _this.props.parentValue;
94
- }
95
- return false;
96
- });
97
- }
98
- _this.setState({ data: newData, realData: realData });
99
- }
100
- };
101
-
102
- _this.parseData = function (data) {
103
- if (data) {
104
- var nullOption = [];
105
- var newData = [].concat(nullOption, _toConsumableArray(data));
106
- var realData = [].concat(nullOption, _toConsumableArray(data));
107
- if ('parentValue' in _this.props) {
108
- realData = newData.filter(function (item) {
109
- // 因为nextProps.parentValue 的值可能是undefined
110
- if ('PARENTVALUE' in item) {
111
- return item.PARENTVALUE === _this.props.parentValue;
112
- }
113
- if ('parentValue' in item) {
114
- return item.parentValue === _this.props.parentValue;
115
- }
116
- return false;
117
- });
118
- }
119
- _this.setState({ data: newData, realData: realData });
120
- } else {
121
- //如果远程数据为空,则尝试加载本地数据源
122
- _this.loadLocalData();
123
- }
124
- };
125
-
126
- _this.getLabel = function (val) {
127
- var item = _this.state.data.find(function (item) {
128
- return (item.value || item.VALUE) === val[0];
129
- });
130
- var label = item.label || item.LABEL;
131
- return label;
132
- };
133
-
134
- _this.handleChange = function (val) {
135
- if (!('value' in _this.props)) {
136
- _this.setState({
137
- value: val
138
- });
139
- }
140
- var onChange = _this.props.onChange;
141
- if (onChange) {
142
- onChange(val[0], _this.getLabel(val));
143
- }
144
- var onSelect = _this.props.onSelect;
145
- if (onSelect) {
146
- onSelect(val[0], _this.getLabel(val));
147
- }
148
- };
149
-
150
- var value = _this.props.value ? [_this.props.value] : [];
151
- _this.state = {
152
- data: [],
153
- value: value,
154
- realData: []
155
- };
156
- return _this;
157
- }
158
-
159
- _createClass(NHSelect, [{
160
- key: 'componentDidMount',
161
- value: function componentDidMount() {
162
- var _props = this.props,
163
- flexibleUrl = _props.flexibleUrl,
164
- sign = _props.sign;
165
- //优先支持自定义的url以满足更复杂的请求
166
-
167
- if (flexibleUrl && flexibleUrl != '') {
168
- this.loadRemoteDataUseUrl(flexibleUrl);
169
- return;
170
- }
171
- //如果是使用数据源标识,则优先加载远程数据
172
- if (sign && sign !== '') {
173
- this.loadRemoteDataUseSign(sign);
174
- } else {
175
- //如果没有使用远程数据,则加载本地数据
176
- this.loadLocalData();
177
- }
178
- }
179
-
180
- //数据回传格式需要正确格式为[{LABEL:"",VALUE:""},{LABEL:"",VALUE:""}]
181
-
182
- //加载远程数据
183
-
184
-
185
- //加载本地数据
186
-
187
-
188
- //解析数据
189
-
190
- }, {
191
- key: 'render',
192
- value: function render() {
193
- var _props2 = this.props,
194
- style = _props2.style,
195
- placeholder = _props2.placeholder,
196
- disabled = _props2.disabled,
197
- defaultValue = _props2.defaultValue,
198
- filterData = _props2.filterData,
199
- error = _props2.error;
200
- var _state = this.state,
201
- value = _state.value,
202
- realData = _state.realData;
203
-
204
- var options = [];
205
- var data = realData;
206
- //如果有过滤条件
207
- if (filterData) {
208
- var type = filterData.type,
209
- _filterData$filterkey = filterData.filterkeys,
210
- filterkeys = _filterData$filterkey === undefined ? [] : _filterData$filterkey;
211
-
212
- switch (type) {
213
- //过滤掉指定key值
214
- case 'remove':
215
- {
216
- options = data.filter(function (item) {
217
- if (filterkeys.find(function (key) {
218
- return (item.VALUE || item.value) === key;
219
- })) {
220
- return false;
221
- } else {
222
- return true;
223
- }
224
- });
225
- break;
226
- }
227
- //保留指定key值
228
- case 'save':
229
- {
230
- options = data.filter(function (item) {
231
- if (filterkeys.find(function (key) {
232
- return (item.VALUE || item.value) === key;
233
- })) {
234
- return true;
235
- } else {
236
- return false;
237
- }
238
- });
239
- break;
240
- }
241
- //未找到指定过滤类型,则不做过滤
242
- default:
243
- {
244
- /* options = data;*/
245
- break;
246
- }
247
- }
248
- } else {
249
- options = data;
250
- }
251
- if (defaultValue && value.length === 0) {
252
- value = [defaultValue];
253
- }
254
- // 将大写转为小写
255
- options = options.map(function (item) {
256
- var i = {};
257
- i.value = item.value || item.VALUE;
258
- i.label = item.label || item.LABEL;
259
- return i;
260
- });
261
- return _react2.default.createElement(
262
- 'div',
263
- { className: disabled ? 'nh-inputrender-disabled' : 'nh-inputrender' },
264
- _react2.default.createElement(
265
- _picker2.default,
266
- {
267
- style: style,
268
- data: options,
269
- value: value,
270
- title: placeholder,
271
- disabled: disabled,
272
- onChange: this.handleChange,
273
- cols: 1
274
- },
275
- _react2.default.createElement(
276
- _list2.default.Item,
277
- { arrow: 'horizontal', wrap: true, error: error },
278
- this.props.children
279
- )
280
- )
281
- );
282
- }
283
- }], [{
284
- key: 'getDerivedStateFromProps',
285
- value: function getDerivedStateFromProps(nextProps, prevState) {
286
-
287
- var updateState = {};
288
-
289
- if ('value' in nextProps) {
290
- var value = nextProps.value;
291
- Object.assign(updateState, { value: [value] });
292
- }
293
-
294
- if ('dataSource' in nextProps) {
295
- var data = nextProps.dataSource;
296
- Object.assign(updateState, { data: data });
297
- }
298
-
299
- if ('parentValue' in nextProps) {
300
- var realData = prevState.data.filter(function (item) {
301
- // 因为nextProps.parentValue 的值可能是undefined
302
- if ('PARENTVALUE' in item) {
303
- return item.PARENTVALUE === nextProps.parentValue;
304
- }
305
- if ('parentValue' in item) {
306
- return item.parentValue === nextProps.parentValue;
307
- }
308
- return false;
309
- });
310
- var _value = prevState.value;
311
- if ('value' in nextProps) {
312
- _value = [nextProps.value];
313
- }
314
- if (!(realData.findIndex(function (item) {
315
- return item.value === _value[0] || item.VALUE === _value[0];
316
- }) > -1)) {
317
- _value = undefined;
318
- if (prevState.data && prevState.data.length > 0 && nextProps.value !== _value && nextProps.onChange) {
319
- // 此时需要重置值,并且通知也上一级(form)
320
- nextProps.onChange(_value, '');
321
- }
322
- }
323
- Object.assign(updateState, { realData: realData, value: _value });
324
- }
325
-
326
- if (Object.keys(updateState).length > 0) {
327
- return updateState;
328
- }
329
-
330
- return null;
331
- }
332
- }]);
333
-
334
- return NHSelect;
335
- }(_react2.default.Component);
336
-
337
- //属性默认值
338
-
339
-
340
- exports.default = NHSelect;
341
- NHSelect.defaultProps = {
342
- placeholder: '请选择',
343
- disabled: false
344
-
345
- //属性检查
346
- };NHSelect.propTypes = {
347
- sign: _propTypes2.default.string, //远程数据源标识
348
- dataSource: _propTypes2.default.arrayOf(_propTypes2.default.shape({
349
- value: _propTypes2.default.string,
350
- label: _propTypes2.default.node
351
- })), //本地数据源
352
- style: _propTypes2.default.object, //样式
353
- placeholder: _propTypes2.default.string, //下拉提示
354
- disabled: _propTypes2.default.bool, //是否禁用
355
- defaultValue: _propTypes2.default.string, //默认值
356
- value: _propTypes2.default.string, //初始值
357
- filterData: _propTypes2.default.shape({
358
- type: _propTypes2.default.oneOf(['remove', 'save']), //是保留还是过滤掉
359
- filterkeys: _propTypes2.default.array //保留或过滤的key值
360
- }), //要过滤掉的Key值
361
- onSelect: _propTypes2.default.func, //下拉选项选中时回调
362
- onChange: _propTypes2.default.func, //下拉框值变化时回调
363
- baseUrl: _propTypes2.default.string //请求路径的前缀,可通过改参数控制访问的后端服务,如果不设置,则会去访问当前前端服务对应的后端服务,例如:api/sm-bpm-expansion
364
- };
@@ -1,126 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _button = require("antd-mobile/lib/button");
8
-
9
- var _button2 = _interopRequireDefault(_button);
10
-
11
- 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; }; }();
12
-
13
- require("antd-mobile/lib/button/style/css");
14
-
15
- var _react = require("react");
16
-
17
- var _react2 = _interopRequireDefault(_react);
18
-
19
- var _propTypes = require("prop-types");
20
-
21
- var _propTypes2 = _interopRequireDefault(_propTypes);
22
-
23
- var _treeNode = require("./treeNode.js");
24
-
25
- var _treeNode2 = _interopRequireDefault(_treeNode);
26
-
27
- require("../../../assets/NHTreeMenu/index.less");
28
-
29
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
-
31
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
32
-
33
- 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; }
34
-
35
- 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; }
36
- // import css from './index.less';
37
-
38
-
39
- var treeMenu = function (_Component) {
40
- _inherits(treeMenu, _Component);
41
-
42
- // Tree菜单
43
- function treeMenu(props) {
44
- _classCallCheck(this, treeMenu);
45
-
46
- return _possibleConstructorReturn(this, (treeMenu.__proto__ || Object.getPrototypeOf(treeMenu)).call(this, props));
47
- }
48
-
49
- _createClass(treeMenu, [{
50
- key: "render",
51
- value: function render() {
52
- var _props = this.props,
53
- dataList = _props.dataList,
54
- selectedData = _props.selectedData,
55
- onSelected = _props.onSelected;
56
-
57
- var fullHeight = document.body.clientHeight;
58
- var ifShowHeader = sessionStorage.getItem("showHeaderConfig");
59
- return _react2.default.createElement(
60
- "div",
61
- null,
62
- dataList instanceof Array ? _react2.default.createElement(
63
- "div",
64
- {
65
- className: "treeMenu",
66
- style: {
67
- height: ifShowHeader ? "calc(" + fullHeight + "px - 0.88rem - 0.88rem - 0.7rem)" : "calc(" + fullHeight + "px - 0.88rem - 0.88rem)",
68
- overflow: "auto"
69
- }
70
- },
71
- dataList.map(function (d, index) {
72
- return _react2.default.createElement(_treeNode2.default, {
73
- dataList: d,
74
- key: "treeNode-" + d.type + "-" + d.id,
75
- onSelected: onSelected,
76
- selectedData: selectedData
77
- });
78
- })
79
- ) : _react2.default.createElement("div", null),
80
- _react2.default.createElement(
81
- "div",
82
- { className: "treeMenu-button" },
83
- _react2.default.createElement(
84
- _button2.default,
85
- {
86
- type: "ghost",
87
- inline: true,
88
- size: "small",
89
- onClick: this.props.onReset
90
- },
91
- "\u91CD\u7F6E"
92
- ),
93
- _react2.default.createElement(
94
- _button2.default,
95
- {
96
- type: "primary",
97
- inline: true,
98
- size: "small",
99
- onClick: this.props.onComfirm
100
- },
101
- "\u786E\u5B9A"
102
- )
103
- )
104
- );
105
- }
106
- }]);
107
-
108
- return treeMenu;
109
- }(_react.Component);
110
-
111
- // 属性默认值
112
-
113
-
114
- exports.default = treeMenu;
115
- treeMenu.defaultProps = {
116
- // dataList: [],
117
- };
118
-
119
- // 属性检查
120
- treeMenu.propTypes = {
121
- // dataList: PropTypes.array, //树级的数据
122
- onSelected: _propTypes2.default.func, //选中的事件
123
- selectedData: _propTypes2.default.array, //所选的数据
124
- onClose: _propTypes2.default.func, //点击确认后执行的事件
125
- onReset: _propTypes2.default.func //点击重置后执行的事件
126
- };
@@ -1,164 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _accordion = require('antd-mobile/lib/accordion');
8
-
9
- var _accordion2 = _interopRequireDefault(_accordion);
10
-
11
- var _list = require('antd-mobile/lib/list');
12
-
13
- var _list2 = _interopRequireDefault(_list);
14
-
15
- var _radio = require('antd-mobile/lib/radio');
16
-
17
- var _radio2 = _interopRequireDefault(_radio);
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/accordion/style/css');
22
-
23
- require('antd-mobile/lib/list/style/css');
24
-
25
- require('antd-mobile/lib/radio/style/css');
26
-
27
- var _react = require('react');
28
-
29
- var _react2 = _interopRequireDefault(_react);
30
-
31
- var _propTypes = require('prop-types');
32
-
33
- var _propTypes2 = _interopRequireDefault(_propTypes);
34
-
35
- var _treeNode = require('./treeNode.js');
36
-
37
- var _treeNode2 = _interopRequireDefault(_treeNode);
38
-
39
- require('../../../assets/NHTreeMenu/index.less');
40
-
41
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42
-
43
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
44
-
45
- 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; }
46
-
47
- 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; } /*
48
- * @Description:
49
- * @Author: lisenlin
50
- * @Date: 2021-03-05 09:16:35
51
- * @LastEditors: lisenlin
52
- * @LastEditTime: 2021-03-09 10:19:22
53
- */
54
-
55
-
56
- var treeNode = function (_Component) {
57
- _inherits(treeNode, _Component);
58
-
59
- // Tree菜单节点
60
- function treeNode(props) {
61
- _classCallCheck(this, treeNode);
62
-
63
- var _this = _possibleConstructorReturn(this, (treeNode.__proto__ || Object.getPrototypeOf(treeNode)).call(this, props));
64
-
65
- _this.RadioClick = function (e) {
66
- e.stopPropagation();
67
- _this.props.onSelected(_this.props.dataList);
68
- };
69
-
70
- _this.renderHeader = function (item, value) {
71
-
72
- var selectedData = _this.props.selectedData;
73
- return _react2.default.createElement(
74
- 'div',
75
- { className: item.type + '-TreeNode' },
76
- _react2.default.createElement(
77
- _radio2.default.RadioItem,
78
- { onClick: _this.RadioClick
79
- // checked={item.id == selectedData.id}
80
- , checked: selectedData.length > 0 && selectedData.findIndex(function (row) {
81
- return row.id == item.id;
82
- }) !== -1
83
- },
84
- value
85
- )
86
- );
87
- };
88
-
89
- return _this;
90
- }
91
-
92
- // 渲染有下一级别(有children)的选项,父级选项
93
-
94
-
95
- _createClass(treeNode, [{
96
- key: 'render',
97
- value: function render() {
98
- var _this2 = this;
99
-
100
- var data = this.props.dataList;
101
- var selectedData = this.props.selectedData;
102
- var Header = this.renderHeader(data, data.value);
103
- return data && (!data.children || data.children.length === 0) ?
104
- // 渲染无下一级别(无children)的选项
105
- _react2.default.createElement(
106
- 'div',
107
- { className: data.type + '-TreeNode' },
108
- _react2.default.createElement(
109
- _list2.default,
110
- {
111
- className: 'under-list'
112
- },
113
- _react2.default.createElement(
114
- _radio2.default.RadioItem,
115
- { onClick: this.RadioClick,
116
- checked: selectedData.length > 0 && selectedData.findIndex(function (row) {
117
- return row.id == data.id;
118
- }) !== -1
119
- // checked={selectedData.id==data.id}
120
- },
121
- data.value
122
- )
123
- )
124
- ) : _react2.default.createElement(
125
- 'div',
126
- null,
127
- _react2.default.createElement(
128
- _accordion2.default,
129
- null,
130
- _react2.default.createElement(
131
- _accordion2.default.Panel,
132
- { header: Header, className: 'tree-accordion-panel' },
133
- data && data.children && data.children.map(function (item, index) {
134
- // 若存在子元素,则继续遍历
135
- return _react2.default.createElement(_treeNode2.default, {
136
- dataList: item,
137
- onSelected: _this2.props.onSelected,
138
- key: 'treeNodeHasChildren-' + item.type + '-' + item.id,
139
- selectedData: selectedData
140
- });
141
- })
142
- )
143
- )
144
- );
145
- }
146
- }]);
147
-
148
- return treeNode;
149
- }(_react.Component);
150
-
151
- // 属性默认值
152
-
153
-
154
- exports.default = treeNode;
155
- treeNode.defaultProps = {}
156
- // dataList: [],
157
-
158
- // 属性检查
159
- ;treeNode.propTypes = {
160
- // dataList: PropTypes.array, //树级的数据
161
- onSelected: _propTypes2.default.func, //选中的事件
162
- selectedData: _propTypes2.default.array //所选的数据
163
-
164
- };