Browse Source

REPORT-87542 复制模板,点击刷新按钮,触发粘贴,会提示没有权限

release/11.0
roger 2 years ago
parent
commit
3d57a6bff5
  1. 5
      designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java
  2. 1
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

5
designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java

@ -28,6 +28,7 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.CollectionUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
@ -229,6 +230,10 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
}
//确定目标目录并检查权限
FileOperations selectedOperation = DesignerFrameFileDealerPane.getInstance().getSelectedOperation();
//没有选中目标目录时粘贴,允许超管往根目录粘贴
if (selectedOperation.getFileNode() == null && WorkContext.getCurrent().isRoot()) {
return true;
}
if (!selectedOperation.access()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied"),

1
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -307,6 +307,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
if (reportletsTree.getSelectionCount() == 0) {
//没选中文件刷新根目录
reportletsTree.refresh();
return;
}
reportletsTree.refreshParent(Objects.requireNonNull(reportletsTree.getSelectionPath()));
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(null);

Loading…
Cancel
Save