138 lines
6.8 KiB
Java
138 lines
6.8 KiB
Java
package shkd.repc.resp.portal;
|
|
|
|
import kd.bos.bill.OperationStatus;
|
|
import kd.bos.context.RequestContext;
|
|
import kd.bos.dataentity.resource.ResManager;
|
|
import kd.bos.dataentity.utils.StringUtils;
|
|
import kd.bos.form.*;
|
|
import kd.bos.form.container.Container;
|
|
import kd.bos.form.control.Control;
|
|
import kd.bos.form.control.Label;
|
|
import kd.repc.common.util.CacheMCData;
|
|
import kd.repc.resp.formplugin.portal.IndexEditNew;
|
|
import kd.repc.resp.formplugin.portal.PortalLableStyleChangeUtil;
|
|
|
|
import java.util.EventObject;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
public class IndexEditNewPlugin extends IndexEditNew {
|
|
|
|
protected static final String companyLogoFlag = "companylogo";
|
|
protected static final String COMPANYLOGOFLEXPANEL = "companylogoflexpanel";
|
|
static String openPanelRegFlag = "openPanelRegFlag";
|
|
|
|
@Override
|
|
public void beforeBindData(EventObject e) {
|
|
super.beforeBindData(e);
|
|
((Label)this.getView().getControl("label_bidproj")).setText( ResManager.loadKDString("询比价公告", "IndexEditNew_3", "repc-resp-formplugin", new Object[0]));
|
|
}
|
|
|
|
@Override
|
|
public void click(EventObject eventobject) {
|
|
Control source = (Control)eventobject.getSource();
|
|
String portalConfigId = this.getPortalConfigId();
|
|
String key = source.getKey();
|
|
if (!"reg".equals(key)) {
|
|
String isOpenPanelReg = this.getPageCache().get(openPanelRegFlag);
|
|
if ("true".equalsIgnoreCase(isOpenPanelReg)) {
|
|
this.getView().setVisible(false, new String[]{"panel_reg"});
|
|
this.getView().setVisible(true, new String[]{"flexpanelap"});
|
|
this.getPageCache().put(openPanelRegFlag, "false");
|
|
}
|
|
}
|
|
|
|
IFormView view = this.getView();
|
|
this.setHeadflexpanelBackgroundImg(false);
|
|
switch (key) {
|
|
case "label_home":
|
|
(new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_home", ResManager.loadKDString("首页", "IndexEditNew_2", "repc-resp-formplugin", new Object[0]));
|
|
this.getView().invokeOperation("refresh");
|
|
break;
|
|
case "label_bidproj":
|
|
(new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_bidproj", ResManager.loadKDString("询比价公告", "IndexEditNew_3", "repc-resp-formplugin", new Object[0]));
|
|
break;
|
|
case "label_recruit":
|
|
(new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_recruit", ResManager.loadKDString("招募公告", "IndexEditNew_4", "repc-resp-formplugin", new Object[0]));
|
|
this.loadCards(portalConfigId, this.getCardInfo("recruitannolarge"), (Map)null);
|
|
break;
|
|
case "label_bidwon":
|
|
(new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_bidwon", ResManager.loadKDString("中标公告", "IndexEditNew_5", "repc-resp-formplugin", new Object[0]));
|
|
this.loadCards(portalConfigId, this.getCardInfo("bidwinannolarge"), (Map)null);
|
|
break;
|
|
case "label_helpcenter":
|
|
(new PortalLableStyleChangeUtil()).addClickedLableStyle(view, "label_helpcenter", ResManager.loadKDString("帮助中心", "IndexEditNew_6", "repc-resp-formplugin", new Object[0]));
|
|
this.loadCards(portalConfigId, this.getCardInfo("bidwinannolarge"), (Map)null);
|
|
break;
|
|
case "label_logintip":
|
|
String globalSessionId = RequestContext.get().getGlobalSessionId();
|
|
String registeredId = CacheMCData.getAttribute(globalSessionId, "registeredid");
|
|
if (StringUtils.isEmpty(registeredId)) {
|
|
this.showLoginRegTipForm(ResManager.loadKDString("会话超时请重新登录。", "IndexEditNew_7", "repc-resp-formplugin", new Object[0]));
|
|
}
|
|
|
|
this.getView().setVisible(false, new String[]{"flexpanelap"});
|
|
Map<String, Object> map = new HashMap();
|
|
this.getView().setVisible(Boolean.FALSE, new String[]{"btn_templogin", "link_login", "label_regist"});
|
|
this.getView().setVisible(Boolean.TRUE, new String[]{"label_logintip", "btn_exit"});
|
|
map.put("formId", "resp_portalregister");
|
|
FormShowParameter formShowPara = FormShowParameter.createFormShowParameter(map);
|
|
formShowPara.setCustomParam("registeredid", this.getPageCache().get("registeredid"));
|
|
this.openForm("resp_portalregister", formShowPara);
|
|
break;
|
|
case "morecompanyflex":
|
|
this.filterPanelMoreOrLittleData("morecompanyflex", "orgs", "companymoreorlittile");
|
|
break;
|
|
case "morepurtypeflex":
|
|
this.filterPanelMoreOrLittleData("morepurtypeflex", "purtypes", "purtypemoreorlittile");
|
|
break;
|
|
case "moresuppliertypeflex":
|
|
this.filterPanelMoreOrLittleData("moresuppliertypeflex", "supplierypes", "suppliertypemoreorlittile");
|
|
break;
|
|
case "companyflexpanelap":
|
|
this.filterBidProjAnnoSmallData();
|
|
this.filterRecruitAnnoSmallData();
|
|
break;
|
|
case "purtypeflexpanelap":
|
|
this.filterBidWinAnnoSmallData();
|
|
break;
|
|
case "suppliertypeflexpanelap":
|
|
this.filterRecruitAnnoSmallData();
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
public void setHeadflexpanelBackgroundImg(boolean flag) {
|
|
Container flexPanel = (Container)this.getView().getControl("flexpanelap1");
|
|
if (flag) {
|
|
// flexPanel.setBackgroundImg("/images/pc/other/AI_bg_108_110.png");
|
|
} else {
|
|
flexPanel.setBackgroundImg((String)null);
|
|
}
|
|
}
|
|
|
|
private void openForm(String formId, FormShowParameter formShowPara) {
|
|
this.getPageCache().put(openPanelRegFlag, "true");
|
|
OpenStyle openStyle = formShowPara.getOpenStyle();
|
|
this.getView().setVisible(true, new String[]{"panel_reg"});
|
|
openStyle.setTargetKey("panel_reg");
|
|
openStyle.setShowType(ShowType.InContainer);
|
|
CloseCallBack callBack = new CloseCallBack(this, formId);
|
|
formShowPara.setCloseCallBack(callBack);
|
|
formShowPara.setCustomParam("companyname", this.getPageCache().get("companyname"));
|
|
this.getView().showForm(formShowPara);
|
|
}
|
|
|
|
private void showLoginRegTipForm(String regTip) {
|
|
FormShowParameter showParameter = new FormShowParameter();
|
|
showParameter.getOpenStyle().setShowType(ShowType.MainNewTabPage);
|
|
showParameter.setStatus(OperationStatus.VIEW);
|
|
showParameter.setFormId("login_regtip");
|
|
showParameter.setCustomParam("regtip", regTip);
|
|
CloseCallBack back = new CloseCallBack(this, "login_expire_tip");
|
|
showParameter.setCloseCallBack(back);
|
|
this.getView().showForm(showParameter);
|
|
}
|
|
}
|