解决包名冲突问题

This commit is contained in:
cuibaocheng 2021-06-19 11:29:42 +08:00
parent 48ddd9fad4
commit f6538b97e2
22 changed files with 3377 additions and 42 deletions

View File

@ -133,7 +133,6 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@ -0,0 +1,111 @@
package cn.com.tenlion.controller.api.columnmngitem;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import cn.com.tenlion.pojo.dtos.columnmngitem.ColumnMngItemDTO;
import cn.com.tenlion.pojo.vos.columnmngitem.ColumnMngItemVO;
import cn.com.tenlion.service.columnmngitem.IColumnMngItemService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ColumnMngItemController
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口")
@RestController
@RequestMapping(ISystemConstant.API_PREFIX + "/columnmngitem")
public class ColumnMngItemController extends DefaultBaseController {
@Autowired
private IColumnMngItemService columnMngItemService;
@ApiOperation(value = "新增", notes = "新增接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save")
@CheckRequestBodyAnnotation
public SuccessResult save(@RequestBody ColumnMngItemVO columnMngItemVO) {
columnMngItemService.save(columnMngItemVO);
return new SuccessResult();
}
@ApiOperation(value = "删除", notes = "删除接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@PathVariable("ids") String ids) {
columnMngItemService.remove(Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ApiOperation(value = "修改", notes = "修改接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "columnMngItemId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update/{columnMngItemId}")
@CheckRequestBodyAnnotation
public SuccessResult update(@PathVariable("columnMngItemId") String columnMngItemId, @RequestBody ColumnMngItemVO columnMngItemVO) {
columnMngItemService.update(columnMngItemId, columnMngItemVO);
return new SuccessResult();
}
@ApiOperation(value = "详情", notes = "详情接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "columnMngItemId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{columnMngItemId}")
public ColumnMngItemDTO get(@PathVariable("columnMngItemId") String columnMngItemId) {
return columnMngItemService.get(columnMngItemId);
}
@ApiOperation(value = "列表", notes = "列表接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list")
public List<ColumnMngItemDTO> list() {
Map<String, Object> params = requestParams();
return columnMngItemService.list(params);
}
@ApiOperation(value = "分页列表", notes = "分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage")
public SuccessResultList<List<ColumnMngItemDTO>> listPage(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return columnMngItemService.listPage(page);
}
@ApiOperation(value = "统计", notes = "统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("count")
SuccessResultData<Integer> count() {
Map<String, Object> params = requestParams();
return new SuccessResultData<>(columnMngItemService.count(params));
}
}

View File

@ -0,0 +1,121 @@
package cn.com.tenlion.controller.app.api.columnmngitem;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import cn.com.tenlion.pojo.dtos.columnmngitem.ColumnMngItemDTO;
import cn.com.tenlion.pojo.vos.columnmngitem.ColumnMngItemVO;
import cn.com.tenlion.service.columnmngitem.IColumnMngItemService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ColumnMngItemAppController
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/columnmngitem")
public class ColumnMngItemAppController extends DefaultBaseController {
@Autowired
private IColumnMngItemService columnMngItemService;
@ApiOperation(value = "新增", notes = "新增接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save")
@CheckRequestBodyAnnotation
public SuccessResult save(@RequestHeader("token") String token, @RequestBody ColumnMngItemVO columnMngItemVO) {
columnMngItemService.save(token, columnMngItemVO);
return new SuccessResult();
}
@ApiOperation(value = "删除(id列表)", notes = "删除(id列表)接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) {
columnMngItemService.remove(token, Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ApiOperation(value = "修改", notes = "修改接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "columnMngItemId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updatecolumnmngitem/{columnMngItemId}")
@CheckRequestBodyAnnotation
public SuccessResult updateColumnMngItem(@RequestHeader("token") String token, @PathVariable("columnMngItemId") String columnMngItemId, @RequestBody ColumnMngItemVO columnMngItemVO) {
columnMngItemService.update(token, columnMngItemId, columnMngItemVO);
return new SuccessResult();
}
@ApiOperation(value = "详情(通过ID)", notes = "详情(通过ID)接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "columnMngItemId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{columnMngItemId}")
public ColumnMngItemDTO get(@RequestHeader("token") String token, @PathVariable("columnMngItemId") String columnMngItemId) {
return columnMngItemService.get(columnMngItemId);
}
@ApiOperation(value = "列表", notes = "列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list")
public List<ColumnMngItemDTO> list(@RequestHeader("token") String token) {
Map<String, Object> params = requestParams();
return columnMngItemService.list(params);
}
@ApiOperation(value = "分页列表", notes = "分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpagecolumnmngitem")
public SuccessResultList<List<ColumnMngItemDTO>> listPage(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return columnMngItemService.listPage(page);
}
@ApiOperation(value = "统计", notes = "统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("count")
SuccessResultData<Integer> count() {
Map<String, Object> params = requestParams();
return new SuccessResultData<>(columnMngItemService.count(params));
}
}

View File

@ -0,0 +1,121 @@
package cn.com.tenlion.controller.resource.columnmngitem;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import cn.com.tenlion.pojo.dtos.columnmngitem.ColumnMngItemDTO;
import cn.com.tenlion.pojo.vos.columnmngitem.ColumnMngItemVO;
import cn.com.tenlion.service.columnmngitem.IColumnMngItemService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ColumnMngItemResourceController
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "接口")
@RestController
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/columnmngitem")
public class ColumnMngItemResourceController extends DefaultBaseController {
@Autowired
private IColumnMngItemService columnMngItemService;
@ApiOperation(value = "新增", notes = "新增接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save")
@CheckRequestBodyAnnotation
public SuccessResult save(@RequestBody ColumnMngItemVO columnMngItemVO) {
columnMngItemService.save(columnMngItemVO);
return new SuccessResult();
}
@ApiOperation(value = "删除(id列表)", notes = "删除(id列表)接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@PathVariable("ids") String ids) {
columnMngItemService.remove(Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ApiOperation(value = "修改", notes = "修改接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
@ApiImplicitParam(name = "columnMngItemId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update/{columnMngItemId}")
@CheckRequestBodyAnnotation
public SuccessResult update(@PathVariable("columnMngItemId") String columnMngItemId, @RequestBody ColumnMngItemVO columnMngItemVO) {
columnMngItemService.update(columnMngItemId, columnMngItemVO);
return new SuccessResult();
}
@ApiOperation(value = "详情", notes = "详情接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
@ApiImplicitParam(name = "columnMngItemId", value = "ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{columnMngItemId}")
public ColumnMngItemDTO get(@PathVariable("columnMngItemId") String columnMngItemId) {
return columnMngItemService.get(columnMngItemId);
}
@ApiOperation(value = "列表", notes = "列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list")
public List<ColumnMngItemDTO> list() {
Map<String, Object> params = requestParams();
return columnMngItemService.list(params);
}
@ApiOperation(value = "分页列表", notes = "分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage")
public SuccessResultList<List<ColumnMngItemDTO>> listPage(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return columnMngItemService.listPage(page);
}
@ApiOperation(value = "统计", notes = "统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("count")
SuccessResultData<Integer> count() {
Map<String, Object> params = requestParams();
return new SuccessResultData<>(columnMngItemService.count(params));
}
}

View File

@ -0,0 +1,42 @@
package cn.com.tenlion.controller.route.columnmngitem;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import cn.com.tenlion.service.columnmngitem.IColumnMngItemService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ColumnMngItemController
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "路由")
@RestController
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/columnmngitem")
public class ColumnMngItemRouteController extends DefaultBaseController {
@GetMapping("save")
public ModelAndView save() {
return new ModelAndView("columnmngitem/save");
}
@GetMapping("update")
public ModelAndView update() {
return new ModelAndView("columnmngitem/update");
}
@GetMapping("list")
public ModelAndView list() {
return new ModelAndView("columnmngitem/list");
}
}

View File

@ -0,0 +1,120 @@
package cn.com.tenlion.dao.columnmngitem;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import cn.com.tenlion.pojo.bos.columnmngitem.ColumnMngItemBO;
import cn.com.tenlion.pojo.pos.columnmngitem.ColumnMngItemPO;
import cn.com.tenlion.pojo.dtos.columnmngitem.ColumnMngItemDTO;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IColumnMngItemDao
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@Repository
public interface IColumnMngItemDao {
/**
* 新增
*
* @param params
* @throws SaveException
*/
void save(Map<String, Object> params) throws SaveException;
/**
* 删除
*
* @param params
* @throws RemoveException
*/
void remove(Map<String, Object> params) throws RemoveException;
/**
* 删除物理
*
* @param params
* @throws RemoveException
*/
void delete(Map<String, Object> params) throws RemoveException;
/**
* 修改
*
* @param params
* @throws UpdateException
*/
void update(Map<String, Object> params) throws UpdateException;
/**
* 详情
*
* @param params
* @return
* @throws SearchException
*/
ColumnMngItemDTO get(Map<String, Object> params) throws SearchException;
/**
* 详情
*
* @param params
* @return
* @throws SearchException
*/
ColumnMngItemBO getBO(Map<String, Object> params) throws SearchException;
/**
* 详情
*
* @param params
* @return
* @throws SearchException
*/
ColumnMngItemPO getPO(Map<String, Object> params) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<ColumnMngItemDTO> list(Map<String, Object> params) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<ColumnMngItemBO> listBO(Map<String, Object> params) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<ColumnMngItemPO> listPO(Map<String, Object> params) throws SearchException;
/**
* 统计
*
* @param params
* @return
* @throws SearchException
*/
Integer count(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,170 @@
package cn.com.tenlion.pojo.bos.columnmngitem;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: ColumnMngItemBO
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
public class ColumnMngItemBO {
private String columnItemId;
private Integer columnCount;
private String columnType;
private Integer columnOrder;
private String columnName;
private String columnIcon;
private Integer columnRow;
private Integer columnHeight;
private String columnRemark;
private String columnParam;
private String columnStatus;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
private Integer isDelete;
private String columnId;
public String getColumnId() {
return columnId == null ? "" : columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
public String getColumnItemId() {
return columnItemId == null ? "" : columnItemId.trim();
}
public void setColumnItemId(String columnItemId) {
this.columnItemId = columnItemId;
}
public Integer getColumnCount() {
return columnCount == null ? 0 : columnCount;
}
public void setColumnCount(Integer columnCount) {
this.columnCount = columnCount;
}
public String getColumnType() {
return columnType == null ? "" : columnType.trim();
}
public void setColumnType(String columnType) {
this.columnType = columnType;
}
public Integer getColumnOrder() {
return columnOrder == null ? 0 : columnOrder;
}
public void setColumnOrder(Integer columnOrder) {
this.columnOrder = columnOrder;
}
public String getColumnName() {
return columnName == null ? "" : columnName.trim();
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getColumnIcon() {
return columnIcon == null ? "" : columnIcon.trim();
}
public void setColumnIcon(String columnIcon) {
this.columnIcon = columnIcon;
}
public Integer getColumnRow() {
return columnRow == null ? 0 : columnRow;
}
public void setColumnRow(Integer columnRow) {
this.columnRow = columnRow;
}
public Integer getColumnHeight() {
return columnHeight == null ? 0 : columnHeight;
}
public void setColumnHeight(Integer columnHeight) {
this.columnHeight = columnHeight;
}
public String getColumnRemark() {
return columnRemark == null ? "" : columnRemark.trim();
}
public void setColumnRemark(String columnRemark) {
this.columnRemark = columnRemark;
}
public String getColumnParam() {
return columnParam == null ? "" : columnParam.trim();
}
public void setColumnParam(String columnParam) {
this.columnParam = columnParam;
}
public String getColumnStatus() {
return columnStatus == null ? "" : columnStatus.trim();
}
public void setColumnStatus(String columnStatus) {
this.columnStatus = columnStatus;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,189 @@
package cn.com.tenlion.pojo.dtos.columnmngitem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: ColumnMngItemDTO
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@ApiModel
public class ColumnMngItemDTO {
@ApiModelProperty(name = "columnItemId", value = "栏目区域")
private String columnItemId;
@ApiModelProperty(name = "columnCount", value = "区域数量")
private Integer columnCount;
@ApiModelProperty(name = "columnType", value = "区域类型")
private String columnType;
@ApiModelProperty(name = "columnOrder", value = "排序")
private Integer columnOrder;
@ApiModelProperty(name = "columnName", value = "区域名")
private String columnName;
@ApiModelProperty(name = "columnIcon", value = "区域图标")
private String columnIcon;
@ApiModelProperty(name = "columnRow", value = "行占比.1-12")
private Integer columnRow;
@ApiModelProperty(name = "columnHeight", value = "高度")
private Integer columnHeight;
@ApiModelProperty(name = "columnRemark", value = "备注")
private String columnRemark;
@ApiModelProperty(name = "columnParam", value = "附加参数")
private String columnParam;
@ApiModelProperty(name = "columnStatus", value = "区域状态0关1开")
private String columnStatus;
@ApiModelProperty(name = "creator", value = "")
private String creator;
@ApiModelProperty(name = "gmtCreate", value = "")
private String gmtCreate;
@ApiModelProperty(name = "modifier", value = "")
private String modifier;
@ApiModelProperty(name = "gmtModified", value = "")
private String gmtModified;
@ApiModelProperty(name = "isDelete", value = "")
private Integer isDelete;
@ApiModelProperty(name = "columnId", value = "")
private String columnId;
public String getColumnId() {
return columnId == null ? "" : columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
public String getColumnItemId() {
return columnItemId == null ? "" : columnItemId.trim();
}
public void setColumnItemId(String columnItemId) {
this.columnItemId = columnItemId;
}
public Integer getColumnCount() {
return columnCount == null ? 0 : columnCount;
}
public void setColumnCount(Integer columnCount) {
this.columnCount = columnCount;
}
public String getColumnType() {
return columnType == null ? "" : columnType.trim();
}
public void setColumnType(String columnType) {
this.columnType = columnType;
}
public Integer getColumnOrder() {
return columnOrder == null ? 0 : columnOrder;
}
public void setColumnOrder(Integer columnOrder) {
this.columnOrder = columnOrder;
}
public String getColumnName() {
return columnName == null ? "" : columnName.trim();
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getColumnIcon() {
return columnIcon == null ? "" : columnIcon.trim();
}
public void setColumnIcon(String columnIcon) {
this.columnIcon = columnIcon;
}
public Integer getColumnRow() {
return columnRow == null ? 0 : columnRow;
}
public void setColumnRow(Integer columnRow) {
this.columnRow = columnRow;
}
public Integer getColumnHeight() {
return columnHeight == null ? 0 : columnHeight;
}
public void setColumnHeight(Integer columnHeight) {
this.columnHeight = columnHeight;
}
public String getColumnRemark() {
return columnRemark == null ? "" : columnRemark.trim();
}
public void setColumnRemark(String columnRemark) {
this.columnRemark = columnRemark;
}
public String getColumnParam() {
return columnParam == null ? "" : columnParam.trim();
}
public void setColumnParam(String columnParam) {
this.columnParam = columnParam;
}
public String getColumnStatus() {
return columnStatus == null ? "" : columnStatus.trim();
}
public void setColumnStatus(String columnStatus) {
this.columnStatus = columnStatus;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,170 @@
package cn.com.tenlion.pojo.pos.columnmngitem;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: ColumnMngItemPO
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
public class ColumnMngItemPO {
private String columnItemId;
private Integer columnCount;
private String columnType;
private Integer columnOrder;
private String columnName;
private String columnIcon;
private Integer columnRow;
private Integer columnHeight;
private String columnRemark;
private String columnParam;
private String columnStatus;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
private Integer isDelete;
private String columnId;
public String getColumnId() {
return columnId == null ? "" : columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
public String getColumnItemId() {
return columnItemId == null ? "" : columnItemId.trim();
}
public void setColumnItemId(String columnItemId) {
this.columnItemId = columnItemId;
}
public Integer getColumnCount() {
return columnCount == null ? 0 : columnCount;
}
public void setColumnCount(Integer columnCount) {
this.columnCount = columnCount;
}
public String getColumnType() {
return columnType == null ? "" : columnType.trim();
}
public void setColumnType(String columnType) {
this.columnType = columnType;
}
public Integer getColumnOrder() {
return columnOrder == null ? 0 : columnOrder;
}
public void setColumnOrder(Integer columnOrder) {
this.columnOrder = columnOrder;
}
public String getColumnName() {
return columnName == null ? "" : columnName.trim();
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getColumnIcon() {
return columnIcon == null ? "" : columnIcon.trim();
}
public void setColumnIcon(String columnIcon) {
this.columnIcon = columnIcon;
}
public Integer getColumnRow() {
return columnRow == null ? 0 : columnRow;
}
public void setColumnRow(Integer columnRow) {
this.columnRow = columnRow;
}
public Integer getColumnHeight() {
return columnHeight == null ? 0 : columnHeight;
}
public void setColumnHeight(Integer columnHeight) {
this.columnHeight = columnHeight;
}
public String getColumnRemark() {
return columnRemark == null ? "" : columnRemark.trim();
}
public void setColumnRemark(String columnRemark) {
this.columnRemark = columnRemark;
}
public String getColumnParam() {
return columnParam == null ? "" : columnParam.trim();
}
public void setColumnParam(String columnParam) {
this.columnParam = columnParam;
}
public String getColumnStatus() {
return columnStatus == null ? "" : columnStatus.trim();
}
public void setColumnStatus(String columnStatus) {
this.columnStatus = columnStatus;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier == null ? "" : modifier.trim();
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified == null ? "" : gmtModified.trim();
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public Integer getIsDelete() {
return isDelete == null ? 0 : isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
}

View File

@ -0,0 +1,145 @@
package cn.com.tenlion.pojo.vos.columnmngitem;
import ink.wgink.annotation.CheckEmptyAnnotation;
import ink.wgink.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
* @ClassName: ColumnMngItemVO
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@ApiModel
public class ColumnMngItemVO {
@ApiModelProperty(name = "columnItemId", value = "栏目区域")
private String columnItemId;
@ApiModelProperty(name = "columnCount", value = "区域数量")
@CheckNumberAnnotation(name = "区域数量")
private Integer columnCount;
@ApiModelProperty(name = "columnType", value = "区域类型")
private String columnType;
@ApiModelProperty(name = "columnOrder", value = "排序")
@CheckNumberAnnotation(name = "排序")
private Integer columnOrder;
@ApiModelProperty(name = "columnName", value = "区域名")
private String columnName;
@ApiModelProperty(name = "columnIcon", value = "区域图标")
private String columnIcon;
@ApiModelProperty(name = "columnRow", value = "行占比.1-12")
@CheckNumberAnnotation(name = "行占比.1-12")
private Integer columnRow;
@ApiModelProperty(name = "columnHeight", value = "高度")
@CheckNumberAnnotation(name = "高度")
private Integer columnHeight;
@ApiModelProperty(name = "columnRemark", value = "备注")
private String columnRemark;
@ApiModelProperty(name = "columnParam", value = "附加参数")
private String columnParam;
@ApiModelProperty(name = "columnStatus", value = "区域状态0关1开")
private String columnStatus;
@ApiModelProperty(name = "columnId", value = "")
private String columnId;
public String getColumnId() {
return columnId == null ? "" : columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
public String getColumnItemId() {
return columnItemId == null ? "" : columnItemId.trim();
}
public void setColumnItemId(String columnItemId) {
this.columnItemId = columnItemId;
}
public Integer getColumnCount() {
return columnCount == null ? 0 : columnCount;
}
public void setColumnCount(Integer columnCount) {
this.columnCount = columnCount;
}
public String getColumnType() {
return columnType == null ? "" : columnType.trim();
}
public void setColumnType(String columnType) {
this.columnType = columnType;
}
public Integer getColumnOrder() {
return columnOrder == null ? 0 : columnOrder;
}
public void setColumnOrder(Integer columnOrder) {
this.columnOrder = columnOrder;
}
public String getColumnName() {
return columnName == null ? "" : columnName.trim();
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getColumnIcon() {
return columnIcon == null ? "" : columnIcon.trim();
}
public void setColumnIcon(String columnIcon) {
this.columnIcon = columnIcon;
}
public Integer getColumnRow() {
return columnRow == null ? 0 : columnRow;
}
public void setColumnRow(Integer columnRow) {
this.columnRow = columnRow;
}
public Integer getColumnHeight() {
return columnHeight == null ? 0 : columnHeight;
}
public void setColumnHeight(Integer columnHeight) {
this.columnHeight = columnHeight;
}
public String getColumnRemark() {
return columnRemark == null ? "" : columnRemark.trim();
}
public void setColumnRemark(String columnRemark) {
this.columnRemark = columnRemark;
}
public String getColumnParam() {
return columnParam == null ? "" : columnParam.trim();
}
public void setColumnParam(String columnParam) {
this.columnParam = columnParam;
}
public String getColumnStatus() {
return columnStatus == null ? "" : columnStatus.trim();
}
public void setColumnStatus(String columnStatus) {
this.columnStatus = columnStatus;
}
}

View File

@ -0,0 +1,188 @@
package cn.com.tenlion.service.columnmngitem;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResultList;
import cn.com.tenlion.pojo.dtos.columnmngitem.ColumnMngItemDTO;
import cn.com.tenlion.pojo.vos.columnmngitem.ColumnMngItemVO;
import cn.com.tenlion.pojo.bos.columnmngitem.ColumnMngItemBO;
import cn.com.tenlion.pojo.pos.columnmngitem.ColumnMngItemPO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IColumnMngItemService
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
public interface IColumnMngItemService {
/**
* 新增
*
* @param columnMngItemVO
* @return
*/
void save(ColumnMngItemVO columnMngItemVO);
/**
* 新增
*
* @param token
* @param columnMngItemVO
* @return
*/
void save(String token, ColumnMngItemVO columnMngItemVO);
/**
* 新增
*
* @param columnMngItemVO
* @return columnMngItemId
*/
String saveReturnId(ColumnMngItemVO columnMngItemVO);
/**
* 新增
*
* @param token
* @param columnMngItemVO
* @return columnMngItemId
*/
String saveReturnId(String token, ColumnMngItemVO columnMngItemVO);
/**
* 删除
*
* @param ids id列表
* @return
*/
void remove(List<String> ids);
/**
* 删除
*
* @param token
* @param ids id列表
* @return
*/
void remove(String token, List<String> ids);
/**
* 删除物理删除
*
* @param ids id列表
*/
void delete(List<String> ids);
/**
* 修改
*
* @param columnMngItemId
* @param columnMngItemVO
* @return
*/
void update(String columnMngItemId, ColumnMngItemVO columnMngItemVO);
/**
* 修改
*
* @param token
* @param columnMngItemId
* @param columnMngItemVO
* @return
*/
void update(String token, String columnMngItemId, ColumnMngItemVO columnMngItemVO);
/**
* 详情
*
* @param params 参数Map
* @return
*/
ColumnMngItemDTO get(Map<String, Object> params);
/**
* 详情
*
* @param columnMngItemId
* @return
*/
ColumnMngItemDTO get(String columnMngItemId);
/**
* 详情
*
* @param params 参数Map
* @return
*/
ColumnMngItemBO getBO(Map<String, Object> params);
/**
* 详情
*
* @param columnMngItemId
* @return
*/
ColumnMngItemBO getBO(String columnMngItemId);
/**
* 详情
*
* @param params 参数Map
* @return
*/
ColumnMngItemPO getPO(Map<String, Object> params);
/**
* 详情
*
* @param columnMngItemId
* @return
*/
ColumnMngItemPO getPO(String columnMngItemId);
/**
* 列表
*
* @param params
* @return
*/
List<ColumnMngItemDTO> list(Map<String, Object> params);
/**
* 列表
*
* @param params
* @return
*/
List<ColumnMngItemBO> listBO(Map<String, Object> params);
/**
* 列表
*
* @param params
* @return
*/
List<ColumnMngItemPO> listPO(Map<String, Object> params);
/**
* 分页列表
*
* @param page
* @return
*/
SuccessResultList<List<ColumnMngItemDTO>> listPage(ListPage page);
/**
* 统计
*
* @param params
* @return
*/
Integer count(Map<String, Object> params);
}

View File

@ -0,0 +1,171 @@
package cn.com.tenlion.service.columnmngitem.impl;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
import cn.com.tenlion.dao.columnmngitem.IColumnMngItemDao;
import cn.com.tenlion.pojo.dtos.columnmngitem.ColumnMngItemDTO;
import cn.com.tenlion.pojo.vos.columnmngitem.ColumnMngItemVO;
import cn.com.tenlion.pojo.bos.columnmngitem.ColumnMngItemBO;
import cn.com.tenlion.pojo.pos.columnmngitem.ColumnMngItemPO;
import cn.com.tenlion.service.columnmngitem.IColumnMngItemService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* @ClassName: ColumnMngItemServiceImpl
* @Description:
* @Author: CodeFactory
* @Date: 2021-06-10 14:35:58
* @Version: 3.0
**/
@Service
public class ColumnMngItemServiceImpl extends DefaultBaseService implements IColumnMngItemService {
@Autowired
private IColumnMngItemDao columnMngItemDao;
@Override
public void save(ColumnMngItemVO columnMngItemVO) {
saveReturnId(columnMngItemVO);
}
@Override
public void save(String token, ColumnMngItemVO columnMngItemVO) {
saveReturnId(token, columnMngItemVO);
}
@Override
public String saveReturnId(ColumnMngItemVO columnMngItemVO) {
return saveReturnId(null, columnMngItemVO);
}
@Override
public String saveReturnId(String token, ColumnMngItemVO columnMngItemVO) {
String columnItemId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(columnMngItemVO);
params.put("columnItemId", columnItemId);
if (StringUtils.isBlank(token)) {
setSaveInfo(params);
} else {
setAppSaveInfo(token, params);
}
columnMngItemDao.save(params);
return columnItemId;
}
@Override
public void remove(List<String> ids) {
remove(null, ids);
}
@Override
public void remove(String token, List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("columnItemIds", ids);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
columnMngItemDao.remove(params);
}
@Override
public void delete(List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("columnItemIds", ids);
columnMngItemDao.delete(params);
}
@Override
public void update(String columnItemId, ColumnMngItemVO columnMngItemVO) {
update(null, columnItemId, columnMngItemVO);
}
@Override
public void update(String token, String columnItemId, ColumnMngItemVO columnMngItemVO) {
Map<String, Object> params = HashMapUtil.beanToMap(columnMngItemVO);
params.put("columnItemId", columnItemId);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
columnMngItemDao.update(params);
}
@Override
public ColumnMngItemDTO get(Map<String, Object> params) {
return columnMngItemDao.get(params);
}
@Override
public ColumnMngItemDTO get(String columnItemId) {
Map<String, Object> params = super.getHashMap(2);
params.put("columnItemId", columnItemId);
return get(params);
}
@Override
public ColumnMngItemBO getBO(Map<String, Object> params) {
return columnMngItemDao.getBO(params);
}
@Override
public ColumnMngItemBO getBO(String columnItemId) {
Map<String, Object> params = super.getHashMap(2);
params.put("columnItemId", columnItemId);
return getBO(params);
}
@Override
public ColumnMngItemPO getPO(Map<String, Object> params) {
return columnMngItemDao.getPO(params);
}
@Override
public ColumnMngItemPO getPO(String columnItemId) {
Map<String, Object> params = super.getHashMap(2);
params.put("columnItemId", columnItemId);
return getPO(params);
}
@Override
public List<ColumnMngItemDTO> list(Map<String, Object> params) {
return columnMngItemDao.list(params);
}
@Override
public List<ColumnMngItemBO> listBO(Map<String, Object> params) {
return columnMngItemDao.listBO(params);
}
@Override
public List<ColumnMngItemPO> listPO(Map<String, Object> params) {
return columnMngItemDao.listPO(params);
}
@Override
public SuccessResultList<List<ColumnMngItemDTO>> listPage(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
List<ColumnMngItemDTO> columnMngItemDTOs = list(page.getParams());
PageInfo<ColumnMngItemDTO> pageInfo = new PageInfo<>(columnMngItemDTOs);
return new SuccessResultList<>(columnMngItemDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public Integer count(Map<String, Object> params) {
Integer count = columnMngItemDao.count(params);
return count == null ? 0 : count;
}
}

View File

@ -0,0 +1,392 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.tenlion.dao.columnmngitem.IColumnMngItemDao">
<resultMap id="columnMngItemDTO" type="cn.com.tenlion.pojo.dtos.columnmngitem.ColumnMngItemDTO">
<result column="column_item_id" property="columnItemId"/>
<result column="column_id" property="columnId"/>
<result column="column_count" property="columnCount"/>
<result column="column_type" property="columnType"/>
<result column="column_order" property="columnOrder"/>
<result column="column_name" property="columnName"/>
<result column="column_icon" property="columnIcon"/>
<result column="column_row" property="columnRow"/>
<result column="column_height" property="columnHeight"/>
<result column="column_remark" property="columnRemark"/>
<result column="column_param" property="columnParam"/>
<result column="column_status" property="columnStatus"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="columnMngItemBO" type="cn.com.tenlion.pojo.bos.columnmngitem.ColumnMngItemBO">
<result column="column_item_id" property="columnItemId"/>
<result column="column_id" property="columnId"/>
<result column="column_count" property="columnCount"/>
<result column="column_type" property="columnType"/>
<result column="column_order" property="columnOrder"/>
<result column="column_name" property="columnName"/>
<result column="column_icon" property="columnIcon"/>
<result column="column_row" property="columnRow"/>
<result column="column_height" property="columnHeight"/>
<result column="column_remark" property="columnRemark"/>
<result column="column_param" property="columnParam"/>
<result column="column_status" property="columnStatus"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="columnMngItemPO" type="cn.com.tenlion.pojo.pos.columnmngitem.ColumnMngItemPO">
<result column="column_item_id" property="columnItemId"/>
<result column="column_id" property="columnId"/>
<result column="column_count" property="columnCount"/>
<result column="column_type" property="columnType"/>
<result column="column_order" property="columnOrder"/>
<result column="column_name" property="columnName"/>
<result column="column_icon" property="columnIcon"/>
<result column="column_row" property="columnRow"/>
<result column="column_height" property="columnHeight"/>
<result column="column_remark" property="columnRemark"/>
<result column="column_param" property="columnParam"/>
<result column="column_status" property="columnStatus"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="modifier" property="modifier"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<!-- 新增 -->
<insert id="save" parameterType="map">
INSERT INTO card_column_mng_item(
column_item_id,
column_id,
column_count,
column_type,
column_order,
column_name,
column_icon,
column_row,
column_height,
column_remark,
column_param,
column_status,
creator,
gmt_create,
modifier,
gmt_modified,
is_delete
) VALUES(
#{columnItemId},
#{columnId},
#{columnCount},
#{columnType},
#{columnOrder},
#{columnName},
#{columnIcon},
#{columnRow},
#{columnHeight},
#{columnRemark},
#{columnParam},
#{columnStatus},
#{creator},
#{gmtCreate},
#{modifier},
#{gmtModified},
#{isDelete}
)
</insert>
<!-- 删除 -->
<update id="remove" parameterType="map">
UPDATE
card_column_mng_item
SET
gmt_modified = #{gmtModified},
modifier = #{modifier},
is_delete = 1
WHERE
<!-- 添加条件 -->
</update>
<!-- 删除(物理) -->
<update id="delete" parameterType="map">
DELETE FROM
card_column_mng_item
WHERE
<!-- 添加条件 -->
</update>
<!-- 修改 -->
<update id="update" parameterType="map">
UPDATE
card_column_mng_item
SET
<if test="columnId != null and columnId != ''">
column_id = #{columnId},
</if>
<if test="columnCount != null">
column_count = #{columnCount},
</if>
<if test="columnType != null and columnType != ''">
column_type = #{columnType},
</if>
<if test="columnOrder != null">
column_order = #{columnOrder},
</if>
<if test="columnName != null and columnName != ''">
column_name = #{columnName},
</if>
<if test="columnIcon != null and columnIcon != ''">
column_icon = #{columnIcon},
</if>
<if test="columnRow != null">
column_row = #{columnRow},
</if>
<if test="columnHeight != null">
column_height = #{columnHeight},
</if>
<if test="columnRemark != null and columnRemark != ''">
column_remark = #{columnRemark},
</if>
<if test="columnParam != null and columnParam != ''">
column_param = #{columnParam},
</if>
<if test="columnStatus != null and columnStatus != ''">
column_status = #{columnStatus},
</if>
gmt_modified = #{gmtModified},
modifier = #{modifier}
WHERE
<!-- 添加条件 -->
column_item_id = #{columnItemId}
</update>
<!-- 详情 -->
<select id="get" parameterType="map" resultMap="columnMngItemDTO">
SELECT
t1.column_item_id,
t1.column_id,
t1.column_count,
t1.column_type,
t1.column_order,
t1.column_name,
t1.column_icon,
t1.column_row,
t1.column_height,
t1.column_remark,
t1.column_param,
t1.column_status,
1
FROM
card_column_mng_item t1
WHERE
t1.is_delete = 0 AND t1.column_item_id = #{columnItemId}
<!-- 添加条件 -->
</select>
<!-- 详情 -->
<select id="getBO" parameterType="map" resultMap="columnMngItemBO">
SELECT
t1.column_item_id,
t1.column_count,
t1.column_type,
t1.column_order,
t1.column_name,
t1.column_icon,
t1.column_row,
t1.column_height,
t1.column_remark,
t1.column_param,
t1.column_status,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
card_column_mng_item t1
WHERE
t1.is_delete = 0 AND t1.column_item_id = #{columnItemId}
<!-- 添加条件 -->
</select>
<!-- 详情 -->
<select id="getPO" parameterType="map" resultMap="columnMngItemPO">
SELECT
t1.column_item_id,
t1.column_count,
t1.column_type,
t1.column_order,
t1.column_name,
t1.column_icon,
t1.column_row,
t1.column_height,
t1.column_remark,
t1.column_param,
t1.column_status,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
card_column_mng_item t1
WHERE
t1.is_delete = 0 AND t1.column_item_id = #{columnItemId}
<!-- 添加条件 -->
</select>
<!-- 列表 -->
<select id="list" parameterType="map" resultMap="columnMngItemDTO">
SELECT
t1.column_item_id,
t1.column_id,
t1.column_count,
t1.column_type,
t1.column_order,
t1.column_name,
t1.column_icon,
t1.column_row,
t1.column_height,
t1.column_remark,
t1.column_param,
t1.column_status,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete,
1
FROM
card_column_mng_item t1
WHERE
t1.is_delete = 0
<if test="columnId != null and columnId != ''">
AND t1.column_id = #{columnId}
</if>
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY
t1.column_order
</select>
<!-- 列表 -->
<select id="listBO" parameterType="map" resultMap="columnMngItemBO">
SELECT
t1.column_item_id,
t1.column_id,
t1.column_count,
t1.column_type,
t1.column_order,
t1.column_name,
t1.column_icon,
t1.column_row,
t1.column_height,
t1.column_remark,
t1.column_param,
t1.column_status,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
card_column_mng_item t1
WHERE
t1.is_delete = 0
<if test="columnId != null and columnId != ''">
AND t1.column_id = #{columnId}
</if>
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY
t1.column_order
</select>
<!-- 列表 -->
<select id="listPO" parameterType="map" resultMap="columnMngItemPO">
SELECT
t1.column_item_id,
t1.column_id,
t1.column_count,
t1.column_type,
t1.column_order,
t1.column_name,
t1.column_icon,
t1.column_row,
t1.column_height,
t1.column_remark,
t1.column_param,
t1.column_status,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
FROM
card_column_mng_item t1
WHERE
t1.is_delete = 0
<if test="columnId != null and columnId != ''">
AND t1.column_id = #{columnId}
</if>
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
ORDER BY
t1.column_order
</select>
<!-- 统计 -->
<select id="count" parameterType="map" resultType="Integer">
SELECT
COUNT(*)
FROM
card_column_mng_item t1
WHERE
t1.is_delete = 0
</select>
</mapper>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,72 @@
$.fn.moduleSet = function(opt){
var setting = {
button:[
{text:'编辑',callback:function(){},iconfont:'&#xe648;'},
{text:'美化',callback:function(){},iconfont:'&#xe63f;'},
{text:'删除',callback:function(){},iconfont:'&#xe613;'},
],
}
var options = $.extend({},setting,opt);
var M = {};
var _this = this;
// 初始化
M.init = function(){
$(_this).css('position','relative');
M.createStyle();
M.createElem(function(){
M.initShowModule();
});
}
// 显示方法
M.initShowModule = function(){
$(_this).mouseenter(function(){
$(_this).find('.panel-module-box').fadeIn(200);
}).mouseleave(function(){
$(_this).find('.panel-module-box').fadeOut(100);
})
}
// 创建样式
M.createStyle = function(){
if($('#panel-style').length > 0) return;
var style = '<style id="panel-style">.panel-module-box{display:none;}.panel-module-mask{ position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; top: 0; background: #000; opacity: .7; border: 2px dashed #fff; cursor: move; } .panel-module-handle{ position: absolute; left:0; top:0; z-index: 2; } .handle-btn{ cursor: pointer; padding:7px 20px; border:1px solid #eee; background-color: #fff; border-right:0; } .handle-btn:hover{ background-color: #f1f3f5; } .handle-btn:last-child{ border-right:1px solid #eee; }</style>';
$($('head')[0]).append(style);
}
// 创建elem
M.createElem = function(callback){
if($(_this).find('.panel-module-handle').length > 0) return;
var btnGroup = '';
for(var i = 0; i < options.button.length; i++){
btnGroup += '<button class="handle-btn"><i class="iconfont">'+options.button[i].iconfont+'</i>'+options.button[i].text+'</button>';
// 绑定事件
M.createEvent(i);
}
var elem = '<div class="panel-module-box"><div class="panel-module-mask"></div><div class="panel-module-handle">'+btnGroup+'</div></div>';
$(_this).append(elem);
// 创建后回调
callback && typeof(callback) == 'function' && callback(this);
}
// 创建事件
M.createEvent = function(index){
$(_this).delegate('button:eq('+index+')','click',function(){
!!options.button[index].callback && typeof(options.button[index].callback) == 'function' && options.button[index].callback(this);
})
}
M.init();
}

View File

@ -108,24 +108,6 @@
return rowData;
}
},
{field: 'gridNumber', width: 120, title: '栅格值', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'orderNumber', width: 120, title: '排序(降序)', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'openType', width: 100, title: '开启状态', align:'center',
templet: function(row) {
var rowData = row[this.field];
@ -147,24 +129,14 @@
return rowData;
}
},
{field: 'linkWay', width: 180, title: '跳转方式', align:'center',
{field:'cz', width:220, title: '操作', align:'center', fixed: 'right',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
var rowData = '<div class="layui-btn-group">' +
'<button type="button" class="layui-btn layui-btn-xs" lay-event="mngItem">栏目区域配置</button>' +
'</div>';
return rowData;
}
},
{field: 'linkAddr', width: 180, title: '跳转地址', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
}
]
],
page: true,
@ -238,6 +210,28 @@
$(document).on('click', '#search', function() {
reloadTable(1);
});
table.on('tool(dataTable)', function(obj) {
var data = obj.data;
var event = obj.event;
if (event === 'mngItem') {
top.layer.open({
type: 2,
title: false,
closeBtn: 1,
area: ['50%', '95%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/columnmngitem/list-area.html?columnId={columnId}', [data.columnId]),
end: function () {
reloadTable();
}
})
}
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;

View File

@ -59,15 +59,15 @@
</div>
</div>
<div class="layui-row">
<div class="layui-col-md3">
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">序-降</label>
<label class="layui-form-label">列表排序</label>
<div class="layui-input-block">
<input type="number" id="orderNumber" name="orderNumber" min="0" class="layui-input" value="0" placeholder="请输入排序-降序排列" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md2">
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">显示数量</label>
<div class="layui-input-block">
@ -75,15 +75,15 @@
</div>
</div>
</div>
<div class="layui-col-md2">
<!--<div class="layui-col-md2">
<div class="layui-form-item">
<label class="layui-form-label">栅格值1-12</label>
<div class="layui-input-block">
<input type="number" id="gridNumber" name="gridNumber" min="1" max="12" class="layui-input" value="1" placeholder="请输入栅格值1-12" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md3">
</div>-->
<div class="layui-col-md4">
<div class="layui-form-item" pane>
<label class="layui-form-label">开启状态</label>
<div class="layui-input-block layui-form">
@ -92,14 +92,14 @@
</div>
</div>
</div>
<div class="layui-col-md2">
<!--<div class="layui-col-md2">
<div class="layui-form-item">
<label class="layui-form-label">约定值</label>
<div class="layui-input-block">
<input type="text" id="agreedValue" name="agreedValue" class="layui-input" value="" placeholder="请输入约定值" maxlength="50">
</div>
</div>
</div>
</div>-->
</div>
<div class="layui-row">
<div class="layui-col-md6">

View File

@ -0,0 +1,166 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base href="/businesscard/">
<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/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style>
.TEXT{
background-color: #0e0f0d;
}
.PHOTO{
background-color: #c81352;
}
.AUDIO{
background-color: #13c862;
}
.VIDEO{
background-color: #1376c8;
}
.MAP{
background-color: #62595c;
}
.LINK{
background-color: #ef5619;
}
.module1{
text-align: center;
color: #0e0f0d;
float:left;
}
</style>
</head>
<body>
<div style="width:100%;height:30px;text-align: center">
<button type="button" class="addEvent layui-btn layui-btn-sm" lay-event="addEvent">
<i class="fa fa-lg fa-plus"></i> 新增区域
</button>
<button type="button" class="saveEvent layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-save"></i> 保存配置
</button>
</div>
<div id="container">
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<!--<script src="assets/js/vendor/sortable/jquery.min.js"></script>-->
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="assets/js/vendor/sortable/moduleSet.js"></script>
<script type="text/javascript" src="assets/js/vendor/sortable/Sortable.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
var columnId = top.restAjax.params(window.location.href).columnId;
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
$('.addEvent').on('click', function() {
addItem();
});
$('.saveEvent').on('click', function() {
$("#container .module1").each(function(v, e) {
console.log(e.id);
});
});
function addItem() {
top.layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['800px', '95%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/columnmngitem/save.html?columnId=' + columnId, []),
end: function() {
initData();
}
});
}
function createDiv(data) {
$("#container").append('<div id="' + data.columnItemId + '" class="module1 js_module_' + data.columnItemId + ' ' + data.columnType + '" style="width:' + data.columnRow + '%;height:' + data.columnHeight + 'px;">' + data.columnName + '</div>');
$(".js_module_" + data.columnItemId).moduleSet({
button:[
{text:'编辑',callback:function(){alert('编辑')},iconfont:'&#xe648;'},
{text:'增加',callback:function(){
addItem();
},iconfont:'&#xe623;'},
{text:'删除',callback:function(){alert('删除')},iconfont:'&#xe613;'},
],
})
}
// 初始化内容
function initData() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/columnmngitem/list?columnId={columnId}', [columnId]), {}, null, function(code, data) {
$("#container").empty();
for(var i = 0; i < data.length; i++) {
createDiv(data[i]);
}
// 排序
var container = document.getElementById("container");
var sort = Sortable.create(container, {
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
handle: ".module1", // Restricts sort start click/touch to the specified element
draggable: ".module1", // Specifies which items inside the element should be sortable
onUpdate: function (evt){
console.log(evt);
var item = evt.item; // the current dragged HTMLElement
console.log(item);
/**
* 动态修改顺序
*/
// top.restAjax.put(top.restAjax.path('api/columnmngitem/updateorder/{id}/{order}', [id, order]), {}, null, function (code, data) {
//
// }, function (code, data) {
// top.dialog.msg(data.msg);
// }, function () {
// layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
// }, function () {
// top.dialog.close(layIndex);
// });
}
});
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
initData();
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,387 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#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/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline">
<input type="text" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
</div>
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
<i class="fa fa-lg fa-edit"></i> 编辑
</button>
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
<i class="fa fa-lg fa-trash"></i> 删除
</button>
</div>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/columnmngitem/listpage';
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
toolbar: '#headerToolBar',
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'columnItemId', width: 180, title: '栏目区域', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnCount', width: 180, title: '区域数量', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnType', width: 180, title: '区域类型', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
var downloadFile = '';
var datas = rowData.split(',');
for(var i = 0, item = datas[i]; item = datas[i++];) {
if(downloadFile.length > 0) {
downloadFile += ' | ';
}
downloadFile += '<a href="route/file/download/false/'+ item +'" target="_blank">点击下载</a>'
}
return downloadFile;
}
},
{field: 'columnOrder', width: 180, title: '排序', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnName', width: 180, title: '区域名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnIcon', width: 180, title: '区域图标', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
var downloadFile = '';
var datas = rowData.split(',');
for(var i = 0, item = datas[i]; item = datas[i++];) {
if(downloadFile.length > 0) {
downloadFile += ' | ';
}
downloadFile += '<a href="route/file/download/false/'+ item +'" target="_blank">点击下载</a>'
}
return downloadFile;
}
},
{field: 'columnRow', width: 180, title: '行占比.1-12', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnHeight', width: 180, title: '高度', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnRemark', width: 180, title: '备注', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnParam', width: 180, title: '附加参数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'columnStatus', width: 180, title: '区域状态0关1开', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
var downloadFile = '';
var datas = rowData.split(',');
for(var i = 0, item = datas[i]; item = datas[i++];) {
if(downloadFile.length > 0) {
downloadFile += ' | ';
}
downloadFile += '<a href="route/file/download/false/'+ item +'" target="_blank">点击下载</a>'
}
return downloadFile;
}
},
{field: 'creator', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'gmtCreate', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'modifier', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'gmtModified', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'isDelete', width: 180, title: '', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
]
],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
laydate.render({
elem: '#startTime',
format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#endTime',
format: 'yyyy-MM-dd'
});
}
// 删除
function removeData(ids) {
top.dialog.msg(top.dataMessage.delete, {
time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
var layIndex;
top.restAjax.delete(top.restAjax.path('api/columnmngitem/remove/{ids}', [ids]), {}, null, function (code, data) {
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
reloadTable();
}, function (code, data) {
top.dialog.msg(data.msg);
}, function () {
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
}, function () {
top.dialog.close(layIndex);
});
}
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/columnmngitem/save', []),
end: function() {
reloadTable();
}
});
} else if(layEvent === 'updateEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectEdit);
} else if(checkDatas.length > 1) {
top.dialog.msg(top.dataMessage.table.selectOneEdit);
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/columnmngitem/update?columnMngItemId={columnMngItemId}', [checkDatas[0].columnMngItemId]),
end: function() {
reloadTable();
}
});
}
} else if(layEvent === 'removeEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectDelete);
} else {
var ids = '';
for(var i = 0, item; item = checkDatas[i++];) {
if(i > 1) {
ids += '_';
}
ids += item['columnMngItemId'];
}
removeData(ids);
}
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,321 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base href="/businesscard/">
<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/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-card">
<div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>新增内容</cite></a>
</span>
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<input type="hidden" id="columnStatus" name="columnStatus" class="layui-input" value="1" lay-verify="required">
<input type="hidden" id="columnOrder" name="columnOrder" class="layui-input" value="1" lay-verify="required">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">区域图标</label>
<div class="layui-input-block">
<input type="hidden" id="columnIcon" name="columnIcon">
<div class="layui-btn-container" id="columnIconFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="columnIconFileDownload" type="text/html">
{{# var fileName = 'columnIcon'; }}
{{# if(d[fileName].length > 0) { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box">
<span class="upload-image-span">
<img src="route/file/download/false/{{item.fileId}}" align="加载失败">
</span>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="columnIconRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 2) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="区域图标" data-name="columnIcon" lay-filter="columnIconUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000">*</span>区域名称</label>
<div class="layui-input-block">
<input type="text" id="columnName" name="columnName" class="layui-input" value="" placeholder="请输入区域名称" maxlength="500">
</div>
</div>
<div class="layui-form-item" pane>
<label class="layui-form-label"><span style="color: #cc0000">*</span>素材类型</label>
<div class="layui-input-block layui-form" id="columnTypeCheckboxTemplateBox" lay-filter="columnTypeCheckboxTemplateBox"></div>
<script id="columnTypeCheckboxTemplate" type="text/html">
{{# for(var i = 0, item; item = d[i++];) { }}
<input type="radio" name="columnType" value="{{item.value}}" title="{{item.name}}" >
{{# } }}
</script>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000">*</span>限制数量</label>
<div class="layui-input-block">
<div style="padding-left:10px; padding-top: 20px;" id="columnCountDiv"></div>
<input type="hidden" id="columnCount" name="columnCount" value="1" class="layui-input" />
</div>
</div>
<div class="layui-form-item" pane>
<label class="layui-form-label"><span style="color: red">*</span>区域宽度</label>
<div class="layui-input-block">
<div style="padding-left:10px; padding-top: 20px;" id="columnRowDiv"></div>
<input type="hidden" id="columnRow" name="columnRow" value="10" class="layui-input" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span style="color: #cc0000">*</span>区域高度</label>
<div class="layui-input-block">
<div style="padding-left:10px; padding-top: 20px;" id="columnHeightDiv"></div>
<input type="hidden" id="columnHeight" name="columnHeight" value="10" class="layui-input" />
</div>
</div>
<!-- <div class="layui-form-item">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<input type="text" id="columnRemark" name="columnRemark" class="layui-input" value="" placeholder="请输入备注" maxlength="500">
</div>
</div>-->
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交新增</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'form', 'slider', 'laydate', 'laytpl'], function(){
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var wangEditor = window.wangEditor;
var slider = layui.slider;
var wangEditorObj = {};
var viewerObj = {};
var columnId = top.restAjax.params(window.location.href).columnId;
// 初始化素材类型复选框
function initResourceTypeCheckbox() {
top.restAjax.get(top.restAjax.path('api/columnmng/material-type-list', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('columnTypeCheckboxTemplate').innerHTML).render(data, function(html) {
document.getElementById('columnTypeCheckboxTemplateBox').innerHTML = html;
});
form.render('radio', 'columnTypeCheckboxTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
function refreshDownloadTemplet(fileName, file) {
var dataRander = {};
dataRander[fileName] = file;
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
document.getElementById(fileName +'FileBox').innerHTML = html;
});
}
// 初始化文件列表
function initFileList(fileName, ids, callback) {
var dataForm = {};
dataForm[fileName] = ids;
form.val('dataForm', dataForm);
if(!ids) {
refreshDownloadTemplet(fileName, []);
if(callback) {
callback(fileName, []);
}
return;
}
top.restAjax.get(top.restAjax.path('api/file/list', []), {
ids: ids
}, null, function(code, data) {
refreshDownloadTemplet(fileName, data);
if(callback) {
callback(fileName, data);
}
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化视频
function initVideo(fileName, data) {
for(var i = 0, item; item = data[i++];) {
var player = new ckplayer({
container: '#'+ fileName + i,
variable: 'player',
flashplayer: false,
video: {
file: 'route/file/download/true/'+ item.fileId,
type: 'video/mp4'
}
});
}
}
// 初始化区域图标图片上传
function initColumnIconUploadFile() {
var files = $('#columnIcon').val();
initFileList('columnIcon', files, function(fileName) {
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
viewerObj[fileName] = viewer;
});
form.on('button(columnIconUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'image',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
}
}
});
});
form.on('button(columnIconRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
});
}
// 初始化内容
function initData() {
initColumnIconUploadFile();
initResourceTypeCheckbox();
slider.render({
elem: '#columnRowDiv'
,setTips: function(value){ //自定义提示文本
return value + '%';
},
min:10,
max:100,
change: function(value){
$("#columnRow").val(value.replace("%",""));
}
});
slider.render({
elem: '#columnHeightDiv'
,setTips: function(value){ //自定义提示文本
return value + 'px';
},
min:10,
max:200,
change: function(value){
$("#columnHeight").val(value.replace("px",""));
}
});
slider.render({
elem: '#columnCountDiv'
,setTips: function(value){ //自定义提示文本
return value + '个';
},
min:1,
max:9,
change: function(value){
$("#columnCount").val(value.replace("个",""));
}
});
}
initData();
// 提交表单
form.on('submit(submitForm)', function(formData) {
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;
formData.field.columnId = columnId;
top.restAjax.post(top.restAjax.path('api/columnmngitem/save', []), formData.field, null, function(code, data) {
closeBox();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
return false;
});
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,450 @@
<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#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/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-card">
<div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
</span>
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item">
<label class="layui-form-label">栏目区域</label>
<div class="layui-input-block">
<input type="text" id="columnItemId" name="columnItemId" class="layui-input" value="" placeholder="请输入栏目区域" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">区域数量</label>
<div class="layui-input-block">
<input type="number" id="columnCount" name="columnCount" class="layui-input" value="" placeholder="请输入区域数量" lay-verify="required">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">区域类型</label>
<div class="layui-input-block">
<input type="hidden" id="columnType" name="columnType">
<div class="layui-btn-container" id="columnTypeFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="columnTypeFileDownload" type="text/html">
{{# var fileName = 'columnType' }}
{{# if(d[fileName] != '') { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-audio-box">
<audio src="route/file/download/true/{{item.fileId}}" controls="controls">您的浏览器不支持 audio 标签。</audio>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-audio" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="columnTypeRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="区域类型" data-name="columnType" lay-filter="columnTypeUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序</label>
<div class="layui-input-block">
<input type="number" id="columnOrder" name="columnOrder" class="layui-input" value="" placeholder="请输入排序" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">区域名</label>
<div class="layui-input-block">
<input type="text" id="columnName" name="columnName" class="layui-input" value="" placeholder="请输入区域名" maxlength="500">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">区域图标</label>
<div class="layui-input-block">
<input type="hidden" id="columnIcon" name="columnIcon">
<div class="layui-btn-container" id="columnIconFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="columnIconFileDownload" type="text/html">
{{# var fileName = 'columnIcon'; }}
{{# if(d[fileName].length > 0) { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box">
<span class="upload-image-span">
<img src="route/file/download/false/{{item.fileId}}" align="加载失败">
</span>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="columnIconRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="区域图标" data-name="columnIcon" lay-filter="columnIconUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">行占比.1-12</label>
<div class="layui-input-block">
<input type="number" id="columnRow" name="columnRow" class="layui-input" value="" placeholder="请输入行占比.1-12" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">高度</label>
<div class="layui-input-block">
<input type="number" id="columnHeight" name="columnHeight" class="layui-input" value="" placeholder="请输入高度" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">备注</label>
<div class="layui-input-block">
<input type="text" id="columnRemark" name="columnRemark" class="layui-input" value="" placeholder="请输入备注" maxlength="500">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">附加参数</label>
<div class="layui-input-block">
<input type="text" id="columnParam" name="columnParam" class="layui-input" value="" placeholder="请输入附加参数" maxlength="500">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">区域状态0关1开</label>
<div class="layui-input-block">
<input type="hidden" id="columnStatus" name="columnStatus">
<div class="layui-btn-container" id="columnStatusFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="columnStatusFileDownload" type="text/html">
{{# var fileName = 'columnStatus' }}
{{# if(d[fileName] != '') { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-audio-box">
<audio src="route/file/download/true/{{item.fileId}}" controls="controls">您的浏览器不支持 audio 标签。</audio>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-audio" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="columnStatusRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="区域状态0关1开" data-name="columnStatus" lay-filter="columnStatusUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var columnMngItemId = top.restAjax.params(window.location.href).columnMngItemId;
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
function refreshDownloadTemplet(fileName, file) {
var dataRander = {};
dataRander[fileName] = file;
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
document.getElementById(fileName +'FileBox').innerHTML = html;
});
}
// 初始化文件列表
function initFileList(fileName, ids, callback) {
var dataForm = {};
dataForm[fileName] = ids;
form.val('dataForm', dataForm);
if(!ids) {
refreshDownloadTemplet(fileName, []);
if(callback) {
callback(fileName, []);
}
return;
}
top.restAjax.get(top.restAjax.path('api/file/list', []), {
ids: ids
}, null, function(code, data) {
refreshDownloadTemplet(fileName, data);
if(callback) {
callback(fileName, data);
}
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化视频
function initVideo(fileName, data) {
for(var i = 0, item; item = data[i++];) {
var player = new ckplayer({
container: '#'+ fileName + i,
variable: 'player',
flashplayer: false,
video: {
file: 'route/file/download/true/'+ item.fileId,
type: 'video/mp4'
}
});
}
}
// 初始化区域类型音频上传
function initColumnTypeUploadFile() {
var files = $('#columnType').val();
initFileList('columnType', files);
form.on('button(columnTypeUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'audio',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files);
}
}
});
});
form.on('button(columnTypeRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files);
});
}
// 初始化区域图标图片上传
function initColumnIconUploadFile() {
var files = $('#columnIcon').val();
initFileList('columnIcon', files, function(fileName) {
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
viewerObj[fileName] = viewer;
});
form.on('button(columnIconUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'image',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
}
}
});
});
form.on('button(columnIconRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
});
}
// 初始化区域状态0关1开音频上传
function initColumnStatusUploadFile() {
var files = $('#columnStatus').val();
initFileList('columnStatus', files);
form.on('button(columnStatusUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'audio',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files);
}
}
});
});
form.on('button(columnStatusRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files);
});
}
// 初始化内容
function initData() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/columnmngitem/get/{columnMngItemId}', [columnMngItemId]), {}, null, function(code, data) {
var dataFormData = {};
for(var i in data) {
dataFormData[i] = data[i] +'';
}
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
initColumnTypeUploadFile();
initColumnIconUploadFile();
initColumnStatusUploadFile();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
initData();
// 提交表单
form.on('submit(submitForm)', function(formData) {
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/columnmngitem/update/{columnMngItemId}', [columnMngItemId]), formData.field, null, function(code, data) {
var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
shade: 0.3,
yes: function(index) {
top.dialog.close(index);
window.location.reload();
},
btn2: function() {
closeBox();
}
});
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
return false;
});
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
});
});
</script>
</body>
</html>