动态表单新增联表字段宽度控制,移动端新增和修改功能完善
This commit is contained in:
parent
4aadcec092
commit
785a0d4f29
@ -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<String, Object> params) {
|
||||
return dynamicDataService.saveDynamicData(tableName, params);
|
||||
public SuccessResult saveDynamicData(@RequestHeader("token") String token, @PathVariable("tableName") String tableName, @RequestBody Map<String, Object> 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<String, Object> params) {
|
||||
return dynamicDataService.updateDynamicData(tableName, id, params);
|
||||
public SuccessResult updateDynamicData(@RequestHeader("token") String token, @PathVariable("tableName") String tableName, @PathVariable("id") String id, @RequestBody Map<String, Object> 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<String, Object> 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<String, Object> params) {
|
||||
return dynamicDataService.updateDynamicJoinData(token, tableName, joinKey, joinId, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "动态数据列表", notes = "动态数据列表接口")
|
||||
|
@ -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<DynamicFormFormShowFieldDTO> dynamicFormFormShowFieldDTOs = dynamicFormService.listFormShowFieldOfPage(tableName);
|
||||
mv.addObject("dynamicFormFormShowFieldDTOList", dynamicFormFormShowFieldDTOs);
|
||||
dynamicFormService.setDynamicFieldData(mv, dynamicFormFormShowFieldDTOs);
|
||||
setCurrentUserIdAndNameValues(mv, token, dynamicFormFormShowFieldDTOs);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置ID和名称值:当前用户、部门、角色、组、职位等
|
||||
*
|
||||
|
@ -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\":")
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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\":")
|
||||
|
@ -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\":")
|
||||
|
@ -33,6 +33,18 @@ public interface IDynamicDataService {
|
||||
*/
|
||||
SuccessResult saveDynamicData(String tableName, Map<String, Object> params) throws SearchException, SaveException;
|
||||
|
||||
/**
|
||||
* 保存动态数据(APP)
|
||||
*
|
||||
* @param token
|
||||
* @param tableName
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
* @throws SaveException
|
||||
*/
|
||||
SuccessResult saveDynamicData(String token, String tableName, Map<String, Object> 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<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 修改动态数据(APP)
|
||||
*
|
||||
* @param token
|
||||
* @param tableName
|
||||
* @param id
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
SuccessResult updateDynamicData(String token, String tableName, String id, Map<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 修改动态数据(链接)
|
||||
*
|
||||
* @param tableName
|
||||
* @param joinKey
|
||||
* @param joinId
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
SuccessResult updateDynamicJoinData(String tableName, String joinKey, String joinId, Map<String, Object> params);
|
||||
SuccessResult updateDynamicJoinData(String tableName, String joinKey, String joinId, Map<String, Object> 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<String, Object> params) throws UpdateException;
|
||||
|
||||
/**
|
||||
* 动态数据列表
|
||||
|
@ -47,6 +47,11 @@ public class DynamicDataServiceImpl extends AbstractService implements IDynamicD
|
||||
|
||||
@Override
|
||||
public SuccessResult saveDynamicData(String tableName, Map<String, Object> params) throws SearchException, SaveException {
|
||||
return saveDynamicData(null, tableName, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult saveDynamicData(String token, String tableName, Map<String, Object> params) throws SearchException, SaveException {
|
||||
List<DynamicFormDTO> 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<String, Object> 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<String, Object> params) throws UpdateException {
|
||||
return updateDynamicData(null, tableName, id, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult updateDynamicData(String token, String tableName, String id, Map<String, Object> params) throws UpdateException {
|
||||
List<KeyValue> 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<String, Object> params) {
|
||||
return updateDynamicJoinData(null, tableName, joinKey, joinId, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult updateDynamicJoinData(String token, String tableName, String joinKey, String joinId, Map<String, Object> params) throws UpdateException {
|
||||
List<KeyValue> 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();
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -15,6 +15,7 @@
|
||||
<result property="verifyRegular" column="verify_regular"/>
|
||||
<result property="fieldSort" column="field_sort"/>
|
||||
<result property="listShow" column="list_show"/>
|
||||
<result property="listShowWidth" column="list_show_width"/>
|
||||
<result property="formShow" column="form_show"/>
|
||||
<result property="joinTable" column="join_table"/>
|
||||
<result property="joinTableField" column="join_table_field"/>
|
||||
@ -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 @@
|
||||
<if test="listShow != null">
|
||||
list_show = #{listShow},
|
||||
</if>
|
||||
<if test="listShowWidth != null">
|
||||
list_show_width = #{listShowWidth},
|
||||
</if>
|
||||
<if test="formShow != null">
|
||||
form_show = #{formShow},
|
||||
</if>
|
||||
|
@ -14,6 +14,7 @@
|
||||
<result property="verifyRegular" column="verify_regular"/>
|
||||
<result property="fieldSort" column="field_sort"/>
|
||||
<result property="listShow" column="list_show"/>
|
||||
<result property="listShowWidth" column="list_show_width"/>
|
||||
<result property="formShow" column="form_show"/>
|
||||
<result property="joinTable" column="join_table"/>
|
||||
<result property="joinTableField" column="join_table_field"/>
|
||||
|
@ -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) {
|
||||
|
@ -157,6 +157,12 @@
|
||||
<input type="radio" name="listShow" value="1" title="开启" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">列表宽度 *</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="listShowWidth" placeholder="请输入列表宽度" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">表单显示 *</label>
|
||||
<div class="layui-input-block">
|
||||
@ -195,9 +201,7 @@
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
}
|
||||
// 初始化
|
||||
function initData() {
|
||||
|
||||
}
|
||||
function initData() {}
|
||||
initData();
|
||||
|
||||
// 提交表单
|
||||
|
@ -157,6 +157,12 @@
|
||||
<input type="radio" name="listShow" value="1" title="开启" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">列表宽度 *</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="listShowWidth" placeholder="请输入列表宽度" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">表单显示 *</label>
|
||||
<div class="layui-input-block">
|
||||
@ -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,
|
||||
|
@ -98,10 +98,10 @@
|
||||
},
|
||||
{field:'createTable', width:100, title: '数据表', align:'center',
|
||||
templet: function(row) {
|
||||
if(row.isCreate === 1) {
|
||||
return '<button type="button" class="layui-btn layui-btn-xs" lay-event="updateDynamicTable"><i class="fa fa-table"></i> 更新表</button>';
|
||||
if(row.isCreate === 0) {
|
||||
return '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="saveDynamicTable"><i class="fa fa-table"></i> 创建表</button>';
|
||||
}
|
||||
return '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="saveDynamicTable"><i class="fa fa-table"></i> 创建表</button>';
|
||||
return '<button type="button" class="layui-btn layui-btn-xs" lay-event="updateDynamicTable"><i class="fa fa-table"></i> 更新表</button>';
|
||||
}
|
||||
},
|
||||
]
|
||||
|
@ -18,225 +18,248 @@
|
||||
<form id="uploadFileForm" enctype="multipart/form-data" style="display:none;">
|
||||
<input type="file" id="uploadFile" name="file" onchange="fileUpload()">
|
||||
</form>
|
||||
<div class="form-item" th:each="dynamicFormFormShowFieldDTO, state: ${dynamicFormFormShowFieldDTOList}">
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'string'}">
|
||||
<!-- 文本start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文本end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'datetime'}">
|
||||
<!-- 时间戳start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 时间戳end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'date'}">
|
||||
<!-- 日期start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 日期end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'number'}">
|
||||
<!-- 整形start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="number" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" pattern="[0-9]*" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- 整形end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'double'}">
|
||||
<!-- 双精度start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="number" class="weui-input" step="0.01" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" pattern="^[-//+]?//d+(//.//d*)?|//.//d+$">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 双精度end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'textarea'}">
|
||||
<!-- 文本域start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<textarea class="weui-textarea" rows="4" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" placeholder="请输入文本域"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文本域end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'richText'}">
|
||||
<!-- 富文本start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<div th:id="${dynamicFormFormShowFieldDTO.fieldName}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 富文本end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'select'}">
|
||||
<!-- 下拉列表start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 下拉列表end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'radio'}">
|
||||
<!-- 单选start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells weui-cells_radio" th:each="radioMap: ${radioMapList}" th:if="${radioMap.name eq dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<label class="weui-cell weui-check__label" th:for="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:each="radio, status: ${radioMap.list}">
|
||||
<div>
|
||||
<div class="form-item" th:each="dynamicFormFormShowFieldDTO, state: ${dynamicFormFormShowFieldDTOList}">
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'string'}">
|
||||
<!-- 文本start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<p th:text="${radio.dictionaryName}"></p>
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
<div class="weui-cell__ft">
|
||||
<input class="weui-check" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:id="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:value="${radio.dictionaryId}" type="radio">
|
||||
<span class="weui-icon-checked"></span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- 文本end -->
|
||||
</div>
|
||||
<!-- 单选end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'checkbox'}">
|
||||
<!-- 复选start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells weui-cells_checkbox" th:each="checkboxMap: ${checkboxMapList}" th:if="${checkboxMap.name eq dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<label class="weui-cell weui-check__label" th:for="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:each="checkbox, status: ${checkboxMap.list}">
|
||||
<div class="weui-cell__hd">
|
||||
<input type="checkbox" class="weui-check" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:id="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:value="${radio.dictionaryId}">
|
||||
<i class="weui-icon-checked"></i>
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'datetime'}">
|
||||
<!-- 时间戳start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<p th:text="${radio.dictionaryName}"></p>
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- 复选end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'file'}">
|
||||
<!-- 文件上传start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells" th:id="${dynamicFormFormShowFieldDTO.fieldName +'Box'}"></div>
|
||||
<div class="upload-file-button-box">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<a href="javascript:void(0);" th:id="${dynamicFormFormShowFieldDTO.fieldName +'UploadFile'}" th:attr="data-name=${dynamicFormFormShowFieldDTO.fieldName}" class="weui-btn weui-btn_mini bg-blue">上传文件</a>
|
||||
</div>
|
||||
<!-- 文件上传end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'selectUser'}">
|
||||
<!-- 人员选择start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'SelectUser'}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
<!-- 时间戳end -->
|
||||
</div>
|
||||
<!-- 人员选择end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'selectDepartment'}">
|
||||
<!-- 部门选择start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'SelectDepartment'}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'date'}">
|
||||
<!-- 日期start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 日期end -->
|
||||
</div>
|
||||
<!-- 部门选择end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'leftJoin' or dynamicFormFormShowFieldDTO.fieldType eq 'innerJoin' or dynamicFormFormShowFieldDTO.fieldType eq 'rightJoin'}">
|
||||
<!-- 联表start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'number'}">
|
||||
<!-- 整形start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="number" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" pattern="[0-9]*" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- 整形end -->
|
||||
</div>
|
||||
<!-- 联表end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentUser'}">
|
||||
<!-- 当前用户start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${userIdAndValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentUser'}" th:value="${userNameValue}" readonly>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'double'}">
|
||||
<!-- 双精度start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="number" class="weui-input" step="0.01" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" pattern="^[-//+]?//d+(//.//d*)?|//.//d+$">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 双精度end -->
|
||||
</div>
|
||||
<!-- 当前用户end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentDepartment'}">
|
||||
<!-- 当前部门start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${departmentIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentDepartment'}" th:value="${departmentNamesValue}" readonly>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'textarea'}">
|
||||
<!-- 文本域start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<textarea class="weui-textarea" rows="4" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" placeholder="请输入文本域"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文本域end -->
|
||||
</div>
|
||||
<!-- 当前部门end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentRole'}">
|
||||
<!-- 当前角色start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${roleIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentRole'}" th:value="${roleNamesValue}" readonly>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'richText'}">
|
||||
<!-- 富文本start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<div th:id="${dynamicFormFormShowFieldDTO.fieldName}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 富文本end -->
|
||||
</div>
|
||||
<!-- 当前角色end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentGroup'}">
|
||||
<!-- 当前组start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${positionIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentGroup'}" th:value="${positionNamesValue}" readonly>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'select'}">
|
||||
<!-- 下拉列表start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 下拉列表end -->
|
||||
</div>
|
||||
<!-- 当前组end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentPosition'}">
|
||||
<!-- 当前职位start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${groupIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentPosition'}" th:value="${groupNamesValue}" readonly>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'radio'}">
|
||||
<!-- 单选start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells weui-cells_radio" th:each="radioMap: ${radioMapList}" th:if="${radioMap.name eq dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<label class="weui-cell weui-check__label" th:for="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:each="radio, status: ${radioMap.list}">
|
||||
<div class="weui-cell__bd">
|
||||
<p th:text="${radio.dictionaryName}"></p>
|
||||
</div>
|
||||
<div class="weui-cell__ft">
|
||||
<input class="weui-check" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:id="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:value="${radio.dictionaryId}" type="radio">
|
||||
<span class="weui-icon-checked"></span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- 单选end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'checkbox'}">
|
||||
<!-- 复选start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells weui-cells_checkbox" th:each="checkboxMap: ${checkboxMapList}" th:if="${checkboxMap.name eq dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<label class="weui-cell weui-check__label" th:for="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:each="checkbox, status: ${checkboxMap.list}">
|
||||
<div class="weui-cell__hd">
|
||||
<input type="checkbox" class="weui-check" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:id="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:value="${checkbox.dictionaryId}">
|
||||
<i class="weui-icon-checked"></i>
|
||||
</div>
|
||||
<div class="weui-cell__bd">
|
||||
<p th:text="${checkbox.dictionaryName}"></p>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- 复选end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'file'}">
|
||||
<!-- 文件上传start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells" th:id="${dynamicFormFormShowFieldDTO.fieldName +'Box'}"></div>
|
||||
<div class="upload-file-button-box">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<a href="javascript:void(0);" th:id="${dynamicFormFormShowFieldDTO.fieldName +'UploadFile'}" th:attr="data-name=${dynamicFormFormShowFieldDTO.fieldName}" class="weui-btn weui-btn_mini bg-blue">上传文件</a>
|
||||
</div>
|
||||
<!-- 文件上传end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'selectUser'}">
|
||||
<!-- 人员选择start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'SelectUser'}" th:attr="data-name=${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 人员选择end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'selectDepartment'}">
|
||||
<!-- 部门选择start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'SelectDepartment'}" th:attr="data-name=${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 部门选择end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'leftJoin' or dynamicFormFormShowFieldDTO.fieldType eq 'innerJoin' or dynamicFormFormShowFieldDTO.fieldType eq 'rightJoin'}">
|
||||
<!-- 联表start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 联表end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentUser'}">
|
||||
<!-- 当前用户start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${userIdAndValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentUser'}" th:value="${userNameValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前用户end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentDepartment'}">
|
||||
<!-- 当前部门start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${departmentIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentDepartment'}" th:value="${departmentNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前部门end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentRole'}">
|
||||
<!-- 当前角色start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${roleIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentRole'}" th:value="${roleNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前角色end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentGroup'}">
|
||||
<!-- 当前组start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${positionIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentGroup'}" th:value="${positionNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前组end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentPosition'}">
|
||||
<!-- 当前职位start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${groupIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentPosition'}" th:value="${groupNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前职位end -->
|
||||
</div>
|
||||
<!-- 当前职位end -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-button">
|
||||
<a href="javascript:void(0);" class="weui-btn weui-btn_primary" id="submitForm">提交</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="commitSuccess" class="weui-msg" style="display: none;">
|
||||
<div class="weui-msg__icon-area"><i class="weui-icon-success weui-icon_msg"></i></div>
|
||||
<div class="weui-msg__text-area">
|
||||
<h2 class="weui-msg__title">提交成功</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div id="commitError" class="weui-msg" style="display: none;">
|
||||
<div class="weui-msg__icon-area"><i class="weui-icon-warn weui-icon_msg"></i></div>
|
||||
<div class="weui-msg__text-area">
|
||||
<h2 class="weui-msg__title">提交失败</h2>
|
||||
<p class="weui-msg__desc" id="errorMessage"></p>
|
||||
</div>
|
||||
<div class="weui-msg__opr-area">
|
||||
<p class="weui-btn-area">
|
||||
<a href="javascript:void(0);" class="weui-btn weui-btn_primary" id="commitErrorBack">返回继续</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="tableName" th:value="${tableName}"/>
|
||||
<input type="hidden" id="token" th:value="${token}"/>
|
||||
<script type="text/javascript" src="assets/js/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/zepto.min.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/zepto.weui.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/php.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="assets/js/restajax.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/dialog.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
@ -252,7 +275,7 @@
|
||||
// 富文本
|
||||
var editor = new wangEditor('#'+ id);
|
||||
editor.customConfig.menus = ['head', 'bold', 'fontSize', 'italic', 'justify', 'quote'];
|
||||
editor.customConfig.zIndex = 100;
|
||||
editor.customConfig.zIndex = 10;
|
||||
editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024;
|
||||
editor.customConfig.uploadImgMaxLength = 1;
|
||||
editor.customConfig.uploadFileName = 'image';
|
||||
@ -271,7 +294,7 @@
|
||||
};
|
||||
editor.create();
|
||||
var wangEditorObj = {};
|
||||
wangEditorObj['richEditor'] = editor;
|
||||
wangEditorObj[id] = editor;
|
||||
wangEditorArray.push(wangEditorObj);
|
||||
}
|
||||
|
||||
@ -290,7 +313,6 @@
|
||||
min: min,
|
||||
max: max,
|
||||
onChange: function (picker, values, displayValues) {
|
||||
console.log(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -307,7 +329,6 @@
|
||||
return str.split("-");
|
||||
},
|
||||
onChange: function (picker, values, displayValues) {
|
||||
console.log(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -390,8 +411,9 @@
|
||||
});
|
||||
} else if(item.fieldType === 'selectUser') {
|
||||
$(document).on('click', '#'+ item.fieldName +'SelectUser', function() {
|
||||
var name = this.dataset.name;
|
||||
var selectedUsers = [];
|
||||
var selectDepartmentUser = $('#'+ item.fieldName).val().split(',');
|
||||
var selectDepartmentUser = $('#'+ name).val().split(',');
|
||||
for(var selectDepartmentUserIndex = 0, item = selectDepartmentUser[selectDepartmentUserIndex]; item = selectDepartmentUser[selectDepartmentUserIndex++];) {
|
||||
var userInfo = item.split('|');
|
||||
selectedUsers.push({
|
||||
@ -401,7 +423,7 @@
|
||||
}
|
||||
top.dialog.dialogData.selectedUsers = selectedUsers;
|
||||
top.dialog.open({
|
||||
url: 'approute/tree/treeuser',
|
||||
url: 'approute/tree/treeuserrelease',
|
||||
title: '选择组织部门人员',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
@ -420,11 +442,11 @@
|
||||
selectedUsersVal += (selectUser.userId +'|'+ selectUser.departmentId +'|'+ selectUser.userName +'|'+ selectUser.userTitle);
|
||||
showSelectedUsersVal += selectUser.userName;
|
||||
}
|
||||
$('#'+ item.fieldName).val(selectedUsersVal);
|
||||
$('#'+ item.fieldName +'SelectUser').val(showSelectedUsersVal);
|
||||
$('#'+ name).val(selectedUsersVal);
|
||||
$('#'+ name +'SelectUser').val(showSelectedUsersVal);
|
||||
} else {
|
||||
$('#'+ item.fieldName).val('');
|
||||
$('#'+ item.fieldName +'SelectUser').val('');
|
||||
$('#'+ name).val('');
|
||||
$('#'+ name +'SelectUser').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -433,7 +455,7 @@
|
||||
$(document).on('click', '#'+ item.fieldName +'SelectDepartment', function() {
|
||||
var name = this.dataset.name;
|
||||
var selectedNodes = [];
|
||||
var selectDepartment = $('#'+ item.fieldName).val().split(',');
|
||||
var selectDepartment = $('#'+ name).val().split(',');
|
||||
for(var selectDepartmentIndex = 0, item = selectDepartment[selectDepartmentIndex]; item = selectDepartment[selectDepartmentIndex++];) {
|
||||
var departmentInfo = item.split('|');
|
||||
selectedNodes.push({
|
||||
@ -473,11 +495,11 @@
|
||||
selectedDepartmentVal += (selectNode.id +'|'+ selectNode.name);
|
||||
showSelectedDepartmentsVal += selectNode.name;
|
||||
}
|
||||
$('#'+ item.fieldName).val(selectedDepartmentVal);
|
||||
$('#'+ item.fieldName +'SelectDepartment').val(showSelectedDepartmentsVal);
|
||||
$('#'+ name).val(selectedDepartmentVal);
|
||||
$('#'+ name +'SelectDepartment').val(showSelectedDepartmentsVal);
|
||||
} else {
|
||||
$('#'+ item.fieldName).val('');
|
||||
$('#'+ item.fieldName +'SelectDepartment').val('');
|
||||
$('#'+ name).val('');
|
||||
$('#'+ name +'SelectDepartment').val('');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -485,6 +507,9 @@
|
||||
});
|
||||
} else if(item.fieldType === 'leftJoin' || item.fieldType === 'innerJoin' || item.fieldType === 'rightJoin') {
|
||||
top.restAjax.get(top.restAjax.path('app/dynamicdata/listdynamicdata/{tableName}', [item.joinTable]), {}, {
|
||||
headers: {
|
||||
token: token
|
||||
},
|
||||
fieldName: item.fieldName,
|
||||
fieldExplain: item.fieldExplain,
|
||||
joinTable: item.joinTable,
|
||||
@ -505,6 +530,91 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#submitForm', function() {
|
||||
var formData = {};
|
||||
// 富文本
|
||||
for(var i = 0, editor; editor = wangEditorArray[i++];) {
|
||||
for(var j in editor) {
|
||||
formData[j] = editor[j].txt.html();
|
||||
}
|
||||
}
|
||||
for(var i = 0, item; item = formFieldList[i++];) {
|
||||
if(item.fieldType === 'radio') {
|
||||
var radioValue = '';
|
||||
$('input[name='+ item.fieldName +']:checked').each(function() {
|
||||
radioValue += $(this).val();
|
||||
});
|
||||
if(radioValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = radioValue;
|
||||
} else if(item.fieldType === 'checkbox') {
|
||||
var checkboxValue = '';
|
||||
$('input[name='+ item.fieldName +']:checked').each(function() {
|
||||
checkboxValue += $(this).val();
|
||||
});
|
||||
if(checkboxValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = checkboxValue;
|
||||
} else if(item.fieldType === 'datetime') {
|
||||
var datetimeValue = $('#'+ item.fieldName).val();
|
||||
if(datetimeValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = datetimeValue +':00';
|
||||
} else if(item.fieldType === 'select') {
|
||||
var selectValue = $('#'+ item.fieldName)[0].dataset.values;
|
||||
if(selectValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = selectValue;
|
||||
} else if(item.fieldType === 'leftJoin' || item.fieldType === 'innerJoin' || item.fieldType === 'rightJoin') {
|
||||
var joinValue = $('#'+ item.fieldName)[0].dataset.values;
|
||||
if(joinValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = joinValue;
|
||||
} else if(item.fieldType != 'richText') {
|
||||
var datetimeValue = $('#'+ item.fieldName).val();
|
||||
if(datetimeValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = $('#'+ item.fieldName).val();
|
||||
}
|
||||
}
|
||||
$.confirm("您确定要提交吗?", "确认提交?", function() {
|
||||
top.restAjax.post(top.restAjax.path('app/dynamicdata/savedynamicdata/{tableName}', [$('#tableName').val()]), formData, {
|
||||
headers: {
|
||||
token: token
|
||||
}
|
||||
}, function(code, data) {
|
||||
$('#app').hide();
|
||||
$('#commitSuccess').show();
|
||||
}, function(code, data) {
|
||||
$('#errorMessage').text(data.msg);
|
||||
$('#app').hide();
|
||||
$('#commitError').show();
|
||||
}, function() {
|
||||
$.showLoading('正在提交...');
|
||||
}, function() {
|
||||
$.hideLoading();
|
||||
});
|
||||
}, function() {
|
||||
});
|
||||
})
|
||||
// 错误返回
|
||||
$(document).on('click', '#commitErrorBack', function() {
|
||||
$('#commitError').hide();
|
||||
$('#app').show();
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
@ -0,0 +1,686 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#httpServletRequest.getScheme() + '://' + #httpServletRequest.getServerName() + ':' + #request.getServerPort() + #request.getContextPath() + '/'} ">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/wxpage/css/weui.css"/>
|
||||
<link rel="stylesheet" href="assets/wxpage/css/weuix.css"/>
|
||||
<style>
|
||||
.layui-m-layercont {height: 100%;}
|
||||
.page-iframe {width: 100%;height:100%;border: 0;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" class="weui-cells weui-cells_form" style="margin-top:0;">
|
||||
<form id="uploadFileForm" enctype="multipart/form-data" style="display:none;">
|
||||
<input type="file" id="uploadFile" name="file" onchange="fileUpload()">
|
||||
</form>
|
||||
<div>
|
||||
<div class="form-item" th:each="dynamicFormFormShowFieldDTO, state: ${dynamicFormFormShowFieldDTOList}">
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'string'}">
|
||||
<!-- 文本start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文本end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'datetime'}">
|
||||
<!-- 时间戳start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 时间戳end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'date'}">
|
||||
<!-- 日期start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 日期end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'number'}">
|
||||
<!-- 整形start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="number" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" pattern="[0-9]*" >
|
||||
</div>
|
||||
</div>
|
||||
<!-- 整形end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'double'}">
|
||||
<!-- 双精度start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="number" class="weui-input" step="0.01" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" pattern="^[-//+]?//d+(//.//d*)?|//.//d+$">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 双精度end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'textarea'}">
|
||||
<!-- 文本域start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<textarea class="weui-textarea" rows="4" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请输入'+ dynamicFormFormShowFieldDTO.fieldExplain}" placeholder="请输入文本域"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文本域end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'richText'}">
|
||||
<!-- 富文本start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<div th:id="${dynamicFormFormShowFieldDTO.fieldName}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 富文本end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'select'}">
|
||||
<!-- 下拉列表start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 下拉列表end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'radio'}">
|
||||
<!-- 单选start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells weui-cells_radio" th:each="radioMap: ${radioMapList}" th:if="${radioMap.name eq dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<label class="weui-cell weui-check__label" th:for="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:each="radio, status: ${radioMap.list}">
|
||||
<div class="weui-cell__bd">
|
||||
<p th:text="${radio.dictionaryName}"></p>
|
||||
</div>
|
||||
<div class="weui-cell__ft">
|
||||
<input class="weui-check" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:id="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:value="${radio.dictionaryId}" type="radio">
|
||||
<span class="weui-icon-checked"></span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- 单选end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'checkbox'}">
|
||||
<!-- 复选start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells weui-cells_checkbox" th:each="checkboxMap: ${checkboxMapList}" th:if="${checkboxMap.name eq dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<label class="weui-cell weui-check__label" th:for="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:each="checkbox, status: ${checkboxMap.list}">
|
||||
<div class="weui-cell__hd">
|
||||
<input type="checkbox" class="weui-check" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:id="${dynamicFormFormShowFieldDTO.fieldName + '_' + status.index}" th:value="${checkbox.dictionaryId}">
|
||||
<i class="weui-icon-checked"></i>
|
||||
</div>
|
||||
<div class="weui-cell__bd">
|
||||
<p th:text="${checkbox.dictionaryName}"></p>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- 复选end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'file'}">
|
||||
<!-- 文件上传start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cells" th:id="${dynamicFormFormShowFieldDTO.fieldName +'Box'}"></div>
|
||||
<div class="upload-file-button-box">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}">
|
||||
<a href="javascript:void(0);" th:id="${dynamicFormFormShowFieldDTO.fieldName +'UploadFile'}" th:attr="data-name=${dynamicFormFormShowFieldDTO.fieldName}" class="weui-btn weui-btn_mini bg-blue">上传文件</a>
|
||||
</div>
|
||||
<!-- 文件上传end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'selectUser'}">
|
||||
<!-- 人员选择start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'SelectUser'}" th:attr="data-name=${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 人员选择end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'selectDepartment'}">
|
||||
<!-- 部门选择start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${dynamicFormFormShowFieldDTO.fieldDefault}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'SelectDepartment'}" th:attr="data-name=${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 部门选择end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'leftJoin' or dynamicFormFormShowFieldDTO.fieldType eq 'innerJoin' or dynamicFormFormShowFieldDTO.fieldType eq 'rightJoin'}">
|
||||
<!-- 联表start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:placeholder="${'请选择'+ dynamicFormFormShowFieldDTO.fieldExplain}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 联表end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentUser'}">
|
||||
<!-- 当前用户start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${userIdAndValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentUser'}" th:value="${userNameValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前用户end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentDepartment'}">
|
||||
<!-- 当前部门start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${departmentIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentDepartment'}" th:value="${departmentNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前部门end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentRole'}">
|
||||
<!-- 当前角色start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${roleIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentRole'}" th:value="${roleNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前角色end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentGroup'}">
|
||||
<!-- 当前组start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${positionIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentGroup'}" th:value="${positionNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前组end -->
|
||||
</div>
|
||||
<div th:if="${dynamicFormFormShowFieldDTO.fieldType eq 'currentPosition'}">
|
||||
<!-- 当前职位start -->
|
||||
<div class="weui-cells__title" th:text="${dynamicFormFormShowFieldDTO.fieldExplain}"></div>
|
||||
<div class="weui-cell">
|
||||
<div class="weui-cell__bd">
|
||||
<input type="hidden" th:id="${dynamicFormFormShowFieldDTO.fieldName}" th:name="${dynamicFormFormShowFieldDTO.fieldName}" th:value="${groupIdAndNamesValue}">
|
||||
<input type="text" class="weui-input" th:id="${dynamicFormFormShowFieldDTO.fieldName +'CurrentPosition'}" th:value="${groupNamesValue}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 当前职位end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-button">
|
||||
<a href="javascript:void(0);" class="weui-btn weui-btn_primary" id="submitForm">提交</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="commitSuccess" class="weui-msg" style="display: none;">
|
||||
<div class="weui-msg__icon-area"><i class="weui-icon-success weui-icon_msg"></i></div>
|
||||
<div class="weui-msg__text-area">
|
||||
<h2 class="weui-msg__title">提交成功</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div id="commitError" class="weui-msg" style="display: none;">
|
||||
<div class="weui-msg__icon-area"><i class="weui-icon-warn weui-icon_msg"></i></div>
|
||||
<div class="weui-msg__text-area">
|
||||
<h2 class="weui-msg__title">提交失败</h2>
|
||||
<p class="weui-msg__desc" id="errorMessage"></p>
|
||||
</div>
|
||||
<div class="weui-msg__opr-area">
|
||||
<p class="weui-btn-area">
|
||||
<a href="javascript:void(0);" class="weui-btn weui-btn_primary" id="commitErrorBack">返回继续</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="tableName" th:value="${tableName}"/>
|
||||
<input type="hidden" id="token" th:value="${token}"/>
|
||||
<input type="hidden" id="uuidValue" th:value="${uuidValue}"/>
|
||||
<script type="text/javascript" src="assets/js/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/layer/layer.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/zepto.min.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/zepto.weui.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/php.js"></script>
|
||||
<script type="text/javascript" src="assets/js/restajax.js"></script>
|
||||
<script type="text/javascript" src="assets/wxpage/js/dialog.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
|
||||
<script type="text/javascript" th:inline="javascript">
|
||||
var token = $('#token').val();
|
||||
var currentUploadFileId = '';
|
||||
var wangEditor = window.wangEditor;
|
||||
var wangEditorArray = [];
|
||||
var formFieldList = [[${dynamicFormFormShowFieldDTOList}]];
|
||||
var selectMapList = [[${selectMapList}]];
|
||||
|
||||
function initRichEditor(id, text) {
|
||||
// 富文本
|
||||
var editor = new wangEditor('#'+ id);
|
||||
editor.customConfig.menus = ['head', 'bold', 'fontSize', 'italic', 'justify', 'quote'];
|
||||
editor.customConfig.zIndex = 10;
|
||||
editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024;
|
||||
editor.customConfig.uploadImgMaxLength = 1;
|
||||
editor.customConfig.uploadFileName = 'image';
|
||||
editor.customConfig.uploadImgServer = 'app/file/wangeditorimage';
|
||||
editor.customConfig.uploadImgHeaders = {token: token};
|
||||
editor.customConfig.uploadImgHooks = {
|
||||
fail: function (xhr, editor, result) {
|
||||
top.dialog.msg('系统错误,图片上传失败');
|
||||
},
|
||||
error: function (xhr, editor) {
|
||||
top.dialog.msg('网络异常');
|
||||
},
|
||||
timeout: function (xhr, editor) {
|
||||
top.dialog.msg('网络请求超时');
|
||||
}
|
||||
};
|
||||
editor.create();
|
||||
editor.txt.html(text);
|
||||
var wangEditorObj = {};
|
||||
wangEditorObj[id] = editor;
|
||||
wangEditorArray.push(wangEditorObj);
|
||||
}
|
||||
|
||||
function initSelect(id, name, data) {
|
||||
// 下拉选择
|
||||
$('#'+ id).select({
|
||||
title: name,
|
||||
items: data
|
||||
});
|
||||
}
|
||||
|
||||
function initDateTime(id, title, min, max, defaultValue) {
|
||||
// 时间戳
|
||||
$('#'+ id).datetimePicker({
|
||||
title: title,
|
||||
min: min,
|
||||
max: max,
|
||||
value: defaultValue,
|
||||
onChange: function (picker, values, displayValues) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initDate(id, title, startYear, endYear, defaultValue) {
|
||||
// 日期
|
||||
$('#'+ id).datetimePicker({
|
||||
title: title,
|
||||
years: range(startYear, endYear),
|
||||
value: defaultValue,
|
||||
times: function () {
|
||||
return [];
|
||||
},
|
||||
parse: function (str) {
|
||||
return str.split("-");
|
||||
},
|
||||
onChange: function (picker, values, displayValues) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 文件上传 start
|
||||
function fileUpload() {
|
||||
if($('#uploadFile').val() == '') {
|
||||
return;
|
||||
}
|
||||
var formData = new FormData(document.getElementById("uploadFileForm"));
|
||||
top.restAjax.postFile(top.restAjax.path('app/file/uploadfile', []), formData, {
|
||||
headers: {
|
||||
token: token
|
||||
}
|
||||
}, function(code, data) {
|
||||
var selectIds = $('#'+ currentUploadFileId).val();
|
||||
if(selectIds != '') {
|
||||
selectIds += ',';
|
||||
}
|
||||
selectIds += data.data;
|
||||
initUploadFileList(currentUploadFileId, selectIds);
|
||||
$('#uploadFile').val('');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
$(document).on('click', '.remove-file', function() {
|
||||
var id = this.dataset.id;
|
||||
var name = this.dataset.filename;
|
||||
var selectIds = $('#'+ name).val();
|
||||
selectIds = selectIds.replace(id, '');
|
||||
selectIds = selectIds.replace(/\,+/g, ',');
|
||||
if(selectIds.indexOf(',') == 0) {
|
||||
selectIds = selectIds.substring(1);
|
||||
}
|
||||
if(selectIds.lastIndexOf(',') == selectIds.length - 1) {
|
||||
selectIds = selectIds.substring(0, selectIds.length - 1);
|
||||
}
|
||||
initUploadFileList(name, selectIds);
|
||||
});
|
||||
// 初始化上传文件列表
|
||||
function initUploadFileList(name, selectIds) {
|
||||
var selectIdArray = selectIds.split(',');
|
||||
var fileItems = '';
|
||||
for(var i = 0, item; item = selectIdArray[i++];) {
|
||||
fileItems += '<div class="weui-cell file-upload"><div class="weui-cell__bd"><p>文件'+ i +'</p></div><div class="weui-cell__ft remove-file" style="font-size: unset;" data-id="'+ item +'" data-filename="'+ name +'">删除</div></div>';
|
||||
}
|
||||
$('#'+ name +'Box').html(fileItems);
|
||||
$('#'+ name).val(selectIds);
|
||||
}
|
||||
// 文件上传end
|
||||
|
||||
$(function() {
|
||||
top.restAjax.get(top.restAjax.path('app/dynamicdata/getdynamicdata/{tableName}/{uuidValue}', [$('#tableName').val(), $('#uuidValue').val()]), {}, {
|
||||
headers: {
|
||||
token: token
|
||||
}
|
||||
}, function(code, data) {
|
||||
for(var i = 0, item = formFieldList[i]; item = formFieldList[i++];) {
|
||||
if(item.fieldType === 'radio') {
|
||||
$('input[name='+ item.fieldName +'][value='+ data[item.fieldName] +']').attr('checked', true);
|
||||
} else if(item.fieldType === 'checkbox') {
|
||||
var valueArray = data[item.fieldName].split(',');
|
||||
for(var j = 0, value; value = valueArray[j++];) {
|
||||
$('input[name='+ item.fieldName +'][value='+ value +']').attr('checked', true);
|
||||
}
|
||||
} else if(item.fieldType === 'date') {
|
||||
initDate(item.fieldName, item.fieldExplain, 1960, 2060, data[item.fieldName]);
|
||||
} else if(item.fieldType === 'datetime') {
|
||||
initDateTime(item.fieldName, item.fieldExplain, '1960-12-12 00:00:00', '2060-12-12 23:59:59', data[item.fieldName]);
|
||||
} else if(item.fieldType === 'select') {
|
||||
var dataArray = [];
|
||||
for(var j = 0, selectMap; selectMap = selectMapList[j++];) {
|
||||
if(selectMap.name === item.fieldName) {
|
||||
var dataArray = [];
|
||||
for(var k = 0, map; map = selectMap.list[k++];) {
|
||||
dataArray.push({
|
||||
title: map.dictionaryName,
|
||||
value: map.dictionaryId
|
||||
});
|
||||
if(map.dictionaryId == data[item.fieldName]) {
|
||||
$('#'+ args.fieldName).val(map.dictionaryName);
|
||||
$('#'+ args.fieldName)[0].dataset.values = map.dictionaryId;
|
||||
}
|
||||
}
|
||||
initSelect(item.fieldName, item.fieldExplain, dataArray);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if(item.fieldType === 'richText') {
|
||||
initRichEditor(item.fieldName, data[item.fieldName]);
|
||||
} else if(item.fieldType === 'file') {
|
||||
$(document).on('click', '#'+ item.fieldName +'UploadFile', function() {
|
||||
currentUploadFileId = this.dataset.name;
|
||||
$('#uploadFile').click();
|
||||
});
|
||||
initUploadFileList(item.fieldName, data[item.fieldName]);
|
||||
} else if(item.fieldType === 'selectUser') {
|
||||
$(document).on('click', '#'+ item.fieldName +'SelectUser', function() {
|
||||
var name = this.dataset.name;
|
||||
var selectedUsers = [];
|
||||
var selectDepartmentUser = $('#'+ name).val().split(',');
|
||||
for(var selectDepartmentUserIndex = 0, item = selectDepartmentUser[selectDepartmentUserIndex]; item = selectDepartmentUser[selectDepartmentUserIndex++];) {
|
||||
var userInfo = item.split('|');
|
||||
selectedUsers.push({
|
||||
userId: userInfo[0],
|
||||
departmentId: userInfo[1]
|
||||
});
|
||||
}
|
||||
top.dialog.dialogData.selectedUsers = selectedUsers;
|
||||
top.dialog.open({
|
||||
url: 'approute/tree/treeuserrelease',
|
||||
title: '选择组织部门人员',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
onClose: function() {
|
||||
var selectedUsers = top.dialog.dialogData.selectedDepartmentUsers;
|
||||
if(selectedUsers != null && selectedUsers.length > 0) {
|
||||
var selectedUsersVal = '';
|
||||
var showSelectedUsersVal = '';
|
||||
for(var j = 0, selectUser = selectedUsers[j]; selectUser = selectedUsers[j++];) {
|
||||
if(selectedUsersVal.length > 0) {
|
||||
selectedUsersVal += ',';
|
||||
}
|
||||
if(showSelectedUsersVal.length > 0) {
|
||||
showSelectedUsersVal += ',';
|
||||
}
|
||||
selectedUsersVal += (selectUser.userId +'|'+ selectUser.departmentId +'|'+ selectUser.userName +'|'+ selectUser.userTitle);
|
||||
showSelectedUsersVal += selectUser.userName;
|
||||
}
|
||||
$('#'+ name).val(selectedUsersVal);
|
||||
$('#'+ name +'SelectUser').val(showSelectedUsersVal);
|
||||
} else {
|
||||
$('#'+ name).val('');
|
||||
$('#'+ name +'SelectUser').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
var selectedUsersVal = data[item.fieldName];
|
||||
if(selectedUsersVal != '') {
|
||||
var users = selectedUsersVal.split(',');
|
||||
var showSelectedUsersVal = '';
|
||||
for(var j = 0, user; user = users[j++];) {
|
||||
if(showSelectedUsersVal != '') {
|
||||
showSelectedUsersVal += ',';
|
||||
}
|
||||
showSelectedUsersVal += user.split('|')[2];
|
||||
}
|
||||
$('#'+ item.fieldName).val(selectedUsersVal);
|
||||
$('#'+ item.fieldName +'SelectUser').val(showSelectedUsersVal);
|
||||
}
|
||||
} else if(item.fieldType === 'selectDepartment') {
|
||||
$(document).on('click', '#'+ item.fieldName +'SelectDepartment', function() {
|
||||
var name = this.dataset.name;
|
||||
var selectedNodes = [];
|
||||
var selectDepartment = $('#'+ name).val().split(',');
|
||||
for(var selectDepartmentIndex = 0, item = selectDepartment[selectDepartmentIndex]; item = selectDepartment[selectDepartmentIndex++];) {
|
||||
var departmentInfo = item.split('|');
|
||||
selectedNodes.push({
|
||||
id: departmentInfo[0],
|
||||
name: departmentInfo[1],
|
||||
title: departmentInfo[1]
|
||||
});
|
||||
}
|
||||
top.dialog.tree({
|
||||
title: '选择部门',
|
||||
apiUri: 'app/department/listztreedepartment',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
dataFilter: function(treeId, parentNode, childNodes) {
|
||||
return childNodes;
|
||||
},
|
||||
check: {
|
||||
enable: true,
|
||||
selectType: 'checkbox',
|
||||
checkboxType: {Y: 'ps', N: 'ps'},
|
||||
radioType: 'level',
|
||||
},
|
||||
selectedNodes: selectedNodes,
|
||||
onClose: function() {
|
||||
var selectNodes = top.dialog.dialogTreeData.selectedNodes;
|
||||
if(typeof(selectNodes) != 'undefined' && selectNodes != null) {
|
||||
if(selectNodes.length > 0) {
|
||||
var selectedDepartmentVal = '';
|
||||
var showSelectedDepartmentsVal = '';
|
||||
for(var j = 0, selectNode = selectNodes[j]; selectNode = selectNodes[j++];) {
|
||||
if(selectedDepartmentVal.length > 0) {
|
||||
selectedDepartmentVal += ',';
|
||||
}
|
||||
if(showSelectedDepartmentsVal.length > 0) {
|
||||
showSelectedDepartmentsVal += ',';
|
||||
}
|
||||
selectedDepartmentVal += (selectNode.id +'|'+ selectNode.name);
|
||||
showSelectedDepartmentsVal += selectNode.name;
|
||||
}
|
||||
$('#'+ name).val(selectedDepartmentVal);
|
||||
$('#'+ name +'SelectDepartment').val(showSelectedDepartmentsVal);
|
||||
} else {
|
||||
$('#'+ name).val('');
|
||||
$('#'+ name +'SelectDepartment').val('');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
var selectedDepartmentVal = data[item.fieldName];
|
||||
if(showSelectedDepartmentsVal != '') {
|
||||
var departments = selectedDepartmentVal.split(',');
|
||||
var showSelectedUsersVal = '';
|
||||
for(var j = 0, department; department = departments[j++];) {
|
||||
if(showSelectedUsersVal != '') {
|
||||
showSelectedUsersVal += ',';
|
||||
}
|
||||
showSelectedUsersVal += selectedDepartmentVal.split('|')[1];
|
||||
}
|
||||
$('#'+ item.fieldName).val(selectedUsersVal);
|
||||
$('#'+ item.fieldName +'SelectDepartment').val(showSelectedDepartmentsVal);
|
||||
}
|
||||
} else if(item.fieldType === 'leftJoin' || item.fieldType === 'innerJoin' || item.fieldType === 'rightJoin') {
|
||||
top.restAjax.get(top.restAjax.path('app/dynamicdata/listdynamicdata/{tableName}', [item.joinTable]), {}, {
|
||||
headers: {
|
||||
token: token
|
||||
},
|
||||
fieldName: item.fieldName,
|
||||
fieldExplain: item.fieldExplain,
|
||||
joinTable: item.joinTable,
|
||||
joinTableField: item.joinTableField,
|
||||
joinTableFormShow: item.joinTableFormShow,
|
||||
checkItem: data[item.fieldName]
|
||||
}, function(code, data, args) {
|
||||
var dataArray = [];
|
||||
for(var j = 0, joinTable; joinTable = data[j++];) {
|
||||
dataArray.push({
|
||||
title: joinTable[args.joinTableFormShow],
|
||||
value: joinTable[args.joinTableField],
|
||||
});
|
||||
if(args.checkItem == joinTable[args.joinTableField]) {
|
||||
$('#'+ args.fieldName).val(joinTable[args.joinTableFormShow]);
|
||||
$('#'+ args.fieldName)[0].dataset.values = args.checkItem;
|
||||
}
|
||||
}
|
||||
initSelect(args.fieldName, args.fieldExplain, dataArray);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
} else {
|
||||
$('#'+ item.fieldName).val(data[item.fieldName]);
|
||||
}
|
||||
}
|
||||
}, function(code, data) {
|
||||
setTimeout(function() {
|
||||
$('#errorMessage').text(data.msg);
|
||||
$('#app').hide();
|
||||
$('#commitError').show();
|
||||
}, 500);
|
||||
}, function() {
|
||||
$.showLoading('正在加载...');
|
||||
}, function() {
|
||||
$.hideLoading();
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '#submitForm', function() {
|
||||
var formData = {};
|
||||
// 富文本
|
||||
for(var i = 0, editor; editor = wangEditorArray[i++];) {
|
||||
for(var j in editor) {
|
||||
formData[j] = editor[j].txt.html();
|
||||
}
|
||||
}
|
||||
for(var i = 0, item; item = formFieldList[i++];) {
|
||||
if(item.fieldType === 'radio') {
|
||||
var radioValue = '';
|
||||
$('input[name='+ item.fieldName +']:checked').each(function() {
|
||||
radioValue += $(this).val();
|
||||
});
|
||||
if(radioValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = radioValue;
|
||||
} else if(item.fieldType === 'checkbox') {
|
||||
var checkboxValue = '';
|
||||
$('input[name='+ item.fieldName +']:checked').each(function() {
|
||||
checkboxValue += $(this).val();
|
||||
});
|
||||
if(checkboxValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = checkboxValue;
|
||||
} else if(item.fieldType === 'datetime') {
|
||||
var datetimeValue = $('#'+ item.fieldName).val();
|
||||
if(datetimeValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = datetimeValue +':00';
|
||||
} else if(item.fieldType === 'select') {
|
||||
var selectValue = $('#'+ item.fieldName)[0].dataset.values;
|
||||
if(selectValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = selectValue;
|
||||
} else if(item.fieldType === 'leftJoin' || item.fieldType === 'innerJoin' || item.fieldType === 'rightJoin') {
|
||||
var joinValue = $('#'+ item.fieldName)[0].dataset.values;
|
||||
if(joinValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = joinValue;
|
||||
} else if(item.fieldType != 'richText') {
|
||||
var datetimeValue = $('#'+ item.fieldName).val();
|
||||
if(datetimeValue === '') {
|
||||
$.toptip(item.fieldExplain +'不能为空', 'error');
|
||||
return;
|
||||
}
|
||||
formData[item.fieldName] = $('#'+ item.fieldName).val();
|
||||
}
|
||||
}
|
||||
$.confirm("您确定要更新吗?", "确认更新?", function() {
|
||||
top.restAjax.put(top.restAjax.path('app/dynamicdata/updatedynamicdata/{tableName}/{uuidValue}', [$('#tableName').val(), $('#uuidValue').val()]), formData, {
|
||||
headers: {
|
||||
token: token
|
||||
}
|
||||
}, function(code, data) {
|
||||
$('#app').hide();
|
||||
$('#commitSuccess').show();
|
||||
}, function(code, data) {
|
||||
$('#errorMessage').text(data.msg);
|
||||
$('#app').hide();
|
||||
$('#commitError').show();
|
||||
}, function() {
|
||||
$.showLoading('正在提交...');
|
||||
}, function() {
|
||||
$.hideLoading();
|
||||
});
|
||||
}, function() {
|
||||
});
|
||||
})
|
||||
// 错误返回
|
||||
$(document).on('click', '#commitErrorBack', function() {
|
||||
$('#commitError').hide();
|
||||
$('#app').show();
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -77,7 +77,7 @@
|
||||
];
|
||||
for(var i = 0, item = defaultCols[i]; item = defaultCols[i++];) {
|
||||
if(item.fieldType === 'file') {
|
||||
autoCols.push({field: (item.fieldName), width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: (item.fieldName), width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var selectData = row[this.field];
|
||||
if(typeof(selectData) === 'undefined' || selectData == null || selectData == '') {
|
||||
@ -95,7 +95,7 @@
|
||||
}
|
||||
});
|
||||
} else if(item.fieldType === 'date') {
|
||||
autoCols.push({field: (item.fieldName), width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: (item.fieldName), width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var selectData = row[this.field];
|
||||
if(typeof(selectData) === 'undefined' || selectData == null || selectData == '') {
|
||||
@ -105,7 +105,7 @@
|
||||
}
|
||||
});
|
||||
} else if(item.fieldType === 'datetime') {
|
||||
autoCols.push({field: (item.fieldName), width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: (item.fieldName), width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var selectData = row[this.field];
|
||||
if(typeof(selectData) === 'undefined' || selectData == null || selectData == '') {
|
||||
@ -115,7 +115,7 @@
|
||||
}
|
||||
});
|
||||
} else if(item.fieldType === 'select' || item.fieldType === 'radio' || item.fieldType === 'checkbox') {
|
||||
autoCols.push({field: (item.fieldName +'DictionaryName'), width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: (item.fieldName +'DictionaryName'), width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var selectData = row[this.field];
|
||||
if(typeof(selectData) === 'undefined' || selectData == null || selectData == '') {
|
||||
@ -125,7 +125,7 @@
|
||||
}
|
||||
});
|
||||
} else if(item.fieldType === 'selectUser') {
|
||||
autoCols.push({field: item.fieldName, width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: item.fieldName, width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var selectData = row[this.field];
|
||||
if(typeof(selectData) === 'undefined' || selectData == null || selectData == '') {
|
||||
@ -144,7 +144,7 @@
|
||||
}
|
||||
});
|
||||
} else if(item.fieldType === 'selectDepartment') {
|
||||
autoCols.push({field: item.fieldName, width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: item.fieldName, width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var selectData = row[this.field];
|
||||
if(typeof(selectData) === 'undefined' || selectData == null || selectData == '') {
|
||||
@ -167,7 +167,7 @@
|
||||
|| item.fieldType === 'currentRole'
|
||||
|| item.fieldType === 'currentGroup'
|
||||
|| item.fieldType === 'currentPosition') {
|
||||
autoCols.push({field: item.fieldName, width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: item.fieldName, width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var currentData = row[this.field];
|
||||
if(typeof(currentData) === 'undefined' || currentData == null || currentData == '') {
|
||||
@ -177,7 +177,7 @@
|
||||
}
|
||||
});
|
||||
} else {
|
||||
autoCols.push({field: item.fieldName, width: 150, title: item.fieldExplain, align:'center',
|
||||
autoCols.push({field: item.fieldName, width: item.fieldWidth, title: item.fieldExplain, align:'center',
|
||||
templet: function(row) {
|
||||
var selectData = row[this.field];
|
||||
if(typeof(selectData) === 'undefined' || selectData == null || selectData == '') {
|
||||
|
Loading…
Reference in New Issue
Block a user