From 89eb72ab4fd8607498445701640c465e2521a2b6 Mon Sep 17 00:00:00 2001 From: Sylar <> Date: Tue, 26 Mar 2024 11:03:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-114436=20fix:=20=E5=90=8C=E6=AD=A5De?= =?UTF-8?q?p=E5=9B=9E=E6=94=B6=E4=BC=98=E5=8C=96=E5=88=B0release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/fix/fix.compact.js | 15 ++++++++------- packages/fineui/src/fix/fix.js | 10 +++++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/fineui/src/fix/fix.compact.js b/packages/fineui/src/fix/fix.compact.js index 40b02fe8f..e76aea6a4 100644 --- a/packages/fineui/src/fix/fix.compact.js +++ b/packages/fineui/src/fix/fix.compact.js @@ -76,7 +76,7 @@ function popTarget() { export const Model = Fix.Model; const oldWatch = Fix.watch; -Fix.watch = function(model, expOrFn, cb, options) { +Fix.watch = function (model, expOrFn, cb, options) { if (isPlainObject(cb)) { options = cb; cb = cb.handler; @@ -89,7 +89,7 @@ Fix.watch = function(model, expOrFn, cb, options) { this, model, expOrFn, - function() { + function () { options && options.store && pushTarget(options.store); let res; try { @@ -167,7 +167,7 @@ export function createStore() { } const _init = Widget.prototype._init; -Widget.prototype._init = function() { +Widget.prototype._init = function () { const needPop = createStore.call(this); try { _init.apply(this, arguments); @@ -178,7 +178,7 @@ Widget.prototype._init = function() { }; const __initWatch = Widget.prototype.__initWatch; -Widget.prototype.__initWatch = function() { +Widget.prototype.__initWatch = function () { __initWatch.apply(this, arguments); const workerMode = Providers.getProvider("bi.provider.system").getWorkerMode(); @@ -191,7 +191,7 @@ Widget.prototype.__initWatch = function() { }; const unMount = Widget.prototype.__destroy; -Widget.prototype.__destroy = function() { +Widget.prototype.__destroy = function () { try { unMount.apply(this, arguments); } catch (e) { @@ -204,6 +204,7 @@ Widget.prototype.__destroy = function() { unwatch(); }); }); + Fix.cleanupDeps(); this._watchers && (this._watchers = []); if (this.store) { this.store._parent && (this.store._parent = null); @@ -213,7 +214,7 @@ Widget.prototype.__destroy = function() { delete this.__cacheStore; }; -Widget.prototype.__watch = function(getter, handler, options) { +Widget.prototype.__watch = function (getter, handler, options) { this._watchers = this._watchers || []; const watcher = new Fix.Watcher( null, @@ -235,7 +236,7 @@ Widget.prototype.__watch = function(getter, handler, options) { _.each(["_render", "__afterRender", "_mount", "__afterMount"], (name) => { const old = Widget.prototype[name]; old && - (Widget.prototype[name] = function() { + (Widget.prototype[name] = function () { this.store && pushTarget(this.store); let res; try { diff --git a/packages/fineui/src/fix/fix.js b/packages/fineui/src/fix/fix.js index ac7a8b839..51e550ae0 100644 --- a/packages/fineui/src/fix/fix.js +++ b/packages/fineui/src/fix/fix.js @@ -110,7 +110,15 @@ function isExtensible(obj) { function remove(arr, item) { - if (arr && arr.length) { + if (!arr) { + return; + } + const len = arr.length; + if (len) { + if (item === arr[len - 1]) { + arr.length = len - 1; + return; + } const index = arr.indexOf(item); if (index > -1) { return arr.splice(index, 1); From 28f5b238400589fbf98b4a5c13e352beb476e35c Mon Sep 17 00:00:00 2001 From: "Jimmy.Chai" Date: Mon, 11 Mar 2024 16:31:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?BI-143833=20fix:=20=E5=85=A8=E9=80=89?= =?UTF-8?q?=E6=97=B6=E6=95=B0=E6=8D=AE=E5=8F=98=E5=8C=96=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A1=AE=E5=AE=9A=E7=BB=84=E4=BB=B6=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 732b158bbe20cadad3d294502ad260739eb5b043) --- .../multiselect/multiselect.insert.combo.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js b/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js index 9a047fbd0..528bba62e 100644 --- a/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js +++ b/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js @@ -31,7 +31,8 @@ import { pushDistinct, Selection, SIZE_CONSANTS, - BlankSplitChar + BlankSplitChar, + size, } from "@/core"; import { Single, Combo, Msg } from "@/base"; import { MultiSelectBar, TriggerIconButton } from "@/case"; @@ -215,7 +216,19 @@ export class MultiSelectInsertCombo extends Single { }, } ], - itemsCreator: o.itemsCreator, + itemsCreator: (op, callback) => { + o.itemsCreator(op, ob => { + callback(ob); + // 全选时数据变化,配置需要同步 + if (this.storeValue.type === Selection.All && size(ob.items) !== size(this.storeValue.assist)) { + this._dataChange = true; + this.storeValue.assist = map(ob.items, 'value'); + this._adjust(() => { + assertShowValue(); + }); + } + }); + }, valueFormatter: o.valueFormatter, itemFormatter: o.itemFormatter, itemHeight: o.itemHeight, From 6d8dc5646d2e70c97d072ef5fba8862f20c4fb6b Mon Sep 17 00:00:00 2001 From: "Jimmy.Chai" Date: Mon, 11 Mar 2024 17:57:44 +0800 Subject: [PATCH 3/3] =?UTF-8?q?BI-143833=20fix:=20=E5=85=A8=E9=80=89?= =?UTF-8?q?=E6=97=B6=E6=95=B0=E6=8D=AE=E5=8F=98=E5=8C=96=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A1=AE=E5=AE=9A=E7=BB=84=E4=BB=B6=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 3192129ee787dddc00bef4dc5a3b4b8a80a7ff30) --- .../fineui/src/widget/multiselect/multiselect.insert.combo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js b/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js index 528bba62e..25ebc9feb 100644 --- a/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js +++ b/packages/fineui/src/widget/multiselect/multiselect.insert.combo.js @@ -220,7 +220,7 @@ export class MultiSelectInsertCombo extends Single { o.itemsCreator(op, ob => { callback(ob); // 全选时数据变化,配置需要同步 - if (this.storeValue.type === Selection.All && size(ob.items) !== size(this.storeValue.assist)) { + if (op.times === 1 &&this.storeValue.type === Selection.All && size(ob.items) !== size(this.storeValue.assist)) { this._dataChange = true; this.storeValue.assist = map(ob.items, 'value'); this._adjust(() => {