@zhubangyun/lowcode-core 5.12.91 → 5.12.161
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/load-materials/index.js +12 -12
- package/es/demo/index.js +8 -8
- package/es/utils/api/file-api.js +21 -21
- package/es/utils/api/form-api.d.ts +1 -1
- package/es/utils/api/form-api.js +38 -36
- package/es/utils/api/form-api.utils.js +5 -4
- package/es/utils/api/index.d.ts +1 -1
- package/es/utils/api/rest-api.js +116 -116
- package/es/utils/api/schema-api.js +5 -5
- package/es/utils/api/script-api.js +12 -12
- package/es/utils/api/user-info.js +7 -7
- package/es/utils/cache/index.js +14 -14
- package/es/utils/common/LoadPlugins.js +33 -33
- package/es/utils/common/SingletonInstanceMap.js +21 -21
- package/es/utils/designer/assets/assets.parse.js +15 -15
- package/es/utils/designer/assets/assets.typing.js +6 -0
- package/es/utils/designer/engine/index.js +23 -23
- package/es/utils/designer/index.js +7 -7
- package/es/utils/page/index.js +18 -18
- package/es/utils/page/page-form-data-manager-group.js +7 -4
- package/es/utils/page/page-form-data-manager.js +7 -4
- package/es/utils/page/page-form-group.js +6 -5
- package/es/utils/page/page-form.js +12 -11
- package/es/utils/page/page-layout.d.ts +2 -0
- package/es/utils/page/page-layout.js +14 -7
- package/es/utils/page/page-render.js +4 -4
- package/es/utils/page/page-show.js +3 -3
- package/es/utils/page/print-form.js +36 -36
- package/lib/components/load-materials/index.js +13 -14
- package/lib/demo/index.js +9 -10
- package/lib/index.js +1 -2
- package/lib/utils/api/file-api.js +21 -21
- package/lib/utils/api/form-api.d.ts +1 -1
- package/lib/utils/api/form-api.js +38 -36
- package/lib/utils/api/form-api.utils.js +5 -4
- package/lib/utils/api/index.d.ts +1 -1
- package/lib/utils/api/index.js +1 -2
- package/lib/utils/api/rest-api.js +116 -116
- package/lib/utils/api/schema-api.js +5 -5
- package/lib/utils/api/script-api.js +12 -12
- package/lib/utils/api/user-info.js +7 -7
- package/lib/utils/cache/index.js +14 -14
- package/lib/utils/common/LoadPlugins.js +33 -33
- package/lib/utils/common/SingletonInstanceMap.js +21 -21
- package/lib/utils/designer/assets/assets.parse.js +16 -17
- package/lib/utils/designer/assets/assets.typing.js +6 -0
- package/lib/utils/designer/engine/index.js +23 -23
- package/lib/utils/designer/index.js +7 -7
- package/lib/utils/index.js +1 -2
- package/lib/utils/page/index.js +18 -18
- package/lib/utils/page/page-form-data-manager-group.js +8 -6
- package/lib/utils/page/page-form-data-manager.js +8 -6
- package/lib/utils/page/page-form-group.js +7 -7
- package/lib/utils/page/page-form.js +13 -13
- package/lib/utils/page/page-layout.d.ts +2 -0
- package/lib/utils/page/page-layout.js +15 -9
- package/lib/utils/page/page-render.js +4 -4
- package/lib/utils/page/page-show.js +4 -5
- package/lib/utils/page/print-form.js +36 -36
- package/package.json +1 -1
|
@@ -16,9 +16,9 @@ function getFormApi(_x, _x2, _x3) {
|
|
|
16
16
|
return _getFormApi.apply(this, arguments);
|
|
17
17
|
}
|
|
18
18
|
function _getFormApi() {
|
|
19
|
-
_getFormApi = (0, _asyncToGenerator2["default"])(
|
|
19
|
+
_getFormApi = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(formId, fieldId, mock) {
|
|
20
20
|
var key;
|
|
21
|
-
return _regenerator["default"].wrap(function
|
|
21
|
+
return _regenerator["default"].wrap(function (_context9) {
|
|
22
22
|
while (1) switch (_context9.prev = _context9.next) {
|
|
23
23
|
case 0:
|
|
24
24
|
if (typeof mock != "boolean") {
|
|
@@ -34,7 +34,7 @@ function _getFormApi() {
|
|
|
34
34
|
fieldId: fieldId,
|
|
35
35
|
formId: formId
|
|
36
36
|
}));
|
|
37
|
-
case
|
|
37
|
+
case 1:
|
|
38
38
|
case "end":
|
|
39
39
|
return _context9.stop();
|
|
40
40
|
}
|
|
@@ -45,7 +45,9 @@ function _getFormApi() {
|
|
|
45
45
|
var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
46
46
|
function RestFormApi(formId, fieldId, mock) {
|
|
47
47
|
var _this;
|
|
48
|
-
_this = _RestApi.call(this, "
|
|
48
|
+
_this = _RestApi.call(this, "forms", {
|
|
49
|
+
title: "表单"
|
|
50
|
+
}) || this;
|
|
49
51
|
_this.formId = void 0;
|
|
50
52
|
_this.fieldId = void 0;
|
|
51
53
|
_this.mock = void 0;
|
|
@@ -59,10 +61,10 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
59
61
|
(0, _inheritsLoose2["default"])(RestFormApi, _RestApi);
|
|
60
62
|
var _proto = RestFormApi.prototype;
|
|
61
63
|
_proto.initialize = /*#__PURE__*/function () {
|
|
62
|
-
var _initialize = (0, _asyncToGenerator2["default"])(
|
|
64
|
+
var _initialize = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
63
65
|
var _this2 = this;
|
|
64
66
|
var res, _this$schema, _this$schema$children, _this$schema$children2;
|
|
65
|
-
return _regenerator["default"].wrap(function
|
|
67
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
66
68
|
while (1) switch (_context.prev = _context.next) {
|
|
67
69
|
case 0:
|
|
68
70
|
if (!this.initialized) {
|
|
@@ -96,7 +98,7 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
return _context.abrupt("return", this.initialized);
|
|
99
|
-
case
|
|
101
|
+
case 1:
|
|
100
102
|
case "end":
|
|
101
103
|
return _context.stop();
|
|
102
104
|
}
|
|
@@ -108,13 +110,13 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
108
110
|
return initialize;
|
|
109
111
|
}();
|
|
110
112
|
_proto.handleRequestConfig = /*#__PURE__*/function () {
|
|
111
|
-
var _handleRequestConfig = (0, _asyncToGenerator2["default"])(
|
|
112
|
-
return _regenerator["default"].wrap(function
|
|
113
|
+
var _handleRequestConfig = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(config) {
|
|
114
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
113
115
|
while (1) switch (_context2.prev = _context2.next) {
|
|
114
116
|
case 0:
|
|
115
|
-
_context2.next =
|
|
117
|
+
_context2.next = 1;
|
|
116
118
|
return this.initialize();
|
|
117
|
-
case
|
|
119
|
+
case 1:
|
|
118
120
|
config.params = config.params || {};
|
|
119
121
|
if (__mock) {
|
|
120
122
|
config.params.description = "" + this.title;
|
|
@@ -126,7 +128,7 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
126
128
|
if (this.mock) {
|
|
127
129
|
config.params.mock = this.mock;
|
|
128
130
|
}
|
|
129
|
-
case
|
|
131
|
+
case 2:
|
|
130
132
|
case "end":
|
|
131
133
|
return _context2.stop();
|
|
132
134
|
}
|
|
@@ -138,10 +140,10 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
138
140
|
return handleRequestConfig;
|
|
139
141
|
}();
|
|
140
142
|
_proto.search = /*#__PURE__*/function () {
|
|
141
|
-
var _search = (0, _asyncToGenerator2["default"])(
|
|
143
|
+
var _search = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(searchParams) {
|
|
142
144
|
var _searchParams, _searchParams2;
|
|
143
145
|
var params, config, res, start;
|
|
144
|
-
return _regenerator["default"].wrap(function
|
|
146
|
+
return _regenerator["default"].wrap(function (_context3) {
|
|
145
147
|
while (1) switch (_context3.prev = _context3.next) {
|
|
146
148
|
case 0:
|
|
147
149
|
searchParams = searchParams || {};
|
|
@@ -155,9 +157,9 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
155
157
|
config = {
|
|
156
158
|
params: params
|
|
157
159
|
};
|
|
158
|
-
_context3.next =
|
|
160
|
+
_context3.next = 1;
|
|
159
161
|
return this.handleRequestConfig(config);
|
|
160
|
-
case
|
|
162
|
+
case 1:
|
|
161
163
|
searchParams.filterRules = (0, _formApi.handleFilterRules)(((_searchParams = searchParams) === null || _searchParams === void 0 ? void 0 : _searchParams.filterRules) || [], {
|
|
162
164
|
filterNullValue: false
|
|
163
165
|
});
|
|
@@ -165,16 +167,16 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
165
167
|
filterNullValue: true
|
|
166
168
|
});
|
|
167
169
|
config.params = (0, _extends2["default"])({}, params, searchParams);
|
|
168
|
-
_context3.next =
|
|
170
|
+
_context3.next = 2;
|
|
169
171
|
return this.request.get("search", config);
|
|
170
|
-
case
|
|
172
|
+
case 2:
|
|
171
173
|
res = _context3.sent;
|
|
172
174
|
//const res = await this.request.post<any, ManyResult<DataType>>("search", searchParams, config);
|
|
173
175
|
start = Date.now();
|
|
174
176
|
(0, _formApi.assembleAssociationField)(res.data, res.refs);
|
|
175
177
|
console.debug("form.search:", res);
|
|
176
178
|
return _context3.abrupt("return", res);
|
|
177
|
-
case
|
|
179
|
+
case 3:
|
|
178
180
|
case "end":
|
|
179
181
|
return _context3.stop();
|
|
180
182
|
}
|
|
@@ -186,19 +188,19 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
186
188
|
return search;
|
|
187
189
|
}();
|
|
188
190
|
_proto.getById = /*#__PURE__*/function () {
|
|
189
|
-
var _getById = (0, _asyncToGenerator2["default"])(
|
|
191
|
+
var _getById = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(id, options) {
|
|
190
192
|
var res;
|
|
191
|
-
return _regenerator["default"].wrap(function
|
|
193
|
+
return _regenerator["default"].wrap(function (_context4) {
|
|
192
194
|
while (1) switch (_context4.prev = _context4.next) {
|
|
193
195
|
case 0:
|
|
194
|
-
_context4.next =
|
|
196
|
+
_context4.next = 1;
|
|
195
197
|
return _RestApi.prototype.getById.call(this, id, options);
|
|
196
|
-
case
|
|
198
|
+
case 1:
|
|
197
199
|
res = _context4.sent;
|
|
198
200
|
(0, _formApi.assembleAssociationField)(res.data, res.refs);
|
|
199
201
|
console.debug("formApi.getById", res);
|
|
200
202
|
return _context4.abrupt("return", res);
|
|
201
|
-
case
|
|
203
|
+
case 2:
|
|
202
204
|
case "end":
|
|
203
205
|
return _context4.stop();
|
|
204
206
|
}
|
|
@@ -210,8 +212,8 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
210
212
|
return getById;
|
|
211
213
|
}();
|
|
212
214
|
_proto.save = /*#__PURE__*/function () {
|
|
213
|
-
var _save = (0, _asyncToGenerator2["default"])(
|
|
214
|
-
return _regenerator["default"].wrap(function
|
|
215
|
+
var _save = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(data, options) {
|
|
216
|
+
return _regenerator["default"].wrap(function (_context5) {
|
|
215
217
|
while (1) switch (_context5.prev = _context5.next) {
|
|
216
218
|
case 0:
|
|
217
219
|
return _context5.abrupt("return", _RestApi.prototype.save.call(this, (0, _formApi.convertSaveData)(data), options));
|
|
@@ -227,8 +229,8 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
227
229
|
return save;
|
|
228
230
|
}();
|
|
229
231
|
_proto.create = /*#__PURE__*/function () {
|
|
230
|
-
var _create = (0, _asyncToGenerator2["default"])(
|
|
231
|
-
return _regenerator["default"].wrap(function
|
|
232
|
+
var _create = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(data, options) {
|
|
233
|
+
return _regenerator["default"].wrap(function (_context6) {
|
|
232
234
|
while (1) switch (_context6.prev = _context6.next) {
|
|
233
235
|
case 0:
|
|
234
236
|
return _context6.abrupt("return", _RestApi.prototype.create.call(this, (0, _formApi.convertSaveData)(data), options));
|
|
@@ -238,14 +240,14 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
238
240
|
}
|
|
239
241
|
}, _callee6, this);
|
|
240
242
|
}));
|
|
241
|
-
function create(
|
|
243
|
+
function create(_x0, _x1) {
|
|
242
244
|
return _create.apply(this, arguments);
|
|
243
245
|
}
|
|
244
246
|
return create;
|
|
245
247
|
}();
|
|
246
248
|
_proto.update = /*#__PURE__*/function () {
|
|
247
|
-
var _update = (0, _asyncToGenerator2["default"])(
|
|
248
|
-
return _regenerator["default"].wrap(function
|
|
249
|
+
var _update = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(id, data, options) {
|
|
250
|
+
return _regenerator["default"].wrap(function (_context7) {
|
|
249
251
|
while (1) switch (_context7.prev = _context7.next) {
|
|
250
252
|
case 0:
|
|
251
253
|
return _context7.abrupt("return", _RestApi.prototype.update.call(this, id, (0, _formApi.convertSaveData)(data), options));
|
|
@@ -255,15 +257,15 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
255
257
|
}
|
|
256
258
|
}, _callee7, this);
|
|
257
259
|
}));
|
|
258
|
-
function update(
|
|
260
|
+
function update(_x10, _x11, _x12) {
|
|
259
261
|
return _update.apply(this, arguments);
|
|
260
262
|
}
|
|
261
263
|
return update;
|
|
262
264
|
}();
|
|
263
265
|
_proto.serviceUpdate = /*#__PURE__*/function () {
|
|
264
|
-
var _serviceUpdate = (0, _asyncToGenerator2["default"])(
|
|
266
|
+
var _serviceUpdate = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(data, options) {
|
|
265
267
|
var params;
|
|
266
|
-
return _regenerator["default"].wrap(function
|
|
268
|
+
return _regenerator["default"].wrap(function (_context8) {
|
|
267
269
|
while (1) switch (_context8.prev = _context8.next) {
|
|
268
270
|
case 0:
|
|
269
271
|
params = {
|
|
@@ -277,13 +279,13 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
277
279
|
return _context8.abrupt("return", this.request.post("serviceUpdate", data, {
|
|
278
280
|
params: params
|
|
279
281
|
}));
|
|
280
|
-
case
|
|
282
|
+
case 1:
|
|
281
283
|
case "end":
|
|
282
284
|
return _context8.stop();
|
|
283
285
|
}
|
|
284
286
|
}, _callee8, this);
|
|
285
287
|
}));
|
|
286
|
-
function serviceUpdate(
|
|
288
|
+
function serviceUpdate(_x13, _x14) {
|
|
287
289
|
return _serviceUpdate.apply(this, arguments);
|
|
288
290
|
}
|
|
289
291
|
return serviceUpdate;
|
|
@@ -11,13 +11,14 @@ exports.handleEntityLabel = handleEntityLabel;
|
|
|
11
11
|
exports.handleFilterRules = handleFilterRules;
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var _data = require("../data");
|
|
14
|
-
function _createForOfIteratorHelperLoose(
|
|
15
|
-
function _unsupportedIterableToArray(
|
|
16
|
-
function _arrayLikeToArray(
|
|
14
|
+
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
+
var SimpleSerialFieldNames = ["parent", "instance"];
|
|
17
18
|
function convertSaveData(data) {
|
|
18
19
|
if (!data) return data;
|
|
19
20
|
return JSON.parse(JSON.stringify(data, function (key, value) {
|
|
20
|
-
if (key
|
|
21
|
+
if (SimpleSerialFieldNames.includes(key)) {
|
|
21
22
|
var id = value === null || value === void 0 ? void 0 : value.id;
|
|
22
23
|
return id ? {
|
|
23
24
|
id: id
|
package/lib/utils/api/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export { getUserinfo } from "./user-info";
|
|
|
6
6
|
export * as files from "./file-api";
|
|
7
7
|
export * as scrips from "./script-api";
|
|
8
8
|
export declare const apiRequest: import("axios").AxiosInstance;
|
|
9
|
-
export declare const request: <T = any, R = AxiosResponse<T, any>, D = any>(config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
|
|
9
|
+
export declare const request: <T = any, R = AxiosResponse<T, any, {}>, D = any>(config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
|
|
10
10
|
export declare function onFulfilled(res: AxiosResponse): any;
|
|
11
11
|
export declare function onRejected(error: any): any;
|
package/lib/utils/api/index.js
CHANGED
|
@@ -20,8 +20,7 @@ var _files = _interopRequireWildcard(require("./file-api"));
|
|
|
20
20
|
exports.files = _files;
|
|
21
21
|
var _scrips = _interopRequireWildcard(require("./script-api"));
|
|
22
22
|
exports.scrips = _scrips;
|
|
23
|
-
function
|
|
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; }
|
|
23
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
25
24
|
var apiRequest = exports.apiRequest = _axios["default"].create({
|
|
26
25
|
baseURL: "/api",
|
|
27
26
|
// 基础URL
|