@byteluck-fe/model-driven-upgrade 1.8.1-beta.4 → 2.0.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.
- package/dist/esm/VersionBuilder.js +2 -2
- package/dist/esm/upgrade/index.js +3 -1
- package/dist/esm/upgrade/v1_0.js +39 -39
- package/dist/esm/upgrade/v2_1.js +1 -1
- package/dist/esm/upgrade/v2_10.js +76 -0
- package/dist/esm/upgrade/v2_3.js +1 -1
- package/dist/esm/upgrade/v2_6.js +2 -2
- package/dist/esm/upgrade/v2_8.js +2 -2
- package/dist/index.umd.js +1 -1
- package/dist/types/upgrade/index.d.ts +2 -1
- package/dist/types/upgrade/v2_10.d.ts +3 -0
- package/package.json +5 -5
|
@@ -51,8 +51,8 @@ export var VersionBuilder = /*#__PURE__*/ function() {
|
|
|
51
51
|
return schema;
|
|
52
52
|
}
|
|
53
53
|
var result = this.callDataCleanerKeys.reduce(function(schema, currentVersion, index, arr) {
|
|
54
|
-
var
|
|
55
|
-
var nextVersion = (
|
|
54
|
+
var ref;
|
|
55
|
+
var nextVersion = (ref = arr[index + 1]) !== null && ref !== void 0 ? ref : _this.toVersion;
|
|
56
56
|
log("Version Builder: current version: ".concat(currentVersion, ", nextVersion: ").concat(nextVersion));
|
|
57
57
|
var callback = dataCleaner[currentVersion];
|
|
58
58
|
var result = schema;
|
|
@@ -9,6 +9,7 @@ import { dataCleaner as dataCleanerV2_6toV2_7 } from "./v2_6";
|
|
|
9
9
|
import { dataCleaner as dataCleanerV2_7toV2_8 } from "./v2_7";
|
|
10
10
|
import { dataCleaner as dataCleanerV2_8toV2_9 } from "./v2_8";
|
|
11
11
|
import { dataCleaner as dataCleanerV2_9toV2_10 } from "./v2_9";
|
|
12
|
+
import { dataCleaner as dataCleanerV2_10toV2_11 } from "./v2_10";
|
|
12
13
|
// TODO 切记复制粘贴的时候改一下from后边的路径,不然会出事儿
|
|
13
14
|
// TODO 注意从2.5版本开始,没有进行驼峰转下划线了,写的时候要注意
|
|
14
15
|
export default {
|
|
@@ -23,6 +24,7 @@ export default {
|
|
|
23
24
|
"v2.7": dataCleanerV2_7toV2_8,
|
|
24
25
|
"v2.8": dataCleanerV2_8toV2_9,
|
|
25
26
|
"v2.9": dataCleanerV2_9toV2_10,
|
|
27
|
+
"v2.10": dataCleanerV2_10toV2_11,
|
|
26
28
|
// 每次都需要预留一个下一版本的转换函数,会使用到对应的key作为当前最新的schema version
|
|
27
|
-
"v2.
|
|
29
|
+
"v2.11": function() {}
|
|
28
30
|
};
|
package/dist/esm/upgrade/v1_0.js
CHANGED
|
@@ -81,7 +81,7 @@ var baseControlKeys = [
|
|
|
81
81
|
CONTROL_TYPE.LINK,
|
|
82
82
|
CONTROL_TYPE.BUTTON,
|
|
83
83
|
"list-btn-export-list",
|
|
84
|
-
"list-btn-export-record"
|
|
84
|
+
"list-btn-export-record",
|
|
85
85
|
];
|
|
86
86
|
var listControlKeys = [
|
|
87
87
|
"subtable",
|
|
@@ -91,7 +91,7 @@ var searchViewControlKeys = [
|
|
|
91
91
|
"simple-search"
|
|
92
92
|
];
|
|
93
93
|
function conversion(item, payload) {
|
|
94
|
-
var
|
|
94
|
+
var ref, ref1, ref2;
|
|
95
95
|
var new_item = item;
|
|
96
96
|
if (!new_item.controlType) {
|
|
97
97
|
if (new_item.is_layout_control === true) {
|
|
@@ -122,13 +122,13 @@ function conversion(item, payload) {
|
|
|
122
122
|
item.props.defaultValue = item.props.value;
|
|
123
123
|
}
|
|
124
124
|
//caption/placeholder/placeholder_end 的 zh 属性将被保留,国际化资源都丢弃,放到外部
|
|
125
|
-
if (isLanguageObject(item === null || item === void 0 ? void 0 : (
|
|
125
|
+
if (isLanguageObject(item === null || item === void 0 ? void 0 : (ref = item.props) === null || ref === void 0 ? void 0 : ref.caption)) {
|
|
126
126
|
new_item.props.caption = item.props.caption.zh;
|
|
127
127
|
}
|
|
128
|
-
if (isLanguageObject(item === null || item === void 0 ? void 0 : (
|
|
128
|
+
if (isLanguageObject(item === null || item === void 0 ? void 0 : (ref1 = item.props) === null || ref1 === void 0 ? void 0 : ref1.placeholder)) {
|
|
129
129
|
new_item.props.placeholder = item.props.placeholder.zh;
|
|
130
130
|
}
|
|
131
|
-
if (isLanguageObject(item === null || item === void 0 ? void 0 : (
|
|
131
|
+
if (isLanguageObject(item === null || item === void 0 ? void 0 : (ref2 = item.props) === null || ref2 === void 0 ? void 0 : ref2.placeholder_end)) {
|
|
132
132
|
new_item.props.placeholder_end = item.props.placeholder_end.zh;
|
|
133
133
|
}
|
|
134
134
|
// 部门组件
|
|
@@ -146,14 +146,14 @@ function conversion(item, payload) {
|
|
|
146
146
|
}
|
|
147
147
|
// 附件类型转换
|
|
148
148
|
if (item.type === "file") {
|
|
149
|
-
var
|
|
149
|
+
var ref3;
|
|
150
150
|
new_item.type = "attachment";
|
|
151
|
-
new_item.props.attachmentAccept = (
|
|
151
|
+
new_item.props.attachmentAccept = (ref3 = item.attachment_format) === null || ref3 === void 0 ? void 0 : ref3.split(",");
|
|
152
152
|
new_item.props.showType = item.props.show_type === "title" ? "default" : "table";
|
|
153
153
|
}
|
|
154
154
|
if (item.type === "image") {
|
|
155
|
-
var
|
|
156
|
-
new_item.props.attachmentAccept = (
|
|
155
|
+
var ref4;
|
|
156
|
+
new_item.props.attachmentAccept = (ref4 = item.attachment_format) === null || ref4 === void 0 ? void 0 : ref4.split(",");
|
|
157
157
|
}
|
|
158
158
|
// 日期选择转换
|
|
159
159
|
if (item.type === "date-pick") {
|
|
@@ -191,11 +191,11 @@ function conversion(item, payload) {
|
|
|
191
191
|
}
|
|
192
192
|
//明细子表去掉 subtable-row,保留 subtable-column
|
|
193
193
|
if (new_item.type === "subtable") {
|
|
194
|
-
var
|
|
194
|
+
var ref5;
|
|
195
195
|
// 转换打开方式
|
|
196
196
|
var entryType = new_item.props.entry_type || new_item.props.entryType;
|
|
197
197
|
new_item.props.openType = entryType === "subpage" ? "modal" : "default";
|
|
198
|
-
if (((
|
|
198
|
+
if (((ref5 = new_item.children[0]) === null || ref5 === void 0 ? void 0 : ref5.type) === "subtable-row") {
|
|
199
199
|
if (new_item.props.headers) {
|
|
200
200
|
new_item.props.headers = new_item.props.headers.map(function(item, index) {
|
|
201
201
|
var subtableColumn = new SubTableColumn.Designer();
|
|
@@ -361,7 +361,7 @@ function conversion(item, payload) {
|
|
|
361
361
|
}
|
|
362
362
|
function conversionDisplayBoListAndBehaviors(control, payload) {
|
|
363
363
|
if (!payload) return;
|
|
364
|
-
var
|
|
364
|
+
var _displayBoList = payload.displayBoList, displayBoList = _displayBoList === void 0 ? [] : _displayBoList, _behaviors = payload.behaviors, behaviors = _behaviors === void 0 ? [] : _behaviors;
|
|
365
365
|
var controlId = control.id;
|
|
366
366
|
var newId = control.children[0].id;
|
|
367
367
|
displayBoList.forEach(function(item) {
|
|
@@ -417,9 +417,9 @@ function conversionLayoutControl(schemArray) {
|
|
|
417
417
|
if (!(item && item.children)) return;
|
|
418
418
|
var controlArray = item.children;
|
|
419
419
|
for(var i = 0; i < controlArray.length; i++){
|
|
420
|
-
var
|
|
420
|
+
var ref, ref1;
|
|
421
421
|
var control = controlArray[i];
|
|
422
|
-
var child = (
|
|
422
|
+
var child = (ref = controlArray[i]) === null || ref === void 0 ? void 0 : (ref1 = ref.children) === null || ref1 === void 0 ? void 0 : ref1[0];
|
|
423
423
|
if (control.type === "grid-row" && child && [
|
|
424
424
|
"group-panel",
|
|
425
425
|
"subtable",
|
|
@@ -431,7 +431,7 @@ function conversionLayoutControl(schemArray) {
|
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
function conversionListPage(controlArray, payload) {
|
|
434
|
-
var
|
|
434
|
+
var ref, ref1, ref2, ref3, ref4;
|
|
435
435
|
if (!(Array.isArray(controlArray) && controlArray.length === 1)) {
|
|
436
436
|
return controlArray;
|
|
437
437
|
}
|
|
@@ -443,19 +443,19 @@ function conversionListPage(controlArray, payload) {
|
|
|
443
443
|
var listPageProps = listPage.props, children = listPage.children;
|
|
444
444
|
var _children = _slicedToArray(children, 3), search = _children[0], toolbox = _children[1], table = _children[2];
|
|
445
445
|
conversionSearch(search);
|
|
446
|
-
table.props.is_fixed_header = listPageProps === null || listPageProps === void 0 ? void 0 : (
|
|
446
|
+
table.props.is_fixed_header = listPageProps === null || listPageProps === void 0 ? void 0 : (ref = listPageProps.source_config) === null || ref === void 0 ? void 0 : ref.is_fixed_header;
|
|
447
447
|
// table.props.datasource_bind = new DataSourceBind({
|
|
448
448
|
// dataCode: listPageProps?.source_config?data_code,
|
|
449
449
|
// svcCode: listPageProps?.source_config?svc_code,
|
|
450
450
|
// orders: camelizeKeys(listPageProps?.source_config?orders) as any[],
|
|
451
451
|
// })
|
|
452
452
|
conversionGridTable(table, toolbox);
|
|
453
|
-
var
|
|
454
|
-
var dataCode = (
|
|
455
|
-
var
|
|
456
|
-
var svcCode = ((
|
|
457
|
-
var
|
|
458
|
-
var orders = (
|
|
453
|
+
var ref5;
|
|
454
|
+
var dataCode = (ref5 = listPageProps === null || listPageProps === void 0 ? void 0 : (ref1 = listPageProps.source_config) === null || ref1 === void 0 ? void 0 : ref1.data_code) !== null && ref5 !== void 0 ? ref5 : payload === null || payload === void 0 ? void 0 : payload.dataCode;
|
|
455
|
+
var ref6;
|
|
456
|
+
var svcCode = ((ref6 = listPageProps === null || listPageProps === void 0 ? void 0 : (ref2 = listPageProps.source_config) === null || ref2 === void 0 ? void 0 : ref2.svc_code) !== null && ref6 !== void 0 ? ref6 : dataCode) ? "".concat(dataCode, "_selectMore") : undefined;
|
|
457
|
+
var ref7;
|
|
458
|
+
var orders = (ref7 = listPageProps === null || listPageProps === void 0 ? void 0 : (ref3 = listPageProps.source_config) === null || ref3 === void 0 ? void 0 : ref3.orders) !== null && ref7 !== void 0 ? ref7 : [];
|
|
459
459
|
var listView = new ListView.Designer();
|
|
460
460
|
listView.props.datasourceBind = new DataSourceBind({
|
|
461
461
|
dataCode: dataCode,
|
|
@@ -465,7 +465,7 @@ function conversionListPage(controlArray, payload) {
|
|
|
465
465
|
listView.props.isShowSubList = listPageProps.is_show_sublist;
|
|
466
466
|
listView.props.triggerType = listPageProps.timing_type;
|
|
467
467
|
listView.props.triggerFieldCode = listPageProps.ctrl_field_code;
|
|
468
|
-
listPageProps === null || listPageProps === void 0 ? void 0 : (
|
|
468
|
+
listPageProps === null || listPageProps === void 0 ? void 0 : (ref4 = listPageProps.sublist_page) === null || ref4 === void 0 ? void 0 : ref4.sublists.forEach(function(item) {
|
|
469
469
|
item.title = isLanguageObject(item.title) ? item.title.zh : item.title;
|
|
470
470
|
});
|
|
471
471
|
listView.props.sublistPage = listPageProps.sublist_page;
|
|
@@ -486,11 +486,11 @@ function conversionSearch(searchControl) {
|
|
|
486
486
|
item.placeholderEnd = placeholder;
|
|
487
487
|
}
|
|
488
488
|
if (item.type === "date-pick") {
|
|
489
|
-
var
|
|
489
|
+
var ref, ref1;
|
|
490
490
|
item.type = "search-date-range";
|
|
491
491
|
item.placeholderStart = placeholder;
|
|
492
492
|
item.placeholderEnd = placeholder;
|
|
493
|
-
item.dateType = (
|
|
493
|
+
item.dateType = (ref = item.dateType) === null || ref === void 0 ? void 0 : (ref1 = ref.replace) === null || ref1 === void 0 ? void 0 : ref1.call(ref, /range$/);
|
|
494
494
|
}
|
|
495
495
|
if (item.type === "automatic-number" || item.type === "auto-number") {
|
|
496
496
|
item.type = "search-input";
|
|
@@ -540,14 +540,14 @@ function conversionGridTable(tableControl, toolbox) {
|
|
|
540
540
|
obj.props.fixed = true;
|
|
541
541
|
} else if (item.table_header_type === "operation") {
|
|
542
542
|
obj.type = "operation-column";
|
|
543
|
-
var
|
|
544
|
-
obj.props.check = (
|
|
543
|
+
var _check;
|
|
544
|
+
obj.props.check = (_check = item.check) !== null && _check !== void 0 ? _check : {};
|
|
545
545
|
obj.props.check.openType = "window";
|
|
546
|
-
var
|
|
547
|
-
obj.props.delete = (
|
|
546
|
+
var _delete;
|
|
547
|
+
obj.props.delete = (_delete = item.delete) !== null && _delete !== void 0 ? _delete : {};
|
|
548
548
|
obj.props.delete.openType = "window";
|
|
549
|
-
var
|
|
550
|
-
obj.props.edit = (
|
|
549
|
+
var _edit;
|
|
550
|
+
obj.props.edit = (_edit = item.edit) !== null && _edit !== void 0 ? _edit : {};
|
|
551
551
|
obj.props.edit.openType = "window";
|
|
552
552
|
obj.props.fixed = true;
|
|
553
553
|
} else {
|
|
@@ -579,12 +579,12 @@ function conversionGridTable(tableControl, toolbox) {
|
|
|
579
579
|
function groupPanelHandler(controlArray) {
|
|
580
580
|
var group = null;
|
|
581
581
|
for(var i = 0; i < controlArray.length; i++){
|
|
582
|
-
var
|
|
582
|
+
var ref;
|
|
583
583
|
var item = controlArray[i];
|
|
584
584
|
if (!item) {
|
|
585
585
|
continue;
|
|
586
586
|
}
|
|
587
|
-
if (item.children && ((
|
|
587
|
+
if (item.children && ((ref = item.children[0]) === null || ref === void 0 ? void 0 : ref.type) === "group-panel") {
|
|
588
588
|
group = item.children[0];
|
|
589
589
|
continue;
|
|
590
590
|
}
|
|
@@ -610,7 +610,7 @@ function conversionPageEvents(events) {
|
|
|
610
610
|
});
|
|
611
611
|
}
|
|
612
612
|
function conversionControlEvents(control, controlEvents) {
|
|
613
|
-
var
|
|
613
|
+
var ref;
|
|
614
614
|
if (!controlEvents || !control.props.events) {
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
@@ -619,7 +619,7 @@ function conversionControlEvents(control, controlEvents) {
|
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
621
|
eventKeys.forEach(function(eventKey) {
|
|
622
|
-
var
|
|
622
|
+
var _eventKey;
|
|
623
623
|
if (!control.props.events[eventKey].length) {
|
|
624
624
|
return;
|
|
625
625
|
}
|
|
@@ -629,17 +629,17 @@ function conversionControlEvents(control, controlEvents) {
|
|
|
629
629
|
if (!controlEvents[control.id][eventKey]) {
|
|
630
630
|
controlEvents[control.id][eventKey] = [];
|
|
631
631
|
}
|
|
632
|
-
(
|
|
632
|
+
(_eventKey = controlEvents[control.id][eventKey]).push.apply(_eventKey, _toConsumableArray(control.props.events[eventKey].map(function(item) {
|
|
633
633
|
return item.name;
|
|
634
634
|
})));
|
|
635
635
|
});
|
|
636
636
|
// 将失焦事件转换为change事件
|
|
637
|
-
if ((
|
|
638
|
-
var
|
|
637
|
+
if ((ref = controlEvents[control.id]) === null || ref === void 0 ? void 0 : ref.on_blur) {
|
|
638
|
+
var _on_change;
|
|
639
639
|
if (!controlEvents[control.id].on_change) {
|
|
640
640
|
controlEvents[control.id].on_change = [];
|
|
641
641
|
}
|
|
642
|
-
(
|
|
642
|
+
(_on_change = controlEvents[control.id].on_change).push.apply(_on_change, _toConsumableArray(controlEvents[control.id].on_blur));
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
export { dataCleaner };
|
package/dist/esm/upgrade/v2_1.js
CHANGED
|
@@ -20,7 +20,7 @@ function conversion(schema, payload) {
|
|
|
20
20
|
CONTROL_TYPE.EXPORT_RECORD_LIST_BUTTON,
|
|
21
21
|
CONTROL_TYPE.EXPORT_LIST_BUTTON,
|
|
22
22
|
CONTROL_TYPE.FORM_SELECT_BUTTON,
|
|
23
|
-
CONTROL_TYPE.LIST_SELECT_BUTTON
|
|
23
|
+
CONTROL_TYPE.LIST_SELECT_BUTTON,
|
|
24
24
|
].includes(schema.type)) {
|
|
25
25
|
if (schema.props.button_type === "default") {
|
|
26
26
|
schema.props.button_type = "secondary";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: qiyu qiyu@byteluck.com
|
|
3
|
+
* @Date: 2022-12-22 11:36:04
|
|
4
|
+
* @LastEditors: qiyu qiyu@byteluck.com
|
|
5
|
+
* @LastEditTime: 2022-12-22 11:46:20
|
|
6
|
+
* @FilePath: /model-driven/packages/upgrade/src/upgrade/v2_10.ts
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
*/ import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
9
|
+
import { OperationButton } from "@byteluck-fe/model-driven-controls";
|
|
10
|
+
var dataCleaner = function(schemaItems, payload) {
|
|
11
|
+
var isArray = Array.isArray(schemaItems);
|
|
12
|
+
var schemaArray = isArray ? schemaItems : [
|
|
13
|
+
schemaItems
|
|
14
|
+
];
|
|
15
|
+
var new_schema = loop(schemaArray, function(item) {
|
|
16
|
+
return conversion(item, payload);
|
|
17
|
+
});
|
|
18
|
+
return isArray ? new_schema : new_schema[0];
|
|
19
|
+
};
|
|
20
|
+
function conversion(schema, payload) {
|
|
21
|
+
if (schema.type === CONTROL_TYPE.GRID_TABLE) {
|
|
22
|
+
schema.props.headers.map(function(item) {
|
|
23
|
+
if (item.type === CONTROL_TYPE.OPERATION_COLUMN) {
|
|
24
|
+
var ref, ref1, ref2;
|
|
25
|
+
item.children = [];
|
|
26
|
+
delete item.props.custom;
|
|
27
|
+
if (((ref = item.props) === null || ref === void 0 ? void 0 : ref.check) !== undefined) {
|
|
28
|
+
var ref3, ref4, ref5, ref6, ref7, ref8;
|
|
29
|
+
var optbtn = new OperationButton.Designer();
|
|
30
|
+
optbtn.props.code = "view";
|
|
31
|
+
optbtn.props.command = "view";
|
|
32
|
+
optbtn.props.content = (ref3 = item.props) === null || ref3 === void 0 ? void 0 : ref3.check.content;
|
|
33
|
+
optbtn.props.priorityProcess = (ref4 = item.props) === null || ref4 === void 0 ? void 0 : ref4.check.priority_process;
|
|
34
|
+
optbtn.props.openType = (ref5 = item.props) === null || ref5 === void 0 ? void 0 : ref5.check.open_type;
|
|
35
|
+
optbtn.props.formKey = (ref6 = item.props) === null || ref6 === void 0 ? void 0 : ref6.check.form_key;
|
|
36
|
+
if ((ref7 = item.props) === null || ref7 === void 0 ? void 0 : ref7.check.is_show) {
|
|
37
|
+
item.children.push(optbtn.toSchema());
|
|
38
|
+
}
|
|
39
|
+
(ref8 = item.props) === null || ref8 === void 0 ? void 0 : delete ref8.check;
|
|
40
|
+
}
|
|
41
|
+
if (((ref1 = item.props) === null || ref1 === void 0 ? void 0 : ref1.edit) !== undefined) {
|
|
42
|
+
var ref9, ref10, ref11, ref12, ref13, ref14;
|
|
43
|
+
var optbtn1 = new OperationButton.Designer();
|
|
44
|
+
optbtn1.props.code = "edit";
|
|
45
|
+
optbtn1.props.command = "edit";
|
|
46
|
+
optbtn1.props.content = (ref9 = item.props) === null || ref9 === void 0 ? void 0 : ref9.edit.content;
|
|
47
|
+
optbtn1.props.priorityProcess = (ref10 = item.props) === null || ref10 === void 0 ? void 0 : ref10.edit.priority_process;
|
|
48
|
+
optbtn1.props.openType = (ref11 = item.props) === null || ref11 === void 0 ? void 0 : ref11.edit.open_type;
|
|
49
|
+
optbtn1.props.formKey = (ref12 = item.props) === null || ref12 === void 0 ? void 0 : ref12.edit.form_key;
|
|
50
|
+
if ((ref13 = item.props) === null || ref13 === void 0 ? void 0 : ref13.edit.is_show) {
|
|
51
|
+
item.children.push(optbtn1.toSchema());
|
|
52
|
+
}
|
|
53
|
+
(ref14 = item.props) === null || ref14 === void 0 ? void 0 : delete ref14.edit;
|
|
54
|
+
}
|
|
55
|
+
if (((ref2 = item.props) === null || ref2 === void 0 ? void 0 : ref2.delete) !== undefined) {
|
|
56
|
+
var ref15, ref16, ref17, ref18, ref19, ref20;
|
|
57
|
+
var optbtn2 = new OperationButton.Designer();
|
|
58
|
+
optbtn2.props.code = "delete";
|
|
59
|
+
optbtn2.props.command = "delete";
|
|
60
|
+
optbtn2.props.content = (ref15 = item.props) === null || ref15 === void 0 ? void 0 : ref15.delete.content;
|
|
61
|
+
optbtn2.props.priorityProcess = (ref16 = item.props) === null || ref16 === void 0 ? void 0 : ref16.delete.priority_process;
|
|
62
|
+
optbtn2.props.openType = (ref17 = item.props) === null || ref17 === void 0 ? void 0 : ref17.delete.open_type;
|
|
63
|
+
optbtn2.props.formKey = (ref18 = item.props) === null || ref18 === void 0 ? void 0 : ref18.delete.form_key;
|
|
64
|
+
optbtn2.props.needConfirm = true;
|
|
65
|
+
optbtn2.props.confirmMessage = "确定要删除此条数据吗?";
|
|
66
|
+
if ((ref19 = item.props) === null || ref19 === void 0 ? void 0 : ref19.delete.is_show) {
|
|
67
|
+
item.children.push(optbtn2.toSchema());
|
|
68
|
+
}
|
|
69
|
+
(ref20 = item.props) === null || ref20 === void 0 ? void 0 : delete ref20.delete;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return schema;
|
|
75
|
+
}
|
|
76
|
+
export { dataCleaner };
|
package/dist/esm/upgrade/v2_3.js
CHANGED
package/dist/esm/upgrade/v2_6.js
CHANGED
|
@@ -47,8 +47,8 @@ function conversion(schema, payload) {
|
|
|
47
47
|
setFieldTypeToDataBind(schema.props.data_bind.max, FieldTypes.TIMESTAMP);
|
|
48
48
|
}
|
|
49
49
|
if (schema.type === CONTROL_TYPE.VUE_FORM_ITEM) {
|
|
50
|
-
var
|
|
51
|
-
setFieldTypeToDataBind(schema.props.data_bind, (
|
|
50
|
+
var _field_type;
|
|
51
|
+
setFieldTypeToDataBind(schema.props.data_bind, (_field_type = schema.field_type) !== null && _field_type !== void 0 ? _field_type : FieldTypes.ANY);
|
|
52
52
|
}
|
|
53
53
|
return schema;
|
|
54
54
|
}
|
package/dist/esm/upgrade/v2_8.js
CHANGED
|
@@ -14,12 +14,12 @@ function conversion(schema, payload) {
|
|
|
14
14
|
if (schema.type === CONTROL_TYPE.SIMPLE_SEARCH && schema.children.length) {
|
|
15
15
|
if (!schema.props.query_type_map) schema.props.query_type_map = [];
|
|
16
16
|
schema.children.forEach(function(item) {
|
|
17
|
-
var
|
|
17
|
+
var ref, ref1;
|
|
18
18
|
if ([
|
|
19
19
|
FieldTypes.VARCHAR,
|
|
20
20
|
FieldTypes.TEXT,
|
|
21
21
|
FieldTypes.AUTO_NUMBER
|
|
22
|
-
].includes((
|
|
22
|
+
].includes((ref = item.props) === null || ref === void 0 ? void 0 : (ref1 = ref.data_bind) === null || ref1 === void 0 ? void 0 : ref1.field_type)) {
|
|
23
23
|
schema.props.query_type_map.push({
|
|
24
24
|
query_type: "LIKE",
|
|
25
25
|
field_code: item.props.data_bind.field_code
|