Merge commit 'bf2b359b44dc6aa331f424d6497a9597842f3c3c' into def_releases_202111221049066_ali-lowcode_ali-lowcode-engine/1.0.73

This commit is contained in:
tbfed 2021-11-26 13:49:48 +08:00
commit 4befcf9ea1
4 changed files with 13 additions and 34 deletions

View File

@ -234,7 +234,6 @@ export class Prop implements IPropParent {
@action @action
setValue(val: CompositeValue) { setValue(val: CompositeValue) {
if (val === this._value) return; if (val === this._value) return;
this.dispose();
const editor = this.owner.document?.designer.editor; const editor = this.owner.document?.designer.editor;
const oldValue = this._value; const oldValue = this._value;
this._value = val; this._value = val;
@ -263,6 +262,8 @@ export class Prop implements IPropParent {
}; };
} }
this.dispose();
if (oldValue !== this._value) { if (oldValue !== this._value) {
const propsInfo = { const propsInfo = {
key: this.key, key: this.key,
@ -450,7 +451,7 @@ export class Prop implements IPropParent {
} }
if (createIfNone) { if (createIfNone) {
prop = new Prop(this, UNSET, entry); prop = new Prop(this, nest ? {} : UNSET, entry);
this.set(entry, prop, true); this.set(entry, prop, true);
if (nest) { if (nest) {
return prop.get(nest, true); return prop.get(nest, true);

View File

@ -202,7 +202,7 @@ export class Props implements IPropParent {
let prop = this.maps.get(entry); let prop = this.maps.get(entry);
if (!prop && createIfNone) { if (!prop && createIfNone) {
prop = new Prop(this, UNSET, entry); prop = new Prop(this, nest ? {} : UNSET, entry);
this.items.push(prop); this.items.push(prop);
} }

View File

@ -79,7 +79,6 @@ Object {
"__slot__extraContent": false, "__slot__extraContent": false,
"__slot__logo": false, "__slot__logo": false,
"__slot__tab": false, "__slot__tab": false,
"__style__": Object {},
"action": "", "action": "",
"content": "", "content": "",
"crumb": "", "crumb": "",
@ -95,7 +94,6 @@ Object {
"condition": true, "condition": true,
"id": "node_k1ow3cbf", "id": "node_k1ow3cbf",
"props": Object { "props": Object {
"__style__": Object {},
"behavior": "NORMAL", "behavior": "NORMAL",
"content": Object { "content": Object {
"en_US": "Title", "en_US": "Title",
@ -144,7 +142,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"addonAfter": Object { "addonAfter": Object {
"type": "i18n", "type": "i18n",
@ -177,7 +174,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -222,7 +219,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"addonAfter": Object { "addonAfter": Object {
"type": "i18n", "type": "i18n",
@ -255,7 +251,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -296,7 +292,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"addonAfter": Object { "addonAfter": Object {
"type": "i18n", "type": "i18n",
@ -329,7 +324,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -369,7 +364,6 @@ Object {
"id": "node_k1ow3cbx", "id": "node_k1ow3cbx",
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__style__": Object {},
"colSpan": "", "colSpan": "",
"fieldId": "column_k1p1bnjm", "fieldId": "column_k1p1bnjm",
}, },
@ -386,7 +380,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"addonAfter": Object { "addonAfter": Object {
"type": "i18n", "type": "i18n",
@ -419,7 +412,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -460,7 +453,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"autoWidth": true, "autoWidth": true,
"behavior": "NORMAL", "behavior": "NORMAL",
@ -509,7 +501,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -553,7 +545,6 @@ Object {
"id": "node_k1ow3cby", "id": "node_k1ow3cby",
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__style__": Object {},
"colSpan": "", "colSpan": "",
"fieldId": "column_k1p1bnjn", "fieldId": "column_k1p1bnjn",
}, },
@ -567,7 +558,6 @@ Object {
"id": "node_k1ow3cbw", "id": "node_k1ow3cbw",
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__style__": Object {},
"columnGap": "20", "columnGap": "20",
"fieldId": "columns_k1ow3h1v", "fieldId": "columns_k1ow3h1v",
"layout": "6:6", "layout": "6:6",
@ -638,7 +628,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"addonAfter": Object { "addonAfter": Object {
"type": "i18n", "type": "i18n",
@ -671,7 +660,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -716,7 +705,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"addonAfter": Object { "addonAfter": Object {
"type": "i18n", "type": "i18n",
@ -749,7 +737,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -789,7 +777,6 @@ Object {
"id": "node_k1ow3cc6", "id": "node_k1ow3cc6",
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__style__": Object {},
"colSpan": "", "colSpan": "",
"fieldId": "column_k1p1bnjo", "fieldId": "column_k1p1bnjo",
}, },
@ -806,7 +793,6 @@ Object {
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__category__": "form", "__category__": "form",
"__style__": Object {},
"__useMediator": "value", "__useMediator": "value",
"addonAfter": Object { "addonAfter": Object {
"type": "i18n", "type": "i18n",
@ -839,7 +825,7 @@ Object {
"labelTextAlign": "right", "labelTextAlign": "right",
"labelTipsIcon": "", "labelTipsIcon": "",
"labelTipsText": Object { "labelTipsText": Object {
"en_US": null, "en_US": "",
"type": "i18n", "type": "i18n",
"use": "zh_CN", "use": "zh_CN",
"zh_CN": "", "zh_CN": "",
@ -879,7 +865,6 @@ Object {
"id": "node_k1ow3cc7", "id": "node_k1ow3cc7",
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__style__": Object {},
"colSpan": "", "colSpan": "",
"fieldId": "column_k1p1bnjp", "fieldId": "column_k1p1bnjp",
}, },
@ -893,7 +878,6 @@ Object {
"id": "node_k1ow3cc5", "id": "node_k1ow3cc5",
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__style__": Object {},
"columnGap": "20", "columnGap": "20",
"fieldId": "columns_k1ow3h22", "fieldId": "columns_k1ow3h22",
"layout": "6:6", "layout": "6:6",
@ -1022,7 +1006,6 @@ Object {
"value": Array [ "value": Array [
Object { Object {
"componentName": "Text", "componentName": "Text",
"props": Object {},
}, },
], ],
}, },
@ -1052,7 +1035,6 @@ Object {
"behavior": "NORMAL", "behavior": "NORMAL",
"className": "div_kgaqfbm9", "className": "div_kgaqfbm9",
"customClassName": "", "customClassName": "",
"events": Object {},
"fieldId": "div_k1ow3h1o", "fieldId": "div_k1ow3h1o",
"useFieldIdAsDomId": false, "useFieldIdAsDomId": false,
}, },
@ -1067,7 +1049,6 @@ Object {
"id": "form", "id": "form",
"isLocked": false, "isLocked": false,
"props": Object { "props": Object {
"__style__": Object {},
"autoUnmount": true, "autoUnmount": true,
"autoValidate": true, "autoValidate": true,
"behavior": "NORMAL", "behavior": "NORMAL",
@ -1076,7 +1057,6 @@ Object {
"variable": "state.formData", "variable": "state.formData",
}, },
"fieldId": "form", "fieldId": "form",
"fieldOptions": Object {},
"labelAlign": "top", "labelAlign": "top",
"obj": Object { "obj": Object {
"a": 1, "a": 1,
@ -1137,7 +1117,6 @@ Object {
"globalConfig": Object { "globalConfig": Object {
"fit": Object { "fit": Object {
"compiled": "", "compiled": "",
"error": Object {},
"source": "", "source": "",
"type": "js", "type": "js",
}, },
@ -1196,7 +1175,6 @@ Object.keys(module.exports).forEach(function(item) {
}, },
"props": Object { "props": Object {
"className": "page_kgaqfbm4", "className": "page_kgaqfbm4",
"containerStyle": Object {},
"extensions": Object { "extensions": Object {
"启用页头": true, "启用页头": true,
}, },

View File

@ -75,7 +75,7 @@ describe('NodeChildren 方法测试', () => {
expect(children.size).toBe(1); expect(children.size).toBe(1);
expect(children.length).toBe(1); expect(children.length).toBe(1);
children.splice(0, 0, { componentName: 'Button' }); children.splice(0, 0, doc.createNode({ componentName: 'Button' }));
expect(children.size).toBe(2); expect(children.size).toBe(2);
expect(children.length).toBe(2); expect(children.length).toBe(2);
}); });