Package org.jeecgframework.web.cgform.entity.enhance

Examples of org.jeecgframework.web.cgform.entity.enhance.CgformEnhanceJsEntity


  public void setButtonSqlMap(Map<String, String[]> buttonSqlMap) {
    this.buttonSqlMap = buttonSqlMap;
  }

  public CgformEnhanceJsEntity getListJs() {
    return listJs==null?new CgformEnhanceJsEntity():listJs;
  }
View Full Code Here


  public void setListJs(CgformEnhanceJsEntity listJs) {
    this.listJs = listJs;
  }

  public CgformEnhanceJsEntity getFormJs() {
    return formJs==null?new CgformEnhanceJsEntity():formJs;
  }
View Full Code Here

    // 隐藏字段 剔除id
    List<Map<String, Object>> hiddenFieldList = getCgFormHiddenFieldByTableName(tableName);
    data.put("columnhidden", hiddenFieldList);
    // js增强
    String jsCode = "";
    CgformEnhanceJsEntity jsEnhance = cgformEnhanceJsService
        .getCgformEnhanceJsByTypeFormId("form", head.getId());
    if (jsEnhance != null) {
      jsCode = jsEnhance.getCgJsStr();
    }
    data.put("js_plug_in", jsCode);
    return data;
  }
View Full Code Here

   */
  @RequestMapping(params = "doCgformEnhanceJs")
  @ResponseBody 
  public AjaxJson doCgformEnhanceJs(CgformEnhanceJsEntity cgformenhanceJs, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    CgformEnhanceJsEntity cgformenJs = cgformenhanceJsService.getCgformEnhanceJsByTypeFormId(cgformenhanceJs.getCgJsType(), cgformenhanceJs.getFormId());
    if(cgformenJs!=null){
      j.setObj(cgformenJs);
      j.setSuccess(true);
    }else{
      j.setSuccess(false);
View Full Code Here

  @ResponseBody
  public AjaxJson save(CgformEnhanceJsEntity cgformenhanceJs, HttpServletRequest request) {
    AjaxJson j = new AjaxJson();
    if (StringUtil.isNotEmpty(cgformenhanceJs.getId())) {
      message = "更新成功";
      CgformEnhanceJsEntity t = cgformenhanceJsService.get(CgformEnhanceJsEntity.class, cgformenhanceJs.getId());
      try {
        MyBeanUtils.copyBeanNotNull2Bean(cgformenhanceJs, t);
        cgformenhanceJsService.saveOrUpdate(t);
        systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
      } catch (Exception e) {
View Full Code Here

  @RequestMapping(params = "addorupdate")
  public ModelAndView addorupdate(CgformEnhanceJsEntity cgformenhanceJs, HttpServletRequest req) {
    //根据cgJsType和formId初始化数据
    cgformenhanceJs.setCgJsType("form");
    if (StringUtil.isNotEmpty(cgformenhanceJs.getCgJsType())&&StringUtil.isNotEmpty(cgformenhanceJs.getFormId())) {
      CgformEnhanceJsEntity cgformenJs = cgformenhanceJsService.getCgformEnhanceJsByTypeFormId(cgformenhanceJs.getCgJsType(), cgformenhanceJs.getFormId());
      if(cgformenJs!=null){
        cgformenhanceJs = cgformenJs;
      }
    }
    req.setAttribute("cgformenhanceJsPage", cgformenhanceJs);
View Full Code Here

    configs.put(CgAutoListConstant.CONFIG_VERSION, tableEntity.getJformVersion());
    String formId = tableEntity.getId();
    List<CgformButtonEntity>  buttons = cgformButtonService.getCgformButtonListByFormId(formId);
    configs.put(CgAutoListConstant.CONFIG_BUTTONLIST,buttons.size()>0?buttons:new ArrayList<CgformButtonEntity>(0));
    String jsCode = "";
    CgformEnhanceJsEntity  jsEnhance = cgformEnhanceJsService.getCgformEnhanceJsByTypeFormId("list", formId);
      if(jsEnhance!=null){
      jsCode = jsEnhance.getCgJsStr();
      if(StringUtil.isEmpty(jsCode)){
        jsCode = "";
      }
    }
    configs.put(CgAutoListConstant.CONFIG_JSENHANCE,jsCode);
View Full Code Here

    CgformButtonSqlEntity cbsUpdate = cgformButtonSqlService.getCgformButtonSqlByCodeFormId("update", cgFormHead.getId());
    buttonSqlMap.put("update", cbsUpdate==null?new String[]{}:cbsUpdate.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
    CgformButtonSqlEntity cbsDelete = cgformButtonSqlService.getCgformButtonSqlByCodeFormId("delete", cgFormHead.getId());
    buttonSqlMap.put("delete", cbsDelete==null?new String[]{}:cbsDelete.getCgbSqlStr().replaceAll("(\r\n|\r|\n|\n\r)", "").split(";"));
    //JS增强-列表
    CgformEnhanceJsEntity listJs =   cgformEnhanceJsService.getCgformEnhanceJsByTypeFormId("list", cgFormHead.getId());
    CgformEnhanceJsEntity listJsCopy = null;
    try{
      listJsCopy = listJs.deepCopy();
    }catch (Exception e) {
      logger.debug(e.getMessage());
    }
    //JS增强-表单
    CgformEnhanceJsEntity formJs =   cgformEnhanceJsService.getCgformEnhanceJsByTypeFormId("form", cgFormHead.getId());
    CgformEnhanceJsEntity formJsCopy = null;
    try{
      formJsCopy = formJs.deepCopy();
    }catch (Exception e) {
      logger.debug(e.getMessage());
    }
    //将js中带有online字段名的 转换成java命名
    for(CgFormFieldEntity field : cgFormHead.getColumns()){
      String fieldName = field.getFieldName();
      if(listJsCopy!=null){
        listJsCopy.setCgJsStr(listJsCopy.getCgJsStr().replace(fieldName, JeecgReadTable.formatField(fieldName)));
      }
      if(formJsCopy!=null){
        formJsCopy.setCgJsStr(formJsCopy.getCgJsStr().replace(fieldName, JeecgReadTable.formatField(fieldName)));
      }
    }
    generateEntity.setButtons(buttons);
    generateEntity.setButtonSqlMap(buttonSqlMap);
    generateEntity.setCgFormHead(cgFormHead);
View Full Code Here

TOP

Related Classes of org.jeecgframework.web.cgform.entity.enhance.CgformEnhanceJsEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.