From 785a0d4f29f1cb774384c87db366013e21276ddb Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Wed, 12 Feb 2020 21:52:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=A1=A8=E5=8D=95=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=81=94=E8=A1=A8=E5=AD=97=E6=AE=B5=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=EF=BC=8C=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=92=8C=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dynamic/DynamicDataAppController.java | 20 +- .../routes/DynamicFormAppRouteController.java | 23 +- .../pojo/dtos/dynamic/DynamicFormDTO.java | 12 + .../dynamic/DynamicFormListShowFieldDTO.java | 12 + .../config/form/DynamicConfigFormDTO.java | 12 + .../config/form/DynamicConfigFormVO.java | 13 + .../service/dynamic/IDynamicDataService.java | 49 +- .../dynamic/impl/DynamicDataServiceImpl.java | 44 +- .../dynamic/impl/DynamicFormServiceImpl.java | 1 + .../dynamic/impl/DynamicTableServiceImpl.java | 4 +- .../config/form/dynamicconfigform-mapper.xml | 6 + .../mapper/dynamic/dynamicform-mapper.xml | 1 + .../templates/dynamic/config/form/list.html | 1 + .../templates/dynamic/config/form/save.html | 10 +- .../templates/dynamic/config/form/update.html | 7 + .../templates/dynamic/config/list.html | 6 +- .../dynamic/form/app/save-dynamic-form.html | 518 +++++++------ .../dynamic/form/app/update-dynamic-form.html | 686 ++++++++++++++++++ .../dynamic/form/list-dynamic-form.html | 16 +- 19 files changed, 1207 insertions(+), 234 deletions(-) create mode 100644 cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/form/app/update-dynamic-form.html diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/apis/dynamic/DynamicDataAppController.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/apis/dynamic/DynamicDataAppController.java index 4ba688d..5248720 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/apis/dynamic/DynamicDataAppController.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/apis/dynamic/DynamicDataAppController.java @@ -34,45 +34,49 @@ public class DynamicDataAppController extends AbstractController { @ApiOperation(value = "保存动态数据", notes = "保存动态数据接口") @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("savedynamicdata/{tableName}") - public SuccessResult saveDynamicData(@PathVariable("tableName") String tableName, @RequestBody Map params) { - return dynamicDataService.saveDynamicData(tableName, params); + public SuccessResult saveDynamicData(@RequestHeader("token") String token, @PathVariable("tableName") String tableName, @RequestBody Map params) { + return dynamicDataService.saveDynamicData(token, tableName, params); } @ApiOperation(value = "删除动态数据", notes = "删除动态数据接口") @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), @ApiImplicitParam(name = "ids", value = "数据ID列表,用下划线分隔", paramType = "path", example = "1_2_3") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @DeleteMapping("removedynamicdata/{tableName}/{ids}") - public SuccessResult removeDynamicData(@PathVariable("tableName") String tableName, @PathVariable("ids") String ids) { - return dynamicDataService.removeDynamicData(tableName, ids); + public SuccessResult removeDynamicData(@RequestHeader("token") String token, @PathVariable("tableName") String tableName, @PathVariable("ids") String ids) { + return dynamicDataService.removeDynamicData(token, tableName, ids); } @ApiOperation(value = "修改动态数据", notes = "修改动态数据接口") @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), @ApiImplicitParam(name = "id", value = "id", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("updatedynamicdata/{tableName}/{id}") - public SuccessResult updateDynamicData(@PathVariable("tableName") String tableName, @PathVariable("id") String id, @RequestBody Map params) { - return dynamicDataService.updateDynamicData(tableName, id, params); + public SuccessResult updateDynamicData(@RequestHeader("token") String token, @PathVariable("tableName") String tableName, @PathVariable("id") String id, @RequestBody Map params) { + return dynamicDataService.updateDynamicData(token, tableName, id, params); } @ApiOperation(value = " 修改动态数据(链接)", notes = " 修改动态数据(链接)接口") @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), @ApiImplicitParam(name = "id", value = "id", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("updatedynamicjoindata/{tableName}/{joinKey}/{joinId}") - public SuccessResult updateDynamicJoinData(@PathVariable("tableName") String tableName, @PathVariable("joinKey") String joinKey, @PathVariable("joinId") String joinId, @RequestBody Map params) { - return dynamicDataService.updateDynamicJoinData(tableName, joinKey, joinId, params); + public SuccessResult updateDynamicJoinData(@RequestHeader("token") String token, @PathVariable("tableName") String tableName, @PathVariable("joinKey") String joinKey, @PathVariable("joinId") String joinId, @RequestBody Map params) { + return dynamicDataService.updateDynamicJoinData(token, tableName, joinKey, joinId, params); } @ApiOperation(value = "动态数据列表", notes = "动态数据列表接口") diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/routes/DynamicFormAppRouteController.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/routes/DynamicFormAppRouteController.java index cb84f1d..fdbca66 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/routes/DynamicFormAppRouteController.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/controller/app/routes/DynamicFormAppRouteController.java @@ -42,11 +42,12 @@ public class DynamicFormAppRouteController { @ApiOperation(value = "动态表单新增页面", notes = "动态表单新增页面接口") @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path") }) @GetMapping("savedynamicform/{tableName}") public ModelAndView saveDynamicForm(@RequestHeader("token") String token, @PathVariable("tableName") String tableName) { - ModelAndView mv = new ModelAndView("dynamic/form/app/save-dynamic-form.html"); + ModelAndView mv = new ModelAndView("dynamic/form/app/save-dynamic-form"); mv.addObject("tableName", tableName); mv.addObject("token", token); @@ -58,6 +59,26 @@ public class DynamicFormAppRouteController { return mv; } + @ApiOperation(value = "动态表单更新页面", notes = "动态表单列表更新接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "tableName", value = "表名", paramType = "path"), + @ApiImplicitParam(name = "uuidValue", value = "id值", paramType = "path") + }) + @GetMapping("updatedynamicform/{tableName}/{uuidValue}") + public ModelAndView updateDynamicForm(@RequestHeader("token") String token, @PathVariable("tableName") String tableName, @PathVariable("uuidValue") String uuidValue) { + ModelAndView mv = new ModelAndView("dynamic/form/app/update-dynamic-form"); + mv.addObject("tableName", tableName); + mv.addObject("token", token); + mv.addObject("uuidValue", uuidValue); + + List dynamicFormFormShowFieldDTOs = dynamicFormService.listFormShowFieldOfPage(tableName); + mv.addObject("dynamicFormFormShowFieldDTOList", dynamicFormFormShowFieldDTOs); + dynamicFormService.setDynamicFieldData(mv, dynamicFormFormShowFieldDTOs); + setCurrentUserIdAndNameValues(mv, token, dynamicFormFormShowFieldDTOs); + return mv; + } + /** * 设置ID和名称值:当前用户、部门、角色、组、职位等 * diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormDTO.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormDTO.java index 967a918..b772c43 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormDTO.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormDTO.java @@ -38,6 +38,8 @@ public class DynamicFormDTO { private Integer fieldSort; @ApiModelProperty(name = "listShow", value = "列表显示") private Integer listShow; + @ApiModelProperty(name = "listShowWidth", value = "列表宽度") + private Integer listShowWidth; @ApiModelProperty(name = "formShow", value = "表单显示") private Integer formShow; @ApiModelProperty(name = "joinTable", value = "联表") @@ -139,6 +141,14 @@ public class DynamicFormDTO { this.listShow = listShow; } + public Integer getListShowWidth() { + return listShowWidth; + } + + public void setListShowWidth(Integer listShowWidth) { + this.listShowWidth = listShowWidth; + } + public Integer getFormShow() { return formShow; } @@ -212,6 +222,8 @@ public class DynamicFormDTO { .append(fieldSort); sb.append(",\"listShow\":") .append(listShow); + sb.append(",\"listShowWidth\":") + .append(listShowWidth); sb.append(",\"formShow\":") .append(formShow); sb.append(",\"joinTable\":") diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormListShowFieldDTO.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormListShowFieldDTO.java index 7c9df17..21021bd 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormListShowFieldDTO.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/DynamicFormListShowFieldDTO.java @@ -22,6 +22,8 @@ public class DynamicFormListShowFieldDTO { private String fieldExplain; @ApiModelProperty(name = "fieldType", value = "字段类型") private String fieldType; + @ApiModelProperty(name = "fieldWidth", value = "字段宽度") + private Integer fieldWidth; public String getFieldName() { return fieldName == null ? "" : fieldName.trim(); @@ -47,6 +49,14 @@ public class DynamicFormListShowFieldDTO { this.fieldType = fieldType; } + public Integer getFieldWidth() { + return fieldWidth; + } + + public void setFieldWidth(Integer fieldWidth) { + this.fieldWidth = fieldWidth; + } + @Override public String toString() { final StringBuilder sb = new StringBuilder("{"); @@ -56,6 +66,8 @@ public class DynamicFormListShowFieldDTO { .append("\"").append(fieldExplain).append("\""); sb.append(",\"fieldType\":") .append("\"").append(fieldType).append("\""); + sb.append(",\"fieldWidth\":") + .append(fieldWidth); sb.append('}'); return sb.toString(); } diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/config/form/DynamicConfigFormDTO.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/config/form/DynamicConfigFormDTO.java index 6a772cd..8393408 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/config/form/DynamicConfigFormDTO.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/dtos/dynamic/config/form/DynamicConfigFormDTO.java @@ -40,6 +40,8 @@ public class DynamicConfigFormDTO { private Integer fieldSort; @ApiModelProperty(name = "listShow", value = "列表显示") private Integer listShow; + @ApiModelProperty(name = "listShowWidth", value = "列表宽度") + private Integer listShowWidth; @ApiModelProperty(name = "formShow", value = "表单显示") private Integer formShow; @ApiModelProperty(name = "joinTable", value = "连接表") @@ -149,6 +151,14 @@ public class DynamicConfigFormDTO { this.listShow = listShow; } + public Integer getListShowWidth() { + return listShowWidth; + } + + public void setListShowWidth(Integer listShowWidth) { + this.listShowWidth = listShowWidth; + } + public Integer getFormShow() { return formShow; } @@ -224,6 +234,8 @@ public class DynamicConfigFormDTO { .append(fieldSort); sb.append(",\"listShow\":") .append(listShow); + sb.append(",\"listShowWidth\":") + .append(listShowWidth); sb.append(",\"formShow\":") .append(formShow); sb.append(",\"joinTable\":") diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/vos/dynamic/config/form/DynamicConfigFormVO.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/vos/dynamic/config/form/DynamicConfigFormVO.java index 4335653..c520f4e 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/vos/dynamic/config/form/DynamicConfigFormVO.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/pojo/vos/dynamic/config/form/DynamicConfigFormVO.java @@ -48,6 +48,9 @@ public class DynamicConfigFormVO { @ApiModelProperty(name = "listShow", value = "列表显示") @CheckNumberAnnotation(name = "列表显示", types = {"0", "1"}) private Integer listShow; + @ApiModelProperty(name = "listShowWidth", value = "列表宽度") + @CheckNumberAnnotation(name = "列表宽度", min = 0) + private Integer listShowWidth; @ApiModelProperty(name = "formShow", value = "表单显示") @CheckNumberAnnotation(name = "表单显示", types = {"0", "1"}) private Integer formShow; @@ -142,6 +145,14 @@ public class DynamicConfigFormVO { this.listShow = listShow; } + public Integer getListShowWidth() { + return listShowWidth; + } + + public void setListShowWidth(Integer listShowWidth) { + this.listShowWidth = listShowWidth; + } + public Integer getFormShow() { return formShow; } @@ -213,6 +224,8 @@ public class DynamicConfigFormVO { .append(fieldSort); sb.append(",\"listShow\":") .append(listShow); + sb.append(",\"listShowWidth\":") + .append(listShowWidth); sb.append(",\"formShow\":") .append(formShow); sb.append(",\"joinTable\":") diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java index f8f7b7e..3f5a217 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/IDynamicDataService.java @@ -33,6 +33,18 @@ public interface IDynamicDataService { */ SuccessResult saveDynamicData(String tableName, Map params) throws SearchException, SaveException; + /** + * 保存动态数据(APP) + * + * @param token + * @param tableName + * @param params + * @return + * @throws SearchException + * @throws SaveException + */ + SuccessResult saveDynamicData(String token, String tableName, Map params) throws SearchException, SaveException; + /** * 删除动态数据 * @@ -43,6 +55,17 @@ public interface IDynamicDataService { */ SuccessResult removeDynamicData(String tableName, String ids) throws RemoveException; + /** + * 删除动态数据(APP) + * + * @param token + * @param tableName + * @param ids + * @return + * @throws RemoveException + */ + SuccessResult removeDynamicData(String token, String tableName, String ids) throws RemoveException; + /** * 修改动态数据 * @@ -54,15 +77,39 @@ public interface IDynamicDataService { */ SuccessResult updateDynamicData(String tableName, String id, Map params) throws UpdateException; + /** + * 修改动态数据(APP) + * + * @param token + * @param tableName + * @param id + * @param params + * @return + */ + SuccessResult updateDynamicData(String token, String tableName, String id, Map params) throws UpdateException; + /** * 修改动态数据(链接) + * * @param tableName * @param joinKey * @param joinId * @param params * @return */ - SuccessResult updateDynamicJoinData(String tableName, String joinKey, String joinId, Map params); + SuccessResult updateDynamicJoinData(String tableName, String joinKey, String joinId, Map params) throws UpdateException; + + /** + * 修改动态数据(链接)(APP) + * @param token + * @param tableName + * @param joinKey + * @param joinId + * @param params + * @return + * @throws UpdateException + */ + SuccessResult updateDynamicJoinData(String token, String tableName, String joinKey, String joinId, Map params) throws UpdateException; /** * 动态数据列表 diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java index 1319f17..4b4aae0 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicDataServiceImpl.java @@ -47,6 +47,11 @@ public class DynamicDataServiceImpl extends AbstractService implements IDynamicD @Override public SuccessResult saveDynamicData(String tableName, Map params) throws SearchException, SaveException { + return saveDynamicData(null, tableName, params); + } + + @Override + public SuccessResult saveDynamicData(String token, String tableName, Map params) throws SearchException, SaveException { List dynamicFormDTOs = dynamicFormService.listDynamicForm(tableName); LOG.debug("校验参数"); requireData(params, dynamicFormDTOs); @@ -62,42 +67,73 @@ public class DynamicDataServiceImpl extends AbstractService implements IDynamicD params.put("uuidValue", UUIDUtil.getUUID()); params.put("insertFieldList", insertFieldList); params.put("insertValueList", insertValueList); - setSaveInfo(params); + if (token != null) { + setSaveInfo(token, params); + } else { + setSaveInfo(params); + } dynamicDataDao.saveDynamicData(params); return new SuccessResult(); } @Override public SuccessResult removeDynamicData(String tableName, String ids) throws RemoveException { + return removeDynamicData(null, tableName, ids); + } + + @Override + public SuccessResult removeDynamicData(String token, String tableName, String ids) throws RemoveException { Map params = getHashMap(7); setUpdateBaseInfo(tableName, params); params.put("idArray", Arrays.asList(ids.split("_"))); - setUpdateInfo(params); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } dynamicDataDao.removeDynamicData(params); return new SuccessResult(); } @Override public SuccessResult updateDynamicData(String tableName, String id, Map params) throws UpdateException { + return updateDynamicData(null, tableName, id, params); + } + + @Override + public SuccessResult updateDynamicData(String token, String tableName, String id, Map params) throws UpdateException { List updateFieldValueList = listUpdateFieldValueList(tableName, params); params.clear(); setUpdateBaseInfo(tableName, params); params.put("uuidValue", id); params.put("updateFieldValueList", updateFieldValueList); - setUpdateInfo(params); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } dynamicDataDao.updateDynamicData(params); return new SuccessResult(); } @Override public SuccessResult updateDynamicJoinData(String tableName, String joinKey, String joinId, Map params) { + return updateDynamicJoinData(null, tableName, joinKey, joinId, params); + } + + @Override + public SuccessResult updateDynamicJoinData(String token, String tableName, String joinKey, String joinId, Map params) throws UpdateException { List updateFieldValueList = listUpdateFieldValueList(tableName, params); params.clear(); setUpdateBaseInfo(tableName, params); params.put("joinKey", WStringUtil.lowerUpper2UnderLine(joinKey)); params.put("joinId", joinId); params.put("updateFieldValueList", updateFieldValueList); - setUpdateInfo(params); + if (token != null) { + setUpdateInfo(token, params); + } else { + setUpdateInfo(params); + } dynamicDataDao.updateDynamicJoinData(params); return new SuccessResult(); } diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java index 5702efd..3d96847 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicFormServiceImpl.java @@ -159,6 +159,7 @@ public class DynamicFormServiceImpl extends AbstractService implements IDynamicF dynamicFormListShowFieldDTO.setFieldName(dynamicFormDTO.getFieldName()); dynamicFormListShowFieldDTO.setFieldExplain(dynamicFormDTO.getFieldExplain()); dynamicFormListShowFieldDTO.setFieldType(dynamicFormDTO.getFieldType()); + dynamicFormListShowFieldDTO.setFieldWidth(dynamicFormDTO.getListShowWidth()); return dynamicFormListShowFieldDTO; } diff --git a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicTableServiceImpl.java b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicTableServiceImpl.java index d875824..879dbe6 100644 --- a/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicTableServiceImpl.java +++ b/cloud-common-plugin-dynamic/src/main/java/com/cm/common/plugin/service/dynamic/impl/DynamicTableServiceImpl.java @@ -114,9 +114,9 @@ public class DynamicTableServiceImpl extends AbstractService implements IDynamic } else if (StringUtils.equals(tableColumn.getDataType(), ColumnDataTypeEnum.CHAR.getDataType())) { columnSql.append(String.format("`%s` CHAR(%d)", WStringUtil.lowerUpper2UnderLine(tableColumn.getColumnName()), tableColumn.getColumnLength())); } else if (StringUtils.equals(tableColumn.getDataType(), ColumnDataTypeEnum.DATE.getDataType())) { - columnSql.append(String.format("`%s` DATE", WStringUtil.lowerUpper2UnderLine(tableColumn.getColumnName()), tableColumn.getColumnLength())); + columnSql.append(String.format("`%s` VARCHAR(40)", WStringUtil.lowerUpper2UnderLine(tableColumn.getColumnName()), tableColumn.getColumnLength())); } else if (StringUtils.equals(tableColumn.getDataType(), ColumnDataTypeEnum.DATETIME.getDataType())) { - columnSql.append(String.format("`%s` DATETIME", WStringUtil.lowerUpper2UnderLine(tableColumn.getColumnName()), tableColumn.getColumnLength())); + columnSql.append(String.format("`%s` VARCHAR(50)", WStringUtil.lowerUpper2UnderLine(tableColumn.getColumnName()), tableColumn.getColumnLength())); } else if (StringUtils.equals(tableColumn.getDataType(), ColumnDataTypeEnum.TEXT.getDataType())) { columnSql.append(String.format("`%s` TEXT DEFAULT NULL", WStringUtil.lowerUpper2UnderLine(tableColumn.getColumnName()), tableColumn.getColumnLength())); notNull = false; diff --git a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml index ff179a1..df13f9f 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml +++ b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/config/form/dynamicconfigform-mapper.xml @@ -15,6 +15,7 @@ + @@ -37,6 +38,7 @@ verify_regular, field_sort, list_show, + list_show_width, form_show, join_table, join_table_field, @@ -60,6 +62,7 @@ #{verifyRegular}, #{fieldSort}, #{listShow}, + #{listShowWidth}, #{formShow}, #{joinTable}, #{joinTableField}, @@ -124,6 +127,9 @@ list_show = #{listShow}, + + list_show_width = #{listShowWidth}, + form_show = #{formShow}, diff --git a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicform-mapper.xml b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicform-mapper.xml index 6a1144f..d0b5dfc 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicform-mapper.xml +++ b/cloud-common-plugin-dynamic/src/main/resources/mybatis/mapper/dynamic/dynamicform-mapper.xml @@ -14,6 +14,7 @@ + diff --git a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/list.html b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/list.html index 008b8dd..ceb2f1b 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/list.html +++ b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/list.html @@ -202,6 +202,7 @@ }, {field:'verifyRegular', width:140, title: '校验正则', align:'center'}, {field:'fieldSort', width:80, title: '排序', align:'center'}, + {field:'listShowWidth', width:100, title: '列表宽度', align:'center'}, {field:'listShow', width:100, title: '列表显示', align:'center', fixed: 'right', templet: function(row) { if(row.listShow == 1) { diff --git a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/save.html b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/save.html index bd76285..0a3b7b9 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/save.html +++ b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/save.html @@ -157,6 +157,12 @@ +
+ +
+ +
+
@@ -195,9 +201,7 @@ parent.layer.close(parent.layer.getFrameIndex(window.name)); } // 初始化 - function initData() { - - } + function initData() {} initData(); // 提交表单 diff --git a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/update.html b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/update.html index cc15f8f..7a86d58 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/update.html +++ b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/form/update.html @@ -157,6 +157,12 @@
+
+ +
+ +
+
@@ -212,6 +218,7 @@ verifyRegular: data.verifyRegular, fieldSort: data.fieldSort, listShow: data.listShow.toString(), + listShowWidth: data.listShowWidth, formShow: data.formShow.toString(), joinTable: data.joinTable, joinTableField: data.joinTableField, diff --git a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/list.html b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/list.html index 6196d27..c419a5b 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/list.html +++ b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/config/list.html @@ -98,10 +98,10 @@ }, {field:'createTable', width:100, title: '数据表', align:'center', templet: function(row) { - if(row.isCreate === 1) { - return ''; + if(row.isCreate === 0) { + return ''; } - return ''; + return ''; } }, ] diff --git a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/form/app/save-dynamic-form.html b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/form/app/save-dynamic-form.html index c6b5a5a..ea38ffa 100644 --- a/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/form/app/save-dynamic-form.html +++ b/cloud-common-plugin-dynamic/src/main/resources/templates/dynamic/form/app/save-dynamic-form.html @@ -18,225 +18,248 @@ -
-
- -
-
-
- -
-
- -
-
- -
-
-
- -
-
- -
-
- -
-
-
- -
-
- -
-
- -
-
-
- -
-
- -
-
- -
-
-
- -
-
- -
-
- -
-
-
- -
-
- -
-
- -
-
-
-
-
-
- -
-
- -
-
-
- -
-
- -
-
- -
-
-