@zhubangyun/lowcode-core 5.6.214 → 5.7.301
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/page-loading/index.less +2 -2
- package/es/index.d.ts +2 -1
- package/es/index.js +7 -1
- package/es/style.js +2 -1
- package/es/utils/api/form-api.js +87 -33
- package/es/utils/api/rest-api.js +45 -2
- package/es/utils/cache/schema.js +15 -3
- package/es/utils/page/page-form-data-manager.d.ts +7 -1
- package/es/utils/page/page-form-data-manager.js +10 -8
- package/es/utils/page/page-layout.js +8 -3
- package/es/utils/page/page-load-schema.js +2 -1
- package/lib/components/page-loading/index.less +2 -2
- package/lib/index.d.ts +2 -1
- package/lib/index.js +11 -2
- package/lib/style.js +2 -1
- package/lib/utils/api/form-api.js +87 -33
- package/lib/utils/api/rest-api.js +45 -2
- package/lib/utils/cache/schema.js +15 -3
- package/lib/utils/page/page-form-data-manager.d.ts +7 -1
- package/lib/utils/page/page-form-data-manager.js +10 -8
- package/lib/utils/page/page-layout.js +8 -3
- package/lib/utils/page/page-load-schema.js +2 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
top: 0;
|
|
6
6
|
left: 0;
|
|
7
7
|
z-index: 10;
|
|
8
|
-
background:
|
|
8
|
+
background: rgba(255, 255, 255, 0.5);
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
align-items: center;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
width: 100%;
|
|
17
17
|
height: 100%;
|
|
18
18
|
z-index: 10;
|
|
19
|
-
background:
|
|
19
|
+
background: rgba(255, 255, 255, 0.5);
|
|
20
20
|
display: flex;
|
|
21
21
|
justify-content: center;
|
|
22
22
|
align-items: center;
|
package/es/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
2
|
import utils from "./utils";
|
|
3
|
+
import * as lodash from "lodash";
|
|
3
4
|
export { LoadMaterials } from "./components/load-materials";
|
|
4
5
|
export { PageLoading } from "./components/page-loading";
|
|
5
6
|
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
6
7
|
export { Layout } from "./components/layout";
|
|
7
8
|
export { ReactRender } from "./components/react-render";
|
|
8
|
-
export { utils };
|
|
9
|
+
export { utils, lodash };
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
2
|
import utils from "./utils";
|
|
3
3
|
import { ReactRender } from "./components/react-render";
|
|
4
|
+
import * as lodash from "lodash";
|
|
4
5
|
export { LoadMaterials } from "./components/load-materials";
|
|
5
6
|
export { PageLoading } from "./components/page-loading";
|
|
6
7
|
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
@@ -10,4 +11,9 @@ export { ReactRender } from "./components/react-render";
|
|
|
10
11
|
window.utils = utils;
|
|
11
12
|
// @ts-ignore
|
|
12
13
|
window.__ReactRender = ReactRender;
|
|
13
|
-
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
if (window._) {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
window.lodash = window._;
|
|
18
|
+
}
|
|
19
|
+
export { utils, lodash };
|
package/es/style.js
CHANGED
package/es/utils/api/form-api.js
CHANGED
|
@@ -90,6 +90,7 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
90
90
|
return this.initialize();
|
|
91
91
|
case 2:
|
|
92
92
|
config.params = config.params || {};
|
|
93
|
+
config.params.description = "" + this.title;
|
|
93
94
|
config.params.formId = this.formId;
|
|
94
95
|
if (this.fieldId) {
|
|
95
96
|
config.params.fieldId = this.fieldId;
|
|
@@ -97,7 +98,7 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
97
98
|
if (this.mock) {
|
|
98
99
|
config.params.mock = this.mock;
|
|
99
100
|
}
|
|
100
|
-
case
|
|
101
|
+
case 7:
|
|
101
102
|
case "end":
|
|
102
103
|
return _context2.stop();
|
|
103
104
|
}
|
|
@@ -115,12 +116,21 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
115
116
|
while (1) switch (_context3.prev = _context3.next) {
|
|
116
117
|
case 0:
|
|
117
118
|
_context3.next = 2;
|
|
118
|
-
return
|
|
119
|
+
return this.initialize();
|
|
119
120
|
case 2:
|
|
121
|
+
_context3.next = 4;
|
|
122
|
+
return this.request.post("search", params, {
|
|
123
|
+
params: {
|
|
124
|
+
description: this.title + "\u67E5\u8BE2",
|
|
125
|
+
formId: this.formId,
|
|
126
|
+
fieldId: this.fieldId
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
case 4:
|
|
120
130
|
res = _context3.sent;
|
|
121
|
-
|
|
131
|
+
assembleAssociationField(res.data, res.refs);
|
|
122
132
|
return _context3.abrupt("return", res);
|
|
123
|
-
case
|
|
133
|
+
case 7:
|
|
124
134
|
case "end":
|
|
125
135
|
return _context3.stop();
|
|
126
136
|
}
|
|
@@ -141,9 +151,10 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
141
151
|
return _RestApi.prototype.getById.call(this, id, options);
|
|
142
152
|
case 2:
|
|
143
153
|
res = _context4.sent;
|
|
144
|
-
|
|
154
|
+
assembleAssociationField(res.data, res.refs);
|
|
155
|
+
console.debug("formApi.getById", res);
|
|
145
156
|
return _context4.abrupt("return", res);
|
|
146
|
-
case
|
|
157
|
+
case 6:
|
|
147
158
|
case "end":
|
|
148
159
|
return _context4.stop();
|
|
149
160
|
}
|
|
@@ -222,40 +233,83 @@ function assembleAssociationField(data, refs) {
|
|
|
222
233
|
for (var _iterator = _createForOfIteratorHelperLoose(refs), _step; !(_step = _iterator()).done;) {
|
|
223
234
|
var ref = _step.value;
|
|
224
235
|
var dataMap = new Map();
|
|
225
|
-
for (var
|
|
226
|
-
var datum =
|
|
236
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(ref.data), _step4; !(_step4 = _iterator4()).done;) {
|
|
237
|
+
var datum = _step4.value;
|
|
227
238
|
dataMap.set(datum.id, datum);
|
|
228
239
|
}
|
|
229
|
-
for (var
|
|
230
|
-
var fieldId =
|
|
240
|
+
for (var _iterator5 = _createForOfIteratorHelperLoose(ref.fieldIds), _step5; !(_step5 = _iterator5()).done;) {
|
|
241
|
+
var fieldId = _step5.value;
|
|
231
242
|
fieldIdDataMap.set(fieldId + "Id", dataMap);
|
|
232
243
|
}
|
|
233
244
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
245
|
+
//组装refs的关联属性
|
|
246
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(refs), _step2; !(_step2 = _iterator2()).done;) {
|
|
247
|
+
var _ref = _step2.value;
|
|
248
|
+
var key = _ref.form.id;
|
|
249
|
+
if (_ref.form.fieldId) {
|
|
250
|
+
key += "." + _ref.form.fieldId;
|
|
251
|
+
}
|
|
252
|
+
assembleAssociationFieldValue(_ref.data, fieldIdDataMap, key);
|
|
253
|
+
}
|
|
254
|
+
function loopAssembleAssociation(values) {
|
|
255
|
+
if (!Array.isArray(values)) {
|
|
256
|
+
if (values !== null && values !== void 0 && values.id) {
|
|
257
|
+
loopAssembleAssociation([values]);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (Array.isArray(values)) {
|
|
261
|
+
var _values$;
|
|
262
|
+
if ((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.id) {
|
|
263
|
+
assembleAssociationFieldValue(values, fieldIdDataMap);
|
|
264
|
+
//处理子表
|
|
265
|
+
for (var _iterator3 = _createForOfIteratorHelperLoose(values), _step3; !(_step3 = _iterator3()).done;) {
|
|
266
|
+
var value = _step3.value;
|
|
267
|
+
for (var _i = 0, _Object$values = Object.values(value); _i < _Object$values.length; _i++) {
|
|
268
|
+
var subValues = _Object$values[_i];
|
|
269
|
+
if (Array.isArray(subValues)) {
|
|
270
|
+
loopAssembleAssociation(subValues);
|
|
271
|
+
}
|
|
250
272
|
}
|
|
251
|
-
value[fieldIdName.slice(0, -2)] = fieldValue;
|
|
252
273
|
}
|
|
253
|
-
};
|
|
254
|
-
for (var _i = 0, _Object$keys = Object.keys(value); _i < _Object$keys.length; _i++) {
|
|
255
|
-
_loop();
|
|
256
274
|
}
|
|
257
275
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
276
|
+
}
|
|
277
|
+
loopAssembleAssociation(data);
|
|
278
|
+
}
|
|
279
|
+
function assembleAssociationFieldValue(data, fieldIdDataMap, prefixKey) {
|
|
280
|
+
var arrayData = [];
|
|
281
|
+
if (Array.isArray(data)) {
|
|
282
|
+
arrayData = data;
|
|
283
|
+
} else if (typeof data == "object") {
|
|
284
|
+
arrayData = [data];
|
|
285
|
+
}
|
|
286
|
+
for (var _iterator6 = _createForOfIteratorHelperLoose(arrayData), _step6; !(_step6 = _iterator6()).done;) {
|
|
287
|
+
var item = _step6.value;
|
|
288
|
+
var _loop = function _loop() {
|
|
289
|
+
var fieldIdName = _Object$keys[_i2];
|
|
290
|
+
var fieldIdKey = fieldIdName;
|
|
291
|
+
if (prefixKey) {
|
|
292
|
+
fieldIdKey = prefixKey + "." + fieldIdName;
|
|
293
|
+
}
|
|
294
|
+
var dataMap = fieldIdDataMap.get(fieldIdKey);
|
|
295
|
+
if (dataMap) {
|
|
296
|
+
var fieldIdValue = item[fieldIdName];
|
|
297
|
+
var fieldValue = null;
|
|
298
|
+
if (Array.isArray(fieldIdValue)) {
|
|
299
|
+
// @ts-ignore
|
|
300
|
+
fieldValue = fieldIdValue.map(function (id) {
|
|
301
|
+
return dataMap.get(id);
|
|
302
|
+
}).filter(function (v) {
|
|
303
|
+
return !!v;
|
|
304
|
+
});
|
|
305
|
+
} else if (typeof fieldIdValue == "string") {
|
|
306
|
+
fieldValue = dataMap.get(fieldIdValue);
|
|
307
|
+
}
|
|
308
|
+
item[fieldIdName.slice(0, -2)] = fieldValue;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
for (var _i2 = 0, _Object$keys = Object.keys(item); _i2 < _Object$keys.length; _i2++) {
|
|
312
|
+
_loop();
|
|
313
|
+
}
|
|
314
|
+
}
|
|
261
315
|
}
|
package/es/utils/api/rest-api.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
2
|
+
import _notification from "antd/es/notification";
|
|
3
|
+
import _Modal from "antd/es/modal";
|
|
2
4
|
import _message from "antd/es/message";
|
|
3
5
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
@@ -286,16 +288,57 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
286
288
|
}();
|
|
287
289
|
_proto.showError = /*#__PURE__*/function () {
|
|
288
290
|
var _showError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(type, msg) {
|
|
291
|
+
var _JSON$parse, _type, message;
|
|
289
292
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
290
293
|
while (1) switch (_context7.prev = _context7.next) {
|
|
291
294
|
case 0:
|
|
295
|
+
_context7.prev = 0;
|
|
296
|
+
if (!msg) {
|
|
297
|
+
_context7.next = 16;
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
_JSON$parse = JSON.parse(msg), _type = _JSON$parse.type, message = _JSON$parse.message;
|
|
301
|
+
if (!(_type == "message")) {
|
|
302
|
+
_context7.next = 8;
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
_message.error({
|
|
306
|
+
type: "error",
|
|
307
|
+
content: message
|
|
308
|
+
});
|
|
309
|
+
return _context7.abrupt("return");
|
|
310
|
+
case 8:
|
|
311
|
+
if (!(_type == "modal")) {
|
|
312
|
+
_context7.next = 13;
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
_Modal.error({
|
|
316
|
+
content: message
|
|
317
|
+
});
|
|
318
|
+
return _context7.abrupt("return");
|
|
319
|
+
case 13:
|
|
320
|
+
if (!(_type == "notification")) {
|
|
321
|
+
_context7.next = 16;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
_notification.error({
|
|
325
|
+
message: message
|
|
326
|
+
});
|
|
327
|
+
return _context7.abrupt("return");
|
|
328
|
+
case 16:
|
|
329
|
+
_context7.next = 20;
|
|
330
|
+
break;
|
|
331
|
+
case 18:
|
|
332
|
+
_context7.prev = 18;
|
|
333
|
+
_context7.t0 = _context7["catch"](0);
|
|
334
|
+
case 20:
|
|
292
335
|
console.error("{" + this.title + "}" + type + (msg || ""));
|
|
293
336
|
_message === null || _message === void 0 ? void 0 : _message.error("{" + this.title + "}" + type + (msg || "")).then();
|
|
294
|
-
case
|
|
337
|
+
case 22:
|
|
295
338
|
case "end":
|
|
296
339
|
return _context7.stop();
|
|
297
340
|
}
|
|
298
|
-
}, _callee7, this);
|
|
341
|
+
}, _callee7, this, [[0, 18]]);
|
|
299
342
|
}));
|
|
300
343
|
function showError(_x13, _x14) {
|
|
301
344
|
return _showError.apply(this, arguments);
|
package/es/utils/cache/schema.js
CHANGED
|
@@ -16,13 +16,25 @@ function _handleFormSchema() {
|
|
|
16
16
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
19
|
+
if (!(schema.type !== "form")) {
|
|
20
|
+
_context.next = 2;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
return _context.abrupt("return");
|
|
24
|
+
case 2:
|
|
25
|
+
if (schema !== null && schema !== void 0 && schema.componentName) {
|
|
26
|
+
_context.next = 4;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
return _context.abrupt("return");
|
|
30
|
+
case 4:
|
|
19
31
|
fdmItems = [];
|
|
20
32
|
fieldIdMap = new Map();
|
|
21
33
|
schema.state = schema.state || {};
|
|
22
34
|
schema.methods = schema.methods || {};
|
|
23
|
-
_context.next =
|
|
35
|
+
_context.next = 10;
|
|
24
36
|
return handleAssociationForm(schema);
|
|
25
|
-
case
|
|
37
|
+
case 10:
|
|
26
38
|
//初次处理
|
|
27
39
|
forEachFormSchema(schema, function (field) {
|
|
28
40
|
if (field.fdmSchema) {
|
|
@@ -69,7 +81,7 @@ function _handleFormSchema() {
|
|
|
69
81
|
return true;
|
|
70
82
|
});
|
|
71
83
|
});
|
|
72
|
-
case
|
|
84
|
+
case 12:
|
|
73
85
|
case "end":
|
|
74
86
|
return _context.stop();
|
|
75
87
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page-layout";
|
|
2
|
-
export declare type PageFormDataManagerModeType = "dataManager" | "selectOne" | "selectMore";
|
|
2
|
+
export declare type PageFormDataManagerModeType = "associationField" | "dataManager" | "selectOne" | "selectMore";
|
|
3
3
|
export interface ShowPageFormDataManagerProps {
|
|
4
4
|
container?: HTMLDivElement;
|
|
5
5
|
layout?: PageLayoutType;
|
|
@@ -8,6 +8,12 @@ export interface ShowPageFormDataManagerProps {
|
|
|
8
8
|
fieldId?: string;
|
|
9
9
|
};
|
|
10
10
|
mode?: PageFormDataManagerModeType;
|
|
11
|
+
extraProps?: any;
|
|
11
12
|
onClose?: () => void | Promise<void>;
|
|
13
|
+
onSearch?: (params: any[]) => void | Promise<void>;
|
|
14
|
+
onLoadData?: (response: {
|
|
15
|
+
data: any[];
|
|
16
|
+
total: number;
|
|
17
|
+
}) => void | Promise<void>;
|
|
12
18
|
}
|
|
13
19
|
export declare function showFormDataManager(options: ShowPageFormDataManagerProps): Promise<any | any[]>;
|
|
@@ -22,7 +22,7 @@ function _showFormDataManager() {
|
|
|
22
22
|
case 0:
|
|
23
23
|
return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
|
|
24
24
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve, reject) {
|
|
25
|
-
var container, onClose, restProps, unmount, _options$form, paths, mode,
|
|
25
|
+
var container, onClose, restProps, unmount, _options$form, paths, mode, _params, url, page;
|
|
26
26
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
27
27
|
while (1) switch (_context2.prev = _context2.next) {
|
|
28
28
|
case 0:
|
|
@@ -38,8 +38,8 @@ function _showFormDataManager() {
|
|
|
38
38
|
}
|
|
39
39
|
paths = window.location.pathname.split("/");
|
|
40
40
|
mode = options.mode;
|
|
41
|
-
|
|
42
|
-
url = "/" + paths[1] + "/" + paths[2] + "/" + ((_options$form = options.form) === null || _options$form === void 0 ? void 0 : _options$form.id) + "/" + mode + "?" +
|
|
41
|
+
_params = new URLSearchParams();
|
|
42
|
+
url = "/" + paths[1] + "/" + paths[2] + "/" + ((_options$form = options.form) === null || _options$form === void 0 ? void 0 : _options$form.id) + "/" + mode + "?" + _params.toString();
|
|
43
43
|
_context2.next = 10;
|
|
44
44
|
return openPage(url, url);
|
|
45
45
|
case 10:
|
|
@@ -59,18 +59,19 @@ function _showFormDataManager() {
|
|
|
59
59
|
while (1) switch (_context.prev = _context.next) {
|
|
60
60
|
case 0:
|
|
61
61
|
resolve(null);
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
64
|
+
}, 10);
|
|
62
65
|
if (unmount) {
|
|
63
66
|
//等待动画结束
|
|
64
67
|
setTimeout(function () {
|
|
65
68
|
var _container;
|
|
66
|
-
//取消挂载
|
|
67
|
-
ReactDOM.unmountComponentAtNode(container);
|
|
68
69
|
//移除
|
|
69
70
|
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
70
|
-
},
|
|
71
|
+
}, 100);
|
|
71
72
|
}
|
|
72
73
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
73
|
-
case
|
|
74
|
+
case 4:
|
|
74
75
|
case "end":
|
|
75
76
|
return _context.stop();
|
|
76
77
|
}
|
|
@@ -116,8 +117,9 @@ var FormDataManagerRender = /*#__PURE__*/function (_Component) {
|
|
|
116
117
|
onSelectOk = _this$props.onSelectOk,
|
|
117
118
|
onClose = _this$props.onClose,
|
|
118
119
|
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
120
|
+
|
|
119
121
|
// @ts-ignore
|
|
120
|
-
restProps.layout = layout || "
|
|
122
|
+
restProps.layout = layout || "modal";
|
|
121
123
|
// @ts-ignore
|
|
122
124
|
restProps.onClose = function () {
|
|
123
125
|
var _self$layoutRef;
|
|
@@ -18,9 +18,11 @@ export var PageLayout = /*#__PURE__*/function (_Component) {
|
|
|
18
18
|
return Math.min(window.innerWidth, 1440);
|
|
19
19
|
};
|
|
20
20
|
_this.handleResize = function () {
|
|
21
|
-
_this.
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
if (_this.props.layout == "drawer") {
|
|
22
|
+
_this.setState({
|
|
23
|
+
width: _this.getWith()
|
|
24
|
+
});
|
|
25
|
+
}
|
|
24
26
|
};
|
|
25
27
|
_this.state.width = _this.getWith();
|
|
26
28
|
return _this;
|
|
@@ -44,6 +46,7 @@ export var PageLayout = /*#__PURE__*/function (_Component) {
|
|
|
44
46
|
onClose: this.close,
|
|
45
47
|
footer: false,
|
|
46
48
|
closable: false,
|
|
49
|
+
style: {},
|
|
47
50
|
styles: {
|
|
48
51
|
header: {
|
|
49
52
|
display: "none"
|
|
@@ -58,6 +61,8 @@ export var PageLayout = /*#__PURE__*/function (_Component) {
|
|
|
58
61
|
maskClosable: false
|
|
59
62
|
};
|
|
60
63
|
if (layout == "modal") {
|
|
64
|
+
restProps.style.top = 64;
|
|
65
|
+
restProps.styles.body.maxHeight = "calc(100vh - 180px)";
|
|
61
66
|
return /*#__PURE__*/React.createElement(_Modal, restProps, children);
|
|
62
67
|
} else if (layout == "drawer") {
|
|
63
68
|
return /*#__PURE__*/React.createElement(_Drawer, restProps, children);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
top: 0;
|
|
6
6
|
left: 0;
|
|
7
7
|
z-index: 10;
|
|
8
|
-
background:
|
|
8
|
+
background: rgba(255, 255, 255, 0.5);
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
align-items: center;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
width: 100%;
|
|
17
17
|
height: 100%;
|
|
18
18
|
z-index: 10;
|
|
19
|
-
background:
|
|
19
|
+
background: rgba(255, 255, 255, 0.5);
|
|
20
20
|
display: flex;
|
|
21
21
|
justify-content: center;
|
|
22
22
|
align-items: center;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
2
|
import utils from "./utils";
|
|
3
|
+
import * as lodash from "lodash";
|
|
3
4
|
export { LoadMaterials } from "./components/load-materials";
|
|
4
5
|
export { PageLoading } from "./components/page-loading";
|
|
5
6
|
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
6
7
|
export { Layout } from "./components/layout";
|
|
7
8
|
export { ReactRender } from "./components/react-render";
|
|
8
|
-
export { utils };
|
|
9
|
+
export { utils, lodash };
|
package/lib/index.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.apiRequest = exports.RestFormApi = exports.RestApi = exports.PageLoading = exports.LoadMaterials = exports.Layout = void 0;
|
|
5
|
+
exports.lodash = exports.apiRequest = exports.RestFormApi = exports.RestApi = exports.PageLoading = exports.LoadMaterials = exports.Layout = void 0;
|
|
6
6
|
require("./index.less");
|
|
7
7
|
var _utils = _interopRequireDefault(require("./utils"));
|
|
8
8
|
exports.utils = _utils["default"];
|
|
9
9
|
var _reactRender = require("./components/react-render");
|
|
10
10
|
exports.ReactRender = _reactRender.ReactRender;
|
|
11
|
+
var lodash = _interopRequireWildcard(require("lodash"));
|
|
12
|
+
exports.lodash = lodash;
|
|
11
13
|
var _loadMaterials = require("./components/load-materials");
|
|
12
14
|
exports.LoadMaterials = _loadMaterials.LoadMaterials;
|
|
13
15
|
var _pageLoading = require("./components/page-loading");
|
|
@@ -18,7 +20,14 @@ exports.RestFormApi = _api.RestFormApi;
|
|
|
18
20
|
exports.apiRequest = _api.apiRequest;
|
|
19
21
|
var _layout = require("./components/layout");
|
|
20
22
|
exports.Layout = _layout.Layout;
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
25
|
// @ts-ignore
|
|
22
26
|
window.utils = _utils["default"];
|
|
23
27
|
// @ts-ignore
|
|
24
|
-
window.__ReactRender = _reactRender.ReactRender;
|
|
28
|
+
window.__ReactRender = _reactRender.ReactRender;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
if (window._) {
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
window.lodash = window._;
|
|
33
|
+
}
|
package/lib/style.js
CHANGED
|
@@ -95,6 +95,7 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
95
95
|
return this.initialize();
|
|
96
96
|
case 2:
|
|
97
97
|
config.params = config.params || {};
|
|
98
|
+
config.params.description = "" + this.title;
|
|
98
99
|
config.params.formId = this.formId;
|
|
99
100
|
if (this.fieldId) {
|
|
100
101
|
config.params.fieldId = this.fieldId;
|
|
@@ -102,7 +103,7 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
102
103
|
if (this.mock) {
|
|
103
104
|
config.params.mock = this.mock;
|
|
104
105
|
}
|
|
105
|
-
case
|
|
106
|
+
case 7:
|
|
106
107
|
case "end":
|
|
107
108
|
return _context2.stop();
|
|
108
109
|
}
|
|
@@ -120,12 +121,21 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
120
121
|
while (1) switch (_context3.prev = _context3.next) {
|
|
121
122
|
case 0:
|
|
122
123
|
_context3.next = 2;
|
|
123
|
-
return
|
|
124
|
+
return this.initialize();
|
|
124
125
|
case 2:
|
|
126
|
+
_context3.next = 4;
|
|
127
|
+
return this.request.post("search", params, {
|
|
128
|
+
params: {
|
|
129
|
+
description: this.title + "\u67E5\u8BE2",
|
|
130
|
+
formId: this.formId,
|
|
131
|
+
fieldId: this.fieldId
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
case 4:
|
|
125
135
|
res = _context3.sent;
|
|
126
|
-
|
|
136
|
+
assembleAssociationField(res.data, res.refs);
|
|
127
137
|
return _context3.abrupt("return", res);
|
|
128
|
-
case
|
|
138
|
+
case 7:
|
|
129
139
|
case "end":
|
|
130
140
|
return _context3.stop();
|
|
131
141
|
}
|
|
@@ -146,9 +156,10 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
146
156
|
return _RestApi.prototype.getById.call(this, id, options);
|
|
147
157
|
case 2:
|
|
148
158
|
res = _context4.sent;
|
|
149
|
-
|
|
159
|
+
assembleAssociationField(res.data, res.refs);
|
|
160
|
+
console.debug("formApi.getById", res);
|
|
150
161
|
return _context4.abrupt("return", res);
|
|
151
|
-
case
|
|
162
|
+
case 6:
|
|
152
163
|
case "end":
|
|
153
164
|
return _context4.stop();
|
|
154
165
|
}
|
|
@@ -227,40 +238,83 @@ function assembleAssociationField(data, refs) {
|
|
|
227
238
|
for (var _iterator = _createForOfIteratorHelperLoose(refs), _step; !(_step = _iterator()).done;) {
|
|
228
239
|
var ref = _step.value;
|
|
229
240
|
var dataMap = new Map();
|
|
230
|
-
for (var
|
|
231
|
-
var datum =
|
|
241
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(ref.data), _step4; !(_step4 = _iterator4()).done;) {
|
|
242
|
+
var datum = _step4.value;
|
|
232
243
|
dataMap.set(datum.id, datum);
|
|
233
244
|
}
|
|
234
|
-
for (var
|
|
235
|
-
var fieldId =
|
|
245
|
+
for (var _iterator5 = _createForOfIteratorHelperLoose(ref.fieldIds), _step5; !(_step5 = _iterator5()).done;) {
|
|
246
|
+
var fieldId = _step5.value;
|
|
236
247
|
fieldIdDataMap.set(fieldId + "Id", dataMap);
|
|
237
248
|
}
|
|
238
249
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
250
|
+
//组装refs的关联属性
|
|
251
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(refs), _step2; !(_step2 = _iterator2()).done;) {
|
|
252
|
+
var _ref = _step2.value;
|
|
253
|
+
var key = _ref.form.id;
|
|
254
|
+
if (_ref.form.fieldId) {
|
|
255
|
+
key += "." + _ref.form.fieldId;
|
|
256
|
+
}
|
|
257
|
+
assembleAssociationFieldValue(_ref.data, fieldIdDataMap, key);
|
|
258
|
+
}
|
|
259
|
+
function loopAssembleAssociation(values) {
|
|
260
|
+
if (!Array.isArray(values)) {
|
|
261
|
+
if (values !== null && values !== void 0 && values.id) {
|
|
262
|
+
loopAssembleAssociation([values]);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (Array.isArray(values)) {
|
|
266
|
+
var _values$;
|
|
267
|
+
if ((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.id) {
|
|
268
|
+
assembleAssociationFieldValue(values, fieldIdDataMap);
|
|
269
|
+
//处理子表
|
|
270
|
+
for (var _iterator3 = _createForOfIteratorHelperLoose(values), _step3; !(_step3 = _iterator3()).done;) {
|
|
271
|
+
var value = _step3.value;
|
|
272
|
+
for (var _i = 0, _Object$values = Object.values(value); _i < _Object$values.length; _i++) {
|
|
273
|
+
var subValues = _Object$values[_i];
|
|
274
|
+
if (Array.isArray(subValues)) {
|
|
275
|
+
loopAssembleAssociation(subValues);
|
|
276
|
+
}
|
|
255
277
|
}
|
|
256
|
-
value[fieldIdName.slice(0, -2)] = fieldValue;
|
|
257
278
|
}
|
|
258
|
-
};
|
|
259
|
-
for (var _i = 0, _Object$keys = Object.keys(value); _i < _Object$keys.length; _i++) {
|
|
260
|
-
_loop();
|
|
261
279
|
}
|
|
262
280
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
281
|
+
}
|
|
282
|
+
loopAssembleAssociation(data);
|
|
283
|
+
}
|
|
284
|
+
function assembleAssociationFieldValue(data, fieldIdDataMap, prefixKey) {
|
|
285
|
+
var arrayData = [];
|
|
286
|
+
if (Array.isArray(data)) {
|
|
287
|
+
arrayData = data;
|
|
288
|
+
} else if (typeof data == "object") {
|
|
289
|
+
arrayData = [data];
|
|
290
|
+
}
|
|
291
|
+
for (var _iterator6 = _createForOfIteratorHelperLoose(arrayData), _step6; !(_step6 = _iterator6()).done;) {
|
|
292
|
+
var item = _step6.value;
|
|
293
|
+
var _loop = function _loop() {
|
|
294
|
+
var fieldIdName = _Object$keys[_i2];
|
|
295
|
+
var fieldIdKey = fieldIdName;
|
|
296
|
+
if (prefixKey) {
|
|
297
|
+
fieldIdKey = prefixKey + "." + fieldIdName;
|
|
298
|
+
}
|
|
299
|
+
var dataMap = fieldIdDataMap.get(fieldIdKey);
|
|
300
|
+
if (dataMap) {
|
|
301
|
+
var fieldIdValue = item[fieldIdName];
|
|
302
|
+
var fieldValue = null;
|
|
303
|
+
if (Array.isArray(fieldIdValue)) {
|
|
304
|
+
// @ts-ignore
|
|
305
|
+
fieldValue = fieldIdValue.map(function (id) {
|
|
306
|
+
return dataMap.get(id);
|
|
307
|
+
}).filter(function (v) {
|
|
308
|
+
return !!v;
|
|
309
|
+
});
|
|
310
|
+
} else if (typeof fieldIdValue == "string") {
|
|
311
|
+
fieldValue = dataMap.get(fieldIdValue);
|
|
312
|
+
}
|
|
313
|
+
item[fieldIdName.slice(0, -2)] = fieldValue;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
for (var _i2 = 0, _Object$keys = Object.keys(item); _i2 < _Object$keys.length; _i2++) {
|
|
317
|
+
_loop();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
266
320
|
}
|
|
@@ -5,6 +5,8 @@ exports.__esModule = true;
|
|
|
5
5
|
exports.RestApi = exports.BaseRestApi = void 0;
|
|
6
6
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
7
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
8
|
+
var _notification2 = _interopRequireDefault(require("antd/lib/notification"));
|
|
9
|
+
var _modal = _interopRequireDefault(require("antd/lib/modal"));
|
|
8
10
|
var _message2 = _interopRequireDefault(require("antd/lib/message"));
|
|
9
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
12
|
var _axios = _interopRequireDefault(require("axios"));
|
|
@@ -291,16 +293,57 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
291
293
|
}();
|
|
292
294
|
_proto.showError = /*#__PURE__*/function () {
|
|
293
295
|
var _showError = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(type, msg) {
|
|
296
|
+
var _JSON$parse, _type, message;
|
|
294
297
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
295
298
|
while (1) switch (_context7.prev = _context7.next) {
|
|
296
299
|
case 0:
|
|
300
|
+
_context7.prev = 0;
|
|
301
|
+
if (!msg) {
|
|
302
|
+
_context7.next = 16;
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
_JSON$parse = JSON.parse(msg), _type = _JSON$parse.type, message = _JSON$parse.message;
|
|
306
|
+
if (!(_type == "message")) {
|
|
307
|
+
_context7.next = 8;
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
_message2["default"].error({
|
|
311
|
+
type: "error",
|
|
312
|
+
content: message
|
|
313
|
+
});
|
|
314
|
+
return _context7.abrupt("return");
|
|
315
|
+
case 8:
|
|
316
|
+
if (!(_type == "modal")) {
|
|
317
|
+
_context7.next = 13;
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
_modal["default"].error({
|
|
321
|
+
content: message
|
|
322
|
+
});
|
|
323
|
+
return _context7.abrupt("return");
|
|
324
|
+
case 13:
|
|
325
|
+
if (!(_type == "notification")) {
|
|
326
|
+
_context7.next = 16;
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
_notification2["default"].error({
|
|
330
|
+
message: message
|
|
331
|
+
});
|
|
332
|
+
return _context7.abrupt("return");
|
|
333
|
+
case 16:
|
|
334
|
+
_context7.next = 20;
|
|
335
|
+
break;
|
|
336
|
+
case 18:
|
|
337
|
+
_context7.prev = 18;
|
|
338
|
+
_context7.t0 = _context7["catch"](0);
|
|
339
|
+
case 20:
|
|
297
340
|
console.error("{" + this.title + "}" + type + (msg || ""));
|
|
298
341
|
_message2["default"] === null || _message2["default"] === void 0 ? void 0 : _message2["default"].error("{" + this.title + "}" + type + (msg || "")).then();
|
|
299
|
-
case
|
|
342
|
+
case 22:
|
|
300
343
|
case "end":
|
|
301
344
|
return _context7.stop();
|
|
302
345
|
}
|
|
303
|
-
}, _callee7, this);
|
|
346
|
+
}, _callee7, this, [[0, 18]]);
|
|
304
347
|
}));
|
|
305
348
|
function showError(_x13, _x14) {
|
|
306
349
|
return _showError.apply(this, arguments);
|
|
@@ -20,13 +20,25 @@ function _handleFormSchema() {
|
|
|
20
20
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
21
21
|
while (1) switch (_context.prev = _context.next) {
|
|
22
22
|
case 0:
|
|
23
|
+
if (!(schema.type !== "form")) {
|
|
24
|
+
_context.next = 2;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
return _context.abrupt("return");
|
|
28
|
+
case 2:
|
|
29
|
+
if (schema !== null && schema !== void 0 && schema.componentName) {
|
|
30
|
+
_context.next = 4;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
return _context.abrupt("return");
|
|
34
|
+
case 4:
|
|
23
35
|
fdmItems = [];
|
|
24
36
|
fieldIdMap = new Map();
|
|
25
37
|
schema.state = schema.state || {};
|
|
26
38
|
schema.methods = schema.methods || {};
|
|
27
|
-
_context.next =
|
|
39
|
+
_context.next = 10;
|
|
28
40
|
return handleAssociationForm(schema);
|
|
29
|
-
case
|
|
41
|
+
case 10:
|
|
30
42
|
//初次处理
|
|
31
43
|
forEachFormSchema(schema, function (field) {
|
|
32
44
|
if (field.fdmSchema) {
|
|
@@ -73,7 +85,7 @@ function _handleFormSchema() {
|
|
|
73
85
|
return true;
|
|
74
86
|
});
|
|
75
87
|
});
|
|
76
|
-
case
|
|
88
|
+
case 12:
|
|
77
89
|
case "end":
|
|
78
90
|
return _context.stop();
|
|
79
91
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page-layout";
|
|
2
|
-
export declare type PageFormDataManagerModeType = "dataManager" | "selectOne" | "selectMore";
|
|
2
|
+
export declare type PageFormDataManagerModeType = "associationField" | "dataManager" | "selectOne" | "selectMore";
|
|
3
3
|
export interface ShowPageFormDataManagerProps {
|
|
4
4
|
container?: HTMLDivElement;
|
|
5
5
|
layout?: PageLayoutType;
|
|
@@ -8,6 +8,12 @@ export interface ShowPageFormDataManagerProps {
|
|
|
8
8
|
fieldId?: string;
|
|
9
9
|
};
|
|
10
10
|
mode?: PageFormDataManagerModeType;
|
|
11
|
+
extraProps?: any;
|
|
11
12
|
onClose?: () => void | Promise<void>;
|
|
13
|
+
onSearch?: (params: any[]) => void | Promise<void>;
|
|
14
|
+
onLoadData?: (response: {
|
|
15
|
+
data: any[];
|
|
16
|
+
total: number;
|
|
17
|
+
}) => void | Promise<void>;
|
|
12
18
|
}
|
|
13
19
|
export declare function showFormDataManager(options: ShowPageFormDataManagerProps): Promise<any | any[]>;
|
|
@@ -29,7 +29,7 @@ function _showFormDataManager() {
|
|
|
29
29
|
case 0:
|
|
30
30
|
return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
|
|
31
31
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(resolve, reject) {
|
|
32
|
-
var container, onClose, restProps, unmount, _options$form, paths, mode,
|
|
32
|
+
var container, onClose, restProps, unmount, _options$form, paths, mode, _params, url, page;
|
|
33
33
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
34
34
|
while (1) switch (_context2.prev = _context2.next) {
|
|
35
35
|
case 0:
|
|
@@ -45,8 +45,8 @@ function _showFormDataManager() {
|
|
|
45
45
|
}
|
|
46
46
|
paths = window.location.pathname.split("/");
|
|
47
47
|
mode = options.mode;
|
|
48
|
-
|
|
49
|
-
url = "/" + paths[1] + "/" + paths[2] + "/" + ((_options$form = options.form) === null || _options$form === void 0 ? void 0 : _options$form.id) + "/" + mode + "?" +
|
|
48
|
+
_params = new URLSearchParams();
|
|
49
|
+
url = "/" + paths[1] + "/" + paths[2] + "/" + ((_options$form = options.form) === null || _options$form === void 0 ? void 0 : _options$form.id) + "/" + mode + "?" + _params.toString();
|
|
50
50
|
_context2.next = 10;
|
|
51
51
|
return (0, _index.openPage)(url, url);
|
|
52
52
|
case 10:
|
|
@@ -66,18 +66,19 @@ function _showFormDataManager() {
|
|
|
66
66
|
while (1) switch (_context.prev = _context.next) {
|
|
67
67
|
case 0:
|
|
68
68
|
resolve(null);
|
|
69
|
+
setTimeout(function () {
|
|
70
|
+
_reactDom["default"].unmountComponentAtNode(container);
|
|
71
|
+
}, 10);
|
|
69
72
|
if (unmount) {
|
|
70
73
|
//等待动画结束
|
|
71
74
|
setTimeout(function () {
|
|
72
75
|
var _container;
|
|
73
|
-
//取消挂载
|
|
74
|
-
_reactDom["default"].unmountComponentAtNode(container);
|
|
75
76
|
//移除
|
|
76
77
|
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
77
|
-
},
|
|
78
|
+
}, 100);
|
|
78
79
|
}
|
|
79
80
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
80
|
-
case
|
|
81
|
+
case 4:
|
|
81
82
|
case "end":
|
|
82
83
|
return _context.stop();
|
|
83
84
|
}
|
|
@@ -123,8 +124,9 @@ var FormDataManagerRender = /*#__PURE__*/function (_Component) {
|
|
|
123
124
|
onSelectOk = _this$props.onSelectOk,
|
|
124
125
|
onClose = _this$props.onClose,
|
|
125
126
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded);
|
|
127
|
+
|
|
126
128
|
// @ts-ignore
|
|
127
|
-
restProps.layout = layout || "
|
|
129
|
+
restProps.layout = layout || "modal";
|
|
128
130
|
// @ts-ignore
|
|
129
131
|
restProps.onClose = function () {
|
|
130
132
|
var _self$layoutRef;
|
|
@@ -25,9 +25,11 @@ var PageLayout = exports.PageLayout = /*#__PURE__*/function (_Component) {
|
|
|
25
25
|
return Math.min(window.innerWidth, 1440);
|
|
26
26
|
};
|
|
27
27
|
_this.handleResize = function () {
|
|
28
|
-
_this.
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
if (_this.props.layout == "drawer") {
|
|
29
|
+
_this.setState({
|
|
30
|
+
width: _this.getWith()
|
|
31
|
+
});
|
|
32
|
+
}
|
|
31
33
|
};
|
|
32
34
|
_this.state.width = _this.getWith();
|
|
33
35
|
return _this;
|
|
@@ -51,6 +53,7 @@ var PageLayout = exports.PageLayout = /*#__PURE__*/function (_Component) {
|
|
|
51
53
|
onClose: this.close,
|
|
52
54
|
footer: false,
|
|
53
55
|
closable: false,
|
|
56
|
+
style: {},
|
|
54
57
|
styles: {
|
|
55
58
|
header: {
|
|
56
59
|
display: "none"
|
|
@@ -65,6 +68,8 @@ var PageLayout = exports.PageLayout = /*#__PURE__*/function (_Component) {
|
|
|
65
68
|
maskClosable: false
|
|
66
69
|
};
|
|
67
70
|
if (layout == "modal") {
|
|
71
|
+
restProps.style.top = 64;
|
|
72
|
+
restProps.styles.body.maxHeight = "calc(100vh - 180px)";
|
|
68
73
|
return /*#__PURE__*/_react["default"].createElement(_modal["default"], restProps, children);
|
|
69
74
|
} else if (layout == "drawer") {
|
|
70
75
|
return /*#__PURE__*/_react["default"].createElement(_drawer["default"], restProps, children);
|