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