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
package/es/index2.js DELETED
@@ -1,2075 +0,0 @@
1
- import { _ as _objectSpread2 } from './objectSpread2.js';
2
- import { _ as _inherits, a as _classCallCheck, e as _assertThisInitialized, b as _createClass, c as _getPrototypeOf, d as _possibleConstructorReturn } from './getPrototypeOf.js';
3
- import { Layout, Button, Card, Space, Divider, Tooltip, Affix, Spin, Row, Col, Empty } from 'antd';
4
- import React, { Fragment } from 'react';
5
- import { contentConfig, cardConfig, defaultEmptyImage, datetimeFormat, extraBuildType } from 'antd-management-fast-common/es/utils/constants';
6
- import { runtimeSettings } from 'antd-management-fast-common/es/utils/dynamicSetting';
7
- import { pretreatmentRequestParams } from 'antd-management-fast-common/es/utils/requestAssistor';
8
- import { logObject, logText, toNumber, isEqual, toString, showErrorMessage, isFunction, isArray, isBoolean, isObject, inCollection, stringIsEmpty, buildFieldDescription, copyToClipboard, formatDatetime, toDatetime, refitCommonData, defaultCommonState, getDerivedStateFromPropsForUrlParams } from 'antd-management-fast-common/es/utils/tools';
9
- import FadeBox from 'antd-management-fast-component/es/customComponents/AnimalBox/FadeBox';
10
- import QueueBox from 'antd-management-fast-component/es/customComponents/AnimalBox/QueueBox';
11
- import AudioUpload from 'antd-management-fast-component/es/customComponents/AudioUpload';
12
- import ColorText from 'antd-management-fast-component/es/customComponents/ColorText';
13
- import TinymceWrapper from 'antd-management-fast-component/es/customComponents/Editor/TinymceWrapper';
14
- import FileBase64Upload from 'antd-management-fast-component/es/customComponents/FileBase64Upload';
15
- import FileUpload from 'antd-management-fast-component/es/customComponents/FileUpload';
16
- import FlexBox from 'antd-management-fast-component/es/customComponents/FlexBox';
17
- import FlexText from 'antd-management-fast-component/es/customComponents/FlexText';
18
- import { buildFormNowTimeField, buildFormCreateTimeField, buildFormUpdateTimeField, buildRadioItem, buildOptionItem, buildSearchInput, buildSearchInputNumber, buildFormDisplay, buildFormHiddenWrapper, buildFormInputFieldData, buildFormInput, buildFormSwitch, buildFormPassword, buildFormOnlyShowText, buildSyntaxHighlighter, buildJsonView, buildFormInnerComponent, buildFormButton, buildFormActionItem, buildFormOnlyShowSyntaxHighlighter, buildFormOnlyShowTextarea, buildFormText, buildFormOnlyShowInput, buildFormInputNumber, buildFormTextArea, buildFormDatePicker, buildFormTimePicker, buildFormSelect, buildFormRadio, buildSearchFormSelect, buildButton, buildCustomGrid, buildTree, buildTreeSelect, buildCustomSelect, buildDropdownEllipsis, buildDropdownButton, buildDropdown, buildButtonGroup } from 'antd-management-fast-component/es/customComponents/FunctionComponent';
19
- import { renderFormWhetherSelect } from 'antd-management-fast-component/es/customComponents/FunctionSupplement/Whether';
20
- import HelpBox from 'antd-management-fast-component/es/customComponents/HelpBox';
21
- import HelpCard from 'antd-management-fast-component/es/customComponents/HelpCard';
22
- import HtmlBox from 'antd-management-fast-component/es/customComponents/HtmlBox';
23
- import { iconBuilder } from 'antd-management-fast-component/es/customComponents/Icon';
24
- import IconInfo from 'antd-management-fast-component/es/customComponents/IconInfo';
25
- import ImageBox from 'antd-management-fast-component/es/customComponents/ImageBox';
26
- import ImageUpload from 'antd-management-fast-component/es/customComponents/ImageUpload';
27
- import VideoUpload from 'antd-management-fast-component/es/customComponents/VideoUpload';
28
- import { getMetaData } from './utils/metaDataAssist.js';
29
- import Core from './framework/Core/index.js';
30
-
31
- function _extends() {
32
- _extends = Object.assign ? Object.assign.bind() : function (target) {
33
- for (var i = 1; i < arguments.length; i++) {
34
- var source = arguments[i];
35
- for (var key in source) {
36
- if (Object.prototype.hasOwnProperty.call(source, key)) {
37
- target[key] = source[key];
38
- }
39
- }
40
- }
41
- return target;
42
- };
43
- return _extends.apply(this, arguments);
44
- }
45
-
46
- var styles = {"cardContainor":"index_cardContainor__M4iBL"};
47
-
48
- 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); }; }
49
- 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; } }
50
- var Content = Layout.Content,
51
- Sider = Layout.Sider;
52
- var metaData = {};
53
- var Common = /*#__PURE__*/function (_Core) {
54
- _inherits(Common, _Core);
55
- var _super = _createSuper(Common);
56
- function Common(_props) {
57
- var _this;
58
- _classCallCheck(this, Common);
59
- _this = _super.call(this, _props);
60
- _this.showExtraActionDivider = false;
61
- _this.loadDataAfterMount = true;
62
- _this.lastRequestingData = {
63
- type: '',
64
- payload: {}
65
- };
66
- _this.doDidMountTask = function () {
67
- _this.adjustWhenDidMount();
68
- _this.init();
69
- };
70
- _this.checkNeedUpdate = function (preProps, preState, snapshot) {
71
- return false;
72
- };
73
- _this.getMetaData = function () {
74
- return metaData;
75
- };
76
- _this.initOther = function () {};
77
- _this.init = function () {
78
- if (_this.loadDataAfterMount) {
79
- _this.initLoad({});
80
- }
81
- _this.initOther();
82
- };
83
- _this.beforeFirstLoadRequest = function (submitData) {};
84
- _this.beforeReLoadRequest = function (submitData) {};
85
- _this.beforeRequest = function (submitData) {};
86
- _this.afterGetFirstRequestResult = function (submitData, responseData) {};
87
- _this.afterGetRequestResult = function (submitData, responseData) {};
88
- _this.afterGetReLoadRequestResult = function (submitData, responseData) {};
89
- _this.initLoadRequestParams = function (o) {
90
- return o || {};
91
- };
92
- _this.supplementLoadRequestParams = function (o) {
93
- return o || {};
94
- };
95
- _this.checkLoadRequestParams = function (o) {
96
- return true;
97
- };
98
- _this.initLoad = function (_ref) {
99
- var _ref$otherState = _ref.otherState,
100
- otherState = _ref$otherState === void 0 ? {} : _ref$otherState,
101
- _ref$delay = _ref.delay,
102
- delay = _ref$delay === void 0 ? 0 : _ref$delay,
103
- _ref$callback = _ref.callback,
104
- callback = _ref$callback === void 0 ? null : _ref$callback;
105
- var _this$state = _this.state,
106
- loadApiPath = _this$state.loadApiPath,
107
- firstLoadSuccess = _this$state.firstLoadSuccess,
108
- reloadingBefore = _this$state.reloading;
109
- try {
110
- if ((loadApiPath || '') === '') {
111
- var text = 'loadApiPath需要配置';
112
- showRuntimeError({
113
- message: text
114
- });
115
- logObject(_assertThisInitialized(_this));
116
- _this.setState({
117
- dataLoading: false,
118
- loadSuccess: false,
119
- reloading: false,
120
- searching: false,
121
- refreshing: false,
122
- paging: false,
123
- dispatchComplete: true
124
- });
125
- return;
126
- }
127
- var willSaveState = _objectSpread2(_objectSpread2({}, {
128
- dataLoading: true,
129
- loadSuccess: false
130
- }), otherState || {});
131
- _this.setState(willSaveState, function () {
132
- _this.setState({
133
- dispatchComplete: false
134
- }, function () {
135
- var submitData = _this.initLoadRequestParams() || {};
136
- submitData = pretreatmentRequestParams(submitData || {});
137
- submitData = _this.supplementLoadRequestParams(submitData || {});
138
- var checkResult = _this.checkLoadRequestParams(submitData || {});
139
- if (checkResult) {
140
- if (!firstLoadSuccess) {
141
- _this.beforeFirstLoadRequest(submitData || {});
142
- }
143
- if (reloadingBefore) {
144
- _this.beforeReLoadRequest(submitData || {});
145
- }
146
- _this.beforeRequest(submitData || {});
147
- _this.initLoadCore({
148
- requestData: submitData || {},
149
- delay: delay,
150
- callback: callback
151
- });
152
- } else {
153
- _this.setState({
154
- dataLoading: false,
155
- loadSuccess: false,
156
- reloading: false,
157
- searching: false,
158
- refreshing: false,
159
- paging: false,
160
- dispatchComplete: true
161
- });
162
- }
163
- });
164
- });
165
- } catch (error) {
166
- logText({
167
- loadApiPath: loadApiPath
168
- });
169
- throw error;
170
- }
171
- };
172
- _this.adjustLoadApiPath = function () {
173
- return '';
174
- };
175
- _this.initLoadCore = function (_ref2) {
176
- var requestData = _ref2.requestData,
177
- _ref2$delay = _ref2.delay,
178
- delay = _ref2$delay === void 0 ? 0 : _ref2$delay,
179
- callback = _ref2.callback;
180
- var delayTime = toNumber(delay);
181
- if (delayTime <= 0) {
182
- _this.loadFromApi({
183
- requestData: requestData,
184
- callback: callback
185
- });
186
- } else {
187
- var that = _assertThisInitialized(_this);
188
- setTimeout(function () {
189
- that.loadFromApi({
190
- requestData: requestData,
191
- callback: callback
192
- });
193
- }, delayTime);
194
- }
195
- };
196
- _this.loadFromApi = function (_ref3) {
197
- var requestData = _ref3.requestData,
198
- callback = _ref3.callback;
199
- var loadApiPath = '';
200
- var that = _assertThisInitialized(_this);
201
- try {
202
- var requestingDataPre = _this.getRequestingData();
203
- var loadApiCustomPath = _this.adjustLoadApiPath();
204
- var loadApiPathCustom = checkStringIsNullOrWhiteSpace(loadApiCustomPath) ? {} : {
205
- loadApiPath: loadApiCustomPath
206
- };
207
- var _this$state$loadApiPa = _objectSpread2(_objectSpread2({}, _this.state), loadApiPathCustom),
208
- loadApiPathValue = _this$state$loadApiPa.loadApiPath,
209
- firstLoadSuccess = _this$state$loadApiPa.firstLoadSuccess;
210
- loadApiPath = loadApiPathValue || '';
211
-
212
- // 处理频繁的相同请求
213
- if (!isEqual(requestingDataPre, {
214
- type: loadApiPath,
215
- payload: requestData
216
- })) {
217
- that.setRequestingData({
218
- type: loadApiPath,
219
- payload: requestData
220
- });
221
- that.dispatchApi({
222
- type: loadApiPath,
223
- payload: requestData
224
- }).then(function (metaOriginalData) {
225
- var willSaveToState = {
226
- dataLoading: false,
227
- loadSuccess: false,
228
- reloading: false,
229
- searching: false,
230
- refreshing: false,
231
- paging: false,
232
- dispatchComplete: true
233
- };
234
- if (isUndefined(metaOriginalData)) {
235
- that.setState(willSaveToState);
236
- return;
237
- }
238
- that.lastLoadParams = requestData;
239
- var dataSuccess = metaOriginalData.dataSuccess;
240
- willSaveToState = _objectSpread2(_objectSpread2({}, willSaveToState), {
241
- loadSuccess: dataSuccess
242
- });
243
- if (dataSuccess) {
244
- var metaListData = metaOriginalData.list,
245
- _metaData = metaOriginalData.data,
246
- metaExtra = metaOriginalData.extra;
247
- willSaveToState = _objectSpread2(_objectSpread2({}, {
248
- metaData: _metaData || null,
249
- metaExtra: metaExtra || null,
250
- metaListData: metaListData || [],
251
- metaOriginalData: metaOriginalData
252
- }), willSaveToState);
253
- try {
254
- that.afterLoadSuccess({
255
- metaData: _metaData || null,
256
- metaListData: metaListData || [],
257
- metaExtra: metaExtra || null,
258
- metaOriginalData: metaOriginalData || null
259
- });
260
- } catch (e) {
261
- logObject(e);
262
- var text = "".concat(toString(e), ",place view in the console");
263
- showErrorMessage({
264
- message: text
265
- });
266
- }
267
- }
268
- var reloadingComplete = that.state.reloading;
269
- if (reloadingComplete) {
270
- that.afterReloadSuccess();
271
- that.afterGetReLoadRequestResult(requestData, metaOriginalData);
272
- }
273
- if (!firstLoadSuccess) {
274
- willSaveToState = _objectSpread2(_objectSpread2({}, willSaveToState), {
275
- firstLoadSuccess: true
276
- });
277
- }
278
- that.setState(willSaveToState);
279
- if (!firstLoadSuccess) {
280
- that.afterFirstLoadSuccess();
281
- that.afterGetFirstRequestResult(requestData, metaOriginalData);
282
- }
283
- that.afterGetRequestResult(requestData, metaOriginalData);
284
- if (typeof callback === 'function') {
285
- callback();
286
- }
287
- that.clearRequestingData();
288
- })["catch"](function (res) {
289
- logObject(res);
290
- that.setState({
291
- dataLoading: false,
292
- loadSuccess: false,
293
- reloading: false,
294
- searching: false,
295
- refreshing: false,
296
- paging: false,
297
- dispatchComplete: true
298
- });
299
- });
300
- }
301
- } catch (error) {
302
- logObject({
303
- loadApiPath: loadApiPath,
304
- requestData: requestData
305
- });
306
- that.setState({
307
- dataLoading: false,
308
- loadSuccess: false,
309
- reloading: false,
310
- searching: false,
311
- refreshing: false,
312
- paging: false,
313
- dispatchComplete: true
314
- });
315
- throw error;
316
- }
317
- };
318
- _this.pageListData = function (otherState) {
319
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
320
- var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
321
- var s = _objectSpread2(_objectSpread2({}, otherState || {}), {
322
- paging: true
323
- });
324
- _this.initLoad({
325
- otherState: s,
326
- delay: delay || 0,
327
- callback: callback || null
328
- });
329
- };
330
- _this.reloadData = function (otherState) {
331
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
332
- var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
333
- var s = _objectSpread2(_objectSpread2({}, otherState || {}), {
334
- reloading: true
335
- });
336
- _this.initLoad({
337
- otherState: s,
338
- delay: delay || 0,
339
- callback: callback || null
340
- });
341
- };
342
- _this.searchData = function (otherState) {
343
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
344
- var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
345
- var s = _objectSpread2(_objectSpread2({}, otherState || {}), {
346
- searching: true
347
- });
348
- _this.initLoad({
349
- otherState: s,
350
- delay: delay || 0,
351
- callback: callback
352
- });
353
- };
354
- _this.refreshData = function (otherState) {
355
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
356
- var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
357
- var s = _objectSpread2(_objectSpread2({}, otherState || {}), {
358
- refreshing: true
359
- });
360
- _this.initLoad({
361
- otherState: s,
362
- delay: delay || 0,
363
- callback: callback
364
- });
365
- };
366
- _this.reloadGlobalData = function () {
367
- var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
368
- _this.dispatchApi({
369
- type: 'global/getMetaData',
370
- payload: {
371
- force: true
372
- }
373
- }).then(function () {
374
- if (isFunction(callback)) {
375
- callback();
376
- }
377
- });
378
- };
379
- _this.afterFirstLoadSuccess = function () {};
380
- _this.afterLoadSuccess = function (_ref4) {
381
- _ref4.metaData;
382
- _ref4.metaListData;
383
- _ref4.metaExtra;
384
- _ref4.metaOriginalData;
385
- };
386
- _this.afterReloadSuccess = function () {};
387
- _this.backToList = function () {
388
- var backPath = _this.state.backPath;
389
- _this.goToPath(backPath);
390
- };
391
- _this.renderOther = function () {
392
- return null;
393
- };
394
- _this.renderFormNowTimeField = function (data) {
395
- var _helper$label$formIte = _objectSpread2(_objectSpread2({}, {
396
- helper: '数据的添加时间',
397
- label: '添加时间',
398
- formItemLayout: null
399
- }), data || {}),
400
- label = _helper$label$formIte.label,
401
- helper = _helper$label$formIte.helper,
402
- formItemLayout = _helper$label$formIte.formItemLayout;
403
- return buildFormNowTimeField({
404
- label: label,
405
- helper: helper,
406
- formItemLayout: formItemLayout
407
- });
408
- };
409
- _this.renderFormCreateTimeField = function () {
410
- var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'createTime';
411
- var helper = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '数据的添加时间';
412
- var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '添加时间';
413
- var formItemLayout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
414
- return buildFormCreateTimeField({
415
- name: name,
416
- helper: helper,
417
- label: label,
418
- formItemLayout: formItemLayout
419
- });
420
- };
421
- _this.renderFormUpdateTimeField = function () {
422
- var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'updateTime';
423
- var helper = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '数据的最后修改时间';
424
- var label = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '最后修改时间';
425
- var formItemLayout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
426
- return buildFormUpdateTimeField({
427
- name: name,
428
- helper: helper,
429
- label: label,
430
- formItemLayout: formItemLayout
431
- });
432
- };
433
- _this.renderFormRadioCore = function (listDataSource) {
434
- var adjustListDataCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
435
- return buildRadioItem({
436
- list: listDataSource,
437
- adjustListDataCallback: adjustListDataCallback
438
- });
439
- };
440
- _this.renderFormOptionCore = function (listDataSource) {
441
- var adjustListDataCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
442
- return buildOptionItem({
443
- list: listDataSource,
444
- adjustListDataCallback: adjustListDataCallback
445
- });
446
- };
447
- _this.renderSearchInput = function (label, name) {
448
- var helper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
449
- var icon = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : iconBuilder.form();
450
- var inputProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
451
- var canOperate = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
452
- var formItemLayout = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
453
- return buildSearchInput({
454
- label: label,
455
- name: name,
456
- helper: helper,
457
- icon: icon,
458
- inputProps: inputProps,
459
- canOperate: canOperate,
460
- formItemLayout: formItemLayout
461
- });
462
- };
463
- _this.renderSearchInputNumber = function (label, name) {
464
- var helper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
465
- var icon = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : iconBuilder.form();
466
- var inputProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
467
- var canOperate = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
468
- var formItemLayout = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
469
- return buildSearchInputNumber({
470
- label: label,
471
- name: name,
472
- helper: helper,
473
- icon: icon,
474
- inputProps: inputProps,
475
- canOperate: canOperate,
476
- formItemLayout: formItemLayout
477
- });
478
- };
479
- _this.renderFormDisplay = function (label, content) {
480
- var formItemLayout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
481
- var useDisplayBoxStyle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
482
- return buildFormDisplay({
483
- label: label,
484
- content: content,
485
- formItemLayout: formItemLayout,
486
- useDisplayBoxStyle: useDisplayBoxStyle
487
- });
488
- };
489
- _this.renderFormHiddenWrapper = function (children) {
490
- var hidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
491
- return buildFormHiddenWrapper({
492
- children: children,
493
- hidden: hidden
494
- });
495
- };
496
- _this.renderFormInputFieldData = function (fieldData) {
497
- var required = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
498
- var icon = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : iconBuilder.form();
499
- var inputProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
500
- var canOperate = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
501
- var formItemLayout = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
502
- var reminderPrefix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '输入';
503
- var hidden = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
504
- return buildFormInputFieldData({
505
- fieldData: fieldData,
506
- required: required,
507
- icon: icon,
508
- inputProps: inputProps,
509
- canOperate: canOperate,
510
- formItemLayout: formItemLayout,
511
- reminderPrefix: reminderPrefix,
512
- hidden: hidden
513
- });
514
- };
515
- _this.renderFormInput = function (label, name) {
516
- var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
517
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
518
- var icon = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : iconBuilder.form();
519
- var inputProps = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
520
- var canOperate = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
521
- var formItemLayout = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
522
- var reminderPrefix = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : '输入';
523
- var hidden = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
524
- return buildFormInput({
525
- label: label,
526
- name: name,
527
- required: required,
528
- helper: helper,
529
- icon: icon,
530
- inputProps: inputProps,
531
- canOperate: canOperate,
532
- formItemLayout: formItemLayout,
533
- reminderPrefix: reminderPrefix,
534
- hidden: hidden
535
- });
536
- };
537
- _this.renderFormSwitch = function (label, name) {
538
- var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
539
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
540
- var otherProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
541
- var canOperate = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
542
- var formItemLayout = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
543
- var hidden = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
544
- return buildFormSwitch({
545
- label: label,
546
- name: name,
547
- required: required,
548
- helper: helper,
549
- otherProps: otherProps,
550
- canOperate: canOperate,
551
- formItemLayout: formItemLayout,
552
- hidden: hidden
553
- });
554
- };
555
- _this.renderFormPassword = function (label, name) {
556
- var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
557
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
558
- var icon = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : iconBuilder.form();
559
- var inputProps = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
560
- var canOperate = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
561
- var formItemLayout = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
562
- return buildFormPassword({
563
- label: label,
564
- name: name,
565
- required: required,
566
- helper: helper,
567
- icon: icon,
568
- inputProps: inputProps,
569
- canOperate: canOperate,
570
- formItemLayout: formItemLayout
571
- });
572
- };
573
- _this.renderFormOnlyShowText = function (label, value) {
574
- var helper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
575
- var formItemLayout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
576
- var requiredForShow = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
577
- return buildFormOnlyShowText({
578
- label: label,
579
- value: value,
580
- helper: helper,
581
- formItemLayout: formItemLayout,
582
- requiredForShow: requiredForShow
583
- });
584
- };
585
- _this.renderSyntaxHighlighter = function (language, value) {
586
- var other = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
587
- return buildSyntaxHighlighter({
588
- language: language,
589
- value: value,
590
- other: other
591
- });
592
- };
593
- _this.renderJsonView = function (value) {
594
- var theme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'monokai';
595
- return buildJsonView({
596
- value: value,
597
- theme: theme
598
- });
599
- };
600
- _this.renderFormInnerComponent = function (label, innerComponent) {
601
- var helper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
602
- var formItemLayout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
603
- var requiredForShow = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
604
- return buildFormInnerComponent({
605
- label: label,
606
- innerComponent: innerComponent,
607
- helper: helper,
608
- formItemLayout: formItemLayout,
609
- requiredForShow: requiredForShow
610
- });
611
- };
612
- _this.renderFormButton = function (config) {
613
- var formItemLayout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
614
- return buildFormButton({
615
- config: config,
616
- formItemLayout: formItemLayout
617
- });
618
- };
619
- _this.renderFormActionItem = function (component) {
620
- var formItemLayout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
621
- return buildFormActionItem({
622
- component: component || null,
623
- formItemLayout: formItemLayout
624
- });
625
- };
626
- _this.renderFormOnlyShowSyntaxHighlighter = function (language, label, value) {
627
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
628
- var formItemLayout = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
629
- var requiredForShow = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
630
- var otherProps = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
631
- return buildFormOnlyShowSyntaxHighlighter({
632
- language: language,
633
- label: label,
634
- value: value,
635
- helper: helper,
636
- formItemLayout: formItemLayout,
637
- requiredForShow: requiredForShow,
638
- otherProps: otherProps
639
- });
640
- };
641
- _this.renderFormOnlyShowTextarea = function (label, value) {
642
- var helper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
643
- var textAreaProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
644
- disabled: true
645
- };
646
- var formItemLayout = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
647
- return buildFormOnlyShowTextarea({
648
- label: label,
649
- value: value,
650
- helper: helper,
651
- textAreaProps: textAreaProps,
652
- formItemLayout: formItemLayout
653
- });
654
- };
655
- _this.renderFormText = function (label, value) {
656
- var helper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
657
- var formItemLayout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
658
- return buildFormText({
659
- label: label,
660
- value: value,
661
- helper: helper,
662
- formItemLayout: formItemLayout
663
- });
664
- };
665
- _this.renderFormOnlyShowInput = function (label, value) {
666
- var helper = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
667
- var icon = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : iconBuilder.form();
668
- var inputProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
669
- disabled: true
670
- };
671
- var formItemLayout = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
672
- return buildFormOnlyShowInput({
673
- label: label,
674
- value: value,
675
- helper: helper,
676
- icon: icon,
677
- inputProps: inputProps,
678
- formItemLayout: formItemLayout
679
- });
680
- };
681
- _this.renderFormInputNumber = function (label, name) {
682
- var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
683
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
684
- var icon = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : iconBuilder.form();
685
- var inputNumberProps = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
686
- var canOperate = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
687
- var formItemLayout = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
688
- return buildFormInputNumber({
689
- label: label,
690
- name: name,
691
- required: required,
692
- helper: helper,
693
- icon: icon,
694
- inputNumberProps: inputNumberProps,
695
- canOperate: canOperate,
696
- formItemLayout: formItemLayout
697
- });
698
- };
699
- _this.renderFormTextArea = function (label, name) {
700
- var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
701
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
702
- var textAreaProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
703
- var canOperate = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
704
- var formItemLayout = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
705
- return buildFormTextArea({
706
- label: label,
707
- name: name,
708
- required: required,
709
- helper: helper,
710
- textAreaProps: textAreaProps,
711
- canOperate: canOperate,
712
- formItemLayout: formItemLayout
713
- });
714
- };
715
- _this.renderFormDatePicker = function (label, name) {
716
- var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
717
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
718
- var datePickerProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
719
- var canOperate = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
720
- var formItemLayout = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
721
- return buildFormDatePicker({
722
- label: label,
723
- name: name,
724
- required: required,
725
- helper: helper,
726
- datePickerProps: datePickerProps,
727
- canOperate: canOperate,
728
- formItemLayout: formItemLayout
729
- });
730
- };
731
- _this.renderFormTimePicker = function (label, name) {
732
- var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
733
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
734
- var timePickerProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
735
- var canOperate = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
736
- var formItemLayout = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
737
- return buildFormTimePicker({
738
- label: label,
739
- name: name,
740
- required: required,
741
- helper: helper,
742
- timePickerProps: timePickerProps,
743
- canOperate: canOperate,
744
- formItemLayout: formItemLayout
745
- });
746
- };
747
- _this.renderFormSelect = function (label, name, renderItemFunction) {
748
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
749
- var onChangeCallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
750
- var formItemLayout = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
751
- var required = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
752
- var otherProps = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
753
- return buildFormSelect({
754
- label: label,
755
- name: name,
756
- renderItemFunction: renderItemFunction,
757
- helper: helper,
758
- onChangeCallback: onChangeCallback,
759
- formItemLayout: formItemLayout,
760
- required: required,
761
- otherProps: otherProps
762
- });
763
- };
764
- _this.renderFormRadio = function (label, name, renderItemFunction) {
765
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
766
- var onChangeCallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
767
- var formItemLayout = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
768
- var required = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
769
- var otherProps = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
770
- return buildFormRadio({
771
- label: label,
772
- name: name,
773
- renderItemFunction: renderItemFunction,
774
- helper: helper,
775
- onChangeCallback: onChangeCallback,
776
- formItemLayout: formItemLayout,
777
- required: required,
778
- otherProps: otherProps
779
- });
780
- };
781
- _this.renderSearchFormSelect = function (label, name, options) {
782
- var helper = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
783
- return buildSearchFormSelect({
784
- label: label,
785
- name: name,
786
- options: options,
787
- helper: helper
788
- });
789
- };
790
- _this.getOtherButtonDisabled = function () {
791
- return false;
792
- };
793
- _this.getSaveButtonDisabled = function () {
794
- var processing = _this.state.processing;
795
- if (_this.loadDataAfterMount) {
796
- return _this.checkOperability();
797
- }
798
- return processing;
799
- };
800
- _this.getSaveButtonLoading = function () {
801
- if (_this.loadDataAfterMount) {
802
- return _this.checkLoadingProgress();
803
- }
804
- return _this.loadDataAfterMount;
805
- };
806
- _this.getSaveButtonProcessing = function () {
807
- var processing = _this.state.processing;
808
- return processing;
809
- };
810
- _this.getSaveButtonIcon = function () {
811
- return iconBuilder.save();
812
- };
813
- _this.getDisabledButtonIcon = function () {
814
- return iconBuilder.save();
815
- };
816
- _this.renderDisabledButton = function () {
817
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
818
- return /*#__PURE__*/React.createElement(Button, {
819
- type: "primary",
820
- disabled: true
821
- }, _this.getDisabledButtonIcon(), text || '保存');
822
- };
823
- _this.renderSaveButton = function (_ref5) {
824
- var icon = _ref5.icon,
825
- text = _ref5.text,
826
- _handleClick = _ref5.handleClick,
827
- _ref5$disabled = _ref5.disabled,
828
- disabled = _ref5$disabled === void 0 ? false : _ref5$disabled,
829
- _ref5$processing = _ref5.processing,
830
- processing = _ref5$processing === void 0 ? false : _ref5$processing,
831
- _ref5$hidden = _ref5.hidden,
832
- hidden = _ref5$hidden === void 0 ? false : _ref5$hidden;
833
- var that = _assertThisInitialized(_this);
834
- var buttonDisabled = _this.getSaveButtonDisabled();
835
- var buttonProcessing = _this.getSaveButtonProcessing();
836
- var ico = (icon || null) == null ? _this.getSaveButtonIcon() : icon;
837
- return _this.renderGeneralButton({
838
- type: 'primary',
839
- text: text || '保存',
840
- icon: ico,
841
- hidden: hidden,
842
- disabled: disabled || buttonDisabled,
843
- processing: processing || buttonProcessing,
844
- handleClick: function handleClick(e) {
845
- if (isFunction(_handleClick)) {
846
- _handleClick(e);
847
- } else {
848
- that.validate(e);
849
- }
850
- }
851
- });
852
- };
853
- _this.renderGeneralButton = function (_ref6) {
854
- var _ref6$key = _ref6.key,
855
- key = _ref6$key === void 0 ? null : _ref6$key,
856
- type = _ref6.type,
857
- size = _ref6.size,
858
- text = _ref6.text,
859
- icon = _ref6.icon,
860
- handleClick = _ref6.handleClick,
861
- _ref6$danger = _ref6.danger,
862
- danger = _ref6$danger === void 0 ? false : _ref6$danger,
863
- _ref6$disabled = _ref6.disabled,
864
- disabled = _ref6$disabled === void 0 ? false : _ref6$disabled,
865
- _ref6$hidden = _ref6.hidden,
866
- hidden = _ref6$hidden === void 0 ? false : _ref6$hidden,
867
- _ref6$confirm = _ref6.confirm,
868
- confirm = _ref6$confirm === void 0 ? false : _ref6$confirm,
869
- _ref6$processing = _ref6.processing,
870
- processing = _ref6$processing === void 0 ? false : _ref6$processing,
871
- _ref6$handleData = _ref6.handleData,
872
- handleData = _ref6$handleData === void 0 ? null : _ref6$handleData,
873
- _ref6$style = _ref6.style,
874
- style = _ref6$style === void 0 ? null : _ref6$style,
875
- _ref6$showIcon = _ref6.showIcon,
876
- showIcon = _ref6$showIcon === void 0 ? true : _ref6$showIcon;
877
- if (hidden) {
878
- return null;
879
- }
880
- return buildButton({
881
- key: key,
882
- type: type,
883
- size: size,
884
- text: text,
885
- icon: icon,
886
- handleClick: handleClick,
887
- danger: danger || false,
888
- disabled: disabled,
889
- processing: processing,
890
- hidden: hidden,
891
- confirm: confirm,
892
- handleData: handleData !== null && handleData !== void 0 ? handleData : null,
893
- style: style || null,
894
- showIcon: showIcon
895
- });
896
- };
897
- _this.establishFormAdditionalConfig = function () {
898
- return {};
899
- };
900
- _this.renderRefreshButton = function () {
901
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
902
- var _size$text = _objectSpread2(_objectSpread2({}, {
903
- size: 'default',
904
- text: '刷新'
905
- }), props || {}),
906
- size = _size$text.size,
907
- text = _size$text.text;
908
- return buildButton({
909
- size: size,
910
- text: text,
911
- icon: iconBuilder.reload(),
912
- disabled: _this.checkOperability(),
913
- handleClick: _this.reloadData
914
- });
915
- };
916
- _this.getUploadTokenObject = function () {
917
- var text = '需要在继承中重新实现 getUploadTokenObject';
918
- showRuntimeError({
919
- message: text
920
- });
921
- throw new Error(text);
922
- };
923
- _this.beforeVideoUpload = function (file) {
924
- var isVideo = file.type === 'video/mp4';
925
- if (!isVideo) {
926
- var text = '请上传视频文件!';
927
- showRuntimeError({
928
- message: text
929
- });
930
- }
931
- var isLt3M = file.size / 1024 / 1024 < 3;
932
- if (!isLt3M) {
933
- var _text = '视频文件不能超过3MB!';
934
- showRuntimeError({
935
- message: _text
936
- });
937
- }
938
- return isVideo && isLt3M;
939
- };
940
- _this.pretreatmentImageUploadRemoteResponse = function (response) {
941
- var text = '需要在继承中重新实现 pretreatmentImageUploadRemoteResponse';
942
- showRuntimeError({
943
- message: text
944
- });
945
- throw new Error(text);
946
- };
947
- _this.pretreatmentFileBase64UploadRemoteResponse = function (response) {
948
- var text = '需要在继承中重新实现 pretreatmentFileBase64UploadRemoteResponse';
949
- showRuntimeError({
950
- message: text
951
- });
952
- throw new Error(text);
953
- };
954
- _this.pretreatmentVideoUploadRemoteResponse = function (response) {
955
- var text = '需要在继承中重新实现 pretreatmentVideoUploadRemoteResponse';
956
- showRuntimeError({
957
- message: text
958
- });
959
- throw new Error(text);
960
- };
961
- _this.pretreatmentAudioUploadRemoteResponse = function (response) {
962
- var text = '需要在继承中重新实现 pretreatmentAudioUploadRemoteResponse';
963
- showRuntimeError({
964
- message: text
965
- });
966
- throw new Error(text);
967
- };
968
- _this.pretreatmentFileUploadRemoteResponse = function (response) {
969
- var text = '需要在继承中重新实现 pretreatmentFileUploadRemoteResponse';
970
- showRuntimeError({
971
- message: text
972
- });
973
- throw new Error(text);
974
- };
975
- _this.establishToolBarConfig = function () {
976
- return null;
977
- };
978
- _this.buildToolBar = function () {
979
- var config = _this.establishToolBarConfig();
980
- if ((config || null) == null) {
981
- return null;
982
- }
983
- var _stick$title$tools$co = _objectSpread2(_objectSpread2({}, {
984
- stick: false,
985
- title: '工具栏',
986
- tools: []
987
- }), config),
988
- stick = _stick$title$tools$co.stick,
989
- title = _stick$title$tools$co.title,
990
- tools = _stick$title$tools$co.tools;
991
- if (!isArray(tools)) {
992
- var text = '工具栏配置数据无效';
993
- showErrorMessage({
994
- message: text
995
- });
996
- logObject(config);
997
- return null;
998
- }
999
- var toolList = tools.map(function (o, index) {
1000
- return _objectSpread2(_objectSpread2({}, o), {
1001
- key: "toolItem_".concat(index)
1002
- });
1003
- });
1004
- var bar = /*#__PURE__*/React.createElement("div", {
1005
- className: styles.cardContainor
1006
- }, /*#__PURE__*/React.createElement(Card, {
1007
- title: /*#__PURE__*/React.createElement(IconInfo, {
1008
- icon: iconBuilder.tool(),
1009
- text: title || '工具栏'
1010
- }),
1011
- bordered: false,
1012
- bodyStyle: {
1013
- padding: 0
1014
- },
1015
- extra: /*#__PURE__*/React.createElement(Space, {
1016
- split: /*#__PURE__*/React.createElement(Divider, {
1017
- type: "vertical"
1018
- })
1019
- }, toolList.map(function (o) {
1020
- var _hidden = _objectSpread2(_objectSpread2({}, {
1021
- hidden: false
1022
- }), o !== null && o !== void 0 ? o : {}),
1023
- hidden = _hidden.hidden;
1024
- if (hidden) {
1025
- return null;
1026
- }
1027
- return /*#__PURE__*/React.createElement(Tooltip, {
1028
- key: o.key,
1029
- title: o.title || ''
1030
- }, o.component);
1031
- }))
1032
- }));
1033
- if (isBoolean(stick) && stick) {
1034
- return /*#__PURE__*/React.createElement(Affix, {
1035
- offsetTop: 0
1036
- }, bar);
1037
- }
1038
- return bar;
1039
- };
1040
- _this.buildToolBarWrapper = function () {
1041
- var toolBar = _this.buildToolBar();
1042
- if ((toolBar || null) == null) {
1043
- return null;
1044
- }
1045
- return toolBar;
1046
- };
1047
- _this.establishWrapperTypeConfig = function () {
1048
- return {
1049
- mode: contentConfig.wrapperType.page
1050
- };
1051
- };
1052
- _this.establishHelpConfig = function () {
1053
- return null;
1054
- };
1055
- _this.buildHelp = function () {
1056
- var wrapperTypeConfig = _this.establishWrapperTypeConfig() || {
1057
- mode: contentConfig.wrapperType.page
1058
- };
1059
- var configData = _objectSpread2(_objectSpread2({}, {
1060
- mode: contentConfig.wrapperType.page
1061
- }), wrapperTypeConfig || {});
1062
- var mode = configData.mode;
1063
- var config = _this.establishHelpConfig();
1064
- if ((config || null) == null) {
1065
- return null;
1066
- }
1067
- var _title$showNumber$lis = _objectSpread2(_objectSpread2({}, {
1068
- title: '操作帮助',
1069
- showNumber: true,
1070
- list: []
1071
- }), config),
1072
- title = _title$showNumber$lis.title,
1073
- showNumber = _title$showNumber$lis.showNumber,
1074
- list = _title$showNumber$lis.list;
1075
- if (!isArray(list)) {
1076
- var text = '帮助条目数据无效';
1077
- showErrorMessage({
1078
- message: text
1079
- });
1080
- logObject(config);
1081
- return null;
1082
- }
1083
- return /*#__PURE__*/React.createElement(HelpCard, {
1084
- border: mode !== contentConfig.wrapperType.model && mode !== contentConfig.wrapperType.drawer,
1085
- compact: mode === contentConfig.wrapperType.model,
1086
- helpBoxProps: {
1087
- title: title || '操作帮助',
1088
- showNumber: showNumber || false,
1089
- list: list
1090
- }
1091
- });
1092
- };
1093
- _this.buildHelpWrapper = function () {
1094
- var help = _this.buildHelp();
1095
- if ((help || null) == null) {
1096
- return null;
1097
- }
1098
- return help;
1099
- };
1100
- _this.establishSiderTopAreaConfig = function () {
1101
- return null;
1102
- };
1103
- _this.renderSiderTopArea = function () {
1104
- var config = _this.establishSiderTopAreaConfig();
1105
- if (config == null) {
1106
- return null;
1107
- }
1108
- return _this.buildCardCollectionArea(config);
1109
- };
1110
- _this.establishSiderBottomAreaConfig = function () {
1111
- return null;
1112
- };
1113
- _this.renderSiderBottomArea = function () {
1114
- var config = _this.establishSiderBottomAreaConfig();
1115
- if (config == null) {
1116
- return null;
1117
- }
1118
- return _this.buildCardCollectionArea(config);
1119
- };
1120
- _this.buildCardCollectionArea = function () {
1121
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1122
- if (config == null) {
1123
- return null;
1124
- }
1125
- var formContentWrapperTypeConfig = _this.establishWrapperTypeConfig() || {
1126
- mode: cardConfig.wrapperType.page
1127
- };
1128
- var configData = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {
1129
- mode: cardConfig.wrapperType.page,
1130
- justify: 'start',
1131
- align: 'top'
1132
- }), formContentWrapperTypeConfig || {}), {
1133
- list: []
1134
- }), config || {});
1135
- var mode = configData.mode,
1136
- justifyGeneral = configData.justify,
1137
- alignGeneral = configData.align,
1138
- list = configData.list;
1139
- var listData = [];
1140
- if (isArray(list)) {
1141
- list.forEach(function (co, ci) {
1142
- listData.push(co);
1143
- if (ci !== list.length - 1) {
1144
- listData.push('');
1145
- }
1146
- });
1147
- }
1148
- return /*#__PURE__*/React.createElement("div", {
1149
- style: {
1150
- backgroundColor: '#f0f2f5'
1151
- }
1152
- }, /*#__PURE__*/React.createElement(Space, {
1153
- style: {
1154
- width: '100%'
1155
- },
1156
- direction: "vertical",
1157
- size: 24
1158
- }, listData.map(function (item, index) {
1159
- return _this.buildCardCollectionItem({
1160
- mode: mode,
1161
- justify: justifyGeneral,
1162
- align: alignGeneral,
1163
- config: item,
1164
- key: index
1165
- });
1166
- })));
1167
- };
1168
- _this.renderSiderArea = function () {
1169
- var topArea = _this.renderSiderTopArea();
1170
- var bottomArea = _this.renderSiderBottomArea();
1171
- if ((bottomArea || null) == null) {
1172
- return topArea;
1173
- }
1174
- return /*#__PURE__*/React.createElement(FlexBox, {
1175
- flexAuto: "top",
1176
- top: topArea,
1177
- bottom: bottomArea
1178
- });
1179
- };
1180
- _this.establishPageContentLayoutSiderConfig = function () {
1181
- return {};
1182
- };
1183
- _this.establishPageContentLayoutConfig = function () {
1184
- return {};
1185
- };
1186
- _this.buildCardCollection = function (config) {
1187
- var siderArea = _this.renderSiderArea();
1188
- var contentArea = _this.buildCardCollectionArea(config);
1189
- var layoutSiderConfig = _this.establishPageContentLayoutSiderConfig();
1190
- var layoutConfig = _this.establishPageContentLayoutConfig();
1191
- var _position = _objectSpread2(_objectSpread2({}, {
1192
- position: 'left'
1193
- }), layoutSiderConfig || {}),
1194
- siderPosition = _position.position;
1195
- var siderConfig = _objectSpread2(_objectSpread2({}, {
1196
- width: 300,
1197
- style: _objectSpread2(_objectSpread2({}, {
1198
- backgroundColor: '#fff',
1199
- borderRadius: '4px',
1200
- overflowX: 'auto',
1201
- overflowY: 'hidden'
1202
- }), siderPosition === 'left' ? {
1203
- marginRight: '24px'
1204
- } : {
1205
- marginLeft: '24px'
1206
- })
1207
- }), layoutSiderConfig || {});
1208
- layoutConfig = _objectSpread2(_objectSpread2({}, {
1209
- breakpoint: 'sm',
1210
- style: {
1211
- backgroundColor: '#f0f2f5',
1212
- minHeight: 'auto'
1213
- }
1214
- }), layoutConfig || {});
1215
- var inner = siderArea == null ? contentArea : /*#__PURE__*/React.createElement(Layout, layoutConfig, siderPosition === 'left' ? /*#__PURE__*/React.createElement(Sider, siderConfig, siderArea) : null, /*#__PURE__*/React.createElement(Content, {
1216
- style: {
1217
- backgroundColor: '#fff',
1218
- borderRadius: '4px'
1219
- }
1220
- }, contentArea), siderPosition !== 'left' ? /*#__PURE__*/React.createElement(Sider, siderConfig, siderArea) : null);
1221
- var toolbar = _this.buildToolBarWrapper();
1222
- var help = _this.buildHelpWrapper();
1223
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, {
1224
- style: {
1225
- width: '100%'
1226
- },
1227
- direction: "vertical",
1228
- size: 24
1229
- }, toolbar, inner, help));
1230
- };
1231
- _this.buildCardCollectionItem = function (_ref7) {
1232
- var cardItemConfig = _ref7.config,
1233
- cardItemKey = _ref7.key,
1234
- _ref7$mode = _ref7.mode,
1235
- mode = _ref7$mode === void 0 ? cardConfig.wrapperType.page : _ref7$mode,
1236
- _ref7$justify = _ref7.justify,
1237
- justifyGeneral = _ref7$justify === void 0 ? 'start' : _ref7$justify,
1238
- _ref7$align = _ref7.align,
1239
- alignGeneral = _ref7$align === void 0 ? 'top' : _ref7$align;
1240
- var key = "cardCollectionItem_key_".concat(cardItemKey);
1241
- if ((cardItemConfig || null) == null) {
1242
- return null;
1243
- }
1244
- var _title$size$bordered$ = _objectSpread2(_objectSpread2({}, {
1245
- title: '',
1246
- size: 'default',
1247
- bordered: false,
1248
- useAnimal: false,
1249
- animalType: cardConfig.animalType.none,
1250
- extra: null,
1251
- hidden: false,
1252
- cardType: cardConfig.renderType.normal,
1253
- cardBodyStyle: {},
1254
- items: [],
1255
- otherComponent: null,
1256
- formItemLayout: null,
1257
- instruction: null,
1258
- justify: 'start',
1259
- align: 'top'
1260
- }), cardItemConfig || {}),
1261
- title = _title$size$bordered$.title,
1262
- size = _title$size$bordered$.size,
1263
- bordered = _title$size$bordered$.bordered,
1264
- useAnimal = _title$size$bordered$.useAnimal,
1265
- animalType = _title$size$bordered$.animalType,
1266
- extra = _title$size$bordered$.extra,
1267
- hidden = _title$size$bordered$.hidden,
1268
- cardType = _title$size$bordered$.cardType,
1269
- cardBodyStyle = _title$size$bordered$.cardBodyStyle,
1270
- spinning = _title$size$bordered$.spinning,
1271
- contentItems = _title$size$bordered$.items,
1272
- otherComponent = _title$size$bordered$.otherComponent,
1273
- formItemLayout = _title$size$bordered$.formItemLayout,
1274
- instruction = _title$size$bordered$.instruction,
1275
- justifyRow = _title$size$bordered$.justify,
1276
- alignRow = _title$size$bordered$.align;
1277
- if (hidden || false) {
1278
- return null;
1279
- }
1280
- var _image$imageCircle$ic = _objectSpread2(_objectSpread2({}, {
1281
- image: '',
1282
- imageCircle: true,
1283
- icon: null,
1284
- hideIcon: false,
1285
- hideIconWhenShowImage: true,
1286
- text: '',
1287
- textEllipsisMaxWidth: 0,
1288
- subText: '',
1289
- addonBefore: null,
1290
- addonAfter: null
1291
- }), title || {}),
1292
- image = _image$imageCircle$ic.image,
1293
- imageCircle = _image$imageCircle$ic.imageCircle,
1294
- icon = _image$imageCircle$ic.icon,
1295
- hideIcon = _image$imageCircle$ic.hideIcon,
1296
- hideIconWhenShowImage = _image$imageCircle$ic.hideIconWhenShowImage,
1297
- text = _image$imageCircle$ic.text,
1298
- textEllipsisMaxWidth = _image$imageCircle$ic.textEllipsisMaxWidth,
1299
- subText = _image$imageCircle$ic.subText,
1300
- titleAddonBefore = _image$imageCircle$ic.addonBefore,
1301
- titleAddonAfter = _image$imageCircle$ic.addonAfter;
1302
- var _affix$split$list = _objectSpread2(_objectSpread2({}, {
1303
- affix: false,
1304
- split: false,
1305
- list: []
1306
- }), extra || {}),
1307
- affix = _affix$split$list.affix,
1308
- split = _affix$split$list.split,
1309
- extraItemList = _affix$split$list.list;
1310
- var imageVisible = !checkStringIsNullOrWhiteSpace(image);
1311
- var iconAdjust = !!hideIcon ? null : imageVisible ? !!hideIconWhenShowImage ? null : icon : icon || iconBuilder.read();
1312
- var extraListData = [];
1313
- if (isArray(extraItemList)) {
1314
- extraItemList.forEach(function (eo, ei) {
1315
- if ((eo || null) != null) {
1316
- extraListData.push(eo);
1317
- if (ei !== extraItemList.length - 1) {
1318
- extraListData.push('');
1319
- }
1320
- }
1321
- });
1322
- }
1323
- var extraItems = _this.buildByExtraBuildType({
1324
- keyPrefix: "formContent_key_".concat(cardItemKey, "_extra"),
1325
- configList: extraListData
1326
- });
1327
- var hasExtraItems = extraItems.length > 0;
1328
- var cardTypeBodyStyle = {};
1329
- if (cardType === cardConfig.renderType.help) {
1330
- cardTypeBodyStyle = {
1331
- paddingTop: '12px',
1332
- paddingBottom: '12px'
1333
- };
1334
- }
1335
- var card = /*#__PURE__*/React.createElement(Card, {
1336
- title: cardItemKey === 0 && mode !== cardConfig.wrapperType.page ? null : (text || '') === '' && (subText || '') === '' ? null : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FlexText, {
1337
- icon: iconAdjust || null,
1338
- text: text || '',
1339
- textEllipsisMaxWidth: textEllipsisMaxWidth,
1340
- subText: subText || '',
1341
- addonBefore: (titleAddonBefore || null) == null ? null : titleAddonBefore,
1342
- addonAfter: (titleAddonAfter || null) == null ? null : titleAddonAfter
1343
- })),
1344
- style: imageVisible ? {
1345
- position: 'relative'
1346
- } : {},
1347
- headStyle: imageVisible ? {
1348
- paddingLeft: '64px'
1349
- } : {},
1350
- size: size || 'default',
1351
- bordered: bordered,
1352
- extra: hasExtraItems ? mode === cardConfig.wrapperType.page && affix ? /*#__PURE__*/React.createElement(Affix, {
1353
- offsetTop: 20
1354
- }, /*#__PURE__*/React.createElement(Space, {
1355
- split: isBoolean(split) ? split ? /*#__PURE__*/React.createElement(Divider, {
1356
- type: "vertical"
1357
- }) : null : split
1358
- }, extraItems)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, {
1359
- split: isBoolean(split) ? split ? /*#__PURE__*/React.createElement(Divider, {
1360
- type: "vertical"
1361
- }) : null : split
1362
- }, extraItems)) : null,
1363
- bodyStyle: mode === cardConfig.wrapperType.model ? _objectSpread2(_objectSpread2(_objectSpread2({}, cardBodyStyle || {}), cardTypeBodyStyle || {}), {
1364
- paddingBottom: 0
1365
- }) : _objectSpread2(_objectSpread2({}, cardBodyStyle || {}), cardTypeBodyStyle || {})
1366
- }, /*#__PURE__*/React.createElement(Spin, {
1367
- spinning: spinning || false
1368
- }, /*#__PURE__*/React.createElement(React.Fragment, null, _this.buildCardCollectionItemContent({
1369
- mode: mode,
1370
- justify: justifyRow || justifyGeneral,
1371
- align: alignRow || alignGeneral,
1372
- items: isArray(contentItems) ? contentItems.map(function (o) {
1373
- return _objectSpread2(_objectSpread2({}, o), {
1374
- formItemLayout: formItemLayout || null
1375
- });
1376
- }) : [],
1377
- index: cardItemKey
1378
- }), otherComponent || null, isObject(instruction !== null && instruction !== void 0 ? instruction : false) || isArray(instruction !== null && instruction !== void 0 ? instruction : false) ? isArray(instruction !== null && instruction !== void 0 ? instruction : false) ? instruction.map(function (o, indexHelpBox) {
1379
- if ((o !== null && o !== void 0 ? o : null) == null) {
1380
- return null;
1381
- }
1382
- var keyHelpBox = "".concat(key, "_HelpBox_$").concat(indexHelpBox);
1383
- return /*#__PURE__*/React.createElement(HelpBox, _extends({
1384
- key: keyHelpBox
1385
- }, o));
1386
- }) : /*#__PURE__*/React.createElement(HelpBox, instruction) : null)), imageVisible ? /*#__PURE__*/React.createElement("div", {
1387
- style: {
1388
- position: 'absolute',
1389
- width: '32px',
1390
- left: '22px',
1391
- top: '15px'
1392
- }
1393
- }, /*#__PURE__*/React.createElement(ImageBox, {
1394
- src: image,
1395
- circle: imageCircle,
1396
- lazyLoad: true,
1397
- errorOverlayVisible: true,
1398
- showErrorOverlay: true,
1399
- loadingEffect: true,
1400
- preview: true,
1401
- previewSimpleMask: true
1402
- })) : null);
1403
- return /*#__PURE__*/React.createElement("div", {
1404
- key: key,
1405
- className: styles.cardContainor
1406
- }, isBoolean(useAnimal) && animalType === cardConfig.animalType.fade ? /*#__PURE__*/React.createElement(FadeBox, null, card) : null, isBoolean(useAnimal) && animalType === cardConfig.animalType.queue ? /*#__PURE__*/React.createElement(QueueBox, null, card) : null, !isBoolean(useAnimal) || isBoolean(useAnimal) && !inCollection([cardConfig.animalType.fade, cardConfig.animalType.queue], animalType) ? card : null);
1407
- };
1408
- _this.buildCardCollectionItemContent = function (_ref8) {
1409
- var mode = _ref8.mode,
1410
- justify = _ref8.justify,
1411
- align = _ref8.align,
1412
- _ref8$gutter = _ref8.gutter,
1413
- gutter = _ref8$gutter === void 0 ? 24 : _ref8$gutter,
1414
- contentItems = _ref8.items,
1415
- contentIndex = _ref8.index;
1416
- return /*#__PURE__*/React.createElement(Row, {
1417
- justify: justify,
1418
- align: align,
1419
- gutter: gutter || 24
1420
- }, isArray(contentItems) ? contentItems.map(function (contentItem, contentItemIndex) {
1421
- var contentItemKey = "formContent_key_".concat(contentIndex, "_content_").concat(contentItemIndex);
1422
- var _lg$md$sm$xs$require$ = _objectSpread2(_objectSpread2({}, {
1423
- lg: 6,
1424
- md: 12,
1425
- sm: 24,
1426
- xs: 24,
1427
- require: false,
1428
- type: '',
1429
- fieldData: {
1430
- label: '',
1431
- name: '',
1432
- helper: ''
1433
- },
1434
- hidden: false,
1435
- canOperate: true,
1436
- formItemLayout: null
1437
- }), contentItem || {}),
1438
- lgValue = _lg$md$sm$xs$require$.lg,
1439
- md = _lg$md$sm$xs$require$.md,
1440
- sm = _lg$md$sm$xs$require$.sm,
1441
- xs = _lg$md$sm$xs$require$.xs,
1442
- type = _lg$md$sm$xs$require$.type,
1443
- require = _lg$md$sm$xs$require$.require,
1444
- fieldDataValue = _lg$md$sm$xs$require$.fieldData,
1445
- hidden = _lg$md$sm$xs$require$.hidden,
1446
- canOperate = _lg$md$sm$xs$require$.canOperate,
1447
- formItemLayout = _lg$md$sm$xs$require$.formItemLayout;
1448
- if (hidden) {
1449
- return null;
1450
- }
1451
- var fieldData = _objectSpread2(_objectSpread2({}, {
1452
- label: '',
1453
- name: '',
1454
- helper: ''
1455
- }), fieldDataValue || {});
1456
- var lg = (lgValue || 6) < 12 && mode !== cardConfig.wrapperType.page ? 12 : lgValue;
1457
- lg = lg > 12 && mode !== cardConfig.wrapperType.page ? 24 : lg;
1458
- lg = lg > 24 ? 24 : lg;
1459
- if (type === cardConfig.contentItemType.placeholder) {
1460
- return /*#__PURE__*/React.createElement(Col, {
1461
- key: contentItemKey,
1462
- lg: lg,
1463
- md: lg || md,
1464
- sm: lg || sm,
1465
- xs: lg || xs
1466
- });
1467
- }
1468
- if (type === cardConfig.contentItemType.divider) {
1469
- return /*#__PURE__*/React.createElement(Col, {
1470
- key: contentItemKey,
1471
- lg: lg,
1472
- md: lg || md,
1473
- sm: lg || sm,
1474
- xs: lg || xs
1475
- }, /*#__PURE__*/React.createElement(Divider, _objectSpread2(_objectSpread2({}, {
1476
- style: {
1477
- margin: '4px 0'
1478
- }
1479
- }), contentItem.otherProps || {}), (contentItem.text || null) == null ? null : contentItem.text));
1480
- }
1481
- if (type === cardConfig.contentItemType.customGrid) {
1482
- return /*#__PURE__*/React.createElement(Col, {
1483
- key: contentItemKey,
1484
- lg: lg,
1485
- md: lg || md,
1486
- sm: lg || sm,
1487
- xs: lg || xs
1488
- }, buildCustomGrid({
1489
- list: isArray(contentItem.list) ? contentItem.list : [],
1490
- props: _objectSpread2(_objectSpread2({}, {
1491
- bordered: true,
1492
- column: 3,
1493
- emptyStyle: {
1494
- color: '#cccccc'
1495
- },
1496
- emptyValue: '暂无',
1497
- labelStyle: {
1498
- width: '100px'
1499
- }
1500
- }), contentItem.props || {})
1501
- }));
1502
- }
1503
- if (type === cardConfig.contentItemType.tree) {
1504
- return /*#__PURE__*/React.createElement(Col, {
1505
- key: contentItemKey,
1506
- lg: lg,
1507
- md: lg || md,
1508
- sm: lg || sm,
1509
- xs: lg || xs
1510
- }, buildTree(contentItem));
1511
- }
1512
- if (type === cardConfig.contentItemType.tinymce) {
1513
- return /*#__PURE__*/React.createElement(Col, {
1514
- key: contentItemKey,
1515
- lg: lg,
1516
- md: lg || md,
1517
- sm: lg || sm,
1518
- xs: lg || xs
1519
- }, /*#__PURE__*/React.createElement(TinymceWrapper, {
1520
- apiKey: checkStringIsNullOrWhiteSpace(contentItem.apiKey || '') ? runtimeSettings.getTinymceApiKey() : contentItem.apiKey,
1521
- content: contentItem.html || '',
1522
- afterChange: contentItem.afterChange,
1523
- initConfig: contentItem.initConfig || null,
1524
- imagesUploadUrl: checkStringIsNullOrWhiteSpace(contentItem.imagesUploadUrl || '') ? runtimeSettings.getTinymceImagesUploadUrl() : contentItem.imagesUploadUrl
1525
- }));
1526
- }
1527
- if (type === cardConfig.contentItemType.html) {
1528
- return /*#__PURE__*/React.createElement(Col, {
1529
- key: contentItemKey,
1530
- lg: lg,
1531
- md: lg || md,
1532
- sm: lg || sm,
1533
- xs: lg || xs
1534
- }, /*#__PURE__*/React.createElement(HtmlBox, {
1535
- useEmpty: (contentItem.useEmpty || null) == null ? true : contentItem.useEmpty || false,
1536
- html: contentItem.html || ''
1537
- }));
1538
- }
1539
- if (type === cardConfig.contentItemType.imageUpload) {
1540
- var uploadProps = _objectSpread2(_objectSpread2({}, {
1541
- icon: contentItem.icon || null,
1542
- title: contentItem.title || '',
1543
- helper: contentItem.helper || '',
1544
- image: contentItem.image || '',
1545
- action: contentItem.action || '',
1546
- tokenSet: _this.getUploadTokenObject(),
1547
- multiple: contentItem.multiple || false,
1548
- fileList: contentItem.fileList || [],
1549
- showUploadList: contentItem.showUploadList || false,
1550
- listType: contentItem.listType || 'picture-card',
1551
- disabled: contentItem.disabled || false
1552
- }), contentItem.uploadProps || {});
1553
- return /*#__PURE__*/React.createElement(Col, {
1554
- key: contentItemKey,
1555
- lg: lg || 6,
1556
- md: md,
1557
- sm: sm,
1558
- xs: xs
1559
- }, /*#__PURE__*/React.createElement(ImageUpload, _extends({}, uploadProps, {
1560
- pretreatmentRemoteResponse: _this.pretreatmentImageUploadRemoteResponse,
1561
- afterUploadSuccess: function afterUploadSuccess(image) {
1562
- if (isFunction(contentItem.afterUploadSuccess)) {
1563
- contentItem.afterUploadSuccess(image);
1564
- }
1565
- },
1566
- onItemChange: contentItem.onItemChange || null,
1567
- onItemRemove: contentItem.onItemRemove || null
1568
- })));
1569
- }
1570
- if (type === cardConfig.contentItemType.imageShow) {
1571
- var imageBoxProps = _objectSpread2(_objectSpread2({}, {
1572
- loadingEffect: true,
1573
- errorOverlayVisible: true,
1574
- showErrorIcon: false,
1575
- alt: ''
1576
- }), contentItem.imageBoxProps || {});
1577
- var imageBoxContainorStyle = _objectSpread2(_objectSpread2({}, {
1578
- width: '100px',
1579
- border: '1px solid #d9d9d9',
1580
- borderRadius: '4px',
1581
- padding: '8px'
1582
- }), contentItem.imageBoxContainorStyle || {});
1583
- var imageBox = /*#__PURE__*/React.createElement(ImageBox, _extends({
1584
- src: contentItem.image || defaultEmptyImage,
1585
- preview: !stringIsEmpty(contentItem.image || '')
1586
- }, imageBoxProps));
1587
- return /*#__PURE__*/React.createElement(Col, {
1588
- key: contentItemKey,
1589
- lg: lg || 6,
1590
- md: md,
1591
- sm: sm,
1592
- xs: xs
1593
- }, /*#__PURE__*/React.createElement("div", {
1594
- style: imageBoxContainorStyle
1595
- }, imageBox));
1596
- }
1597
- if (type === cardConfig.contentItemType.imageListShow) {
1598
- var imageBoxListContainorStyle = null;
1599
- var _imageBoxProps = _objectSpread2(_objectSpread2({}, {
1600
- loadingEffect: true,
1601
- errorOverlayVisible: true,
1602
- showErrorIcon: false,
1603
- alt: ''
1604
- }), contentItem.imageBoxProps || {});
1605
- if ((contentItem.imageBoxListContainorStyle || null) != null) {
1606
- imageBoxListContainorStyle = contentItem.imageBoxListContainorStyle;
1607
- }
1608
- var _imageBoxContainorStyle = _objectSpread2(_objectSpread2({}, {
1609
- width: '100px',
1610
- border: '1px solid #d9d9d9',
1611
- borderRadius: '4px',
1612
- padding: '8px'
1613
- }), contentItem.imageBoxContainorStyle || {});
1614
- var imageItemShowList = [];
1615
- var ignoreEmpty = contentItem.ignoreEmpty || false;
1616
- (isArray(contentItem.imageList) ? contentItem.imageList : []).forEach(function (imageOne, imageIndex) {
1617
- var imageKey = "contentItem_".concat(contentIndex, "_imageList_item_").concat(imageIndex);
1618
- if (ignoreEmpty) {
1619
- if (!checkStringIsNullOrWhiteSpace(imageOne)) {
1620
- imageItemShowList.push({
1621
- key: imageKey,
1622
- imageBoxContainorStyle: _imageBoxContainorStyle,
1623
- component: /*#__PURE__*/React.createElement(ImageBox, _extends({
1624
- src: imageOne || defaultEmptyImage,
1625
- preview: !stringIsEmpty(imageOne || '')
1626
- }, _imageBoxProps))
1627
- });
1628
- }
1629
- } else {
1630
- imageItemShowList.push({
1631
- key: imageKey,
1632
- imageBoxContainorStyle: _imageBoxContainorStyle,
1633
- component: /*#__PURE__*/React.createElement(ImageBox, _extends({
1634
- src: imageOne || defaultEmptyImage,
1635
- preview: !stringIsEmpty(imageOne || '')
1636
- }, _imageBoxProps))
1637
- });
1638
- }
1639
- });
1640
- var imageListContainor = /*#__PURE__*/React.createElement(Space, null, imageItemShowList.length <= 0 ? /*#__PURE__*/React.createElement(Empty, {
1641
- image: Empty.PRESENTED_IMAGE_SIMPLE
1642
- }) : imageItemShowList.map(function (o) {
1643
- return /*#__PURE__*/React.createElement("div", {
1644
- key: o.key,
1645
- style: o.imageBoxContainorStyle
1646
- }, o.component);
1647
- }));
1648
- return /*#__PURE__*/React.createElement(Col, {
1649
- key: contentItemKey,
1650
- lg: lg || 6,
1651
- md: md,
1652
- sm: sm,
1653
- xs: xs
1654
- }, imageBoxListContainorStyle == null ? imageListContainor : /*#__PURE__*/React.createElement("div", {
1655
- style: imageBoxListContainorStyle
1656
- }, imageListContainor));
1657
- }
1658
- if (type === cardConfig.contentItemType.treeSelect) {
1659
- var _value$fileBase64$onC = _objectSpread2({}, {
1660
- value: contentItem.value || '',
1661
- fileBase64: contentItem.fileBase64 || '',
1662
- onChangeCallback: contentItem.onChangeCallback || null,
1663
- otherProps: _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}),
1664
- listData: contentItem.listData || [],
1665
- dataConvert: contentItem.dataConvert || null
1666
- }),
1667
- treeSelectValue = _value$fileBase64$onC.value,
1668
- onTreeSelectChangeCallback = _value$fileBase64$onC.onChangeCallback,
1669
- otherTreeSelectProps = _value$fileBase64$onC.otherProps,
1670
- treeSelectListData = _value$fileBase64$onC.listData,
1671
- treeSelectDataConvertor = _value$fileBase64$onC.dataConvert;
1672
- return /*#__PURE__*/React.createElement(Col, {
1673
- key: contentItemKey,
1674
- lg: lg || 6,
1675
- md: md,
1676
- sm: sm,
1677
- xs: xs
1678
- }, _this.renderFormInnerComponent(fieldData.label, buildTreeSelect({
1679
- value: treeSelectValue || null,
1680
- placeholder: buildFieldDescription(fieldData.label, '选择') || '请选择',
1681
- onChangeCallback: onTreeSelectChangeCallback,
1682
- otherProps: otherTreeSelectProps,
1683
- listData: treeSelectListData,
1684
- dataConvert: treeSelectDataConvertor
1685
- }), fieldData.helper, formItemLayout, require));
1686
- }
1687
- if (type === cardConfig.contentItemType.fileBase64Upload) {
1688
- var _uploadProps = _objectSpread2(_objectSpread2({}, contentItem.uploadProps || {}), {
1689
- fileBase64: contentItem.fileBase64 || '',
1690
- action: contentItem.action || '',
1691
- tokenSet: _this.getUploadTokenObject()
1692
- });
1693
- return /*#__PURE__*/React.createElement(Col, {
1694
- key: contentItemKey,
1695
- lg: lg || 6,
1696
- md: md,
1697
- sm: sm,
1698
- xs: xs
1699
- }, _this.renderFormInnerComponent(fieldData.label, /*#__PURE__*/React.createElement(FileBase64Upload, _extends({}, _uploadProps, {
1700
- pretreatmentRemoteResponse: _this.pretreatmentFileBase64UploadRemoteResponse,
1701
- afterUploadSuccess: function afterUploadSuccess(fileBase64) {
1702
- if (isFunction(contentItem.afterUploadSuccess)) {
1703
- contentItem.afterUploadSuccess(fileBase64);
1704
- }
1705
- }
1706
- })), fieldData.helper, null, require));
1707
- }
1708
- if (type === cardConfig.contentItemType.videoUpload) {
1709
- var _uploadProps2 = _objectSpread2(_objectSpread2({}, contentItem.uploadProps || {}), {
1710
- video: contentItem.video || '',
1711
- showPreview: contentItem.showPreview || false,
1712
- action: contentItem.action || '',
1713
- tokenSet: _this.getUploadTokenObject()
1714
- });
1715
- return /*#__PURE__*/React.createElement(Col, {
1716
- key: contentItemKey,
1717
- lg: lg || 6,
1718
- md: md,
1719
- sm: sm,
1720
- xs: xs
1721
- }, _this.renderFormInnerComponent(fieldData.label, /*#__PURE__*/React.createElement(VideoUpload, _extends({}, _uploadProps2, {
1722
- pretreatmentRemoteResponse: _this.pretreatmentVideoUploadRemoteResponse,
1723
- afterChangeSuccess: function afterChangeSuccess(video) {
1724
- if (isFunction(contentItem.afterChangeSuccess)) {
1725
- contentItem.afterChangeSuccess(video);
1726
- }
1727
- }
1728
- })), fieldData.helper, formItemLayout, require));
1729
- }
1730
- if (type === cardConfig.contentItemType.fileUpload) {
1731
- var _uploadProps3 = _objectSpread2(_objectSpread2({}, contentItem.uploadProps || {}), {
1732
- file: contentItem.file || '',
1733
- action: contentItem.action || '',
1734
- tokenSet: _this.getUploadTokenObject()
1735
- });
1736
- return /*#__PURE__*/React.createElement(Col, {
1737
- key: contentItemKey,
1738
- lg: lg || 6,
1739
- md: md,
1740
- sm: sm,
1741
- xs: xs
1742
- }, _this.renderFormInnerComponent(fieldData.label, /*#__PURE__*/React.createElement(FileUpload, _extends({}, _uploadProps3, {
1743
- pretreatmentRemoteResponse: _this.pretreatmentFileUploadRemoteResponse,
1744
- afterChangeSuccess: function afterChangeSuccess(file) {
1745
- if (isFunction(contentItem.afterChangeSuccess)) {
1746
- contentItem.afterChangeSuccess(file);
1747
- }
1748
- }
1749
- })), fieldData.helper, formItemLayout, require));
1750
- }
1751
- if (type === cardConfig.contentItemType.audioUpload) {
1752
- var _uploadProps4 = _objectSpread2(_objectSpread2({}, contentItem.uploadProps || {}), {
1753
- audio: contentItem.audio || '',
1754
- showPreview: contentItem.showPreview || false,
1755
- action: contentItem.action || '',
1756
- tokenSet: _this.getUploadTokenObject()
1757
- });
1758
- return /*#__PURE__*/React.createElement(Col, {
1759
- key: contentItemKey,
1760
- lg: lg || 6,
1761
- md: md,
1762
- sm: sm,
1763
- xs: xs
1764
- }, _this.renderFormInnerComponent(fieldData.label, /*#__PURE__*/React.createElement(AudioUpload, _extends({}, _uploadProps4, {
1765
- pretreatmentRemoteResponse: _this.pretreatmentAudioUploadRemoteResponse,
1766
- afterChangeSuccess: function afterChangeSuccess(audio) {
1767
- if (isFunction(contentItem.afterChangeSuccess)) {
1768
- contentItem.afterChangeSuccess(audio);
1769
- }
1770
- }
1771
- })), fieldData.helper, formItemLayout, require));
1772
- }
1773
- return /*#__PURE__*/React.createElement(Col, {
1774
- key: contentItemKey,
1775
- lg: lg || 6,
1776
- md: md,
1777
- sm: sm,
1778
- xs: xs
1779
- }, type === cardConfig.contentItemType.text ? _this.renderFormText(fieldData.label, contentItem.value || '', fieldData.helper, formItemLayout) : null, type === cardConfig.contentItemType.input ? _this.renderFormInput(fieldData.label, fieldData.name, require, fieldData.helper, contentItem.icon || iconBuilder.form(), _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), canOperate, formItemLayout) : null, type === cardConfig.contentItemType.password ? _this.renderFormPassword(fieldData.label, fieldData.name, require, fieldData.helper, contentItem.icon || iconBuilder.form(), _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), canOperate, formItemLayout) : null, type === cardConfig.contentItemType.inputNumber ? _this.renderFormInputNumber(fieldData.label, fieldData.name, require, fieldData.helper, contentItem.icon || iconBuilder.form(), _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), canOperate, formItemLayout) : null, type === cardConfig.contentItemType["switch"] ? _this.renderFormSwitch(fieldData.label, fieldData.name, require, fieldData.helper, _objectSpread2({}, contentItem.otherProps || {}), canOperate, formItemLayout) : null, type === cardConfig.contentItemType.flexText ? /*#__PURE__*/React.createElement(FlexText, _objectSpread2(_objectSpread2({}, {
1780
- style: {
1781
- margin: '5px 0'
1782
- }
1783
- }), contentItem.flexTextProps || {})) : null, type === cardConfig.contentItemType.onlyShowTextByFlexText ? /*#__PURE__*/React.createElement(FlexText, {
1784
- style: {
1785
- margin: '5px 0'
1786
- },
1787
- icon: null,
1788
- textPrefix: fieldData.label || '',
1789
- text: contentItem.value || ''
1790
- }) : null, type === cardConfig.contentItemType.datePicker ? _this.renderFormDatePicker(fieldData.label, fieldData.name, require, fieldData.helper, _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), canOperate, formItemLayout) : null, type === cardConfig.contentItemType.timePicker ? _this.renderFormTimePicker(fieldData.label, fieldData.name, require, fieldData.helper, _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), canOperate, formItemLayout) : null, type === cardConfig.contentItemType.textarea ? _this.renderFormTextArea(fieldData.label, fieldData.name, require, fieldData.helper, _objectSpread2(_objectSpread2({}, {
1791
- autoSize: {
1792
- minRows: 3,
1793
- maxRows: 5
1794
- }
1795
- }), contentItem.otherProps || {}), canOperate, formItemLayout) : null, type === cardConfig.contentItemType.onlyShowTextarea ? _this.renderFormOnlyShowTextarea(fieldData.label, contentItem.value, fieldData.helper || '', _objectSpread2(_objectSpread2(_objectSpread2({}, {
1796
- autoSize: {
1797
- minRows: 3,
1798
- maxRows: 5
1799
- }
1800
- }), contentItem.otherProps || {}), {
1801
- disabled: true,
1802
- placeholder: "\u6682\u65E0".concat(fieldData.label, "\u4FE1\u606F")
1803
- }), formItemLayout) : null, type === cardConfig.contentItemType.onlyShowInput ? _this.renderFormOnlyShowInput(fieldData.label, contentItem.value, fieldData.helper || '', contentItem.icon || iconBuilder.form(), _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), {
1804
- disabled: true,
1805
- placeholder: "\u6682\u65E0".concat(fieldData.label, "\u4FE1\u606F")
1806
- }), contentItem.canCopy || false ? {
1807
- addonAfter: _this.renderGeneralButton({
1808
- style: {
1809
- border: '0px solid #d9d9d9',
1810
- backgroundColor: '#fafafa',
1811
- height: '30px'
1812
- },
1813
- icon: null,
1814
- showIcon: false,
1815
- disabled: checkStringIsNullOrWhiteSpace(contentItem.value || ''),
1816
- text: '点击复制',
1817
- handleClick: function handleClick() {
1818
- copyToClipboard(contentItem.value || '');
1819
- }
1820
- })
1821
- } : {}), formItemLayout) : null, type === cardConfig.contentItemType.onlyShowInputDatetime ? _this.renderFormOnlyShowInput(fieldData.label, formatDatetime({
1822
- data: toDatetime(contentItem.value),
1823
- format: datetimeFormat.yearMonthDayHourMinute
1824
- }), fieldData.helper || '', contentItem.icon || iconBuilder.form(), _objectSpread2(_objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {}), {
1825
- disabled: true,
1826
- placeholder: "\u6682\u65E0".concat(fieldData.label, "\u4FE1\u606F")
1827
- }), formItemLayout) : null, type === cardConfig.contentItemType.select ? _this.renderFormSelect(fieldData.label, fieldData.name, function () {
1828
- return _this.renderFormOptionCore(refitCommonData(isFunction(contentItem.pretreatmentData) ? contentItem.pretreatmentData(isArray(contentItem.listData) ? contentItem.listData : []) : isArray(contentItem.listData) ? contentItem.listData : []));
1829
- }, fieldData.helper || '', isFunction(contentItem.onChangeCallback) ? contentItem.onChangeCallback : null, formItemLayout, true, _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {})) : null, type === cardConfig.contentItemType.whetherSelect ? renderFormWhetherSelect({
1830
- label: fieldData.label,
1831
- name: fieldData.name,
1832
- helper: fieldData.helper,
1833
- onChangeCallback: contentItem.onChangeCallback,
1834
- formItemLayout: formItemLayout,
1835
- required: true,
1836
- otherProps: _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {})
1837
- }) : null, type === cardConfig.contentItemType.customSelect ? contentItem.component : null, type === cardConfig.contentItemType.flexSelect ? buildCustomSelect(contentItem) : null, type === cardConfig.contentItemType.radio ? _this.renderFormSelect(fieldData.label, fieldData.name, function () {
1838
- return _this.renderFormRadioCore(refitCommonData(isArray(contentItem.listData) ? contentItem.listData : []));
1839
- }, fieldData.helper || '', isFunction(contentItem.onChangeCallback) ? contentItem.onChangeCallback : null, formItemLayout, true, _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {})) : null, type === cardConfig.contentItemType.whetherRadio ? _this.renderFormWhetherRadio(fieldData.label, fieldData.name, fieldData.helper, contentItem.onChangeCallback, formItemLayout, true, _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {})) : null, type === cardConfig.contentItemType.customRadio ? contentItem.component : null, type === cardConfig.contentItemType.onlyShowText ? _this.renderFormOnlyShowText(fieldData.label, contentItem.value, (isUndefined(contentItem.showHelper) ? false : contentItem.showHelper || false) ? fieldData.helper || '' : '', formItemLayout) : null, type === cardConfig.contentItemType.innerComponent ? _this.renderFormInnerComponent(fieldData.label, contentItem.component, fieldData.helper, formItemLayout, require) : null, type === cardConfig.contentItemType.save ? _this.renderFormActionItem(_this.renderSaveButton(contentItem.config || {}), formItemLayout) : null, type === cardConfig.contentItemType.button ? _this.renderFormButton(contentItem.config || {}, formItemLayout) : null, type === cardConfig.contentItemType.actionList ? /*#__PURE__*/React.createElement(Space, {
1840
- split: isBoolean(contentItem.split || false) ? contentItem.split || false ? /*#__PURE__*/React.createElement(Divider, {
1841
- type: "vertical"
1842
- }) : null : contentItem.split
1843
- }, _this.buildByExtraBuildType({
1844
- keyPrefix: "form_card_".concat(contentIndex, "_action_key"),
1845
- configList: contentItem.config || []
1846
- })) : null, type === cardConfig.contentItemType.component ? contentItem.component || null : null, type === cardConfig.contentItemType.jsonView ? _this.renderJsonView(contentItem.value) : null, type === cardConfig.contentItemType.syntaxHighlighterView ? _this.renderFormOnlyShowSyntaxHighlighter(contentItem.language, fieldData.label, contentItem.value, fieldData.helper, formItemLayout, require, _objectSpread2(_objectSpread2({}, {}), contentItem.otherProps || {})) : null, type === cardConfig.contentItemType.nowTime ? _this.renderFormNowTimeField({
1847
- formItemLayout: formItemLayout
1848
- }) : null);
1849
- }) : null);
1850
- };
1851
- _this.buildByExtraBuildType = function (_ref9) {
1852
- var _ref9$keyPrefix = _ref9.keyPrefix,
1853
- keyPrefix = _ref9$keyPrefix === void 0 ? '' : _ref9$keyPrefix,
1854
- configList = _ref9.configList;
1855
- var list = [];
1856
- (isArray(configList) ? configList : []).forEach(function (item, index) {
1857
- if ((item || null) != null) {
1858
- var _hidden$buildType$ico = _objectSpread2(_objectSpread2({}, {
1859
- hidden: false,
1860
- buildType: null,
1861
- icon: null,
1862
- text: '',
1863
- component: null
1864
- }), item),
1865
- hidden = _hidden$buildType$ico.hidden,
1866
- buildType = _hidden$buildType$ico.buildType,
1867
- componentSource = _hidden$buildType$ico.component;
1868
- if (!hidden) {
1869
- var itemKey = "".concat(keyPrefix, "_").concat(index);
1870
- var itemAdjust = item;
1871
- switch (buildType) {
1872
- case extraBuildType.refresh:
1873
- itemAdjust = _this.renderRefreshButton(item);
1874
- break;
1875
- case extraBuildType.save:
1876
- itemAdjust = _this.renderSaveButton(item);
1877
- break;
1878
- case cardConfig.extraBuildType.generalButton:
1879
- itemAdjust = _this.renderGeneralButton(item);
1880
- break;
1881
- case extraBuildType.flexSelect:
1882
- itemAdjust = buildCustomSelect(item);
1883
- break;
1884
- case extraBuildType.button:
1885
- itemAdjust = buildButton(item);
1886
- break;
1887
- case extraBuildType.dropdown:
1888
- itemAdjust = buildDropdown(item);
1889
- break;
1890
- case extraBuildType.dropdownButton:
1891
- itemAdjust = buildDropdownButton(item);
1892
- break;
1893
- case extraBuildType.dropdownEllipsis:
1894
- itemAdjust = buildDropdownEllipsis(item);
1895
- break;
1896
- case extraBuildType.iconInfo:
1897
- itemAdjust = /*#__PURE__*/React.createElement("div", {
1898
- style: {
1899
- padding: '0 8px'
1900
- }
1901
- }, /*#__PURE__*/React.createElement(IconInfo, item));
1902
- break;
1903
- case extraBuildType.colorText:
1904
- itemAdjust = /*#__PURE__*/React.createElement("div", {
1905
- style: {
1906
- padding: '0 8px'
1907
- }
1908
- }, /*#__PURE__*/React.createElement(ColorText, item));
1909
- break;
1910
- case extraBuildType.component:
1911
- itemAdjust = componentSource || null;
1912
- break;
1913
- default:
1914
- logObject({
1915
- message: '未找到匹配的构建模式',
1916
- buildType: extraBuildType.component,
1917
- config: item
1918
- });
1919
- itemAdjust = null;
1920
- break;
1921
- }
1922
- list.push( /*#__PURE__*/React.createElement(Fragment, {
1923
- key: itemKey
1924
- }, itemAdjust));
1925
- }
1926
- }
1927
- });
1928
- return list;
1929
- };
1930
- _this.establishExtraActionConfig = function () {
1931
- return null;
1932
- };
1933
- _this.establishExtraActionGroupConfig = function () {
1934
- return null;
1935
- };
1936
- _this.establishExtraActionEllipsisConfig = function () {
1937
- return null;
1938
- };
1939
- _this.buildExtraBackAction = function () {
1940
- return null;
1941
- };
1942
- _this.buildExtraAction = function () {
1943
- var _this$state2 = _this.state,
1944
- dataLoading = _this$state2.dataLoading,
1945
- reloading = _this$state2.reloading,
1946
- refreshing = _this$state2.refreshing,
1947
- showReloadButton = _this$state2.showReloadButton;
1948
- var _keyPrefix$list$_this = _objectSpread2(_objectSpread2({}, {
1949
- keyPrefix: '',
1950
- list: []
1951
- }), _this.establishExtraActionConfig()),
1952
- keyPrefix = _keyPrefix$list$_this.keyPrefix,
1953
- configList = _keyPrefix$list$_this.list;
1954
- var keyPrefixAdjust = keyPrefix || 'extraActionItem';
1955
- var listAction = _this.buildByExtraBuildType({
1956
- keyPrefix: keyPrefixAdjust,
1957
- configList: configList
1958
- });
1959
- var buttonGroupData = _this.establishExtraActionGroupConfig();
1960
- if ((buttonGroupData || null) != null) {
1961
- var buttonGroup = buildButtonGroup(buttonGroupData);
1962
- if ((buttonGroup || null) != null) {
1963
- listAction.push( /*#__PURE__*/React.createElement(Fragment, {
1964
- key: "".concat(keyPrefixAdjust, "_buttonGroup")
1965
- }, buttonGroup));
1966
- }
1967
- }
1968
- var ellipsisActionData = _this.establishExtraActionEllipsisConfig();
1969
- if ((ellipsisActionData || null) != null) {
1970
- var dropdownEllipsis = buildDropdownEllipsis(ellipsisActionData);
1971
- if ((dropdownEllipsis || null) != null) {
1972
- listAction.push( /*#__PURE__*/React.createElement(Fragment, {
1973
- key: "".concat(keyPrefixAdjust, "_dropdownEllipsis")
1974
- }, dropdownEllipsis));
1975
- }
1976
- }
1977
- var backAction = _this.buildExtraBackAction();
1978
- if ((backAction || null) != null) {
1979
- listAction.push( /*#__PURE__*/React.createElement(Fragment, {
1980
- key: "".concat(keyPrefixAdjust, "_dropdownEllipsis")
1981
- }, backAction));
1982
- }
1983
- if (showReloadButton) {
1984
- listAction.push( /*#__PURE__*/React.createElement(Fragment, {
1985
- key: "".concat(keyPrefixAdjust, "_dropdownEllipsis")
1986
- }, /*#__PURE__*/React.createElement(Tooltip, {
1987
- placement: "top",
1988
- title: "\u5237\u65B0"
1989
- }, /*#__PURE__*/React.createElement(Button, {
1990
- disabled: dataLoading || reloading || refreshing,
1991
- type: "dashed",
1992
- onClick: function onClick() {
1993
- _this.reloadData();
1994
- }
1995
- }, reloading || refreshing ? iconBuilder.loading() : iconBuilder.reload()))));
1996
- }
1997
- return /*#__PURE__*/React.createElement(Space, {
1998
- split: !!_this.showExtraActionDivider || false ? /*#__PURE__*/React.createElement(Divider, {
1999
- type: "vertical"
2000
- }) : null
2001
- }, listAction.map(function (o) {
2002
- return o;
2003
- }));
2004
- };
2005
- var defaultState = defaultCommonState();
2006
- _this.state = _objectSpread2(_objectSpread2({}, defaultState), {
2007
- backPath: '',
2008
- showReloadButton: false
2009
- });
2010
- metaData = getMetaData();
2011
- return _this;
2012
- }
2013
- _createClass(Common, [{
2014
- key: "getRequestingData",
2015
- value: function getRequestingData() {
2016
- return this.lastRequestingData;
2017
- }
2018
- }, {
2019
- key: "setRequestingData",
2020
- value: function setRequestingData(params, callback) {
2021
- var d = params == null ? {
2022
- type: '',
2023
- payload: {}
2024
- } : _objectSpread2(_objectSpread2({}, {
2025
- type: '',
2026
- payload: {}
2027
- }), params);
2028
- this.lastRequestingData = d;
2029
- if (isFunction(callback)) {
2030
- callback();
2031
- }
2032
- }
2033
- }, {
2034
- key: "clearRequestingData",
2035
- value: function clearRequestingData() {
2036
- this.setRequestingData({
2037
- type: '',
2038
- payload: {}
2039
- });
2040
- }
2041
- }, {
2042
- key: "checkWorkDoing",
2043
- value: function checkWorkDoing() {
2044
- var _this$state3 = this.state,
2045
- dataLoading = _this$state3.dataLoading,
2046
- reloading = _this$state3.reloading,
2047
- searching = _this$state3.searching,
2048
- refreshing = _this$state3.refreshing,
2049
- paging = _this$state3.paging,
2050
- processing = _this$state3.processing;
2051
- if (dataLoading || reloading || searching || refreshing || paging || processing) {
2052
- var text = '数据正在处理中,请稍等一下再点哦';
2053
- showErrorMessage({
2054
- message: text
2055
- });
2056
- return true;
2057
- }
2058
- return false;
2059
- }
2060
- }, {
2061
- key: "reloadByUrl",
2062
- value: function reloadByUrl() {
2063
- var pathname = this.props.location.pathname;
2064
- this.redirectToPath(pathname.replace('/load/', '/update/'));
2065
- }
2066
- }], [{
2067
- key: "getDerivedStateFromProps",
2068
- value: function getDerivedStateFromProps(nextProps, prevState) {
2069
- return getDerivedStateFromPropsForUrlParams(nextProps, prevState);
2070
- }
2071
- }]);
2072
- return Common;
2073
- }(Core);
2074
-
2075
- export { Common as C, _extends as _ };