public void initPagePanelBtn(PagePanel pagePanel) {
    // PagePanelType xtype = super.get(PagePanelType.class, pagePanel.getXtype().getId());
    PagePanelType xtype = pagePanel.getXtype();
    xtype = super.get(PagePanelType.class, xtype.getId());
    String xtypeName = xtype.getName();
    if (xtypeName.equals("editorgrid")) { // 可编辑表单

      PagePanelBtn addButton = new PagePanelBtn();
      addButton.setBtnName("添加");
      addButton.setMethod("addByColumn");
      addButton.setImageUrl("add");
      addButton.setPagePanel(pagePanel);
      super.save(addButton);

      PagePanelBtn delButton = new PagePanelBtn();
      delButton.setBtnName("删除");
      delButton.setMethod("removeByColumn");
      delButton.setImageUrl("remove");
      delButton.setPagePanel(pagePanel);
      super.save(delButton);

      PagePanelBtn saveButton = new PagePanelBtn();
      saveButton.setBtnName("保存");
      saveButton.setMethod("saveForGridPanel");
      saveButton.setImageUrl("save");
      saveButton.setPagePanel(pagePanel);
      super.save(saveButton);

      //			PagePanelBtn upLoadButton = new PagePanelBtn();
      //			upLoadButton.setBtnName("上传");
      //			upLoadButton.setMethod("upload");
      //			upLoadButton.setImageUrl("upload");
      //			upLoadButton.setPagePanel(pagePanel);
      //			super.save(upLoadButton);
      //
      //			PagePanelBtn exportButton = new PagePanelBtn();
      //			exportButton.setBtnName("导出");
      //			exportButton.setMethod("export");
      //			exportButton.setImageUrl("export");
      //			exportButton.setPagePanel(pagePanel);
      //			super.save(exportButton);
    } else if (xtypeName.equals("form")) {
      PagePanelBtn saveButton = new PagePanelBtn();
      saveButton.setBtnName("保存");
      saveButton.setMethod("saveForFormPanel");
      saveButton.setImageUrl("save");
      saveButton.setPagePanel(pagePanel);
      super.save(saveButton);

      PagePanelBtn resetButton = new PagePanelBtn();
      resetButton.setBtnName("重置");
      resetButton.setMethod("resetPanel");
      resetButton.setImageUrl("reset");
      resetButton.setPagePanel(pagePanel);
      super.save(resetButton);
    }
  }
Exemple #2
0
 private String forPanelButton(HttpServletRequest request) {
   String keyName = request.getParameter("panelName");
   PagePanel panel = pagePanelService.findPagePanel(keyName);
   String json = "[";
   List<PagePanelBtn> ppbs = pagePanelBtnService.findPanelBtnByPanel(panel);
   if (ppbs.isEmpty()) {
     json += "";
   } else {
     for (PagePanelBtn ppb : ppbs) {
       if (ppb.getIsDisplay() != null && ppb.getIsDisplay() == 1) {
         json += "{";
         json += "\"btnName\":\"" + ppb.getBtnName() + "\",";
         json += "\"container\":\"" + ppb.getPagePanel().getName() + "\",";
         json +=
             "\"containerTable\":\""
                 + ppb.getPagePanel().getSystemMainTable().getTableName()
                 + "\",";
         json += "\"method\":\"" + ppb.getMethod() + "\",";
         json += "\"link\":\"" + ppb.getLink() + "\",";
         json +=
             "\"nextPageModel\":\""
                 + (ppb.getNextPageModel() == null ? "" : ppb.getNextPageModel().getName())
                 + "\",";
         json += "\"imageUrl\":\"" + ppb.getImageUrl() + "\"";
         json += "},";
       }
     }
     if (json.length() > 1) json = json.substring(0, json.length() - 1);
   }
   json += "]";
   return json;
 }