From 441a8b88203d9691cb50d976e95fc46a87d8fee9 Mon Sep 17 00:00:00 2001 From: Treecat Date: Mon, 3 Apr 2023 14:45:18 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14316=20chore:=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/base/tree/customtree.js | 1 + .../src/case/button/item.singleselect.radio.js | 1 + .../allvaluechooser/combo.allvaluechooser.js | 1 + packages/fineui/src/core/structure/tree.js | 12 ++++++------ .../dynamicdatetime/dynamicdatetime.timeselect.js | 10 +++++----- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/fineui/src/base/tree/customtree.js b/packages/fineui/src/base/tree/customtree.js index 0172a19d0..491fbc96b 100644 --- a/packages/fineui/src/base/tree/customtree.js +++ b/packages/fineui/src/base/tree/customtree.js @@ -81,6 +81,7 @@ export class CustomTree extends Widget { { id: node.id, pId: node.pId, + key: node.key, } ); let el = stripEL(node); diff --git a/packages/fineui/src/case/button/item.singleselect.radio.js b/packages/fineui/src/case/button/item.singleselect.radio.js index 331f0bf3f..b39996632 100644 --- a/packages/fineui/src/case/button/item.singleselect.radio.js +++ b/packages/fineui/src/case/button/item.singleselect.radio.js @@ -35,6 +35,7 @@ export class SingleSelectRadioItem extends BasicButton { items: [ { type: Radio.xtype, + once: o.once, ref: _ref => { this.radio = _ref; }, diff --git a/packages/fineui/src/component/allvaluechooser/combo.allvaluechooser.js b/packages/fineui/src/component/allvaluechooser/combo.allvaluechooser.js index ed746ec3c..519218278 100644 --- a/packages/fineui/src/component/allvaluechooser/combo.allvaluechooser.js +++ b/packages/fineui/src/component/allvaluechooser/combo.allvaluechooser.js @@ -34,6 +34,7 @@ export class AllValueChooserCombo extends AbstractAllValueChooser { valueFormatter: bind(this._valueFormatter, this), width: o.width, height: o.height, + defaultText: o.defaultText, value: this._assertValue({ type: Selection.Multi, value: o.value || [], diff --git a/packages/fineui/src/core/structure/tree.js b/packages/fineui/src/core/structure/tree.js index a48c17d83..3f640f7c0 100644 --- a/packages/fineui/src/core/structure/tree.js +++ b/packages/fineui/src/core/structure/tree.js @@ -170,15 +170,15 @@ export class Tree { initTree(nodes) { this.clear(); - const queue = []; + const queue = new Set(); each(nodes, (i, node) => { const n = new Node(node); n.set("data", node); this.addNode(n); - queue.push(n); + queue.add(n); }); - while (!isEmpty(queue)) { - const parent = queue.shift(); + queue.forEach(parent => { + queue.delete(parent); const node = parent.get("data"); each(node.children, (i, child) => { const n = new Node(child); @@ -186,7 +186,7 @@ export class Tree { queue.push(n); this.addNode(parent, n); }); - } + }) } _toJSON(node) { @@ -265,7 +265,7 @@ export class Tree { continue; } if (temp != null) { - queue = queue.concat(temp.getChildren()); + queue.push(...temp.getChildren()); } } } diff --git a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js index f7d46437d..45355275b 100644 --- a/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js +++ b/packages/fineui/src/widget/dynamicdatetime/dynamicdatetime.timeselect.js @@ -28,12 +28,12 @@ export class DynamicDateTimeSelect extends Widget { props () { return { baseCls: "bi-date-time-select", - height: SIZE_CONSANTS.LIST_ITEM_HEIGHT, + editorHeight: SIZE_CONSANTS.LIST_ITEM_HEIGHT, }; } render() { - const { height } = this.options; + const { editorHeight } = this.options; return { type: CenterAdaptLayout.xtype, @@ -79,7 +79,7 @@ export class DynamicDateTimeSelect extends Widget { } ], width: 60, - height, + height: editorHeight, }, }, { @@ -124,7 +124,7 @@ export class DynamicDateTimeSelect extends Widget { } ], width: 60, - height, + height: editorHeight, }, { type: Label.xtype, @@ -158,7 +158,7 @@ export class DynamicDateTimeSelect extends Widget { } ], width: 60, - height, + height: editorHeight, } ], }