Browse Source

REPORT-6700 update

master
yaoh.wu 7 years ago
parent
commit
936a76ce29
  1. 43
      designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  2. 42
      designer-base/src/com/fr/design/remote/RemoteMember.java
  3. 47
      designer-base/src/com/fr/design/remote/Utils.java
  4. 2
      designer-base/src/com/fr/design/remote/ui/AuthorityListControlPane.java
  5. 2
      designer-base/src/com/fr/design/remote/ui/list/AddedMemberListCellRender.java
  6. 2
      designer-base/src/com/fr/design/remote/ui/list/AddingMemberListCellRender.java
  7. 1
      designer-base/src/com/fr/env/RemoteEnv.java

43
designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -8,14 +8,30 @@ import com.fr.base.FRContext;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.*; import com.fr.design.actions.community.BBSAction;
import com.fr.design.actions.file.*; import com.fr.design.actions.community.BugAction;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.UpAction;
import com.fr.design.actions.community.VideoAction;
import com.fr.design.actions.file.CloseCurrentTemplateAction;
import com.fr.design.actions.file.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef;
import com.fr.design.actions.file.OpenTemplateAction;
import com.fr.design.actions.file.PreferenceAction;
import com.fr.design.actions.file.SwitchExistEnv;
import com.fr.design.actions.help.AboutAction; import com.fr.design.actions.help.AboutAction;
import com.fr.design.actions.help.TutorialAction; import com.fr.design.actions.help.TutorialAction;
import com.fr.design.actions.help.WebDemoAction; import com.fr.design.actions.help.WebDemoAction;
import com.fr.design.actions.help.alphafine.AlphaFineAction; import com.fr.design.actions.help.alphafine.AlphaFineAction;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.actions.server.*; import com.fr.design.actions.server.ConnectionListAction;
import com.fr.design.actions.server.FunctionManagerAction;
import com.fr.design.actions.server.GlobalParameterAction;
import com.fr.design.actions.server.GlobalTableDataAction;
import com.fr.design.actions.server.PlatformManagerAction;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.file.NewTemplatePane; import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.fun.TableDataPaneProcessor;
@ -45,10 +61,23 @@ import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.Icon;
import java.awt.*; import javax.swing.JComponent;
import java.util.*; import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Set;
/** /**
* @author richer * @author richer
@ -415,7 +444,7 @@ public abstract class ToolBarMenuDock {
} }
private boolean shouldShowRemotePermission() { private boolean shouldShowRemotePermission() {
return FRContext.getCurrentEnv() != null && FRContext.getCurrentEnv().isRoot(); return FRContext.getCurrentEnv() != null && !FRContext.getCurrentEnv().isLocalEnv() && FRContext.getCurrentEnv().isRoot();
} }
protected boolean shouldShowPlugin() { protected boolean shouldShowPlugin() {

42
designer-base/src/com/fr/design/remote/RemoteMember.java

@ -5,20 +5,48 @@ public class RemoteMember {
public static final RemoteMember DEFAULT_MEMBER = new RemoteMember("查询中..."); public static final RemoteMember DEFAULT_MEMBER = new RemoteMember("查询中...");
private String name; private String username;
private String realName;
private String userId;
private boolean selected; private boolean selected;
public RemoteMember(String name) { public RemoteMember(String username) {
this.name = name; this.username = username;
} }
public String getName() { public RemoteMember realName(String realName) {
return name; this.realName = realName;
return this;
} }
public void setName(String name) { public RemoteMember userId(String userId) {
this.name = name; this.userId = userId;
return this;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
} }

47
designer-base/src/com/fr/design/remote/Utils.java

@ -1,49 +1,38 @@
package com.fr.design.remote; package com.fr.design.remote;
import com.fr.stable.StringUtils; import com.fr.base.FRContext;
import com.fr.decision.webservice.bean.user.UserAdditionBean;
import com.fr.decision.webservice.v10.user.UserService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Map;
public class Utils { public class Utils {
private static final String SOURCES =
"._-~`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
private Utils() { private Utils() {
} }
public static Collection<? extends RemoteMember> getRemoteMember(String keyword) { public static Collection<? extends RemoteMember> getRemoteMember(String keyword) {
// todo 使用决策平台api获取决策平台用户
List<RemoteMember> res = new ArrayList<>(); List<UserAdditionBean> userBeans = new ArrayList<>();
for (int i = 0; i < 30; i++) { try {
RemoteMember remoteMember = new RemoteMember(generate()); Map<String, Object> result = UserService.getInstance().getAllUsers(FRContext.getCurrentEnv().getUser(), 1, 10, keyword, "", true);
if (StringUtils.isEmpty(keyword)) { userBeans = (List<UserAdditionBean>) result.get("items");
res.add(remoteMember); } catch (Exception e) {
continue; e.printStackTrace();
}
if (remoteMember.getName().contains(keyword)) {
res.add(remoteMember);
}
}
return res;
} }
List<RemoteMember> res = new ArrayList<>();
/** for (UserAdditionBean userBean : userBeans) {
* Generate a random string. res.add(new RemoteMember(userBean.getUsername())
* .realName(userBean.getRealName())
* @return String string .userId(userBean.getId())
*/ );
private static String generate() {
Random random = new Random();
char[] text = new char[6];
for (int i = 0; i < 6; i++) {
text[i] = Utils.SOURCES.charAt(random.nextInt(Utils.SOURCES.length()));
} }
return new String(text); return res;
} }
} }

2
designer-base/src/com/fr/design/remote/ui/AuthorityListControlPane.java

@ -481,7 +481,7 @@ public class AuthorityListControlPane extends BasicPane {
List<RemoteMember> members = userManagerPane.update(); List<RemoteMember> members = userManagerPane.update();
for (RemoteMember member : members) { for (RemoteMember member : members) {
RemoteDesignAuthority authority = new RemoteDesignAuthority(); RemoteDesignAuthority authority = new RemoteDesignAuthority();
authority.setName(member.getName()); authority.setName(member.getUsername());
AuthorityListControlPane.this.addAuthority(authority, getModel().getSize()); AuthorityListControlPane.this.addAuthority(authority, getModel().getSize());
} }
} }

2
designer-base/src/com/fr/design/remote/ui/list/AddedMemberListCellRender.java

@ -35,7 +35,7 @@ public class AddedMemberListCellRender extends JPanel implements ListCellRendere
@Override @Override
public Component getListCellRendererComponent(JList<? extends RemoteMember> list, RemoteMember member, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList<? extends RemoteMember> list, RemoteMember member, int index, boolean isSelected, boolean cellHasFocus) {
this.setLabelText(member.getName()); this.setLabelText(member.getUsername());
return this; return this;
} }

2
designer-base/src/com/fr/design/remote/ui/list/AddingMemberListCellRender.java

@ -36,7 +36,7 @@ public class AddingMemberListCellRender extends JPanel implements ListCellRender
@Override @Override
public Component getListCellRendererComponent(JList list, RemoteMember member, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, RemoteMember member, int index, boolean isSelected, boolean cellHasFocus) {
this.setLabelText(member.getName()); this.setLabelText(member.getUsername());
check.setSelected(member.isSelected()); check.setSelected(member.isSelected());
return this; return this;
} }

1
designer-base/src/com/fr/env/RemoteEnv.java vendored

@ -402,7 +402,6 @@ public class RemoteEnv extends AbstractEnv {
} }
HttpClient client = createHttpMethod(para, true); HttpClient client = createHttpMethod(para, true);
client.asGet();
String res = stream2String(execute4InputStream(client)); String res = stream2String(execute4InputStream(client));
if (res == null) { if (res == null) {

Loading…
Cancel
Save