Browse Source

REPORT-62647 组件更新成功后可更新标志应该消失

【问题原因】
更新成功后没有替换视图块中的组件数据,导致组件
数据模型中的版本还是低版本,所以会继续绘制可
更新标志。

【改动思路】
更新成功后,依照id取出最新的数据并赋值重绘
feature/x
Starryi 3 years ago
parent
commit
3c184dd951
  1. 25
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java

25
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<Double> {
} 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<Double> {
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<Double> {
@Override
public void process(Double processValue) {
this.processValue = processValue;
repaintBlockAndOverlay();
}
private void repaintBlockAndOverlay() {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {

Loading…
Cancel
Save