Browse Source

Merge pull request #3585 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '114207a56cfb98583a59fc235eb59abd69df2e21':
  REPORT-47516 远程锁定-集群单节点,两个用户先后进入,数据连接的锁定有问题 【问题原因】主要的原因有两个,一是当时测试同学在集群环境上的操作不当导致了用户lock后,在ClientAliveChecker中的check4EditLock方法报错,然后被认定成脏数据清除了;二是此前userIn和userBeat时存入的是LockItem枚举类对象,相当于常量,那么所有用户beat后存入的对象都是同一个,这个是逻辑问题,并且在集群环境上测试的过程中还发现LockItem对象的序列化有些问题,会报错 【改动思路】①将之前存入的ClientID-LockItem键值对修改为存入ClientID-LockedFile键值对,LockedFile是一个继承了HashSet的类,里面有birth和beat的逻辑,天然实现了序列化接口,是模板锁定那边写的一个类,这边就直接拿来用了;②将EditLock和模板锁定的一些逻辑分离了一下,避免过多耦合;③自己测试的时候还发现数据集查询页下的提示弹窗会出现二级弹窗问题,因此在EditLockUtils中添加了个api用于传入父窗口
  CHART-18066 调整富文本编辑器尺寸
  CHART-18102 JXBrowser资源请求增加文件类型
feature/10.0
superman 4 years ago
parent
commit
48a782fae4
  1. 2
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  2. 6
      designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java
  3. 15
      designer-base/src/main/java/com/fr/design/ui/Assistant.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java
  5. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java
  6. 4
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

2
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -128,7 +128,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
boolean actionLock = EditLockUtils.lock(LockItem.CONNECTION);
if (!actionLock) {
// 锁定失败,代表已经被其他用户锁定,跳出弹窗提示
EditLockUtils.showLockMessage();
EditLockUtils.showLockMessage(this);
return;
}
// 锁定成功,执行后续操作

6
designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java

@ -13,6 +13,8 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.awt.Component;
import java.awt.Image;
/**
@ -65,6 +67,10 @@ public class EditLockUtils {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), EditLockUtils.LOCKED_MESSAGE, EditLockUtils.TOOLTIPS, JOptionPane.INFORMATION_MESSAGE, EditLockUtils.TOOLTIPS_ICON);
}
public static void showLockMessage(Component parentComponent) {
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(parentComponent), EditLockUtils.LOCKED_MESSAGE, EditLockUtils.TOOLTIPS, JOptionPane.INFORMATION_MESSAGE, EditLockUtils.TOOLTIPS_ICON);
}
public static boolean lock(LockItem lockItem) {
return WorkContext.getCurrent().get(EditLockOperator.class).lock(lockItem);
}

15
designer-base/src/main/java/com/fr/design/ui/Assistant.java

@ -6,14 +6,12 @@ import com.teamdev.jxbrowser.chromium.BrowserContext;
import com.teamdev.jxbrowser.chromium.ProtocolService;
import com.teamdev.jxbrowser.chromium.URLResponse;
import javax.activation.MimetypesFileTypeMap;
import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
* @author richie
@ -50,6 +48,19 @@ public class Assistant {
if (path.endsWith(".svg")) {
return "image/svg+xml";
}
if (path.endsWith(".png")) {
return "image/png";
}
if (path.endsWith(".woff")) {
return "font/woff";
}
if (path.endsWith(".ttf")) {
return "truetype";
}
if (path.endsWith(".eot")) {
return "embedded-opentype";
}
Path file = new File(path).toPath();
try {
return Files.probeContentType(file);

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java

@ -10,7 +10,7 @@ import java.awt.Frame;
public class VanChartRichTextDialog extends BasicDialog {
public static final Dimension DEFAULT = new Dimension(960, 600);
public static final Dimension DEFAULT = new Dimension(960, 800);
public VanChartRichTextDialog(Frame parent, BasicPane pane) {
super(parent, pane);

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java

@ -20,7 +20,7 @@ public class VanChartRichTextPane extends BasicBeanPane<AttrTooltipContent> {
private static final int FIELD_PANE_H = 270;
private static final int RICH_EDITOR_W = 940;
private static final int RICH_EDITOR_H = 260;
private static final int RICH_EDITOR_H = 460;
private VanChartFieldListPane fieldListPane;
private VanChartFieldAttrPane fieldAttrPane;

4
designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8"/>
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<link rel="stylesheet" type="text/css" href="./rich_editor.css"/>
<link rel="stylesheet" type="text/css" href="emb:/com/fr/web/ui/fineui.min.css"/>
<link rel="stylesheet" type="text/css" href="emb:/com/fr/web/ui/materials.min.css"/>
</head>
<body>
<script src="script/enums.js"></script>

Loading…
Cancel
Save