Browse Source

REPORT-100991 【版本管理三期】版本中心二次搜索结果为空

newui
Destiny.Lin 1 year ago
parent
commit
f26b7ff286
  1. 28
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java

28
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java

@ -48,6 +48,8 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
private static final int COLUMNS_COUNT = 15;
private List<VcsTableEntity> tableEntities;
public RecyclePane() {
super(i18nText("Fine-Design_Vcs_Recycle"), (o, columnIndex) -> {
switch (columnIndex) {
@ -86,6 +88,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
for (VcsEntity entity : entityList) {
tableEntities.add(new VcsTableEntity(entity));
}
updateTableList(tableEntities);
return tableEntities;
}
@ -166,8 +169,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
@Override
public void actionPerformed(ActionEvent e) {
String str = searchTextField.getText();
List<VcsTableEntity> entityList = model.getList();
model.setList(entityList.stream().filter(entity -> entity.getEntity().getFilename().contains(str)).collect(Collectors.toList()));
model.setList(tableEntities.stream().filter(entity -> entity.getEntity().getFilename().contains(str)).collect(Collectors.toList()));
model.fireTableDataChanged();
}
});
@ -185,7 +187,8 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (selVal == JOptionPane.YES_OPTION) {
model.setList(model.getList().stream().filter(tableEntity -> !tableEntity.isSelect()).collect(Collectors.toList()));
tableEntities = model.getList().stream().filter(tableEntity -> !tableEntity.isSelect()).collect(Collectors.toList());
model.setList(tableEntities);
model.fireTableDataChanged();
listener.doAfterChooseYes(selectList);
}
@ -252,6 +255,25 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
return true;
}
/**
* 更新数据列表
*
* @param entities
*/
public void updateTableList(List<VcsTableEntity> entities) {
tableEntities = entities;
}
/**
* 移除指定元素
*
* @param entity
*/
public void removeTarget(VcsTableEntity entity) {
tableEntities.remove(entity);
}
/**
* 版本管理按钮事件响应
*/

2
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java

@ -115,6 +115,7 @@ public class VcsCenterPane extends VcsNewPane {
JOptionPane.QUESTION_MESSAGE);
if (selVal == JOptionPane.YES_OPTION) {
VcsOperatorWorker.createDeleteWorker().doDelete(entity);
removeTarget((VcsTableEntity) o);
model.getList().remove(o);
model.fireTableDataChanged();
}
@ -166,6 +167,7 @@ public class VcsCenterPane extends VcsNewPane {
for (VcsEntity entity : entities) {
tableEntities.add(new VcsTableEntity(entity));
}
updateTableList(tableEntities);
return tableEntities;
}

Loading…
Cancel
Save