tntd 1.4.32 → 1.4.33-beta.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/components/Ellipsis/index.js +47 -15
- package/components/QueryListScene/QueryForm.js +4 -4
- package/components/QueryListScene/createActions.js +4 -4
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24089 -23289
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +7 -10
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +79 -111
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +33 -40
- package/es/DevelopmentLogin/LoginModal.js +33 -46
- package/es/DevelopmentLogin/index.js +14 -18
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +100 -79
- package/es/Handle/index.js +46 -64
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +12 -15
- package/es/Img/Contain.js +26 -31
- package/es/Img/Cover.js +43 -57
- package/es/Img/index.js +39 -48
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +39 -94
- package/es/Layout/Application.js +28 -74
- package/es/Layout/Avatar.js +30 -67
- package/es/Layout/CompatibleLanguage.js +41 -96
- package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
- package/es/Layout/EnterpriseLayout/Language.js +16 -34
- package/es/Layout/EnterpriseLayout/Theme.js +18 -36
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
- package/es/Layout/GlobalNavigation/index.js +22 -56
- package/es/Layout/Header.js +26 -47
- package/es/Layout/HeaderActions.js +45 -59
- package/es/Layout/HeaderNavs.js +24 -51
- package/es/Layout/HeaderTabs.js +53 -106
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +16 -34
- package/es/Layout/Layout.js +88 -110
- package/es/Layout/Logo.js +17 -33
- package/es/Layout/OrgAppList.js +64 -109
- package/es/Layout/SideMenu.js +67 -128
- package/es/Layout/Theme.js +25 -63
- package/es/Layout/index.js +28 -37
- package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
- package/es/Layout/paaslayout/Header.js +23 -46
- package/es/Layout/paaslayout/Logo.js +4 -14
- package/es/Layout/paaslayout/SideMenu.js +41 -80
- package/es/Layout/paaslayout/index.js +77 -104
- package/es/Layout/storage.js +10 -9
- package/es/LoadingButton/index.js +18 -27
- package/es/Modal/index.js +42 -51
- package/es/Page/Box.js +36 -43
- package/es/Page/index.js +56 -71
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +7 -11
- package/es/QueryForm/Field/Select.js +34 -44
- package/es/QueryForm/Field/SelectInput.js +31 -46
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +46 -78
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +79 -140
- package/es/QueryListScene/List.js +83 -139
- package/es/QueryListScene/QueryForm.js +54 -91
- package/es/QueryListScene/QueryListScene.js +29 -47
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +13 -14
- package/es/QueryListScene/createActions.js +4 -4
- package/es/Select/DropDownWrap.js +32 -55
- package/es/Select/index.js +140 -232
- package/es/Table/ResizableTable/index.js +29 -43
- package/es/Table/index.js +20 -19
- package/es/Title/index.js +23 -25
- package/es/locale.js +1 -5
- package/es/utils/checkAuth.js +6 -8
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +17 -27
- package/lib/ArrayInput/icon.js +7 -9
- package/lib/ArrayInput/index.js +82 -131
- package/lib/AuthContext.js +2 -6
- package/lib/Columns/index.js +36 -54
- package/lib/DevelopmentLogin/LoginModal.js +36 -63
- package/lib/DevelopmentLogin/index.js +21 -31
- package/lib/Ellipsis/Svg/CopySVG.js +15 -18
- package/lib/Ellipsis/Svg/TickSVG.js +10 -13
- package/lib/Ellipsis/index.js +105 -93
- package/lib/Handle/index.js +51 -87
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/iconList.js +1 -2
- package/lib/Icon/index.js +16 -26
- package/lib/Img/Contain.js +29 -40
- package/lib/Img/Cover.js +48 -72
- package/lib/Img/index.js +42 -58
- package/lib/Layout/ActionsContext.js +1 -5
- package/lib/Layout/AppList.js +45 -124
- package/lib/Layout/Application.js +31 -92
- package/lib/Layout/Avatar.js +36 -91
- package/lib/Layout/CompatibleLanguage.js +44 -116
- package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
- package/lib/Layout/EnterpriseLayout/Language.js +22 -54
- package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
- package/lib/Layout/EnterpriseLayout/index.js +17 -27
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
- package/lib/Layout/GlobalNavigation/index.js +28 -80
- package/lib/Layout/Header.js +36 -68
- package/lib/Layout/HeaderActions.js +51 -81
- package/lib/Layout/HeaderNavs.js +30 -70
- package/lib/Layout/HeaderTabs.js +58 -127
- package/lib/Layout/Iconfont.js +4 -9
- package/lib/Layout/Language.js +22 -54
- package/lib/Layout/Layout.js +93 -134
- package/lib/Layout/Logo.js +26 -47
- package/lib/Layout/OrgAppList.js +69 -133
- package/lib/Layout/SideMenu.js +72 -151
- package/lib/Layout/Theme.js +28 -79
- package/lib/Layout/createActions.js +3 -9
- package/lib/Layout/images/index.js +5 -36
- package/lib/Layout/index.js +35 -63
- package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
- package/lib/Layout/paaslayout/Header.js +30 -60
- package/lib/Layout/paaslayout/Logo.js +11 -24
- package/lib/Layout/paaslayout/SideMenu.js +44 -93
- package/lib/Layout/paaslayout/index.js +82 -128
- package/lib/Layout/storage.js +26 -68
- package/lib/LoadingButton/index.js +21 -36
- package/lib/Modal/index.js +45 -62
- package/lib/Page/Box.js +38 -50
- package/lib/Page/index.js +58 -84
- package/lib/Page/utils.js +5 -16
- package/lib/QueryForm/Field/Checkbox.js +10 -19
- package/lib/QueryForm/Field/Select.js +39 -60
- package/lib/QueryForm/Field/SelectInput.js +36 -65
- package/lib/QueryForm/Field/fieldsMap.js +6 -23
- package/lib/QueryForm/Field/index.js +50 -91
- package/lib/QueryForm/createActions.js +9 -16
- package/lib/QueryForm/index.js +83 -165
- package/lib/QueryForm/useForm.js +1 -6
- package/lib/QueryListScene/List.js +89 -153
- package/lib/QueryListScene/QueryForm.js +58 -101
- package/lib/QueryListScene/QueryListScene.js +31 -56
- package/lib/QueryListScene/Title.js +6 -11
- package/lib/QueryListScene/Toolbar.js +16 -22
- package/lib/QueryListScene/createActions.js +7 -13
- package/lib/QueryListScene/index.js +5 -19
- package/lib/QueryListScene/useActions.js +1 -6
- package/lib/Select/DropDownWrap.js +35 -63
- package/lib/Select/index.js +142 -245
- package/lib/Table/ResizableTable/index.js +31 -54
- package/lib/Table/index.js +21 -34
- package/lib/Title/index.js +26 -34
- package/lib/index.js +36 -57
- package/lib/locale.js +9 -25
- package/lib/utils/checkAuth.js +9 -16
- package/lib/utils/findMenuInfoByPath.js +3 -12
- package/lib/utils/index.js +26 -60
- package/package.json +3 -2
|
@@ -1,36 +1,25 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import "antd/lib/spin/style";
|
|
2
3
|
import _Spin from "antd/lib/spin";
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23
|
-
|
|
24
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
25
|
-
|
|
26
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
27
|
-
|
|
28
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
29
|
-
|
|
30
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
|
-
|
|
32
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
-
|
|
4
|
+
var _excluded = ["columns", "children", "pagination", "localPagination", "paginationSticky", "className", "qlsProps"];
|
|
5
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
6
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
13
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
17
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
18
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
19
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
21
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
22
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
34
23
|
/**
|
|
35
24
|
* @file QueryList
|
|
36
25
|
* @author you.zhang
|
|
@@ -41,68 +30,53 @@ import cn from 'classnames';
|
|
|
41
30
|
import { get, pickBy, isEmpty, debounce, throttle } from 'lodash';
|
|
42
31
|
import Table from '../Table';
|
|
43
32
|
import { getText, getLanguage } from '../locale';
|
|
44
|
-
|
|
45
|
-
var QueryList =
|
|
46
|
-
/*#__PURE__*/
|
|
47
|
-
function (_React$PureComponent) {
|
|
48
|
-
_inherits(QueryList, _React$PureComponent);
|
|
49
|
-
|
|
33
|
+
var QueryList = /*#__PURE__*/function (_React$PureComponent) {
|
|
50
34
|
function QueryList(props) {
|
|
51
35
|
var _props$scroll;
|
|
52
|
-
|
|
53
36
|
var _this;
|
|
54
|
-
|
|
55
37
|
_classCallCheck(this, QueryList);
|
|
56
|
-
|
|
57
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(QueryList).call(this, props));
|
|
38
|
+
_this = _callSuper(this, QueryList, [props]);
|
|
58
39
|
_this.onWindowResize = debounce(function () {
|
|
59
40
|
var scroll = _this.state.scroll;
|
|
60
|
-
|
|
61
41
|
_this.setState({
|
|
62
|
-
scroll: _objectSpread({}, scroll, {
|
|
42
|
+
scroll: _objectSpread(_objectSpread({}, scroll), {}, {
|
|
63
43
|
y: window.innerHeight - (_this.initialTop || _this.props.top || 200)
|
|
64
44
|
})
|
|
65
45
|
});
|
|
66
46
|
}, 50);
|
|
67
|
-
|
|
68
47
|
_this.fetchData = function () {
|
|
69
48
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
70
|
-
|
|
71
49
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
50
|
+
callback = _ref.callback,
|
|
51
|
+
_ref$showLoading = _ref.showLoading,
|
|
52
|
+
showLoading = _ref$showLoading === void 0 ? true : _ref$showLoading,
|
|
53
|
+
isInterval = _ref.isInterval;
|
|
77
54
|
var _this$props = _this.props,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
55
|
+
query = _this$props.qlsProps.query,
|
|
56
|
+
defaultExpandAllRows = _this$props.defaultExpandAllRows,
|
|
57
|
+
rowKey = _this$props.rowKey,
|
|
58
|
+
actions = _this$props.actions;
|
|
82
59
|
var pagination = _this.state.pagination;
|
|
83
60
|
var hasPagination = _this.props.pagination !== false;
|
|
84
|
-
|
|
85
61
|
if (hasPagination) {
|
|
86
62
|
params = _objectSpread({
|
|
87
63
|
pageSize: pagination.pageSize,
|
|
88
64
|
current: pagination.current
|
|
89
65
|
}, params);
|
|
90
66
|
}
|
|
91
|
-
|
|
92
67
|
showLoading && _this.setState({
|
|
93
68
|
loading: true
|
|
94
|
-
});
|
|
69
|
+
});
|
|
95
70
|
|
|
71
|
+
// 当用户操作查询还未得到服务端响应前,不要执行轮询请求时序问题导致覆盖
|
|
96
72
|
if (!isInterval) {
|
|
97
73
|
_this.isFetching = true;
|
|
98
74
|
}
|
|
99
|
-
|
|
100
75
|
actions.setData('submittedFormData', params);
|
|
101
76
|
return query(pickBy(params, function (val) {
|
|
102
77
|
return val !== '' && val !== null && val !== undefined;
|
|
103
78
|
})).then(function (result) {
|
|
104
79
|
var dataSource = hasPagination ? result.data || [] : result;
|
|
105
|
-
|
|
106
80
|
_this.setState(_objectSpread({
|
|
107
81
|
loading: false,
|
|
108
82
|
dataSource: dataSource,
|
|
@@ -127,50 +101,42 @@ function (_React$PureComponent) {
|
|
|
127
101
|
callback && callback();
|
|
128
102
|
});
|
|
129
103
|
};
|
|
130
|
-
|
|
131
104
|
_this.updateDataSource = function (dataSource) {
|
|
132
105
|
_this.setState({
|
|
133
106
|
dataSource: dataSource
|
|
134
107
|
});
|
|
135
|
-
|
|
136
108
|
_this.props.actions.setData('dataSource', dataSource);
|
|
137
109
|
};
|
|
138
|
-
|
|
139
110
|
_this.updatePagination = function (pagination) {
|
|
140
111
|
_this.setState({
|
|
141
112
|
pagination: pagination
|
|
142
113
|
});
|
|
143
|
-
|
|
144
114
|
_this.props.actions.setData('pagination', pagination);
|
|
145
115
|
};
|
|
146
|
-
|
|
147
116
|
_this.onFormChange = function (values) {
|
|
148
|
-
_this.formData = pickBy(_objectSpread({}, values, {
|
|
117
|
+
_this.formData = pickBy(_objectSpread(_objectSpread({}, values), {}, {
|
|
149
118
|
sorter: get(_this.formData, 'sorter'),
|
|
150
119
|
filters: get(_this.formData, 'filters')
|
|
151
120
|
}), function (val) {
|
|
152
121
|
return val !== undefined;
|
|
153
122
|
});
|
|
154
123
|
};
|
|
155
|
-
|
|
156
124
|
_this.onSearch = function (values) {
|
|
157
125
|
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
126
|
+
callback = _ref2.callback,
|
|
127
|
+
_ref2$showLoading = _ref2.showLoading,
|
|
128
|
+
showLoading = _ref2$showLoading === void 0 ? true : _ref2$showLoading;
|
|
129
|
+
_this.formData = _objectSpread(_objectSpread({}, _this.formData), values);
|
|
130
|
+
// this.props.actions.setData('formData', this.formData);
|
|
164
131
|
return _this.fetchData(_this.formData, {
|
|
165
132
|
callback: callback,
|
|
166
133
|
showLoading: showLoading
|
|
167
134
|
});
|
|
168
135
|
};
|
|
169
|
-
|
|
170
136
|
_this.onTableChange = function (pagination, filters, sorter) {
|
|
171
137
|
var _this$props2 = _this.props,
|
|
172
|
-
|
|
173
|
-
|
|
138
|
+
actions = _this$props2.actions,
|
|
139
|
+
localPagination = _this$props2.localPagination;
|
|
174
140
|
var tableParams = {
|
|
175
141
|
pageSize: pagination.pageSize,
|
|
176
142
|
current: pagination.current,
|
|
@@ -178,17 +144,17 @@ function (_React$PureComponent) {
|
|
|
178
144
|
sorter: isEmpty(sorter) ? undefined : sorter
|
|
179
145
|
};
|
|
180
146
|
console.log('onTableChange...', actions.getSubmittedFormData(), _this.formData);
|
|
181
|
-
Object.assign(_this.formData, tableParams);
|
|
182
|
-
// 所以暂时排序有使用者自己处理
|
|
147
|
+
Object.assign(_this.formData, tableParams);
|
|
183
148
|
|
|
149
|
+
// 排序变化暂时不处理,因为有时可能是前端sorter不需要走请求
|
|
150
|
+
// 所以暂时排序有使用者自己处理
|
|
184
151
|
if (!localPagination) {
|
|
185
|
-
_this.fetchData(_objectSpread({}, actions.getSubmittedFormData(),
|
|
186
|
-
|
|
152
|
+
_this.fetchData(_objectSpread(_objectSpread({}, actions.getSubmittedFormData()), tableParams));
|
|
187
153
|
return;
|
|
188
154
|
}
|
|
155
|
+
var dataSource = _this.state.dataSource;
|
|
189
156
|
|
|
190
|
-
|
|
191
|
-
|
|
157
|
+
// 前端本地分页
|
|
192
158
|
if (localPagination) {
|
|
193
159
|
_this.setState({
|
|
194
160
|
dataSource: dataSource,
|
|
@@ -203,26 +169,21 @@ function (_React$PureComponent) {
|
|
|
203
169
|
});
|
|
204
170
|
}
|
|
205
171
|
};
|
|
206
|
-
|
|
207
172
|
_this.onTableBodyScroll = throttle(function (evt) {
|
|
208
173
|
console.log('onTableBodyScroll', evt.target.scrollTop);
|
|
209
|
-
|
|
210
174
|
_this.updateIsScrollToBottom(evt.target);
|
|
211
175
|
}, 50);
|
|
212
|
-
|
|
213
176
|
_this.updateIsScrollToBottom = function (tableBody) {
|
|
214
177
|
var isScrollToBottom = function isScrollToBottom(tableBody) {
|
|
215
178
|
var scrollHeight = tableBody.scrollHeight,
|
|
216
|
-
|
|
217
|
-
|
|
179
|
+
scrollTop = tableBody.scrollTop,
|
|
180
|
+
offsetHeight = tableBody.offsetHeight;
|
|
218
181
|
return scrollHeight === scrollTop + offsetHeight;
|
|
219
182
|
};
|
|
220
|
-
|
|
221
183
|
_this.setState({
|
|
222
184
|
hasScrollToBottom: isScrollToBottom(tableBody)
|
|
223
185
|
});
|
|
224
186
|
};
|
|
225
|
-
|
|
226
187
|
_this.state = {
|
|
227
188
|
loading: false,
|
|
228
189
|
dataSource: [],
|
|
@@ -232,48 +193,41 @@ function (_React$PureComponent) {
|
|
|
232
193
|
total: 0
|
|
233
194
|
},
|
|
234
195
|
scroll: props.scroll,
|
|
235
|
-
hasScrollToBottom: !((_props$scroll = props.scroll)
|
|
196
|
+
hasScrollToBottom: !((_props$scroll = props.scroll) != null && _props$scroll.y)
|
|
236
197
|
};
|
|
237
|
-
_this.tableRef = createRef();
|
|
198
|
+
_this.tableRef = /*#__PURE__*/createRef();
|
|
238
199
|
var _actions = props.actions;
|
|
239
|
-
|
|
240
200
|
_actions.on('search', _this.onSearch);
|
|
241
|
-
|
|
242
201
|
_actions.on('setTableDataSource', _this.updateDataSource);
|
|
243
|
-
|
|
244
202
|
_actions.on('setPagination', _this.updatePagination);
|
|
245
|
-
|
|
246
203
|
_actions.on('setFormData', _this.onFormChange);
|
|
247
|
-
|
|
248
204
|
return _this;
|
|
249
205
|
}
|
|
250
|
-
|
|
251
|
-
_createClass(QueryList, [{
|
|
206
|
+
_inherits(QueryList, _React$PureComponent);
|
|
207
|
+
return _createClass(QueryList, [{
|
|
252
208
|
key: "render",
|
|
253
209
|
value: function render() {
|
|
254
210
|
var _this$props3 = this.props,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
211
|
+
columns = _this$props3.columns,
|
|
212
|
+
children = _this$props3.children,
|
|
213
|
+
pagination = _this$props3.pagination,
|
|
214
|
+
_this$props3$localPag = _this$props3.localPagination,
|
|
215
|
+
localPagination = _this$props3$localPag === void 0 ? false : _this$props3$localPag,
|
|
216
|
+
_this$props3$paginati = _this$props3.paginationSticky,
|
|
217
|
+
paginationSticky = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
|
|
218
|
+
_this$props3$classNam = _this$props3.className,
|
|
219
|
+
className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
|
|
220
|
+
qlsProps = _this$props3.qlsProps,
|
|
221
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
267
222
|
var _this$state = this.state,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
223
|
+
dataSource = _this$state.dataSource,
|
|
224
|
+
loading = _this$state.loading,
|
|
225
|
+
_this$state$expandedR = _this$state.expandedRowKeys,
|
|
226
|
+
expandedRowKeys = _this$state$expandedR === void 0 ? [] : _this$state$expandedR,
|
|
227
|
+
scroll = _this$state.scroll,
|
|
228
|
+
hasScrollToBottom = _this$state.hasScrollToBottom;
|
|
274
229
|
var hasPagination = typeof pagination !== 'undefined' ? pagination : true;
|
|
275
|
-
|
|
276
|
-
var paginationInfo = _objectSpread({}, this.state.pagination, {
|
|
230
|
+
var paginationInfo = _objectSpread(_objectSpread({}, this.state.pagination), {}, {
|
|
277
231
|
// size: 'small',
|
|
278
232
|
showQuickJumper: true,
|
|
279
233
|
showSizeChanger: true,
|
|
@@ -281,20 +235,18 @@ function (_React$PureComponent) {
|
|
|
281
235
|
return getText('totalRecords', getLanguage(), total);
|
|
282
236
|
}
|
|
283
237
|
}, pagination || {});
|
|
284
|
-
|
|
285
238
|
var expandProps = _objectSpread({}, rest.defaultExpandAllRows ? {
|
|
286
239
|
expandedRowKeys: expandedRowKeys,
|
|
287
240
|
onExpandedRowsChange: this.onExpandedRowsChange
|
|
288
241
|
} : {});
|
|
289
|
-
|
|
290
|
-
return React.createElement("div", {
|
|
242
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
291
243
|
className: cn("tnt-querylistscene-list ".concat(className), {
|
|
292
244
|
paginationSticky: paginationSticky,
|
|
293
245
|
hasScrollToBottom: hasScrollToBottom
|
|
294
246
|
})
|
|
295
|
-
}, React.createElement(_Spin, {
|
|
247
|
+
}, /*#__PURE__*/React.createElement(_Spin, {
|
|
296
248
|
spinning: loading
|
|
297
|
-
}, React.createElement(Table, _extends({
|
|
249
|
+
}, /*#__PURE__*/React.createElement(Table, _extends({
|
|
298
250
|
ref: this.tableRef
|
|
299
251
|
}, expandProps, rest, columns ? {
|
|
300
252
|
columns: columns
|
|
@@ -309,19 +261,17 @@ function (_React$PureComponent) {
|
|
|
309
261
|
key: "componentDidMount",
|
|
310
262
|
value: function componentDidMount() {
|
|
311
263
|
var _this2 = this,
|
|
312
|
-
|
|
313
|
-
|
|
264
|
+
_this$state$scroll;
|
|
314
265
|
var _this$props4 = this.props,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
this.formData = _objectSpread({}, actions.getFormData() || {},
|
|
318
|
-
|
|
266
|
+
qlsProps = _this$props4.qlsProps,
|
|
267
|
+
actions = _this$props4.actions;
|
|
268
|
+
this.formData = _objectSpread(_objectSpread({}, actions.getFormData() || {}), qlsProps.memory ? actions.getPagination() : {});
|
|
319
269
|
if (!qlsProps.initSearch) {
|
|
320
270
|
// 默认进来不请求
|
|
321
271
|
this.fetchData(this.formData)["finally"](function () {
|
|
322
272
|
// 轮询
|
|
323
273
|
if (qlsProps.interval && !_this2.isUnmounted) {
|
|
324
|
-
var
|
|
274
|
+
var _doIntervalQuery = function doIntervalQuery(ms) {
|
|
325
275
|
// 组件unmounted后,不执行轮训逻辑
|
|
326
276
|
if (!_this2.isUnmounted) {
|
|
327
277
|
_this2.timmer = setTimeout(function () {
|
|
@@ -331,23 +281,20 @@ function (_React$PureComponent) {
|
|
|
331
281
|
isInterval: true,
|
|
332
282
|
showLoading: false
|
|
333
283
|
}).then(function () {
|
|
334
|
-
|
|
284
|
+
_doIntervalQuery(ms);
|
|
335
285
|
});
|
|
336
286
|
} else {
|
|
337
|
-
|
|
287
|
+
_doIntervalQuery(ms);
|
|
338
288
|
}
|
|
339
289
|
}, ms);
|
|
340
290
|
}
|
|
341
291
|
};
|
|
342
|
-
|
|
343
|
-
doIntervalQuery(qlsProps.interval);
|
|
292
|
+
_doIntervalQuery(qlsProps.interval);
|
|
344
293
|
}
|
|
345
294
|
});
|
|
346
295
|
}
|
|
347
|
-
|
|
348
|
-
if ((_this$state$scroll = this.state.scroll) == null ? void 0 : _this$state$scroll.y) {
|
|
296
|
+
if ((_this$state$scroll = this.state.scroll) != null && _this$state$scroll.y) {
|
|
349
297
|
window.addEventListener('resize', this.onWindowResize);
|
|
350
|
-
|
|
351
298
|
if (this.tableRef.current) {
|
|
352
299
|
// table内垂直滚动,需要动态设置分页组件上阴影样式
|
|
353
300
|
var tableBody = findDOMNode(this.tableRef.current).querySelector('.ant-table-body');
|
|
@@ -370,9 +317,6 @@ function (_React$PureComponent) {
|
|
|
370
317
|
this.timmer && clearTimeout(this.timmer);
|
|
371
318
|
}
|
|
372
319
|
}]);
|
|
373
|
-
|
|
374
|
-
return QueryList;
|
|
375
320
|
}(React.PureComponent);
|
|
376
|
-
|
|
377
321
|
export { QueryList as default };
|
|
378
322
|
;
|