@zhubangyun/lowcode-core 5.12.10 → 5.12.90
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/utils/api/form-api.js +14 -3
- package/es/utils/api/rest-api.d.ts +4 -0
- package/es/utils/page/page-form-data-manager-group.d.ts +8 -1
- package/es/utils/page/page-form-data-manager.d.ts +47 -6
- package/lib/utils/api/form-api.js +14 -3
- package/lib/utils/api/rest-api.d.ts +4 -0
- package/lib/utils/page/page-form-data-manager-group.d.ts +8 -1
- package/lib/utils/page/page-form-data-manager.d.ts +47 -6
- package/package.json +1 -1
package/es/utils/api/form-api.js
CHANGED
|
@@ -39,7 +39,7 @@ function _getFormApi() {
|
|
|
39
39
|
export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
40
40
|
function RestFormApi(formId, fieldId, mock) {
|
|
41
41
|
var _this;
|
|
42
|
-
_this = _RestApi.call(this, "
|
|
42
|
+
_this = _RestApi.call(this, "表单", {}) || this;
|
|
43
43
|
_this.formId = void 0;
|
|
44
44
|
_this.fieldId = void 0;
|
|
45
45
|
_this.mock = void 0;
|
|
@@ -256,11 +256,22 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
256
256
|
}();
|
|
257
257
|
_proto.serviceUpdate = /*#__PURE__*/function () {
|
|
258
258
|
var _serviceUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data, options) {
|
|
259
|
+
var params;
|
|
259
260
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
260
261
|
while (1) switch (_context8.prev = _context8.next) {
|
|
261
262
|
case 0:
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
params = {
|
|
264
|
+
formId: this.formId,
|
|
265
|
+
fieldId: this.fieldId
|
|
266
|
+
};
|
|
267
|
+
if (__mock) {
|
|
268
|
+
params.mock = true;
|
|
269
|
+
params.description = (this.title || "表单") + ".\u67E5\u8BE2";
|
|
270
|
+
}
|
|
271
|
+
return _context8.abrupt("return", this.request.post("serviceUpdate", data, {
|
|
272
|
+
params: params
|
|
273
|
+
}));
|
|
274
|
+
case 3:
|
|
264
275
|
case "end":
|
|
265
276
|
return _context8.stop();
|
|
266
277
|
}
|
|
@@ -19,6 +19,10 @@ export interface FilterRule {
|
|
|
19
19
|
value?: any;
|
|
20
20
|
rules?: FilterRule[];
|
|
21
21
|
}
|
|
22
|
+
export interface OrderRule {
|
|
23
|
+
key: string;
|
|
24
|
+
direction: "asc" | "desc";
|
|
25
|
+
}
|
|
22
26
|
export type OperatorType = "eq" | "ne" | "gt" | "goe" | "lt" | "loe" | "like" | "notLike" | "in" | "notIn" | "isNull" | "isNotNull" | "between" | "notBetween";
|
|
23
27
|
export interface RestSearchParams {
|
|
24
28
|
page?: number;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page-layout";
|
|
2
|
+
import { DataView } from "./page-form-data-manager";
|
|
2
3
|
export type PageFormDataManagerModeType = "page" | "selectOne" | "selectMore";
|
|
4
|
+
interface ShowFormDataManagerGroupItem extends DataView {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
initialValues: any;
|
|
8
|
+
}
|
|
3
9
|
export interface ShowFormDataManagerGroupProps {
|
|
4
10
|
container?: HTMLDivElement;
|
|
5
11
|
layout?: PageLayoutType;
|
|
6
12
|
mode?: PageFormDataManagerModeType;
|
|
7
13
|
title?: string;
|
|
8
|
-
items:
|
|
14
|
+
items: ShowFormDataManagerGroupItem[];
|
|
9
15
|
extraProps?: any;
|
|
10
16
|
defaultSelectedRows?: any[];
|
|
11
17
|
onClose?: () => void | Promise<void>;
|
|
@@ -17,3 +23,4 @@ export interface ShowFormDataManagerGroupProps {
|
|
|
17
23
|
pageRef?: (page: any) => void;
|
|
18
24
|
}
|
|
19
25
|
export declare function showFormDataManagerGroup(options: ShowFormDataManagerGroupProps): Promise<any | any[]>;
|
|
26
|
+
export {};
|
|
@@ -1,19 +1,59 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page-layout";
|
|
2
|
-
import { FilterRule } from "../api/rest-api";
|
|
2
|
+
import { FilterRule, OrderRule } from "../api/rest-api";
|
|
3
|
+
import { FormInstance } from "antd";
|
|
3
4
|
export type PageFormDataManagerModeType = "associationField" | "dataManager" | "selectOne" | "selectMany";
|
|
5
|
+
interface FillRule {
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DataView {
|
|
10
|
+
form?: {
|
|
11
|
+
id?: string;
|
|
12
|
+
fieldId?: string;
|
|
13
|
+
};
|
|
14
|
+
labelField?: string;
|
|
15
|
+
secondaryLabelFields?: string[];
|
|
16
|
+
fieldWidth?: Record<string, number>;
|
|
17
|
+
filterRules: FilterRule[];
|
|
18
|
+
hiddenFields: string[];
|
|
19
|
+
searchFields: FilterRule[];
|
|
20
|
+
orderRules: OrderRule[];
|
|
21
|
+
fillRules?: {
|
|
22
|
+
mainRules: FillRule[];
|
|
23
|
+
tableRules: FillRule[];
|
|
24
|
+
};
|
|
25
|
+
showFields: {
|
|
26
|
+
key: string;
|
|
27
|
+
fixed?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
onSearch?: (params: any, form?: FormInstance) => void;
|
|
30
|
+
onLoadData?: (data: any[], form?: FormInstance) => void;
|
|
31
|
+
callbacks?: {
|
|
32
|
+
beforeSearch?: string;
|
|
33
|
+
afterSearch?: string;
|
|
34
|
+
beforeExport?: string;
|
|
35
|
+
};
|
|
36
|
+
customActions?: {
|
|
37
|
+
enable?: boolean;
|
|
38
|
+
defaults?: string[];
|
|
39
|
+
toolbarLeftOptions?: string[];
|
|
40
|
+
toolbarRightOptions?: string[];
|
|
41
|
+
footerLeftOptions?: string[];
|
|
42
|
+
footerRightOptions?: string[];
|
|
43
|
+
rowOptions?: string[];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
4
46
|
export interface ShowPageFormDataManagerProps {
|
|
5
47
|
container?: HTMLDivElement;
|
|
6
48
|
layout?: PageLayoutType;
|
|
49
|
+
title?: string;
|
|
7
50
|
form?: {
|
|
8
51
|
id: string;
|
|
9
52
|
fieldId?: string;
|
|
10
53
|
};
|
|
11
54
|
mode?: PageFormDataManagerModeType;
|
|
12
|
-
dataView?:
|
|
13
|
-
|
|
14
|
-
searchFields?: FilterRule[];
|
|
15
|
-
orderRules?: any[];
|
|
16
|
-
};
|
|
55
|
+
dataView?: DataView;
|
|
56
|
+
defaultSelectedRows?: any[];
|
|
17
57
|
extraProps?: any;
|
|
18
58
|
onClose?: () => void | Promise<void>;
|
|
19
59
|
onSearch?: (params: any[]) => void | Promise<void>;
|
|
@@ -24,3 +64,4 @@ export interface ShowPageFormDataManagerProps {
|
|
|
24
64
|
pageRef?: (page: any) => void;
|
|
25
65
|
}
|
|
26
66
|
export declare function showFormDataManager(options: ShowPageFormDataManagerProps): Promise<any | any[]>;
|
|
67
|
+
export {};
|
|
@@ -45,7 +45,7 @@ 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, "表单", {}) || this;
|
|
49
49
|
_this.formId = void 0;
|
|
50
50
|
_this.fieldId = void 0;
|
|
51
51
|
_this.mock = void 0;
|
|
@@ -262,11 +262,22 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
262
262
|
}();
|
|
263
263
|
_proto.serviceUpdate = /*#__PURE__*/function () {
|
|
264
264
|
var _serviceUpdate = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(data, options) {
|
|
265
|
+
var params;
|
|
265
266
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
266
267
|
while (1) switch (_context8.prev = _context8.next) {
|
|
267
268
|
case 0:
|
|
268
|
-
|
|
269
|
-
|
|
269
|
+
params = {
|
|
270
|
+
formId: this.formId,
|
|
271
|
+
fieldId: this.fieldId
|
|
272
|
+
};
|
|
273
|
+
if (__mock) {
|
|
274
|
+
params.mock = true;
|
|
275
|
+
params.description = (this.title || "表单") + ".\u67E5\u8BE2";
|
|
276
|
+
}
|
|
277
|
+
return _context8.abrupt("return", this.request.post("serviceUpdate", data, {
|
|
278
|
+
params: params
|
|
279
|
+
}));
|
|
280
|
+
case 3:
|
|
270
281
|
case "end":
|
|
271
282
|
return _context8.stop();
|
|
272
283
|
}
|
|
@@ -19,6 +19,10 @@ export interface FilterRule {
|
|
|
19
19
|
value?: any;
|
|
20
20
|
rules?: FilterRule[];
|
|
21
21
|
}
|
|
22
|
+
export interface OrderRule {
|
|
23
|
+
key: string;
|
|
24
|
+
direction: "asc" | "desc";
|
|
25
|
+
}
|
|
22
26
|
export type OperatorType = "eq" | "ne" | "gt" | "goe" | "lt" | "loe" | "like" | "notLike" | "in" | "notIn" | "isNull" | "isNotNull" | "between" | "notBetween";
|
|
23
27
|
export interface RestSearchParams {
|
|
24
28
|
page?: number;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page-layout";
|
|
2
|
+
import { DataView } from "./page-form-data-manager";
|
|
2
3
|
export type PageFormDataManagerModeType = "page" | "selectOne" | "selectMore";
|
|
4
|
+
interface ShowFormDataManagerGroupItem extends DataView {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
initialValues: any;
|
|
8
|
+
}
|
|
3
9
|
export interface ShowFormDataManagerGroupProps {
|
|
4
10
|
container?: HTMLDivElement;
|
|
5
11
|
layout?: PageLayoutType;
|
|
6
12
|
mode?: PageFormDataManagerModeType;
|
|
7
13
|
title?: string;
|
|
8
|
-
items:
|
|
14
|
+
items: ShowFormDataManagerGroupItem[];
|
|
9
15
|
extraProps?: any;
|
|
10
16
|
defaultSelectedRows?: any[];
|
|
11
17
|
onClose?: () => void | Promise<void>;
|
|
@@ -17,3 +23,4 @@ export interface ShowFormDataManagerGroupProps {
|
|
|
17
23
|
pageRef?: (page: any) => void;
|
|
18
24
|
}
|
|
19
25
|
export declare function showFormDataManagerGroup(options: ShowFormDataManagerGroupProps): Promise<any | any[]>;
|
|
26
|
+
export {};
|
|
@@ -1,19 +1,59 @@
|
|
|
1
1
|
import { PageLayoutType } from "./page-layout";
|
|
2
|
-
import { FilterRule } from "../api/rest-api";
|
|
2
|
+
import { FilterRule, OrderRule } from "../api/rest-api";
|
|
3
|
+
import { FormInstance } from "antd";
|
|
3
4
|
export type PageFormDataManagerModeType = "associationField" | "dataManager" | "selectOne" | "selectMany";
|
|
5
|
+
interface FillRule {
|
|
6
|
+
key: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DataView {
|
|
10
|
+
form?: {
|
|
11
|
+
id?: string;
|
|
12
|
+
fieldId?: string;
|
|
13
|
+
};
|
|
14
|
+
labelField?: string;
|
|
15
|
+
secondaryLabelFields?: string[];
|
|
16
|
+
fieldWidth?: Record<string, number>;
|
|
17
|
+
filterRules: FilterRule[];
|
|
18
|
+
hiddenFields: string[];
|
|
19
|
+
searchFields: FilterRule[];
|
|
20
|
+
orderRules: OrderRule[];
|
|
21
|
+
fillRules?: {
|
|
22
|
+
mainRules: FillRule[];
|
|
23
|
+
tableRules: FillRule[];
|
|
24
|
+
};
|
|
25
|
+
showFields: {
|
|
26
|
+
key: string;
|
|
27
|
+
fixed?: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
onSearch?: (params: any, form?: FormInstance) => void;
|
|
30
|
+
onLoadData?: (data: any[], form?: FormInstance) => void;
|
|
31
|
+
callbacks?: {
|
|
32
|
+
beforeSearch?: string;
|
|
33
|
+
afterSearch?: string;
|
|
34
|
+
beforeExport?: string;
|
|
35
|
+
};
|
|
36
|
+
customActions?: {
|
|
37
|
+
enable?: boolean;
|
|
38
|
+
defaults?: string[];
|
|
39
|
+
toolbarLeftOptions?: string[];
|
|
40
|
+
toolbarRightOptions?: string[];
|
|
41
|
+
footerLeftOptions?: string[];
|
|
42
|
+
footerRightOptions?: string[];
|
|
43
|
+
rowOptions?: string[];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
4
46
|
export interface ShowPageFormDataManagerProps {
|
|
5
47
|
container?: HTMLDivElement;
|
|
6
48
|
layout?: PageLayoutType;
|
|
49
|
+
title?: string;
|
|
7
50
|
form?: {
|
|
8
51
|
id: string;
|
|
9
52
|
fieldId?: string;
|
|
10
53
|
};
|
|
11
54
|
mode?: PageFormDataManagerModeType;
|
|
12
|
-
dataView?:
|
|
13
|
-
|
|
14
|
-
searchFields?: FilterRule[];
|
|
15
|
-
orderRules?: any[];
|
|
16
|
-
};
|
|
55
|
+
dataView?: DataView;
|
|
56
|
+
defaultSelectedRows?: any[];
|
|
17
57
|
extraProps?: any;
|
|
18
58
|
onClose?: () => void | Promise<void>;
|
|
19
59
|
onSearch?: (params: any[]) => void | Promise<void>;
|
|
@@ -24,3 +64,4 @@ export interface ShowPageFormDataManagerProps {
|
|
|
24
64
|
pageRef?: (page: any) => void;
|
|
25
65
|
}
|
|
26
66
|
export declare function showFormDataManager(options: ShowPageFormDataManagerProps): Promise<any | any[]>;
|
|
67
|
+
export {};
|