Browse Source

PFC-982 修复工具栏权限颗粒度设置时卡死的问题

master
rinoux 7 years ago
parent
commit
01fcdf0740
  1. 31
      designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  2. 31
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

31
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
@ -20,6 +21,7 @@ import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
/**
@ -96,23 +98,22 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
null || selectedPathArray == null) {
return;
}
for (int t = 0; t < selectedPathArray.length; t++) {
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
buttonlists.get(i).changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected());
authorityToolBarPane.repaint();
}
ToolBarButton selectedButton = null;
//是否可见的checkbox
UICheckBox checkbox = (UICheckBox) e.getSource();
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
selectedButton = buttonlists.get(i);
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
RolesAlreadyEditedPane.getInstance().refreshDockingView();
UICheckBox checkbox = (UICheckBox) e.getSource();
List<ToolBarButton> btns = AuthorityEditPane.this.buttonlists;
for (int j = 0; j < btns.size(); j++) {
if (btns.get(j).isSelected()) {
//由引擎实现保存进模板报表
authorityToolBarPane.setAuthorityWebAttr(btns.get(j).getWidget(), checkbox.isSelected(), selectedPathArray[t]);
}
}
if (selectedButton != null) {
for (int t = 0; t < selectedPathArray.length; t++) {
selectedButton.changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected());
authorityToolBarPane.repaint();
authorityToolBarPane.setAuthorityWebAttr(selectedButton.getWidget(), checkbox.isSelected(), selectedPathArray[t]);
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();//模版更新
RolesAlreadyEditedPane.getInstance().refreshDockingView();//已配置角色视图刷新
}
}
};

31
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -219,23 +219,24 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
//wbTpl.clear先清空
//再将所有的保存进去
//看是存在服务器还存在模板里面
if (choseComboBox.getSelectedIndex() == 0) {
//分页
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebPage(), widget, isSelected, selectedRole);
}
} else if (choseComboBox.getSelectedIndex() == 1) {
//填报
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebWrite(), widget, isSelected, selectedRole);
}
} else {
//view
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebView(), widget, isSelected, selectedRole);
if (webAttr != null) {
if (choseComboBox.getSelectedIndex() == 0) {
//分页
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebPage(), widget, isSelected, selectedRole);
}
} else if (choseComboBox.getSelectedIndex() == 1) {
//填报
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebWrite(), widget, isSelected, selectedRole);
}
} else {
//view
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebView(), widget, isSelected, selectedRole);
}
}
}
}
private void dealWithWebContent(WebContent wc, Widget widget, boolean isSelected, String selectedRole) {

Loading…
Cancel
Save