Browse Source

REPORT-133888 - 【fr-fbp回归】文件数据集excel只能被选一次

fbp/release
Destiny.Lin 3 months ago
parent
commit
7cfeaef10c
  1. 19
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  2. 16
      designer-base/src/main/java/com/fr/file/FILEFactory.java
  3. 11
      designer-base/src/main/java/com/fr/file/FileDataFILE.java

19
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -1384,6 +1384,7 @@ public class FILEChooserPane extends BasicPane {
private class FileDataPlaceListModel extends AbstractPlaceListModel {
private FileDataFILE envFILE;
private String type;
FileDataPlaceListModel(String type) {
envFILE = new FileDataFILE(new FileNode(StableUtils.pathJoin(ProjectConstants.ASSETS_NAME, FileDataFILE.FILE_DATASET_NAME), true), false, StableUtils.pathJoin(ProjectConstants.ASSETS_NAME, FileDataFILE.FILE_DATASET_NAME)) {
@ -1393,6 +1394,7 @@ public class FILEChooserPane extends BasicPane {
}
};
envFILE.setType(type);
FileDataPlaceListModel.this.setType(type);
}
@Override
@ -1405,6 +1407,21 @@ public class FILEChooserPane extends BasicPane {
return 1 + filesOfSystem.size();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
protected void setCD(FILE lastDirectory) {
super.setCD(lastDirectory);
if (lastDirectory instanceof FileDataFILE) {
((FileDataFILE)lastDirectory).setType(type);
}
}
}
private class FileCAPlaceListModel extends AbstractPlaceListModel {
@ -1642,7 +1659,7 @@ public class FILEChooserPane extends BasicPane {
this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/',
// alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux
// OS中意义很不一样
FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath))));
FILEFactory.createFolder(dir, dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath))));
}
maxPathIndex = calculateMaxPathIndex();

16
designer-base/src/main/java/com/fr/file/FILEFactory.java

@ -39,12 +39,22 @@ public class FILEFactory {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else if (path.startsWith(FILE_DATA_PREFIX)) {
return new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), false), false, path.substring(FILE_DATA_PREFIX.length()));
} else if (path.startsWith(FILE_CA_PREFIX)) {
return new FileCAFILE(new FileNode(path.substring(FILE_CA_PREFIX.length()), false), false, path.substring(FILE_CA_PREFIX.length()));
} else {
return new FileNodeFILE(new FileNode(path, WorkContext.getWorkResource().isDirectory(path)));
}
}
public static FILE createFolder(String path) {
return createFolder(null, path);
}
/**
* 传递依据的基础文件并创建文件夹
*/
public static FILE createFolder(FILE origin, String path) {
if (path == null) {
return null;
} else if (path.startsWith(MEM_PREFIX)) {
@ -58,7 +68,11 @@ public class FILEFactory {
} else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else if (path.startsWith(FILE_DATA_PREFIX)) {
return new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), true), false, path.substring(FILE_DATA_PREFIX.length()));
FileDataFILE file = new FileDataFILE(new FileNode(path.substring(FILE_DATA_PREFIX.length()), true), false, path.substring(FILE_DATA_PREFIX.length()));
if (origin instanceof FileDataFILE) {
file.setType(((FileDataFILE) origin).getType());
}
return file;
} else if (path.startsWith(FILE_CA_PREFIX)) {
return new FileCAFILE(new FileNode(path.substring(FILE_CA_PREFIX.length()), true), false, path.substring(FILE_CA_PREFIX.length()));
}

11
designer-base/src/main/java/com/fr/file/FileDataFILE.java

@ -42,6 +42,13 @@ public class FileDataFILE extends FileNodeFILE{
this.id = id;
}
public FileDataFILE(FileNode node, boolean builded, String id, String type) {
super(node);
this.builded = builded;
this.id = id;
this.type = type;
}
private void addChild(FileDataFILE file) {
children.add(file);
}
@ -127,7 +134,7 @@ public class FileDataFILE extends FileNodeFILE{
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
tree.putIfAbsent(bean.getId(), new FileDataFILE(fileNode, true, bean.getId()));
tree.putIfAbsent(bean.getId(), new FileDataFILE(fileNode, true, bean.getId(), type));
if (StringUtils.isEmpty(bean.getpId())) {
root = tree.get(bean.getId());
} else {
@ -147,7 +154,7 @@ public class FileDataFILE extends FileNodeFILE{
FileNode fileNode = new FileNode();
fileNode.setEnvPath(bean.getPath());
fileNode.setDirectory(bean.getIsParent());
return new FileDataFILE(fileNode, true, bean.getId());
return new FileDataFILE(fileNode, true, bean.getId(), type);
}
}
return null;

Loading…
Cancel
Save