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,123 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
8
|
require("antd/lib/spin/style");
|
|
9
|
-
|
|
10
9
|
var _spin = _interopRequireDefault(require("antd/lib/spin"));
|
|
11
|
-
|
|
12
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
11
|
var _reactDom = require("react-dom");
|
|
15
|
-
|
|
16
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
-
|
|
18
13
|
var _lodash = require("lodash");
|
|
19
|
-
|
|
20
14
|
var _Table = _interopRequireDefault(require("../Table"));
|
|
21
|
-
|
|
22
15
|
var _locale = require("../locale");
|
|
23
|
-
|
|
24
|
-
function _getRequireWildcardCache() { if (typeof WeakMap
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
51
|
-
|
|
52
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
53
|
-
|
|
54
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
-
|
|
56
|
-
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); }
|
|
57
|
-
|
|
58
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
59
|
-
|
|
60
|
-
var QueryList =
|
|
61
|
-
/*#__PURE__*/
|
|
62
|
-
function (_React$PureComponent) {
|
|
63
|
-
_inherits(QueryList, _React$PureComponent);
|
|
64
|
-
|
|
16
|
+
var _excluded = ["columns", "children", "pagination", "localPagination", "paginationSticky", "className", "qlsProps"];
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
27
|
+
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); } }
|
|
28
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
29
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
30
|
+
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); }
|
|
31
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
32
|
+
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); }
|
|
33
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
34
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
35
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
36
|
+
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); }
|
|
37
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } /**
|
|
38
|
+
* @file QueryList
|
|
39
|
+
* @author you.zhang
|
|
40
|
+
*/
|
|
41
|
+
var QueryList = exports["default"] = /*#__PURE__*/function (_React$PureComponent) {
|
|
65
42
|
function QueryList(props) {
|
|
66
43
|
var _props$scroll;
|
|
67
|
-
|
|
68
44
|
var _this;
|
|
69
|
-
|
|
70
45
|
_classCallCheck(this, QueryList);
|
|
71
|
-
|
|
72
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(QueryList).call(this, props));
|
|
46
|
+
_this = _callSuper(this, QueryList, [props]);
|
|
73
47
|
_this.onWindowResize = (0, _lodash.debounce)(function () {
|
|
74
48
|
var scroll = _this.state.scroll;
|
|
75
|
-
|
|
76
49
|
_this.setState({
|
|
77
|
-
scroll: _objectSpread({}, scroll, {
|
|
50
|
+
scroll: _objectSpread(_objectSpread({}, scroll), {}, {
|
|
78
51
|
y: window.innerHeight - (_this.initialTop || _this.props.top || 200)
|
|
79
52
|
})
|
|
80
53
|
});
|
|
81
54
|
}, 50);
|
|
82
|
-
|
|
83
55
|
_this.fetchData = function () {
|
|
84
56
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
85
|
-
|
|
86
57
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
58
|
+
callback = _ref.callback,
|
|
59
|
+
_ref$showLoading = _ref.showLoading,
|
|
60
|
+
showLoading = _ref$showLoading === void 0 ? true : _ref$showLoading,
|
|
61
|
+
isInterval = _ref.isInterval;
|
|
92
62
|
var _this$props = _this.props,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
query = _this$props.qlsProps.query,
|
|
64
|
+
defaultExpandAllRows = _this$props.defaultExpandAllRows,
|
|
65
|
+
rowKey = _this$props.rowKey,
|
|
66
|
+
actions = _this$props.actions;
|
|
97
67
|
var pagination = _this.state.pagination;
|
|
98
68
|
var hasPagination = _this.props.pagination !== false;
|
|
99
|
-
|
|
100
69
|
if (hasPagination) {
|
|
101
70
|
params = _objectSpread({
|
|
102
71
|
pageSize: pagination.pageSize,
|
|
103
72
|
current: pagination.current
|
|
104
73
|
}, params);
|
|
105
74
|
}
|
|
106
|
-
|
|
107
75
|
showLoading && _this.setState({
|
|
108
76
|
loading: true
|
|
109
|
-
});
|
|
77
|
+
});
|
|
110
78
|
|
|
79
|
+
// 当用户操作查询还未得到服务端响应前,不要执行轮询请求时序问题导致覆盖
|
|
111
80
|
if (!isInterval) {
|
|
112
81
|
_this.isFetching = true;
|
|
113
82
|
}
|
|
114
|
-
|
|
115
83
|
actions.setData('submittedFormData', params);
|
|
116
84
|
return query((0, _lodash.pickBy)(params, function (val) {
|
|
117
85
|
return val !== '' && val !== null && val !== undefined;
|
|
118
86
|
})).then(function (result) {
|
|
119
87
|
var dataSource = hasPagination ? result.data || [] : result;
|
|
120
|
-
|
|
121
88
|
_this.setState(_objectSpread({
|
|
122
89
|
loading: false,
|
|
123
90
|
dataSource: dataSource,
|
|
@@ -142,50 +109,42 @@ function (_React$PureComponent) {
|
|
|
142
109
|
callback && callback();
|
|
143
110
|
});
|
|
144
111
|
};
|
|
145
|
-
|
|
146
112
|
_this.updateDataSource = function (dataSource) {
|
|
147
113
|
_this.setState({
|
|
148
114
|
dataSource: dataSource
|
|
149
115
|
});
|
|
150
|
-
|
|
151
116
|
_this.props.actions.setData('dataSource', dataSource);
|
|
152
117
|
};
|
|
153
|
-
|
|
154
118
|
_this.updatePagination = function (pagination) {
|
|
155
119
|
_this.setState({
|
|
156
120
|
pagination: pagination
|
|
157
121
|
});
|
|
158
|
-
|
|
159
122
|
_this.props.actions.setData('pagination', pagination);
|
|
160
123
|
};
|
|
161
|
-
|
|
162
124
|
_this.onFormChange = function (values) {
|
|
163
|
-
_this.formData = (0, _lodash.pickBy)(_objectSpread({}, values, {
|
|
125
|
+
_this.formData = (0, _lodash.pickBy)(_objectSpread(_objectSpread({}, values), {}, {
|
|
164
126
|
sorter: (0, _lodash.get)(_this.formData, 'sorter'),
|
|
165
127
|
filters: (0, _lodash.get)(_this.formData, 'filters')
|
|
166
128
|
}), function (val) {
|
|
167
129
|
return val !== undefined;
|
|
168
130
|
});
|
|
169
131
|
};
|
|
170
|
-
|
|
171
132
|
_this.onSearch = function (values) {
|
|
172
133
|
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
134
|
+
callback = _ref2.callback,
|
|
135
|
+
_ref2$showLoading = _ref2.showLoading,
|
|
136
|
+
showLoading = _ref2$showLoading === void 0 ? true : _ref2$showLoading;
|
|
137
|
+
_this.formData = _objectSpread(_objectSpread({}, _this.formData), values);
|
|
138
|
+
// this.props.actions.setData('formData', this.formData);
|
|
179
139
|
return _this.fetchData(_this.formData, {
|
|
180
140
|
callback: callback,
|
|
181
141
|
showLoading: showLoading
|
|
182
142
|
});
|
|
183
143
|
};
|
|
184
|
-
|
|
185
144
|
_this.onTableChange = function (pagination, filters, sorter) {
|
|
186
145
|
var _this$props2 = _this.props,
|
|
187
|
-
|
|
188
|
-
|
|
146
|
+
actions = _this$props2.actions,
|
|
147
|
+
localPagination = _this$props2.localPagination;
|
|
189
148
|
var tableParams = {
|
|
190
149
|
pageSize: pagination.pageSize,
|
|
191
150
|
current: pagination.current,
|
|
@@ -193,17 +152,17 @@ function (_React$PureComponent) {
|
|
|
193
152
|
sorter: (0, _lodash.isEmpty)(sorter) ? undefined : sorter
|
|
194
153
|
};
|
|
195
154
|
console.log('onTableChange...', actions.getSubmittedFormData(), _this.formData);
|
|
196
|
-
Object.assign(_this.formData, tableParams);
|
|
197
|
-
// 所以暂时排序有使用者自己处理
|
|
155
|
+
Object.assign(_this.formData, tableParams);
|
|
198
156
|
|
|
157
|
+
// 排序变化暂时不处理,因为有时可能是前端sorter不需要走请求
|
|
158
|
+
// 所以暂时排序有使用者自己处理
|
|
199
159
|
if (!localPagination) {
|
|
200
|
-
_this.fetchData(_objectSpread({}, actions.getSubmittedFormData(),
|
|
201
|
-
|
|
160
|
+
_this.fetchData(_objectSpread(_objectSpread({}, actions.getSubmittedFormData()), tableParams));
|
|
202
161
|
return;
|
|
203
162
|
}
|
|
163
|
+
var dataSource = _this.state.dataSource;
|
|
204
164
|
|
|
205
|
-
|
|
206
|
-
|
|
165
|
+
// 前端本地分页
|
|
207
166
|
if (localPagination) {
|
|
208
167
|
_this.setState({
|
|
209
168
|
dataSource: dataSource,
|
|
@@ -218,26 +177,21 @@ function (_React$PureComponent) {
|
|
|
218
177
|
});
|
|
219
178
|
}
|
|
220
179
|
};
|
|
221
|
-
|
|
222
180
|
_this.onTableBodyScroll = (0, _lodash.throttle)(function (evt) {
|
|
223
181
|
console.log('onTableBodyScroll', evt.target.scrollTop);
|
|
224
|
-
|
|
225
182
|
_this.updateIsScrollToBottom(evt.target);
|
|
226
183
|
}, 50);
|
|
227
|
-
|
|
228
184
|
_this.updateIsScrollToBottom = function (tableBody) {
|
|
229
185
|
var isScrollToBottom = function isScrollToBottom(tableBody) {
|
|
230
186
|
var scrollHeight = tableBody.scrollHeight,
|
|
231
|
-
|
|
232
|
-
|
|
187
|
+
scrollTop = tableBody.scrollTop,
|
|
188
|
+
offsetHeight = tableBody.offsetHeight;
|
|
233
189
|
return scrollHeight === scrollTop + offsetHeight;
|
|
234
190
|
};
|
|
235
|
-
|
|
236
191
|
_this.setState({
|
|
237
192
|
hasScrollToBottom: isScrollToBottom(tableBody)
|
|
238
193
|
});
|
|
239
194
|
};
|
|
240
|
-
|
|
241
195
|
_this.state = {
|
|
242
196
|
loading: false,
|
|
243
197
|
dataSource: [],
|
|
@@ -247,48 +201,41 @@ function (_React$PureComponent) {
|
|
|
247
201
|
total: 0
|
|
248
202
|
},
|
|
249
203
|
scroll: props.scroll,
|
|
250
|
-
hasScrollToBottom: !((_props$scroll = props.scroll)
|
|
204
|
+
hasScrollToBottom: !((_props$scroll = props.scroll) != null && _props$scroll.y)
|
|
251
205
|
};
|
|
252
|
-
_this.tableRef = (0, _react.createRef)();
|
|
206
|
+
_this.tableRef = /*#__PURE__*/(0, _react.createRef)();
|
|
253
207
|
var _actions = props.actions;
|
|
254
|
-
|
|
255
208
|
_actions.on('search', _this.onSearch);
|
|
256
|
-
|
|
257
209
|
_actions.on('setTableDataSource', _this.updateDataSource);
|
|
258
|
-
|
|
259
210
|
_actions.on('setPagination', _this.updatePagination);
|
|
260
|
-
|
|
261
211
|
_actions.on('setFormData', _this.onFormChange);
|
|
262
|
-
|
|
263
212
|
return _this;
|
|
264
213
|
}
|
|
265
|
-
|
|
266
|
-
_createClass(QueryList, [{
|
|
214
|
+
_inherits(QueryList, _React$PureComponent);
|
|
215
|
+
return _createClass(QueryList, [{
|
|
267
216
|
key: "render",
|
|
268
217
|
value: function render() {
|
|
269
218
|
var _this$props3 = this.props,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
219
|
+
columns = _this$props3.columns,
|
|
220
|
+
children = _this$props3.children,
|
|
221
|
+
pagination = _this$props3.pagination,
|
|
222
|
+
_this$props3$localPag = _this$props3.localPagination,
|
|
223
|
+
localPagination = _this$props3$localPag === void 0 ? false : _this$props3$localPag,
|
|
224
|
+
_this$props3$paginati = _this$props3.paginationSticky,
|
|
225
|
+
paginationSticky = _this$props3$paginati === void 0 ? false : _this$props3$paginati,
|
|
226
|
+
_this$props3$classNam = _this$props3.className,
|
|
227
|
+
className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
|
|
228
|
+
qlsProps = _this$props3.qlsProps,
|
|
229
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
282
230
|
var _this$state = this.state,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
231
|
+
dataSource = _this$state.dataSource,
|
|
232
|
+
loading = _this$state.loading,
|
|
233
|
+
_this$state$expandedR = _this$state.expandedRowKeys,
|
|
234
|
+
expandedRowKeys = _this$state$expandedR === void 0 ? [] : _this$state$expandedR,
|
|
235
|
+
scroll = _this$state.scroll,
|
|
236
|
+
hasScrollToBottom = _this$state.hasScrollToBottom;
|
|
289
237
|
var hasPagination = typeof pagination !== 'undefined' ? pagination : true;
|
|
290
|
-
|
|
291
|
-
var paginationInfo = _objectSpread({}, this.state.pagination, {
|
|
238
|
+
var paginationInfo = _objectSpread(_objectSpread({}, this.state.pagination), {}, {
|
|
292
239
|
// size: 'small',
|
|
293
240
|
showQuickJumper: true,
|
|
294
241
|
showSizeChanger: true,
|
|
@@ -296,20 +243,18 @@ function (_React$PureComponent) {
|
|
|
296
243
|
return (0, _locale.getText)('totalRecords', (0, _locale.getLanguage)(), total);
|
|
297
244
|
}
|
|
298
245
|
}, pagination || {});
|
|
299
|
-
|
|
300
246
|
var expandProps = _objectSpread({}, rest.defaultExpandAllRows ? {
|
|
301
247
|
expandedRowKeys: expandedRowKeys,
|
|
302
248
|
onExpandedRowsChange: this.onExpandedRowsChange
|
|
303
249
|
} : {});
|
|
304
|
-
|
|
305
|
-
return _react["default"].createElement("div", {
|
|
250
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
306
251
|
className: (0, _classnames["default"])("tnt-querylistscene-list ".concat(className), {
|
|
307
252
|
paginationSticky: paginationSticky,
|
|
308
253
|
hasScrollToBottom: hasScrollToBottom
|
|
309
254
|
})
|
|
310
|
-
}, _react["default"].createElement(_spin["default"], {
|
|
255
|
+
}, /*#__PURE__*/_react["default"].createElement(_spin["default"], {
|
|
311
256
|
spinning: loading
|
|
312
|
-
}, _react["default"].createElement(_Table["default"], _extends({
|
|
257
|
+
}, /*#__PURE__*/_react["default"].createElement(_Table["default"], _extends({
|
|
313
258
|
ref: this.tableRef
|
|
314
259
|
}, expandProps, rest, columns ? {
|
|
315
260
|
columns: columns
|
|
@@ -324,19 +269,17 @@ function (_React$PureComponent) {
|
|
|
324
269
|
key: "componentDidMount",
|
|
325
270
|
value: function componentDidMount() {
|
|
326
271
|
var _this2 = this,
|
|
327
|
-
|
|
328
|
-
|
|
272
|
+
_this$state$scroll;
|
|
329
273
|
var _this$props4 = this.props,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
this.formData = _objectSpread({}, actions.getFormData() || {},
|
|
333
|
-
|
|
274
|
+
qlsProps = _this$props4.qlsProps,
|
|
275
|
+
actions = _this$props4.actions;
|
|
276
|
+
this.formData = _objectSpread(_objectSpread({}, actions.getFormData() || {}), qlsProps.memory ? actions.getPagination() : {});
|
|
334
277
|
if (!qlsProps.initSearch) {
|
|
335
278
|
// 默认进来不请求
|
|
336
279
|
this.fetchData(this.formData)["finally"](function () {
|
|
337
280
|
// 轮询
|
|
338
281
|
if (qlsProps.interval && !_this2.isUnmounted) {
|
|
339
|
-
var
|
|
282
|
+
var _doIntervalQuery = function doIntervalQuery(ms) {
|
|
340
283
|
// 组件unmounted后,不执行轮训逻辑
|
|
341
284
|
if (!_this2.isUnmounted) {
|
|
342
285
|
_this2.timmer = setTimeout(function () {
|
|
@@ -346,23 +289,20 @@ function (_React$PureComponent) {
|
|
|
346
289
|
isInterval: true,
|
|
347
290
|
showLoading: false
|
|
348
291
|
}).then(function () {
|
|
349
|
-
|
|
292
|
+
_doIntervalQuery(ms);
|
|
350
293
|
});
|
|
351
294
|
} else {
|
|
352
|
-
|
|
295
|
+
_doIntervalQuery(ms);
|
|
353
296
|
}
|
|
354
297
|
}, ms);
|
|
355
298
|
}
|
|
356
299
|
};
|
|
357
|
-
|
|
358
|
-
doIntervalQuery(qlsProps.interval);
|
|
300
|
+
_doIntervalQuery(qlsProps.interval);
|
|
359
301
|
}
|
|
360
302
|
});
|
|
361
303
|
}
|
|
362
|
-
|
|
363
|
-
if ((_this$state$scroll = this.state.scroll) == null ? void 0 : _this$state$scroll.y) {
|
|
304
|
+
if ((_this$state$scroll = this.state.scroll) != null && _this$state$scroll.y) {
|
|
364
305
|
window.addEventListener('resize', this.onWindowResize);
|
|
365
|
-
|
|
366
306
|
if (this.tableRef.current) {
|
|
367
307
|
// table内垂直滚动,需要动态设置分页组件上阴影样式
|
|
368
308
|
var tableBody = (0, _reactDom.findDOMNode)(this.tableRef.current).querySelector('.ant-table-body');
|
|
@@ -385,9 +325,5 @@ function (_React$PureComponent) {
|
|
|
385
325
|
this.timmer && clearTimeout(this.timmer);
|
|
386
326
|
}
|
|
387
327
|
}]);
|
|
388
|
-
|
|
389
|
-
return QueryList;
|
|
390
328
|
}(_react["default"].PureComponent);
|
|
391
|
-
|
|
392
|
-
exports["default"] = QueryList;
|
|
393
329
|
;
|