From 3c184dd951271f4cfee172e1d4100a47a16b3fd1 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 16 Nov 2021 09:48:02 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62647=20=E7=BB=84=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=88=90=E5=8A=9F=E5=90=8E=E5=8F=AF=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A0=87=E5=BF=97=E5=BA=94=E8=AF=A5=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 更新成功后没有替换视图块中的组件数据,导致组件 数据模型中的版本还是低版本,所以会继续绘制可 更新标志。 【改动思路】 更新成功后,依照id取出最新的数据并赋值重绘 --- .../share/ui/block/LocalWidgetUpdater.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java index 083df1b4e..65e5fcc94 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java @@ -5,12 +5,16 @@ import com.fr.design.extra.Process; import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoUpdater; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; import com.fr.design.mainframe.share.util.DownloadUtils; import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.design.ui.util.UIUtil; import com.fr.form.share.DefaultSharableWidget; import com.fr.form.share.Group; +import com.fr.form.share.GroupManege; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.group.DefaultShareGroupManager; import com.fr.log.FineLoggerFactory; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; @@ -106,6 +110,9 @@ public class LocalWidgetUpdater implements Process { } catch (InterruptedException | ExecutionException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } + if (success) { + resetWidgetOfBlock(); + } if (updateListener != null) { updateListener.onUpdated(success, getGroup().getGroupName(), widget.getId()); } @@ -115,6 +122,21 @@ public class LocalWidgetUpdater implements Process { worker.execute(); } + private void resetWidgetOfBlock() { + GroupManege groupManege = DefaultShareGroupManager.getInstance(); + Group group = groupManege.getGroup(getGroup().getGroupName()); + if (group != null) { + String id = widgetBlock.getWidgetUuid(); + if (StringUtils.isNotEmpty(id)) { + SharableWidgetProvider localLatestWidget = group.getElCaseBindInfoById(widgetBlock.getWidgetUuid()); + if (localLatestWidget instanceof DefaultSharableWidget) { + widgetBlock.widget = (DefaultSharableWidget) localLatestWidget; + repaintBlockAndOverlay(); + } + } + } + } + public void cancelUpdate() { if (worker.isDone() || worker.isCancelled()) { return; @@ -126,7 +148,10 @@ public class LocalWidgetUpdater implements Process { @Override public void process(Double processValue) { this.processValue = processValue; + repaintBlockAndOverlay(); + } + private void repaintBlockAndOverlay() { UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() {