antd-management-fast-framework 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/es/index.js +3 -9771
  2. package/package.json +7 -7
  3. package/es/configGroup/configGeneral.d.ts +0 -28
  4. package/es/configGroup/configGeneral.js +0 -36
  5. package/es/configGroup/index.d.ts +0 -2
  6. package/es/configGroup/themeCollection.d.ts +0 -7
  7. package/es/configGroup/themeCollection.js +0 -9
  8. package/es/configGroup/webpackPlugin.d.ts +0 -4
  9. package/es/configGroup/webpackPlugin.js +0 -351
  10. package/es/customComponents/ApplicationProvider/index.d.ts +0 -12
  11. package/es/customComponents/ApplicationWrapper/index.d.ts +0 -9
  12. package/es/customComponents/Bootstrap/index.d.ts +0 -3
  13. package/es/customComponents/Bootstrap/index.js +0 -67
  14. package/es/customComponents/DataPreviewDrawer/index.d.ts +0 -31
  15. package/es/customComponents/DataPreviewDrawer/index.js +0 -169
  16. package/es/customComponents/LoadingOverlay/index.d.ts +0 -6
  17. package/es/customComponents/LoadingOverloay/index.d.ts +0 -3
  18. package/es/customComponents/MobileContainor/MobileHtmlPreviewBox/index.d.ts +0 -10
  19. package/es/customComponents/MobileContainor/MobileHtmlPreviewBox/index.js +0 -83
  20. package/es/customComponents/MobileContainor/MobilePreviewArea/index.d.ts +0 -75
  21. package/es/customComponents/MobileContainor/MobilePreviewArea/index.js +0 -193
  22. package/es/customComponents/MobileContainor/MobilePreviewDrawer/index.d.ts +0 -54
  23. package/es/customComponents/MobileContainor/MobilePreviewDrawer/index.js +0 -157
  24. package/es/customComponents/MobileContainor/index.d.ts +0 -8
  25. package/es/customComponents/index.d.ts +0 -5
  26. package/es/framework/AuthorizationWrapper/index.js +0 -108
  27. package/es/framework/ButtonExtension/SelectButton/Base/index.js +0 -98
  28. package/es/framework/ButtonExtension/SelectButton/InteractiveBase/index.js +0 -149
  29. package/es/framework/Common/CardCollectionItemContent/index.d.ts +0 -14
  30. package/es/framework/Common/CommonInternal/index.d.ts +0 -167
  31. package/es/framework/Common/InternalMake/index.d.ts +0 -9
  32. package/es/framework/Common/index.js +0 -39
  33. package/es/framework/Core/index.js +0 -38
  34. package/es/framework/CustomWrapper/Supplement/index.js +0 -67
  35. package/es/framework/CustomWrapper/SupplementCore/index.js +0 -131
  36. package/es/framework/CustomWrapper/SupplementWrapper/index.js +0 -61
  37. package/es/framework/DataDrawer/Base/index.js +0 -335
  38. package/es/framework/DataDrawer/BaseAddDrawer/index.js +0 -95
  39. package/es/framework/DataDrawer/BaseLoadDrawer/index.js +0 -82
  40. package/es/framework/DataDrawer/BaseNeedlessLoadDrawer/index.js +0 -94
  41. package/es/framework/DataDrawer/BaseSaveDrawer/index.js +0 -85
  42. package/es/framework/DataDrawer/BaseUpdateDrawer/index.js +0 -83
  43. package/es/framework/DataForm/BaseAddForm/index.js +0 -261
  44. package/es/framework/DataForm/BaseUpdateForm/index.js +0 -183
  45. package/es/framework/DataForm/BaseUpdateFormContent/index.js +0 -72
  46. package/es/framework/DataForm/BaseUpdateFormTab/index.js +0 -66
  47. package/es/framework/DataListView/Base/index.js +0 -1261
  48. package/es/framework/DataListView/BatchAction/index.js +0 -73
  49. package/es/framework/DataListView/ColumnSetting/DndItem.js +0 -116
  50. package/es/framework/DataListView/ColumnSetting/index.js +0 -319
  51. package/es/framework/DataListView/DensityAction/index.js +0 -63
  52. package/es/framework/DataMenuContainer/index.js +0 -282
  53. package/es/framework/DataModal/Base/index.js +0 -231
  54. package/es/framework/DataModal/BaseAddModal/index.js +0 -72
  55. package/es/framework/DataModal/BaseLoadModal/index.js +0 -80
  56. package/es/framework/DataModal/BaseNeedlessLoadModal/index.js +0 -106
  57. package/es/framework/DataModal/BaseSelectModal/index.js +0 -74
  58. package/es/framework/DataModal/BaseUpdateModal/index.js +0 -62
  59. package/es/framework/DataModal/BaseUpdateTransferModal/index.js +0 -140
  60. package/es/framework/DataMultiPageView/InnerMultiPage/index.js +0 -82
  61. package/es/framework/DataMultiPageView/MultiPage/index.js +0 -299
  62. package/es/framework/DataMultiPageView/MultiPageDrawer/index.js +0 -457
  63. package/es/framework/DataMultiPageView/MultiPageSelectDrawer/index.js +0 -123
  64. package/es/framework/DataOperation/Base/index.js +0 -322
  65. package/es/framework/DataOperation/BaseView/index.js +0 -83
  66. package/es/framework/DataOperation/BaseWindow/index.js +0 -330
  67. package/es/framework/DataSinglePageView/InnerSinglePage/index.js +0 -82
  68. package/es/framework/DataSinglePageView/SinglePage/index.js +0 -254
  69. package/es/framework/DataSinglePageView/SinglePageDrawer/index.js +0 -438
  70. package/es/framework/DataSinglePageView/SinglePageSelectDrawer/index.js +0 -126
  71. package/es/framework/DataSingleView/DataCore/index.js +0 -260
  72. package/es/framework/DataSingleView/DataLoad/index.js +0 -151
  73. package/es/framework/DataTabContainer/index.js +0 -254
  74. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.js +0 -158
  75. package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldDrawerBase/index.js +0 -159
  76. package/es/framework/LayoutWrapper/index.d.ts +0 -2
  77. package/es/framework/Wrapper/index.js +0 -59
  78. package/es/get.js +0 -28
  79. package/es/getPrototypeOf.js +0 -76
  80. package/es/index2.js +0 -2075
  81. package/es/index3.js +0 -383
  82. package/es/models/index.d.ts +0 -1
  83. package/es/models/schedulingControl.d.ts +0 -46
  84. package/es/models/schedulingControl.js +0 -171
  85. package/es/objectSpread2.js +0 -40
  86. package/es/services/schedulingControl.js +0 -135
  87. package/es/slicedToArray.js +0 -43
  88. package/es/toConsumableArray.js +0 -19
  89. package/es/toPropertyKey.js +0 -19
  90. package/es/typeof.js +0 -11
  91. package/es/unsupportedIterableToArray.js +0 -16
  92. package/es/utils/appListDataAssist.js +0 -69
  93. package/es/utils/applicationAssist.js +0 -28
  94. package/es/utils/bootstrap.js +0 -58
  95. package/es/utils/layoutSettingAssist.js +0 -60
  96. package/es/utils/metaDataAssist.js +0 -69
  97. package/es/utils/storageAssist.js +0 -153
@@ -1,1261 +0,0 @@
1
- import { _ as _extends } from '../../../index2.js';
2
- import { _ as _toConsumableArray } from '../../../toConsumableArray.js';
3
- import { _ as _objectSpread2 } from '../../../objectSpread2.js';
4
- import { _ as _inherits, a as _classCallCheck, b as _createClass, c as _getPrototypeOf, d as _possibleConstructorReturn } from '../../../getPrototypeOf.js';
5
- import { Layout, Form, DatePicker, FloatButton, Row, Col, Button, Alert, Space, Divider, Pagination, Affix, Tooltip, List, Spin, Empty, Card } from 'antd';
6
- import classNames from 'classnames';
7
- import React from 'react';
8
- import { PageContainer } from '@ant-design/pro-layout';
9
- import { formNameCollection, columnFacadeMode, searchCardConfig, cardConfig, datetimeFormat, pageHeaderRenderType, listViewConfig } from 'antd-management-fast-common/es/utils/constants';
10
- import { getCurrentLocation } from 'antd-management-fast-common/es/utils/routeAssist';
11
- import { isArray, isUndefined, showWarnMessage, toMoment, buildFieldDescription, toNumber, defaultListState, getDerivedStateFromPropsForUrlParams } from 'antd-management-fast-common/es/utils/tools';
12
- import { avatarImageLoadResultCollection, decorateAvatar } from 'antd-management-fast-component/es/customComponents/DecorateAvatar';
13
- import FlexBox from 'antd-management-fast-component/es/customComponents/FlexBox';
14
- import { buildColumnList, buildCustomSelect, buildTagList, buildPageHeaderContent, pageHeaderExtraContent, adjustTableExpandConfig, buildDropdown, buildPageHeaderTitle, buildPageHeaderTagWrapper } from 'antd-management-fast-component/es/customComponents/FunctionComponent';
15
- import { iconBuilder } from 'antd-management-fast-component/es/customComponents/Icon';
16
- import StandardTableCustom from 'antd-management-fast-component/es/customComponents/StandardTableCustom';
17
- import AuthorizationWrapper from '../../AuthorizationWrapper/index.js';
18
- import BatchAction from '../BatchAction/index.js';
19
- import ColumnSetting from '../ColumnSetting/index.js';
20
- import DensityAction from '../DensityAction/index.js';
21
- import 'antd-management-fast-common/es/utils/dynamicSetting';
22
- import 'antd-management-fast-common/es/utils/requestAssistor';
23
- import 'antd-management-fast-component/es/customComponents/AnimalBox/FadeBox';
24
- import 'antd-management-fast-component/es/customComponents/AnimalBox/QueueBox';
25
- import 'antd-management-fast-component/es/customComponents/AudioUpload';
26
- import 'antd-management-fast-component/es/customComponents/ColorText';
27
- import 'antd-management-fast-component/es/customComponents/Editor/TinymceWrapper';
28
- import 'antd-management-fast-component/es/customComponents/FileBase64Upload';
29
- import 'antd-management-fast-component/es/customComponents/FileUpload';
30
- import 'antd-management-fast-component/es/customComponents/FlexText';
31
- import 'antd-management-fast-component/es/customComponents/FunctionSupplement/Whether';
32
- import 'antd-management-fast-component/es/customComponents/HelpBox';
33
- import 'antd-management-fast-component/es/customComponents/HelpCard';
34
- import 'antd-management-fast-component/es/customComponents/HtmlBox';
35
- import 'antd-management-fast-component/es/customComponents/IconInfo';
36
- import 'antd-management-fast-component/es/customComponents/ImageBox';
37
- import 'antd-management-fast-component/es/customComponents/ImageUpload';
38
- import 'antd-management-fast-component/es/customComponents/VideoUpload';
39
- import '../../../utils/metaDataAssist.js';
40
- import '../../../index3.js';
41
- import '../../../typeof.js';
42
- import 'antd-management-fast-common/es/utils/actionAssist';
43
- import 'antd-management-fast-common/es/utils/dva';
44
- import '../../../utils/storageAssist.js';
45
- import 'antd-management-fast-common/es/utils/globalStorageAssist';
46
- import 'antd-management-fast-common/es/utils/localStorageAssist';
47
- import '../../../toPropertyKey.js';
48
- import '../../Core/index.js';
49
- import 'antd-management-fast-component/es/customComponents/BaseComponent';
50
- import '../../../unsupportedIterableToArray.js';
51
- import 'antd-management-fast-common/es/utils/authority';
52
- import '../../CustomWrapper/SupplementWrapper/index.js';
53
- import '../../CustomWrapper/Supplement/index.js';
54
- import '../../CustomWrapper/SupplementCore/index.js';
55
- import 'antd/lib/config-provider/context';
56
- import 'react-dnd';
57
- import 'react-dnd-html5-backend';
58
- import '@ant-design/icons';
59
- import '../ColumnSetting/DndItem.js';
60
- import '../../../slicedToArray.js';
61
-
62
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
63
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
64
- var classPrefix = "amf-data-list-view-base";
65
- var Content = Layout.Content,
66
- Sider = Layout.Sider;
67
- var FormItem = Form.Item;
68
- var RangePicker = DatePicker.RangePicker;
69
- var BackTop = FloatButton.BackTop;
70
- var ListBase = /*#__PURE__*/function (_AuthorizationWrapper) {
71
- _inherits(ListBase, _AuthorizationWrapper);
72
- var _super = _createSuper(ListBase);
73
- /**
74
- * 使用远端分页
75
- */
76
-
77
- /**
78
- * 使用前台模拟分页,有助于优化长列表页面交互操作导致的延迟
79
- */
80
-
81
- function ListBase(props) {
82
- var _this;
83
- _classCallCheck(this, ListBase);
84
- _this = _super.call(this, props);
85
- _this.useRemotePagination = true;
86
- _this.useFrontendPagination = false;
87
- _this.useFrontendPagination = false;
88
- _this.showSearchForm = true;
89
- _this.affixPaginationBar = true;
90
- _this.formRef = /*#__PURE__*/React.createRef();
91
- _this.pageSizeAdditional = 0;
92
- _this.columnOperateVisible = true;
93
- _this.columnOperateWidth = 106;
94
- _this.columnOperateFixed = 'right';
95
- _this.showListViewItemActionSelect = false;
96
- _this.doWorkAfterDidMount = function () {
97
- var pageSize = _this.state.pageSize;
98
- _this.pageSizeAdditional = pageSize;
99
- };
100
- _this.afterLoadSuccess = function (_ref) {
101
- var metaData = _ref.metaData,
102
- metaListData = _ref.metaListData,
103
- metaExtra = _ref.metaExtra,
104
- metaOriginalData = _ref.metaOriginalData;
105
- _this.doOtherAfterLoadSuccess({
106
- metaData: metaData,
107
- metaListData: metaListData,
108
- metaExtra: metaExtra,
109
- metaOriginalData: metaOriginalData
110
- });
111
- };
112
- _this.doOtherAfterLoadSuccess = function (_ref2) {
113
- _ref2.metaData;
114
- _ref2.metaListData;
115
- _ref2.metaExtra;
116
- _ref2.metaOriginalData;
117
- };
118
- _this.onDateRangeChange = function (dates, dateStrings) {
119
- _this.setState({
120
- startTime: dateStrings[0],
121
- endTime: dateStrings[1]
122
- });
123
- };
124
- _this.handleSelectRows = function (rows) {
125
- _this.setState({
126
- selectedDataTableDataRows: rows
127
- });
128
- };
129
- _this.clearSelectRow = function () {
130
- _this.setState({
131
- selectedDataTableDataRows: []
132
- });
133
- };
134
- _this.getCanUseFrontendPagination = function () {
135
- return !!_this.useRemotePagination ? false : !!_this.useFrontendPagination;
136
- };
137
- _this.getSearchFormFieldsValue = function (nameList, filter) {
138
- var form = _this.getSearchCard();
139
- if (form != null) {
140
- return form.getFieldsValue(nameList, filter);
141
- }
142
- return {};
143
- };
144
- _this.getSearchFormFieldValue = function (name) {
145
- var form = _this.getSearchCard();
146
- if (form != null) {
147
- return form.getFieldValue(name);
148
- }
149
- return null;
150
- };
151
- _this.setSearchFormFieldsValue = function (v) {
152
- var form = _this.getSearchCard();
153
- if (form != null) {
154
- form.setFieldsValue(v);
155
- _this.afterSetSearchFormFieldsValue(v);
156
- }
157
- };
158
- _this.afterSetSearchFormFieldsValue = function (v) {};
159
- _this.getPageName = function () {
160
- var pageName = _this.state.pageName;
161
- return pageName;
162
- };
163
- _this.getColumnWrapper = function () {
164
- var text = 'getColumnWrapper 需要重载实现';
165
- showRuntimeError({
166
- message: text
167
- });
168
- return [];
169
- };
170
- _this.buildColumnFromWrapper = function () {
171
- var list = _this.getColumnWrapper() || [];
172
- var hasCustomOperate = false;
173
- list.forEach(function (o) {
174
- var _dataTarget$o = _objectSpread2(_objectSpread2({}, {
175
- dataTarget: {}
176
- }), o),
177
- dt = _dataTarget$o.dataTarget;
178
- var _name$dt = _objectSpread2(_objectSpread2({}, {
179
- name: ''
180
- }), dt),
181
- name = _name$dt.name;
182
- if (name === formNameCollection.customOperate.name) {
183
- hasCustomOperate = true;
184
- }
185
- });
186
- return _this.buildColumnList([].concat(_toConsumableArray(list), _toConsumableArray(hasCustomOperate ? [] : [{
187
- dataTarget: formNameCollection.customOperate,
188
- width: _this.columnOperateWidth,
189
- fixed: _this.columnOperateFixed,
190
- showRichFacade: true,
191
- facadeMode: columnFacadeMode.dropdown,
192
- hidden: !_this.columnOperateVisible,
193
- configBuilder: function configBuilder(val, record) {
194
- var o = _this.establishListItemDropdownConfig(record);
195
- return o || null;
196
- }
197
- }])));
198
- };
199
- _this.buildColumnList = function (list) {
200
- return buildColumnList({
201
- columnList: list,
202
- attachedTargetName: _this.constructor.name
203
- });
204
- };
205
- _this.getColumn = function () {
206
- return _this.buildColumnFromWrapper();
207
- };
208
- _this.getColumnMerged = function () {
209
- var columns = [];
210
- var columnsSource = _this.getColumn();
211
- var columnsOtherConfigArray = _this.columnsOtherConfig || [];
212
- if (isArray(columnsOtherConfigArray)) {
213
- if (columnsOtherConfigArray.length > 0) {
214
- if (columnsSource.length !== columnsOtherConfigArray.length) {
215
- _this.restoreColumnsOtherConfigArray();
216
- } else {
217
- columnsSource.forEach(function (item, index) {
218
- var c = _objectSpread2(_objectSpread2({}, item), columnsOtherConfigArray[index]);
219
- var _ref3 = c || {
220
- show: true
221
- },
222
- show = _ref3.show;
223
- if (show) {
224
- columns.push(c);
225
- }
226
- });
227
- }
228
- } else {
229
- _this.restoreColumnsOtherConfigArray();
230
- columns = columnsSource;
231
- }
232
- } else {
233
- columns = columnsSource;
234
- }
235
- return columns;
236
- };
237
- _this.handleSearchReset = function () {
238
- // 需要继承重载
239
- };
240
- _this.handleAdditionalSearchReset = function () {};
241
- _this.handleSearch = function () {
242
- if (_this.checkWorkDoing()) {
243
- return;
244
- }
245
- var form = _this.getSearchCard();
246
- if (!form) {
247
- var text = '查询表单不存在';
248
- showErrorMessage({
249
- message: text
250
- });
251
- }
252
- var validateFields = form.validateFields;
253
- validateFields().then(function (fieldsValue) {
254
- var values = _objectSpread2(_objectSpread2({}, fieldsValue), {}, {
255
- updatedAt: fieldsValue.updatedAt && fieldsValue.updatedAt.valueOf()
256
- });
257
- _this.searchData({
258
- formValues: values
259
- });
260
- })["catch"](function (error) {
261
- var errorFields = error.errorFields;
262
- if (!isUndefined(errorFields)) {
263
- var m = [];
264
- Object.values(errorFields).forEach(function (o) {
265
- m.push(o.errors[0]);
266
- });
267
- var maxLength = 5;
268
- var beyondMax = false;
269
- if (m.length > maxLength) {
270
- m.length = maxLength;
271
- beyondMax = true;
272
- }
273
- var errorMessage = m.join(', ');
274
- if (beyondMax) {
275
- errorMessage += ' ...';
276
- }
277
- showWarnMessage({
278
- message: errorMessage
279
- });
280
- } else {
281
- showRuntimeError({
282
- message: error
283
- });
284
- }
285
- });
286
- };
287
- _this.getSearchCard = function () {
288
- return _this.formRef.current;
289
- };
290
- _this.buildSearchCardContent = function (config) {
291
- if ((config || null) == null) {
292
- return null;
293
- }
294
- var configData = _objectSpread2(_objectSpread2({}, {
295
- otherComponent: null,
296
- list: []
297
- }), config || {});
298
- var otherComponent = configData.otherComponent,
299
- list = configData.list;
300
- var listData = [];
301
- if (isArray(list)) {
302
- list.forEach(function (co) {
303
- listData.push(co);
304
- });
305
- }
306
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
307
- gutter: 24
308
- }, listData.map(function (item, index) {
309
- return _this.buildSearchCardContentItem(item, index);
310
- })), otherComponent);
311
- };
312
- _this.buildSearchCardContentItem = function (contentItem, contentIndex) {
313
- var contentItemKey = "searchFormContent_key_".concat(contentIndex);
314
- var _lg$md$sm$xs$type$ico = _objectSpread2(_objectSpread2({}, {
315
- lg: 6,
316
- md: 12,
317
- sm: 24,
318
- xs: 24,
319
- type: '',
320
- icon: null,
321
- fieldData: {
322
- label: '',
323
- name: '',
324
- helper: ''
325
- },
326
- showHelper: false,
327
- component: null,
328
- otherProps: null
329
- }), contentItem || {}),
330
- lgValue = _lg$md$sm$xs$type$ico.lg,
331
- md = _lg$md$sm$xs$type$ico.md,
332
- sm = _lg$md$sm$xs$type$ico.sm,
333
- xs = _lg$md$sm$xs$type$ico.xs,
334
- type = _lg$md$sm$xs$type$ico.type,
335
- fieldDataValue = _lg$md$sm$xs$type$ico.fieldData,
336
- icon = _lg$md$sm$xs$type$ico.icon,
337
- showHelper = _lg$md$sm$xs$type$ico.showHelper,
338
- component = _lg$md$sm$xs$type$ico.component,
339
- otherProps = _lg$md$sm$xs$type$ico.otherProps;
340
- var fieldData = _objectSpread2(_objectSpread2({}, {
341
- label: '',
342
- name: '',
343
- helper: ''
344
- }), fieldDataValue || {});
345
- var lg = (lgValue || 6) <= 0 ? 6 : lgValue;
346
- lg = lg > 24 ? 24 : lg;
347
- return /*#__PURE__*/React.createElement(Col, {
348
- key: contentItemKey,
349
- lg: lg || 6,
350
- md: md,
351
- sm: sm,
352
- xs: xs
353
- }, type === searchCardConfig.contentItemType.input ? _this.renderSearchInput(fieldData.label, fieldData.name, showHelper ? fieldData.helper : '', icon || iconBuilder.form(), _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {})) : null, type === searchCardConfig.contentItemType.inputNumber ? _this.renderSearchInputNumber(fieldData.label, fieldData.name, fieldData.helper, icon || iconBuilder.form(), _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {})) : null, type === searchCardConfig.contentItemType.datePicker ? _this.renderFormDatePicker(fieldData.label, fieldData.name, false, fieldData.helper, _objectSpread2(_objectSpread2({}, {}), otherProps || {})) : null, type === searchCardConfig.contentItemType.customRangePicker ? _this.buildSearchCardRangePickerCore(contentItem.dateRangeFieldName, _objectSpread2(_objectSpread2({}, {}), otherProps || {})) : null, type === searchCardConfig.contentItemType.onlyShowInput ? _this.renderFormOnlyShowInput(fieldData.label, contentItem.value, fieldData.helper || '', contentItem.icon || iconBuilder.form(), _objectSpread2(_objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), {
354
- disabled: true
355
- })) : null, type === searchCardConfig.contentItemType.customSelect ? contentItem.component : null, type === cardConfig.contentItemType.flexSelect ? buildCustomSelect(contentItem) : null, type === searchCardConfig.contentItemType.customRadio ? contentItem.component : null, type === searchCardConfig.contentItemType.innerComponent ? _this.renderFormInnerComponent(fieldData.label, component, fieldData.helper, null, false) : null, type === searchCardConfig.contentItemType.component ? component || null : null);
356
- };
357
- _this.establishSearchCardConfig = function () {
358
- var dateRangeFieldName = _this.state.dateRangeFieldName;
359
- return {
360
- list: [{
361
- lg: 10,
362
- type: searchCardConfig.contentItemType.customRangePicker,
363
- dateRangeFieldName: dateRangeFieldName
364
- }, {
365
- lg: 6,
366
- type: searchCardConfig.contentItemType.component,
367
- component: _this.buildSearchCardButtonCore()
368
- }]
369
- };
370
- };
371
- _this.buildSearchCardButtonCore = function () {
372
- var _this$state = _this.state,
373
- dataLoading = _this$state.dataLoading,
374
- reloading = _this$state.reloading,
375
- searching = _this$state.searching;
376
- return /*#__PURE__*/React.createElement("span", {
377
- className: classNames("".concat(classPrefix, "_tableListForm_submitButtons"))
378
- }, /*#__PURE__*/React.createElement(Button, {
379
- disabled: dataLoading || reloading || searching,
380
- type: "primary",
381
- onClick: function onClick(e) {
382
- _this.handleSearch(e);
383
- }
384
- }, searching ? iconBuilder.loading() : iconBuilder.search(), "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
385
- disabled: dataLoading || reloading || searching,
386
- style: {
387
- marginLeft: 8
388
- },
389
- onClick: function onClick() {
390
- _this.handleSearchReset();
391
- }
392
- }, reloading ? iconBuilder.loading() : iconBuilder.reload(), "\u91CD\u7F6E"));
393
- };
394
- _this.buildSearchCardButton = function () {
395
- var ColMd = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
396
- return /*#__PURE__*/React.createElement(Col, {
397
- md: ColMd,
398
- sm: 24
399
- }, _this.buildSearchCardButtonCore());
400
- };
401
- _this.buildSearchCardRangePickerCore = function (dateRangeFieldName) {
402
- var rangePickerProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
403
- var _this$state2 = _this.state,
404
- startTime = _this$state2.startTime,
405
- endTime = _this$state2.endTime;
406
- var valueList = [];
407
- if ((startTime || null) != null) {
408
- valueList.push(toMoment({
409
- data: startTime
410
- }));
411
- }
412
- if ((endTime || null) != null) {
413
- valueList.push(toMoment({
414
- data: endTime
415
- }));
416
- }
417
- var p = _objectSpread2({}, _objectSpread2({
418
- style: {
419
- width: '100%'
420
- },
421
- showTime: {
422
- format: 'HH:mm'
423
- },
424
- value: valueList,
425
- format: datetimeFormat.yearMonthDayHourMinute,
426
- placeholder: ['开始时间', '结束时间'],
427
- onChange: function onChange(dates, dateStrings) {
428
- _this.onDateRangeChange(dates, dateStrings);
429
- }
430
- }, rangePickerProps || {}));
431
- return /*#__PURE__*/React.createElement(FormItem, {
432
- label: dateRangeFieldName,
433
- rules: [{
434
- required: false,
435
- message: buildFieldDescription(dateRangeFieldName, '选择')
436
- }]
437
- }, /*#__PURE__*/React.createElement(RangePicker, p));
438
- };
439
- _this.buildSearchCardRangePicker = function (dateRangeFieldName) {
440
- var colLg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 8;
441
- var rangePickerProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
442
- return /*#__PURE__*/React.createElement(Col, {
443
- lg: colLg,
444
- md: 12,
445
- sm: 24,
446
- xs: 24
447
- }, _this.buildSearchCardRangePickerCore(dateRangeFieldName, rangePickerProps));
448
- };
449
- _this.buildSearchCardRow = function () {
450
- var config = _this.establishSearchCardConfig();
451
- if ((config || null) == null) {
452
- return null;
453
- }
454
- return _this.buildSearchCardContent(config);
455
- };
456
- _this.fillSearchCardInitialValues = function () {
457
- return {};
458
- };
459
- _this.buildSearchCard = function () {
460
- var el = _this.buildSearchCardRow();
461
- if ((el || null) == null) {
462
- return null;
463
- }
464
- return /*#__PURE__*/React.createElement(Form, {
465
- ref: _this.formRef,
466
- initialValues: _this.fillSearchCardInitialValues(),
467
- onSubmit: _this.handleSearch,
468
- layout: "horizontal"
469
- }, el);
470
- };
471
- _this.renderForm = function () {
472
- return _this.buildSearchCard();
473
- };
474
- _this.establishTableAdditionalConfig = function () {
475
- // 可以配置额外的Table属性
476
-
477
- return {};
478
- };
479
- _this.establishTableExpandableConfig = function () {
480
- // 可以配置额外的Table属性
481
-
482
- return null;
483
- };
484
- _this.restoreColumnsOtherConfigArray = function () {
485
- var columnsOtherConfigArray = _this.getColumn().map(function (item) {
486
- return {
487
- dataIndex: item.dataIndex,
488
- show: true,
489
- fixed: item.fixed || ''
490
- };
491
- });
492
- _this.columnsOtherConfig = columnsOtherConfigArray;
493
- };
494
- _this.buildTableConfig = function () {
495
- var tableSize = _this.state.tableSize;
496
- var columns = _this.getColumnMerged();
497
- var expandable = _this.establishTableExpandableConfig();
498
- return _objectSpread2(_objectSpread2({}, _this.establishTableAdditionalConfig()), {}, {
499
- columns: columns,
500
- size: tableSize,
501
- tableLayout: 'fix',
502
- expandable: expandable
503
- });
504
- };
505
- _this.setTableSize = function (key) {
506
- _this.setState({
507
- tableSize: key
508
- });
509
- };
510
- _this.setColumnsMap = function (e) {
511
- if (Object.keys(e || {}).length === 0) {
512
- _this.restoreColumnsOtherConfigArray();
513
- } else {
514
- var columnsOtherConfigArrayChanged = (_this.columnsOtherConfig || []).map(function (item) {
515
- var dataIndex = item.dataIndex;
516
- if (!isUndefined(e[dataIndex])) {
517
- var d = e[dataIndex];
518
- d.show = isUndefined(d.show) ? true : d.show;
519
- return _objectSpread2(_objectSpread2({}, item), d);
520
- }
521
- return item;
522
- });
523
- _this.columnsOtherConfig = columnsOtherConfigArrayChanged;
524
- }
525
- var counterSetColumnsOtherConfig = _this.state.counterSetColumnsOtherConfig;
526
- _this.setState({
527
- counterSetColumnsOtherConfig: counterSetColumnsOtherConfig + 1
528
- });
529
- };
530
- _this.setSortKeyColumns = function (e) {};
531
- _this.getColumnsMap = function () {
532
- var o = {};
533
- (_this.columnsOtherConfig || []).forEach(function (item) {
534
- var dataIndex = item.dataIndex;
535
- var temp = _objectSpread2(_objectSpread2({}, {}), item);
536
- if (temp["delete"]) {
537
- temp["delete"]('dataIndex');
538
- }
539
- o["".concat(dataIndex)] = temp;
540
- });
541
- return o;
542
- };
543
- _this.onBatchActionSelect = function (key) {};
544
- _this.renderTable = function (config) {
545
- return null;
546
- };
547
- _this.renderAlertContent = function () {
548
- return '';
549
- };
550
- _this.renderAlertOption = function () {};
551
- _this.renderAboveTable = function () {
552
- var content = _this.renderAlertContent();
553
- var option = _this.renderAlertOption();
554
- if (!content && !option) {
555
- return null;
556
- }
557
- return /*#__PURE__*/React.createElement("div", {
558
- className: classNames("".concat(classPrefix, "_containorTable_alertContainor"))
559
- }, /*#__PURE__*/React.createElement(Alert, {
560
- message: /*#__PURE__*/React.createElement("div", {
561
- className: classNames("".concat(classPrefix, "_containorTable_alertContainor_alertInfo"))
562
- }, /*#__PURE__*/React.createElement("div", {
563
- className: classNames("".concat(classPrefix, "_containorTable_alertContainor_alertInfo_alertContent"))
564
- }, content), option && /*#__PURE__*/React.createElement("div", {
565
- className: classNames("".concat(classPrefix, "_containorTable_alertContainor_alertInfo_alertOption"))
566
- }, option)),
567
- type: "info",
568
- showIcon: true
569
- }));
570
- };
571
- _this.establishDataContainerExtraActionCollectionConfig = function () {
572
- return [];
573
- };
574
- _this.establishDataContainerExtraAffixConfig = function () {
575
- return {};
576
- };
577
- _this.buildDataContainerExtraActionCollection = function () {
578
- var configList = _this.establishDataContainerExtraActionCollectionConfig();
579
- if (!isArray(configList)) {
580
- return [];
581
- }
582
- return _this.buildByExtraBuildType({
583
- keyPrefix: 'listView_dataContainerExtraActionItem_',
584
- configList: configList
585
- });
586
- };
587
- _this.renderExtraActionView = function () {
588
- var actions = _this.buildDataContainerExtraActionCollection();
589
- if (!isArray(actions) || actions.length <= 0) {
590
- return null;
591
- }
592
- return /*#__PURE__*/React.createElement(Space, {
593
- split: /*#__PURE__*/React.createElement(Divider, {
594
- type: "vertical"
595
- })
596
- }, actions.map(function (item) {
597
- return item;
598
- }));
599
- };
600
- _this.renderBatchActionMenu = function () {
601
- return [];
602
- };
603
- _this.renderBatchAction = function () {
604
- var _this$state3 = _this.state,
605
- showSelect = _this$state3.showSelect,
606
- selectedDataTableDataRows = _this$state3.selectedDataTableDataRows;
607
- var selectRows = isArray(selectedDataTableDataRows) ? selectedDataTableDataRows : [];
608
- if (showSelect) {
609
- var batchActionMenu = _this.renderBatchActionMenu();
610
- if ((batchActionMenu || []).length > 0) {
611
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BatchAction.Button, {
612
- onSelect: function onSelect(key) {
613
- _this.onBatchActionSelect(key);
614
- },
615
- menus: batchActionMenu,
616
- disabled: selectRows.length === 0
617
- }, "\u6279\u91CF\u64CD\u4F5C"), /*#__PURE__*/React.createElement(Divider, {
618
- type: "vertical"
619
- }));
620
- }
621
- }
622
- return null;
623
- };
624
- _this.buildOtherTabProps = function () {
625
- var tabListAvailable = _this.getTabListAvailable();
626
- if (tabListAvailable.length > 0) {
627
- return {
628
- type: 'card',
629
- size: 'small',
630
- tabBarStyle: {
631
- marginBottom: 0
632
- },
633
- tabBarGutter: 3
634
- };
635
- }
636
- return null;
637
- };
638
- _this.adjustTabListAvailable = function (tabListAvailable) {
639
- return tabListAvailable;
640
- };
641
- _this.getTabListAvailable = function () {
642
- var tabListAvailable = [];
643
- (_this.tabList || []).forEach(function (o) {
644
- var v = typeof o.show === 'undefined' ? true : o.show === true;
645
- if (v) {
646
- tabListAvailable.push(o);
647
- }
648
- });
649
- return _this.adjustTabListAvailable(tabListAvailable);
650
- };
651
- _this.getTabActiveKey = function () {
652
- var _getCurrentLocation = getCurrentLocation(),
653
- pathname = _getCurrentLocation.pathname;
654
- var list = pathname.split('/');
655
- console.log({
656
- list: list
657
- });
658
- if (list.length > 1) {
659
- return list[list.length - 1];
660
- }
661
- return '';
662
- };
663
- _this.handleTabChange = function (key) {};
664
- _this.onPageHeaderAvatarLoadErrorCallback = function () {
665
- _this.setState({
666
- avatarImageLoadResult: avatarImageLoadResultCollection.fail
667
- });
668
- };
669
- _this.establishViewDataSource = function () {
670
- var text = 'establishViewDataSource 需要重载实现用来构建列表数据源';
671
- showRuntimeError({
672
- message: text
673
- });
674
- return null;
675
- };
676
- _this.adjustViewDataSource = function () {
677
- return _this.establishViewDataSource();
678
- };
679
- _this.adjustFrontendPaginationViewDataSource = function () {
680
- return _this.adjustViewDataSource();
681
- };
682
- _this.establishCardCollectionViewItemConfig = function (record) {
683
- var text = 'establishCardCollectionViewItemConfig 需要重载实现';
684
- showRuntimeError({
685
- message: text
686
- });
687
- return null;
688
- };
689
- _this.establishViewPaginationConfig = function () {
690
- return null;
691
- };
692
- _this.buildPageSizeOptionList = function () {
693
- var pageSizeList = [10, 20, 50, 100];
694
- pageSizeList.push(toNumber(_this.pageSizeAdditional));
695
- pageSizeList = _toConsumableArray(new Set(pageSizeList)).sort(function (a, b) {
696
- return a - b;
697
- });
698
- return pageSizeList;
699
- };
700
- _this.supplementPaginationConfig = function () {
701
- var _this$state4 = _this.state,
702
- pageNo = _this$state4.pageNo,
703
- pageSize = _this$state4.pageSize;
704
- var config = _objectSpread2(_objectSpread2(_objectSpread2({}, {
705
- size: 'default',
706
- showSizeChanger: true,
707
- showQuickJumper: true,
708
- showTotal: function showTotal(total, range) {
709
- return "".concat(range[0], "-").concat(range[1], " \u5171 ").concat(total, " \u6761\u4FE1\u606F");
710
- },
711
- pageSizeOptions: _this.buildPageSizeOptionList()
712
- }), _this.establishViewPaginationConfig()), {
713
- current: pageNo,
714
- pageSize: pageSize
715
- });
716
- return config;
717
- };
718
- _this.establishPageHeaderTagCollectionConfig = function () {
719
- return [];
720
- };
721
- _this.establishPageHeaderTagConfig = function () {
722
- return buildTagList({
723
- list: _this.establishPageHeaderTagCollectionConfig()
724
- });
725
- };
726
- _this.establishPageHeaderAvatarConfig = function () {
727
- return null;
728
- };
729
- _this.establishPageHeaderTitlePrefix = function () {
730
- return '';
731
- };
732
- _this.buildPageHeaderSubTitle = function () {
733
- return null;
734
- };
735
- _this.establishPageHeaderContentGridCollectionConfig = function () {
736
- return [];
737
- };
738
- _this.establishPageHeaderContentGridConfig = function () {
739
- return {
740
- type: pageHeaderRenderType.descriptionGrid,
741
- list: _this.establishPageHeaderContentGridCollectionConfig()
742
- };
743
- };
744
- _this.establishPageHeaderContentParagraphCollectionConfig = function () {
745
- return [];
746
- };
747
- _this.establishPageHeaderContentParagraphConfig = function () {
748
- return {
749
- type: pageHeaderRenderType.paragraph,
750
- list: _this.establishPageHeaderContentParagraphCollectionConfig()
751
- };
752
- };
753
- _this.establishPageHeaderContentActionCollectionConfig = function () {
754
- return [];
755
- };
756
- _this.establishPageHeaderContentActionConfig = function () {
757
- return {
758
- type: pageHeaderRenderType.paragraph,
759
- list: _this.establishPageHeaderContentActionCollectionConfig()
760
- };
761
- };
762
- _this.establishPageHeaderContentConfig = function () {
763
- return {
764
- list: [_this.establishPageHeaderContentGridConfig(), _this.establishPageHeaderContentParagraphConfig(), _this.establishPageHeaderContentActionConfig()]
765
- };
766
- };
767
- _this.establishPaginationViewStyle = function () {
768
- return {
769
- paddingTop: 16,
770
- paddingBottom: 16
771
- };
772
- };
773
- _this.handleStandardTableChange = function (pagination, filtersArg, sorter) {
774
- _this.handleAdditionalStandardTableChange(pagination, filtersArg, sorter);
775
- };
776
- _this.handleAdditionalStandardTableChange = function (pagination, filtersArg, sorter) {};
777
- _this.handlePaginationChange = function (page, pageSize) {
778
- _this.handleAdditionalPaginationChange(page, pageSize);
779
- };
780
- _this.handleAdditionalPaginationChange = function (page, pageSize) {};
781
- _this.handlePaginationShowSizeChange = function (current, size) {
782
- _this.setState({
783
- pageNo: 1
784
- });
785
- };
786
- _this.renderPageHeaderContent = function () {
787
- return buildPageHeaderContent(_this.establishPageHeaderContentConfig() || {});
788
- };
789
- _this.establishPageHeaderExtraContentConfig = function () {
790
- return null;
791
- };
792
- _this.renderPageHeaderExtraContent = function () {
793
- return pageHeaderExtraContent(_this.establishPageHeaderExtraContentConfig());
794
- };
795
- _this.buildPaginationBar = function () {
796
- var paginationConfig = _this.supplementPaginationConfig();
797
- var style = _this.establishPaginationViewStyle();
798
- var bar = /*#__PURE__*/React.createElement(FlexBox, {
799
- style: style,
800
- flexAuto: "left",
801
- right: /*#__PURE__*/React.createElement(Pagination, _extends({}, paginationConfig, {
802
- onChange: function onChange(page, size) {
803
- _this.handlePaginationChange(page, size);
804
- },
805
- onShowSizeChange: function onShowSizeChange(current, size) {
806
- _this.handlePaginationShowSizeChange(current, size);
807
- }
808
- }))
809
- });
810
- if (_this.affixPaginationBar) {
811
- return /*#__PURE__*/React.createElement(Affix, {
812
- offsetBottom: 0
813
- }, /*#__PURE__*/React.createElement("div", {
814
- style: {
815
- background: '#fff'
816
- }
817
- }, bar));
818
- }
819
- return bar;
820
- };
821
- _this.renderCardExtraAction = function () {
822
- var _this$state5 = _this.state,
823
- listViewMode = _this$state5.listViewMode,
824
- tableSize = _this$state5.tableSize,
825
- refreshing = _this$state5.refreshing;
826
- if (listViewMode === listViewConfig.viewMode.table) {
827
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DensityAction, {
828
- tableSize: tableSize,
829
- setTableSize: function setTableSize(key) {
830
- _this.setTableSize(key);
831
- }
832
- }), /*#__PURE__*/React.createElement(Tooltip, {
833
- title: "\u5237\u65B0\u672C\u9875"
834
- }, /*#__PURE__*/React.createElement(Button, {
835
- shape: "circle",
836
- style: {
837
- color: '#000',
838
- border: 0
839
- },
840
- loading: refreshing,
841
- icon: iconBuilder.reload(),
842
- onClick: function onClick() {
843
- _this.refreshData();
844
- }
845
- })), /*#__PURE__*/React.createElement(ColumnSetting, {
846
- columns: _this.getColumn(),
847
- columnsMap: _this.getColumnsMap(),
848
- setColumnsMap: function setColumnsMap(e) {
849
- _this.setColumnsMap(e);
850
- },
851
- setSortKeyColumns: function setSortKeyColumns(key) {
852
- _this.setSortKeyColumns(key);
853
- }
854
- }));
855
- }
856
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
857
- title: "\u5237\u65B0\u672C\u9875"
858
- }, /*#__PURE__*/React.createElement(Button, {
859
- shape: "circle",
860
- style: {
861
- color: '#000',
862
- border: 0
863
- },
864
- loading: refreshing,
865
- icon: iconBuilder.reload(),
866
- onClick: function onClick() {
867
- _this.refreshData();
868
- }
869
- })));
870
- };
871
- _this.renderListViewItem = function (record, index) {
872
- return /*#__PURE__*/React.createElement(List.Item, {
873
- actions: _this.renderListViewItemActions(record, index),
874
- extra: _this.renderListViewItemExtra(record, index)
875
- }, _this.renderListViewItemInner(record, index));
876
- };
877
- _this.renderListViewItemInner = function (record, index) {
878
- var text = 'renderListViewItemInner 需要重载实现';
879
- showRuntimeError({
880
- message: text
881
- });
882
- return null;
883
- };
884
- _this.renderListViewItemExtra = function (record, index) {
885
- return null;
886
- };
887
- _this.renderListViewItemActions = function (record, index) {
888
- var actionOthers = _this.renderListViewItemActionOthers(record, index);
889
- var actionSelect = null;
890
- if (_this.showListViewItemActionSelect || false) {
891
- actionSelect = _this.renderListViewItemActionSelect(record, index);
892
- }
893
- if (actionSelect == null) {
894
- return _toConsumableArray(isArray(actionOthers) ? actionOthers : []);
895
- }
896
- var list = [].concat(_toConsumableArray(isArray(actionOthers) ? actionOthers : []), [actionSelect]);
897
- return list.length === 0 ? null : list;
898
- };
899
- _this.renderListViewItemActionOthers = function (record, index) {
900
- return null;
901
- };
902
- _this.renderListViewItemActionSelect = function (record, index) {
903
- return null;
904
- };
905
- _this.renderListViewItemLayout = function () {
906
- return 'horizontal';
907
- };
908
- _this.renderListViewSize = function () {
909
- return 'default';
910
- };
911
- _this.renderListView = function () {
912
- var _this$state6 = _this.state,
913
- dataLoading = _this$state6.dataLoading,
914
- reloading = _this$state6.reloading,
915
- processing = _this$state6.processing;
916
- return /*#__PURE__*/React.createElement(Spin, {
917
- spinning: dataLoading || reloading || processing
918
- }, /*#__PURE__*/React.createElement(List, {
919
- itemLayout: _this.renderListViewItemLayout(),
920
- size: _this.renderListViewSize(),
921
- dataSource: _this.getCanUseFrontendPagination() ? _this.adjustFrontendPaginationViewDataSource() : _this.adjustViewDataSource(),
922
- pagination: false,
923
- renderItem: function renderItem(item, index) {
924
- return _this.renderListViewItem(item, index);
925
- }
926
- }), _this.renderPaginationView());
927
- };
928
- _this.renderTableView = function () {
929
- var _this$state7 = _this.state,
930
- metaListData = _this$state7.metaListData,
931
- tableScroll = _this$state7.tableScroll,
932
- showSelect = _this$state7.showSelect,
933
- selectedDataTableDataRows = _this$state7.selectedDataTableDataRows;
934
- var _this$buildTableConfi = _this.buildTableConfig(),
935
- styleSet = _this$buildTableConfi.styleSet,
936
- columns = _this$buildTableConfi.columns,
937
- expandable = _this$buildTableConfi.expandable,
938
- size = _this$buildTableConfi.size;
939
- var standardTableCustomOption = {
940
- loading: _this.checkInProgress(),
941
- showSelect: showSelect,
942
- selectedRows: selectedDataTableDataRows,
943
- columns: columns,
944
- size: size || null,
945
- onSelectRow: _this.handleSelectRows,
946
- onChange: _this.handleStandardTableChange,
947
- expandable: adjustTableExpandConfig({
948
- list: metaListData,
949
- config: expandable
950
- }),
951
- showPagination: _this.useRemotePagination || !!_this.getCanUseFrontendPagination()
952
- };
953
- standardTableCustomOption.data = {
954
- list: _this.adjustViewDataSource(),
955
- pagination: _this.supplementPaginationConfig()
956
- };
957
- if ((styleSet || null) != null) {
958
- standardTableCustomOption.style = styleSet;
959
- }
960
- if ((tableScroll || null) != null) {
961
- standardTableCustomOption.scroll = tableScroll;
962
- }
963
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(StandardTableCustom, standardTableCustomOption));
964
- };
965
- _this.renderCardCollectionView = function () {
966
- var _this$state8 = _this.state,
967
- dataLoading = _this$state8.dataLoading,
968
- reloading = _this$state8.reloading,
969
- processing = _this$state8.processing;
970
- var listItem = _this.getCanUseFrontendPagination() ? _this.adjustFrontendPaginationViewDataSource() : _this.adjustViewDataSource();
971
- var itemCount = listItem.length;
972
- return /*#__PURE__*/React.createElement(Spin, {
973
- spinning: dataLoading || reloading || processing
974
- }, /*#__PURE__*/React.createElement(Space, {
975
- style: {
976
- width: '100%'
977
- },
978
- direction: "vertical",
979
- size: 24
980
- }, itemCount > 0 ? listItem.map(function (o, index) {
981
- return _this.buildCardCollectionItem({
982
- config: _this.establishCardCollectionViewItemConfig(o),
983
- key: index
984
- });
985
- }) : dataLoading || reloading ? /*#__PURE__*/React.createElement("div", {
986
- style: {
987
- height: '130px'
988
- }
989
- }) : /*#__PURE__*/React.createElement(Empty, null)), _this.renderPaginationView());
990
- };
991
- _this.renderPaginationView = function () {
992
- return _this.buildPaginationBar();
993
- };
994
- _this.renderView = function () {
995
- var _this$state9 = _this.state,
996
- showSelect = _this$state9.showSelect,
997
- listViewMode = _this$state9.listViewMode;
998
- if (listViewMode === listViewConfig.viewMode.table) {
999
- return _this.renderTableView();
1000
- }
1001
- if (listViewMode === listViewConfig.viewMode.list) {
1002
- if (showSelect) {
1003
- var _text = 'MultiListView显示模式下不支持选择';
1004
- showRuntimeError({
1005
- message: _text
1006
- });
1007
- }
1008
- return _this.renderListView();
1009
- }
1010
- if (listViewMode === listViewConfig.viewMode.cardCollectionView) {
1011
- if (showSelect) {
1012
- var _text2 = 'MultiListView显示模式下不支持选择';
1013
- showRuntimeError({
1014
- message: _text2
1015
- });
1016
- }
1017
- return _this.renderCardCollectionView();
1018
- }
1019
- var text = '未知的显示模式';
1020
- showRuntimeError({
1021
- message: text
1022
- });
1023
- return null;
1024
- };
1025
- _this.buildCardCollectionArea = function () {
1026
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1027
- if (config == null) {
1028
- return null;
1029
- }
1030
- var formContentWrapperTypeConfig = _this.establishWrapperTypeConfig() || {
1031
- mode: cardConfig.wrapperType.page
1032
- };
1033
- var configData = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
1034
- mode: cardConfig.wrapperType.page,
1035
- justify: 'start',
1036
- align: 'top'
1037
- }), formContentWrapperTypeConfig || {}), {
1038
- list: []
1039
- }), config || {});
1040
- var mode = configData.mode,
1041
- justifyGeneral = configData.justify,
1042
- alignGeneral = configData.align,
1043
- list = configData.list;
1044
- var listData = [];
1045
- if (isArray(list)) {
1046
- list.forEach(function (co, ci) {
1047
- listData.push(co);
1048
- if (ci !== list.length - 1) {
1049
- listData.push('');
1050
- }
1051
- });
1052
- }
1053
- return /*#__PURE__*/React.createElement(Space, {
1054
- style: {
1055
- width: '100%'
1056
- },
1057
- direction: "vertical",
1058
- size: 24
1059
- }, listData.map(function (item, index) {
1060
- return _this.buildCardCollectionItem({
1061
- mode: mode,
1062
- justify: justifyGeneral,
1063
- align: alignGeneral,
1064
- config: item,
1065
- key: index
1066
- });
1067
- }));
1068
- };
1069
- _this.renderSiderArea = function () {
1070
- var topArea = _this.renderSiderTopArea();
1071
- var bottomArea = _this.renderSiderBottomArea();
1072
- if ((bottomArea || null) == null) {
1073
- return topArea;
1074
- }
1075
- return /*#__PURE__*/React.createElement(FlexBox, {
1076
- direction: "vertical",
1077
- top: topArea,
1078
- bottom: bottomArea
1079
- });
1080
- };
1081
- _this.renderContentArea = function () {
1082
- var listTitle = _this.state.listTitle;
1083
- var affixConfig = _objectSpread2(_objectSpread2({}, {
1084
- affix: false,
1085
- offsetTop: 10
1086
- }), _this.establishDataContainerExtraAffixConfig() || {});
1087
- var extraAction = _this.renderExtraActionView();
1088
- var searchForm = _this.renderForm();
1089
- var hasPagination = _this.renderPaginationView() != null;
1090
- var affix = affixConfig.affix,
1091
- offsetTop = affixConfig.offsetTop;
1092
- var extraView = !affix ? /*#__PURE__*/React.createElement(React.Fragment, null, extraAction, extraAction == null ? null : /*#__PURE__*/React.createElement(Divider, {
1093
- type: "vertical"
1094
- }), _this.renderBatchAction(), _this.renderCardExtraAction()) : /*#__PURE__*/React.createElement(Affix, {
1095
- offsetTop: toNumber(offsetTop)
1096
- }, /*#__PURE__*/React.createElement("div", null, extraAction, extraAction == null ? null : /*#__PURE__*/React.createElement(Divider, {
1097
- type: "vertical"
1098
- }), _this.renderBatchAction(), _this.renderCardExtraAction()));
1099
- var gridView = /*#__PURE__*/React.createElement(Card, {
1100
- title: listTitle,
1101
- headStyle: {
1102
- borderBottom: '0px'
1103
- },
1104
- bodyStyle: {
1105
- paddingTop: '0',
1106
- paddingBottom: hasPagination ? 0 : 24
1107
- },
1108
- bordered: false,
1109
- className: classNames("".concat(classPrefix, "_containorTable")),
1110
- extra: extraView
1111
- }, /*#__PURE__*/React.createElement("div", null, _this.renderAboveTable(), _this.renderView()));
1112
- if (!_this.showSearchForm || (searchForm || null) == null) {
1113
- return gridView;
1114
- }
1115
- return /*#__PURE__*/React.createElement("div", {
1116
- style: {
1117
- backgroundColor: '#f0f2f5'
1118
- }
1119
- }, /*#__PURE__*/React.createElement(Space, {
1120
- style: {
1121
- width: '100%'
1122
- },
1123
- direction: "vertical",
1124
- size: 24
1125
- }, /*#__PURE__*/React.createElement(Card, {
1126
- bordered: false,
1127
- className: classNames("".concat(classPrefix, "_containorSearch"))
1128
- }, /*#__PURE__*/React.createElement("div", {
1129
- className: classNames("".concat(classPrefix, "_tableListForm"))
1130
- }, searchForm)), gridView));
1131
- };
1132
- _this.establishPageContentLayoutSiderConfig = function () {
1133
- return {};
1134
- };
1135
- _this.establishPageContentLayoutConfig = function () {
1136
- return {};
1137
- };
1138
- _this.establishListItemDropdownConfig = function (record) {
1139
- if ((record || null) == null) {
1140
- return null;
1141
- }
1142
- return null;
1143
- };
1144
- _this.renderListItemDropdown = function (record) {
1145
- var config = _this.establishListItemDropdownConfig(record);
1146
- config.placement = 'topRight';
1147
- return buildDropdown(config);
1148
- };
1149
- _this.renderPageContent = function () {
1150
- var siderArea = _this.renderSiderArea();
1151
- var contentArea = _this.renderContentArea();
1152
- var layoutSiderConfig = _this.establishPageContentLayoutSiderConfig();
1153
- var layoutConfig = _this.establishPageContentLayoutConfig();
1154
- var _position = _objectSpread2(_objectSpread2({}, {
1155
- position: 'left'
1156
- }), layoutSiderConfig || {}),
1157
- siderPosition = _position.position;
1158
- var siderConfig = _objectSpread2(_objectSpread2({}, {
1159
- width: 300,
1160
- style: _objectSpread2(_objectSpread2({}, {
1161
- backgroundColor: '#fff',
1162
- borderRadius: '4px',
1163
- overflowX: 'auto',
1164
- overflowY: 'hidden'
1165
- }), siderPosition === 'left' ? {
1166
- marginRight: '24px'
1167
- } : {
1168
- marginLeft: '24px'
1169
- })
1170
- }), layoutSiderConfig || {});
1171
- layoutConfig = _objectSpread2(_objectSpread2({}, {
1172
- breakpoint: 'sm',
1173
- style: {
1174
- backgroundColor: '#f0f2f5',
1175
- minHeight: 'auto'
1176
- }
1177
- }), layoutConfig || {});
1178
- var inner = siderArea == null ? contentArea : /*#__PURE__*/React.createElement(Layout, layoutConfig, siderPosition === 'left' ? /*#__PURE__*/React.createElement(Sider, siderConfig, siderArea) : null, /*#__PURE__*/React.createElement(Content, {
1179
- style: {
1180
- backgroundColor: '#fff',
1181
- borderRadius: '4px'
1182
- }
1183
- }, contentArea), siderPosition !== 'left' ? /*#__PURE__*/React.createElement(Sider, siderConfig, siderArea) : null);
1184
- var toolbar = _this.buildToolBarWrapper();
1185
- var help = _this.buildHelpWrapper();
1186
- if ((toolbar || null) != null || (help || null) != null) {
1187
- return /*#__PURE__*/React.createElement("div", {
1188
- style: {
1189
- overflowX: 'hidden'
1190
- }
1191
- }, /*#__PURE__*/React.createElement(Space, {
1192
- style: {
1193
- width: '100%'
1194
- },
1195
- direction: "vertical",
1196
- size: 24
1197
- }, toolbar, inner, help));
1198
- }
1199
- return inner;
1200
- };
1201
- _this.renderPageBody = function () {
1202
- return /*#__PURE__*/React.createElement(React.Fragment, null, _this.renderPageContent(), _this.renderOther());
1203
- };
1204
- _this.lastLoadParams = null;
1205
- _this.columnsOtherConfig = [];
1206
- var defaultState = defaultListState();
1207
- _this.state = _objectSpread2(_objectSpread2(_objectSpread2({}, _this.state), defaultState), {
1208
- showSelect: false,
1209
- renderPageContainer: true,
1210
- listTitle: '检索结果',
1211
- defaultAvatarIcon: iconBuilder.picture(),
1212
- listViewMode: listViewConfig.viewMode.list,
1213
- avatarImageLoadResult: avatarImageLoadResultCollection.wait,
1214
- showPageHeaderAvatar: false,
1215
- tableSize: listViewConfig.tableSize.middle,
1216
- counterSetColumnsOtherConfig: 0
1217
- });
1218
- return _this;
1219
- }
1220
- _createClass(ListBase, [{
1221
- key: "renderFurther",
1222
- value: function renderFurther() {
1223
- var _this2 = this;
1224
- var _this$state10 = this.state,
1225
- renderPageContainer = _this$state10.renderPageContainer,
1226
- showPageHeaderAvatar = _this$state10.showPageHeaderAvatar,
1227
- defaultAvatarIcon = _this$state10.defaultAvatarIcon,
1228
- dataLoading = _this$state10.dataLoading,
1229
- reloading = _this$state10.reloading,
1230
- avatarImageLoadResult = _this$state10.avatarImageLoadResult;
1231
- var tabListAvailable = this.getTabListAvailable();
1232
- var avatarProps = showPageHeaderAvatar ? decorateAvatar(this.establishPageHeaderAvatarConfig(), defaultAvatarIcon, showPageHeaderAvatar, dataLoading, reloading, avatarImageLoadResult, function () {
1233
- _this2.onPageHeaderAvatarLoadErrorCallback();
1234
- }) : null;
1235
- if (renderPageContainer || false) {
1236
- return /*#__PURE__*/React.createElement(PageContainer, {
1237
- avatar: avatarProps,
1238
- title: buildPageHeaderTitle(this.getPageName(), this.establishPageHeaderTitlePrefix()),
1239
- subTitle: this.buildPageHeaderSubTitle(),
1240
- tags: buildPageHeaderTagWrapper(this.establishPageHeaderTagConfig()),
1241
- extra: this.buildExtraAction(),
1242
- tabActiveKey: this.getTabActiveKey(),
1243
- content: this.renderPageHeaderContent(),
1244
- extraContent: this.renderPageHeaderExtraContent(),
1245
- tabList: tabListAvailable,
1246
- onTabChange: this.handleTabChange,
1247
- tabProps: this.buildOtherTabProps()
1248
- }, this.renderPageBody(), /*#__PURE__*/React.createElement(BackTop, null));
1249
- }
1250
- return /*#__PURE__*/React.createElement(React.Fragment, null, this.renderPageBody(), /*#__PURE__*/React.createElement(BackTop, null));
1251
- }
1252
- }], [{
1253
- key: "getDerivedStateFromProps",
1254
- value: function getDerivedStateFromProps(nextProps, prevState) {
1255
- return getDerivedStateFromPropsForUrlParams(nextProps, prevState);
1256
- }
1257
- }]);
1258
- return ListBase;
1259
- }(AuthorizationWrapper);
1260
-
1261
- export { ListBase as default };