dlt-for-react 1.0.24 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/lib/components/Button/index.js +79 -0
- package/lib/components/HqSelector/HqLsrySelector/index.js +3 -5
- package/lib/components/HqSelector/HqRySelector/index.js +3 -5
- package/lib/components/HqSelector/HqWzSelector/index.js +3 -5
- package/lib/components/KyEditableTable/component.js +3 -5
- package/lib/components/KyEditableTable/index.js +7 -13
- package/lib/components/KyExcel/index.js +3 -5
- package/lib/components/KyInputPicker/render.js +13 -43
- package/lib/components/KyInputPicker/setting-checkbox.js +3 -5
- package/lib/components/KyInputPicker/setting-multiSelect.js +3 -5
- package/lib/components/KyInputPicker/setting-nhcascader.js +3 -5
- package/lib/components/KyInputPicker/setting-select.js +3 -5
- package/lib/components/KyInputPicker/setting-stu-selector.js +3 -5
- package/lib/components/KyInputPicker/setting-tea-selector.js +3 -5
- package/lib/components/KyTable/checkButtons.js +4 -7
- package/lib/components/KyTree/index.js +6 -16
- package/lib/components/KyUpload/index.js +10 -20
- package/lib/components/NHAuditPanel/config/Axios.js +263 -0
- package/lib/components/NHAuditPanel/config/api.js +479 -0
- package/lib/components/NHAuditPanel/config/data.js +156 -0
- package/lib/components/NHAuditPanel/config/typeMap.js +1234 -0
- package/lib/components/NHAuditPanel/config/uiValidate.js +92 -0
- package/lib/components/NHAuditPanel/index.js +413 -0
- package/lib/components/NHAuditPanel/node.js +619 -0
- package/lib/components/NHCascader/index.js +355 -0
- package/lib/components/NHCheckboxGroup/index.js +135 -0
- package/lib/components/NHDynamicFormShow/baseInfo/index.js +194 -0
- package/lib/components/NHDynamicFormShow/custom/index.js +553 -0
- package/lib/components/NHDynamicFormShow/customModule/common/CommonMethod.js +43 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/EditForm.js +1113 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/qgzx/index.js +263 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/EditForm.js +880 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/xfjm/index.js +171 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/EditForm.js +865 -0
- package/lib/components/NHDynamicFormShow/customModule/czxy/zxj/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/EditForm.js +571 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zsxxhd/index.js +147 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/EditForm.js +474 -0
- package/lib/components/NHDynamicFormShow/customModule/eszy/zybjtz/index.js +139 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/EditForm.js +506 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/cqzg/index.js +143 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/EditForm.js +1074 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/gwsb/index.js +172 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/EditForm.js +927 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/qjgl/index.js +195 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/EditForm.js +1064 -0
- package/lib/components/NHDynamicFormShow/customModule/gnyxy/sxsqj/index.js +183 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/EditForm.js +763 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/jxj/index.js +137 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/EditForm.js +819 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/lzjxj/index.js +137 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/EditForm.js +700 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/qgzx/index.js +162 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/EditForm.js +743 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/xsqj/index.js +177 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/EditForm.js +848 -0
- package/lib/components/NHDynamicFormShow/customModule/hblgxy/zxj/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/EditForm.js +777 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/qjgl/index.js +161 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/EditForm.js +706 -0
- package/lib/components/NHDynamicFormShow/customModule/hljwgy/xjgl/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/cfjcEditForm.js +413 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/cfjcsq/index.js +135 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/EditForm.js +1013 -0
- package/lib/components/NHDynamicFormShow/customModule/jhysxy/xsqj/index.js +175 -0
- package/lib/components/NHDynamicFormShow/customModule/jjrlx/EditForm.js +1345 -0
- package/lib/components/NHDynamicFormShow/customModule/jjrlx/index.js +274 -0
- package/lib/components/NHDynamicFormShow/customModule/jxj/EditForm.js +669 -0
- package/lib/components/NHDynamicFormShow/customModule/jxj/index.js +134 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/EditForm.js +378 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/fqkns/index.js +120 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/EditForm.js +638 -0
- package/lib/components/NHDynamicFormShow/customModule/jxsl/xwryfjjd/index.js +133 -0
- package/lib/components/NHDynamicFormShow/customModule/qgzx/EditForm.js +965 -0
- package/lib/components/NHDynamicFormShow/customModule/qgzx/index.js +237 -0
- package/lib/components/NHDynamicFormShow/customModule/qjgl/EditForm.js +823 -0
- package/lib/components/NHDynamicFormShow/customModule/qjgl/index.js +188 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/EditForm.js +401 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/jqlssq/index.js +472 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/EditForm.js +304 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHCascader/index.js +375 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/RadioGroup.js +118 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/index.js +62 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/input-const.js +55 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/NHInputPicker/render.js +1238 -0
- package/lib/components/NHDynamicFormShow/customModule/rcgl/tssq/index.js +375 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/collective/EditForm.js +554 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/collective/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/personal/EditForm.js +542 -0
- package/lib/components/NHDynamicFormShow/customModule/rych/personal/index.js +133 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/EditForm.js +575 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/collective/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/EditForm.js +563 -0
- package/lib/components/NHDynamicFormShow/customModule/sxgy/rych/personal/index.js +133 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/EditForm.js +745 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/qjgl/index.js +164 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/EditForm.js +587 -0
- package/lib/components/NHDynamicFormShow/customModule/whcz/rccrxy/index.js +143 -0
- package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/EditForm.js +743 -0
- package/lib/components/NHDynamicFormShow/customModule/whdlqjgl/index.js +172 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/EditForm.js +1410 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jjrlx/index.js +274 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/EditForm.js +755 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/jxj/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/EditForm.js +814 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/qjgl/index.js +188 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/EditForm.js +769 -0
- package/lib/components/NHDynamicFormShow/customModule/whgc/zxj/index.js +130 -0
- package/lib/components/NHDynamicFormShow/customModule/whgcrych/EditForm.js +1004 -0
- package/lib/components/NHDynamicFormShow/customModule/whgcrych/index.js +126 -0
- package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/EditForm.js +503 -0
- package/lib/components/NHDynamicFormShow/customModule/whtl/jsrzsq/index.js +149 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlyhk/EditForm.js +379 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlyhk/index.js +148 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzxj/EditForm.js +748 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzxj/index.js +135 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/EditForm.js +762 -0
- package/lib/components/NHDynamicFormShow/customModule/whtlzy/jxj/index.js +134 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/cfjcEditForm.js +682 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/cfjc/index.js +135 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/index.js +152 -0
- package/lib/components/NHDynamicFormShow/customModule/wjcf/wjsb/wjsbEditForm.js +783 -0
- package/lib/components/NHDynamicFormShow/customModule/zxj/EditForm.js +764 -0
- package/lib/components/NHDynamicFormShow/customModule/zxj/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/cfjcEditForm.js +677 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/cfjcsq/index.js +138 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/EditForm.js +1173 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/qjgl/index.js +242 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistForm.js +862 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/rcgl/rcxwgrdj/IndividualRegistIndex.js +201 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/stuinfo/messageInfo.js +196 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/index.js +167 -0
- package/lib/components/NHDynamicFormShow/customModule/zzsd/wjsb/wjsbEditForm.js +1096 -0
- package/lib/components/NHDynamicFormShow/index.js +647 -0
- package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/cardItem/index.js +279 -0
- package/lib/components/NHDynamicFormShow/oneOnMany/cardForm/index.js +206 -0
- package/lib/components/NHDynamicFormShow/oneOnMany/index.js +419 -0
- package/lib/components/NHDynamicFormShow/oneOnOne/EditForm.js +401 -0
- package/lib/components/NHDynamicFormShow/oneOnOne/index.js +271 -0
- package/lib/components/NHImagePicker/index.js +554 -0
- package/lib/components/NHInputPicker/RadioGroup.js +118 -0
- package/lib/components/NHInputPicker/index.js +62 -0
- package/lib/components/NHInputPicker/input-const.js +55 -0
- package/lib/components/NHInputPicker/render.js +1271 -0
- package/lib/components/NHListView/index.js +374 -0
- package/lib/components/NHMapGeolocation/index.js +537 -0
- package/lib/components/NHMapGeolocation/initMap/initGdMap.js +104 -0
- package/lib/components/NHMapGeolocation/initMap/initTencentMap.js +138 -0
- package/lib/components/NHMapGeolocation/style.js +51 -0
- package/lib/components/NHMultiSelect/index.js +272 -0
- package/lib/components/NHRadioGroup/index.js +118 -0
- package/lib/components/NHSelect/index.js +364 -0
- package/lib/components/NHTreeMenu/index.js +126 -0
- package/lib/components/NHTreeMenu/treeNode.js +164 -0
- package/lib/components/StuSelector/index.js +611 -0
- package/lib/index.js +187 -118
- package/lib/layouts/KyInputPicker/edit-page.js +585 -0
- package/lib/layouts/KyInputPicker/index.js +220 -0
- package/lib/layouts/KyInputPicker/input-const.js +134 -0
- package/lib/layouts/KyInputPicker/render.js +2477 -0
- package/lib/layouts/KyInputPicker/setting-checkbox.js +850 -0
- package/lib/layouts/KyInputPicker/setting-datepicker.js +430 -0
- package/lib/layouts/KyInputPicker/setting-datetimepicker.js +443 -0
- package/lib/layouts/KyInputPicker/setting-input.js +555 -0
- package/lib/layouts/KyInputPicker/setting-inputNumber.js +612 -0
- package/lib/layouts/KyInputPicker/setting-monthpicker.js +434 -0
- package/lib/layouts/KyInputPicker/setting-multiSelect.js +532 -0
- package/lib/layouts/KyInputPicker/setting-nhcascader.js +584 -0
- package/lib/layouts/KyInputPicker/setting-old-upload.js +428 -0
- package/lib/layouts/KyInputPicker/setting-radio.js +468 -0
- package/lib/layouts/KyInputPicker/setting-rangepicker.js +466 -0
- package/lib/layouts/KyInputPicker/setting-select.js +534 -0
- package/lib/layouts/KyInputPicker/setting-stu-selector.js +507 -0
- package/lib/layouts/KyInputPicker/setting-switch.js +274 -0
- package/lib/layouts/KyInputPicker/setting-tea-selector.js +507 -0
- package/lib/layouts/KyInputPicker/setting-textarea.js +619 -0
- package/lib/layouts/KyInputPicker/setting-timepicker.js +437 -0
- package/lib/layouts/KyInputPicker/setting-upload.js +766 -0
- package/lib/layouts/KyModal/buildTitle.js +81 -0
- package/lib/layouts/KyModal/dragM.js +127 -0
- package/lib/layouts/KyModal/index.js +321 -0
- package/lib/layouts/KyPreview/index.js +219 -0
- package/lib/layouts/KyUpload/index.js +1155 -0
- package/lib/layouts/LeftMenu/index.js +5 -11
- package/lib/layouts/NavigationBar/index.js +4 -10
- package/lib/layouts/Top/editPassWord.js +5 -7
- package/lib/layouts/Top/index.js +6 -20
- package/lib/layouts/TopMenu/index.js +11 -14
- package/lib/layouts/layout/index.js +7 -13
- package/lib/layouts/{Login → login}/index-pre.js +3 -5
- package/lib/layouts/{Login → login}/index.js +6 -8
- package/lib/layouts/{Login → login}/login.js +8 -17
- package/lib/layouts/mixTop/index.js +13 -28
- package/lib/layouts/settingDrawer/index.js +3 -5
- package/lib/routes/AuthorizedRoute.js +7 -13
- package/lib/utils/NHCore.js +46 -2
- package/lib/utils/browserJudge.js +33 -0
- package/lib/utils/common.js +18 -20
- package/lib/utils/createUuid.js +11 -31
- package/lib/utils/device.js +44 -0
- package/lib/utils/dynamicLoadCss.js +14 -0
- package/lib/utils/dynamicLoadJs.js +21 -0
- package/lib/utils/getLoginUser.js +1 -1
- package/lib/utils/getSize.js +2 -11
- package/lib/utils/getStyle.js +26 -0
- package/lib/utils/getSuitHeight.js +49 -0
- package/lib/utils/hasAuth.js +11 -0
- package/lib/utils/index.js +1 -34
- package/lib/utils/loadJS.js +40 -0
- package/package.json +1 -1
- /package/lib/layouts/{Login → login}/lyPassword.js +0 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _listView = require('antd-mobile/lib/list-view');
|
|
8
|
+
|
|
9
|
+
var _listView2 = _interopRequireDefault(_listView);
|
|
10
|
+
|
|
11
|
+
var _searchBar = require('antd-mobile/lib/search-bar');
|
|
12
|
+
|
|
13
|
+
var _searchBar2 = _interopRequireDefault(_searchBar);
|
|
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 _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; }; }();
|
|
18
|
+
|
|
19
|
+
require('antd-mobile/lib/list-view/style/css');
|
|
20
|
+
|
|
21
|
+
require('antd-mobile/lib/search-bar/style/css');
|
|
22
|
+
|
|
23
|
+
var _react = require('react');
|
|
24
|
+
|
|
25
|
+
var _react2 = _interopRequireDefault(_react);
|
|
26
|
+
|
|
27
|
+
var _NHFetch = require('../../utils/NHFetch');
|
|
28
|
+
|
|
29
|
+
var _NHFetch2 = _interopRequireDefault(_NHFetch);
|
|
30
|
+
|
|
31
|
+
var _getLoginUser = require('../../utils/getLoginUser');
|
|
32
|
+
|
|
33
|
+
var _getLoginUser2 = _interopRequireDefault(_getLoginUser);
|
|
34
|
+
|
|
35
|
+
var _propTypes = require('prop-types');
|
|
36
|
+
|
|
37
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
38
|
+
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
|
+
|
|
41
|
+
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); } }
|
|
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
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 基于ant design mobile 的ListView封装,与antd-mobile同名的属性基本与其保持一致,可以参考其文档
|
|
51
|
+
* ListView文档:https://mobile.ant.design/components/list-view-cn/
|
|
52
|
+
* 注意事项:
|
|
53
|
+
* 1.useBodyScroll跟height必须存在一个,否则无法展示
|
|
54
|
+
*/
|
|
55
|
+
var NHListView = function (_React$Component) {
|
|
56
|
+
_inherits(NHListView, _React$Component);
|
|
57
|
+
|
|
58
|
+
function NHListView(props) {
|
|
59
|
+
_classCallCheck(this, NHListView);
|
|
60
|
+
|
|
61
|
+
var _this = _possibleConstructorReturn(this, (NHListView.__proto__ || Object.getPrototypeOf(NHListView)).call(this, props));
|
|
62
|
+
|
|
63
|
+
_this.encodeSql = function (params) {
|
|
64
|
+
for (var key in params) {
|
|
65
|
+
if (key.toUpperCase().startsWith('SQL_') && params[key]) {
|
|
66
|
+
// params[key] = encode(params[key]);
|
|
67
|
+
params[key] = params[key];
|
|
68
|
+
} else if (key.toUpperCase().startsWith('G_') && params[key]) {
|
|
69
|
+
params[key] = _this.encodeSql(params[key]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return params;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
_this.getFilterParams = function () {
|
|
76
|
+
var pagination = _this.state.pageData; //分页的参数
|
|
77
|
+
var filters = _this.state.filters; //多选过滤的数据
|
|
78
|
+
var sorter = _this.state.sorter; //过滤的数据
|
|
79
|
+
var searchTextMap = _this.state.searchTextMap; //字段上搜索栏的值
|
|
80
|
+
var searchParams = _this.state.searchParams; //传递过来的查询参数
|
|
81
|
+
var sqlParams = _this.props.sqlParams; //在sql语句中的参数
|
|
82
|
+
var initParams = _this.props.initParams; //初始化参数
|
|
83
|
+
var rangeFilter = _this.props.rangeFilter; //是否根据职务范围过滤
|
|
84
|
+
var rangeFilterList = _this.props.rangeFilterList; // 自定义职务过滤列表
|
|
85
|
+
if (!searchParams) {
|
|
86
|
+
searchParams = {};
|
|
87
|
+
}
|
|
88
|
+
//对里面可能存在的参数值为sql语句进行处理
|
|
89
|
+
searchParams = _this.encodeSql(searchParams);
|
|
90
|
+
sqlParams = _this.encodeSql(sqlParams);
|
|
91
|
+
initParams = _this.encodeSql(initParams);
|
|
92
|
+
|
|
93
|
+
var params = {
|
|
94
|
+
pagination: pagination,
|
|
95
|
+
filters: filters,
|
|
96
|
+
sorter: sorter,
|
|
97
|
+
searchTextMap: searchTextMap,
|
|
98
|
+
searchParams: searchParams,
|
|
99
|
+
sqlParams: sqlParams,
|
|
100
|
+
initParams: initParams,
|
|
101
|
+
sign: _this.props.sign
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// 如果启用职位范围过滤
|
|
105
|
+
if (rangeFilter) {
|
|
106
|
+
var userId = (0, _getLoginUser2.default)() ? (0, _getLoginUser2.default)().userId : '';
|
|
107
|
+
params.rangeFilter = { id: userId };
|
|
108
|
+
}
|
|
109
|
+
if (rangeFilterList) {
|
|
110
|
+
params.rangeFilterList = rangeFilterList;
|
|
111
|
+
}
|
|
112
|
+
return params;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
_this.readTableData = function () {
|
|
116
|
+
var params = _this.getFilterParams();
|
|
117
|
+
_this.setState({ isLoading: true });
|
|
118
|
+
var baseUrl = _this.props.baseUrl;
|
|
119
|
+
var url = _this.props.url ? _this.props.url : (baseUrl ? baseUrl : window.baseUrl) + "/proData/gridList";
|
|
120
|
+
(0, _NHFetch2.default)(url, "POST", params).then(function (res) {
|
|
121
|
+
if (res) {
|
|
122
|
+
var data = [].concat(_toConsumableArray(_this.state.data), _toConsumableArray(res.data.list));
|
|
123
|
+
var hasMore = res.data.pageCount > res.data.pageNum;
|
|
124
|
+
_this.setState({
|
|
125
|
+
data: data,
|
|
126
|
+
dataSource: _this.state.dataSource.cloneWithRows(data),
|
|
127
|
+
pageCount: res.data.pageCount,
|
|
128
|
+
pageData: {
|
|
129
|
+
total: res.data.total,
|
|
130
|
+
pageSize: _this.state.pageData.pageSize,
|
|
131
|
+
page: _this.state.pageData.page
|
|
132
|
+
},
|
|
133
|
+
hasMore: hasMore
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
_this.setState({ isLoading: false });
|
|
137
|
+
}).catch(function (res) {
|
|
138
|
+
_this.setState({ isLoading: false });
|
|
139
|
+
return res;
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
_this.onEndReached = function (event) {
|
|
144
|
+
if (_this.state.isLoading || !_this.state.hasMore) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
_this.setState({ isLoading: true });
|
|
148
|
+
// 如果传了sign,获取sign对应的查询数据
|
|
149
|
+
if (_this.props.sign) {
|
|
150
|
+
_this.setState({
|
|
151
|
+
pageData: _extends({}, _this.state.pageData, {
|
|
152
|
+
page: _this.state.pageData.page + 1
|
|
153
|
+
})
|
|
154
|
+
}, _this.readTableData);
|
|
155
|
+
} else if (_this.props.dataSource) {
|
|
156
|
+
// 如果没有sign且存在dataSource,使用DataSource
|
|
157
|
+
if (typeof _this.props.onEndReached === 'function') {
|
|
158
|
+
_this.props.onEndReached(event, function () {
|
|
159
|
+
return _this.setState({ isLoading: false });
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
throw new Error('must be exist sign or dataSource in NHListView');
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
_this.handleSeachBarChange = function (val) {
|
|
168
|
+
var commonSearchFields = _this.props.commonSearchFields || [];
|
|
169
|
+
var searchFieldsStr = commonSearchFields.map(function (item) {
|
|
170
|
+
return item.toUpperCase();
|
|
171
|
+
}).join(',');
|
|
172
|
+
var searchParams = {};
|
|
173
|
+
if (val && val.trim() !== '') {
|
|
174
|
+
searchParams[searchFieldsStr] = val;
|
|
175
|
+
}
|
|
176
|
+
_this.setState({
|
|
177
|
+
searchText: val,
|
|
178
|
+
searchParams: searchParams
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
_this.onSearch = function () {
|
|
183
|
+
if (_this.props.sign) {
|
|
184
|
+
_this.setState({
|
|
185
|
+
pageData: _extends({}, _this.state.pageData, {
|
|
186
|
+
page: 1
|
|
187
|
+
}),
|
|
188
|
+
data: []
|
|
189
|
+
}, _this.readTableData);
|
|
190
|
+
} else if (_this.props.dataSource) {
|
|
191
|
+
// 如果没有sign且存在dataSource,使用DataSource
|
|
192
|
+
if (typeof _this.props.onSearch === 'function') {
|
|
193
|
+
_this.props.onSearch(_this.state.searchText, function () {
|
|
194
|
+
return _this.setState({ isLoading: false });
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
} else {
|
|
198
|
+
throw new Error('must be exist sign or dataSource in NHListView');
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
_this.handleSearchClear = function () {
|
|
203
|
+
_this.setState({
|
|
204
|
+
searchParams: {}
|
|
205
|
+
}, _this.onSearch);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
_this.getSeatchBar = function () {
|
|
209
|
+
if (!_this.props.searchBarVisible) {
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
return _react2.default.createElement(
|
|
213
|
+
'div',
|
|
214
|
+
null,
|
|
215
|
+
_react2.default.createElement(_searchBar2.default, {
|
|
216
|
+
placeholder: '\u8BF7\u8F93\u5165\u67E5\u8BE2\u6761\u4EF6',
|
|
217
|
+
onChange: _this.handleSeachBarChange,
|
|
218
|
+
onSubmit: _this.onSearch,
|
|
219
|
+
onClear: _this.handleSearchClear
|
|
220
|
+
})
|
|
221
|
+
);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
var dataSource = new _listView2.default.DataSource({
|
|
225
|
+
rowHasChanged: function rowHasChanged(row1, row2) {
|
|
226
|
+
return row1 !== row2;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
_this.state = {
|
|
231
|
+
dataSource: dataSource,
|
|
232
|
+
isLoading: true,
|
|
233
|
+
pageData: { //分页设置的是三个参数
|
|
234
|
+
total: 0,
|
|
235
|
+
pageSize: props.pageSize, //当前页默认多少条数据
|
|
236
|
+
page: 1
|
|
237
|
+
},
|
|
238
|
+
data: [],
|
|
239
|
+
hasMore: true
|
|
240
|
+
};
|
|
241
|
+
return _this;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
_createClass(NHListView, [{
|
|
245
|
+
key: 'componentDidMount',
|
|
246
|
+
value: function componentDidMount() {
|
|
247
|
+
if (this.props.searchBarVisible && this.props.sign && (!this.props.commonSearchFields || this.props.commonSearchFields.length <= 0)) {
|
|
248
|
+
throw new Error('searchBarVisible and commonSearchFields should exist at the same time when use sign mod');
|
|
249
|
+
}
|
|
250
|
+
// 根据sign加载数据
|
|
251
|
+
if (this.props.sign) {
|
|
252
|
+
this.readTableData();
|
|
253
|
+
} else if (this.props.dataSource) {
|
|
254
|
+
// 使用本地数据
|
|
255
|
+
this.setState({
|
|
256
|
+
dataSource: this.state.dataSource.cloneWithRows(this.props.dataSource)
|
|
257
|
+
});
|
|
258
|
+
} else {
|
|
259
|
+
// sign与DataSource都不存在,抛出异常
|
|
260
|
+
throw new Error('must be exist sign or dataSource in NHListView');
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}, {
|
|
264
|
+
key: 'componentWillReceiveProps',
|
|
265
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
266
|
+
if (nextProps.dataSource !== this.props.dataSource) {
|
|
267
|
+
this.setState({
|
|
268
|
+
dataSource: this.state.dataSource.cloneWithRows(nextProps.dataSource),
|
|
269
|
+
isLoading: false
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// 所有数据已经渲染完,需要获取新的数据
|
|
275
|
+
|
|
276
|
+
// 搜索栏变化
|
|
277
|
+
|
|
278
|
+
// 搜索操作
|
|
279
|
+
|
|
280
|
+
// 搜索栏清空
|
|
281
|
+
|
|
282
|
+
}, {
|
|
283
|
+
key: 'render',
|
|
284
|
+
value: function render() {
|
|
285
|
+
var _this2 = this;
|
|
286
|
+
|
|
287
|
+
var _props = this.props,
|
|
288
|
+
renderRow = _props.renderRow,
|
|
289
|
+
renderSeparator = _props.renderSeparator,
|
|
290
|
+
scrollRenderAheadDistance = _props.scrollRenderAheadDistance,
|
|
291
|
+
onEndReachedThreshold = _props.onEndReachedThreshold,
|
|
292
|
+
onScroll = _props.onScroll,
|
|
293
|
+
renderHeader = _props.renderHeader,
|
|
294
|
+
useBodyScroll = _props.useBodyScroll,
|
|
295
|
+
height = _props.height,
|
|
296
|
+
searchBarVisible = _props.searchBarVisible;
|
|
297
|
+
|
|
298
|
+
var styles = {};
|
|
299
|
+
if (!useBodyScroll && height) {
|
|
300
|
+
styles.height = height;
|
|
301
|
+
styles.overflow = 'auto';
|
|
302
|
+
}
|
|
303
|
+
return _react2.default.createElement(
|
|
304
|
+
'div',
|
|
305
|
+
null,
|
|
306
|
+
this.getSeatchBar(),
|
|
307
|
+
_react2.default.createElement(_listView2.default, {
|
|
308
|
+
ref: function ref(el) {
|
|
309
|
+
return _this2.lv = el;
|
|
310
|
+
},
|
|
311
|
+
dataSource: this.state.dataSource,
|
|
312
|
+
renderHeader: renderHeader,
|
|
313
|
+
renderFooter: function renderFooter() {
|
|
314
|
+
return _react2.default.createElement(
|
|
315
|
+
'div',
|
|
316
|
+
{ style: { padding: 30, textAlign: 'center' } },
|
|
317
|
+
_this2.state.isLoading ? '加载中...' : _this2.state.hasMore ? '加载完成' : '已经到底了'
|
|
318
|
+
);
|
|
319
|
+
},
|
|
320
|
+
renderRow: renderRow,
|
|
321
|
+
renderSeparator: renderSeparator,
|
|
322
|
+
className: 'am-list',
|
|
323
|
+
style: styles,
|
|
324
|
+
pageSize: 4,
|
|
325
|
+
useBodyScroll: useBodyScroll,
|
|
326
|
+
onScroll: onScroll,
|
|
327
|
+
scrollRenderAheadDistance: scrollRenderAheadDistance,
|
|
328
|
+
onEndReached: this.onEndReached,
|
|
329
|
+
onEndReachedThreshold: onEndReachedThreshold
|
|
330
|
+
})
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
}]);
|
|
334
|
+
|
|
335
|
+
return NHListView;
|
|
336
|
+
}(_react2.default.Component);
|
|
337
|
+
|
|
338
|
+
NHListView.defaultProps = {
|
|
339
|
+
renderSeparator: function renderSeparator(sectionID, rowID) {
|
|
340
|
+
return _react2.default.createElement('div', {
|
|
341
|
+
key: sectionID + '-' + rowID,
|
|
342
|
+
style: {
|
|
343
|
+
backgroundColor: '#F5F5F9',
|
|
344
|
+
height: 8,
|
|
345
|
+
borderTop: '1px solid #ECECED',
|
|
346
|
+
borderBottom: '1px solid #ECECED'
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}, // 默认的分割渲染
|
|
350
|
+
scrollRenderAheadDistance: 500, // 当一个行接近屏幕范围多少像素之内的时候,就开始渲染这一行
|
|
351
|
+
onEndReachedThreshold: 10, // 调用onEndReached之前的临界值,单位是像素
|
|
352
|
+
pageSize: 20, // 每次查询数据时的条数
|
|
353
|
+
useBodyScroll: false, // 使用body作为滚动容器
|
|
354
|
+
searchBarVisible: false // 是否显示搜索栏
|
|
355
|
+
};
|
|
356
|
+
exports.default = NHListView;
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
NHListView.protoTypes = {
|
|
360
|
+
sign: _propTypes2.default.string, // 数据源标志
|
|
361
|
+
baseUrl: _propTypes2.default.string, // 服务前缀url
|
|
362
|
+
url: _propTypes2.default.string, // 数据源接口url,默认为: baseUrl + "/proData/gridList"
|
|
363
|
+
renderHeader: _propTypes2.default.func, // 渲染头部,() => renderable
|
|
364
|
+
renderSeparator: _propTypes2.default.func, // 渲染分隔区域,(sectionID, rowID, adjacentRowHighlighted) => renderable
|
|
365
|
+
renderRow: _propTypes2.default.func, // 渲染每一行,(rowData, sectionID, rowID, highlightRow) => renderable
|
|
366
|
+
onEndReached: _propTypes2.default.func, // 所有数据都已经渲染完成触发,sign状态下无效,(event?) => {}
|
|
367
|
+
onScroll: _propTypes2.default.func, // 滚动时触发的函数,e => {}
|
|
368
|
+
scrollRenderAheadDistance: _propTypes2.default.number, // 当一个行接近屏幕范围多少像素之内的时候,就开始渲染这一行
|
|
369
|
+
onEndReachedThreshold: _propTypes2.default.number, // 调用onEndReached之前的临界值,单位是像素
|
|
370
|
+
pageSize: _propTypes2.default.number, // 每次获取数据时的条数
|
|
371
|
+
commonSearchFields: _propTypes2.default.array, // 通用搜索的字段名称
|
|
372
|
+
searchBarVisible: _propTypes2.default.bool, // 是否显示搜索栏
|
|
373
|
+
onSearch: _propTypes2.default.func // dataSource作为数据源时通过这个方法通知外部进行搜索过滤
|
|
374
|
+
};
|