新增业务分类功能维护,作为通用业务分类,替换流程分类
This commit is contained in:
@@ -71,5 +71,11 @@ public class SysAutoConfiguration {
|
||||
public MsgInnerService msgInnerService(){
|
||||
return new MsgInnerService();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public BizCategoryService bizCategoryService(){
|
||||
return new BizCategoryServiceSupport();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.sys.dao;
|
||||
|
||||
import com.jeesite.common.dao.TreeDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.sys.entity.BizCategory;
|
||||
|
||||
/**
|
||||
* 业务分类DAO接口
|
||||
* @author ThinkGem
|
||||
* @version 2019-08-12
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface BizCategoryDao extends TreeDao<BizCategory> {
|
||||
|
||||
}
|
||||
@@ -50,6 +50,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
this.initPost();
|
||||
this.initEmpUser();
|
||||
this.initJob();
|
||||
this.initBizCategory();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -345,6 +346,22 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
job.setStatus(JobEntity.STATUS_PAUSED);
|
||||
jobDao.insert(job);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BizCategoryService bizCategoryService;
|
||||
public void initBizCategory() throws Exception{
|
||||
// clearTable(BizCategory.class);
|
||||
initExcelData(BizCategory.class, params -> {
|
||||
String action = (String)params[0];
|
||||
if("save".equals(action)){
|
||||
BizCategory entity = (BizCategory)params[1];
|
||||
entity.setIsNewRecord(true);
|
||||
bizCategoryService.save(entity);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPhase() {
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.sys.entity;
|
||||
|
||||
import com.jeesite.common.entity.BaseEntity;
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.entity.TreeEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 业务分类Entity
|
||||
* @author ThinkGem
|
||||
* @version 2019-08-12
|
||||
*/
|
||||
@Table(name="${_prefix}sys_biz_category", alias="a", columns={
|
||||
@Column(name="category_code", attrName="categoryCode", label="业务分类", isPK=true),
|
||||
@Column(name="view_code", attrName="viewCode", label="业务分类"),
|
||||
@Column(includeEntity=TreeEntity.class),
|
||||
@Column(name="category_name", attrName="categoryName", label="分类名称", queryType=QueryType.LIKE, isTreeName=true),
|
||||
@Column(includeEntity=DataEntity.class),
|
||||
@Column(includeEntity=BaseEntity.class),
|
||||
}, orderBy="a.tree_sorts, a.category_code"
|
||||
)
|
||||
public class BizCategory extends TreeEntity<BizCategory> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String categoryCode; // 分类编码
|
||||
private String viewCode; // 分类代码(作为显示用,多租户内唯一)
|
||||
private String categoryName; // 分类名称
|
||||
|
||||
public BizCategory() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public BizCategory(String id){
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizCategory getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(BizCategory parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String getCategoryCode() {
|
||||
return categoryCode;
|
||||
}
|
||||
|
||||
public void setCategoryCode(String categoryCode) {
|
||||
this.categoryCode = categoryCode;
|
||||
}
|
||||
|
||||
@NotBlank(message="分类代码不能为空")
|
||||
@Pattern(regexp="[a-zA-Z0-9_]{0,30}", message="代码长度不能大于 30 个字符,并且只能包含字母、数字、下划线")
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode;
|
||||
}
|
||||
|
||||
@NotBlank(message="分类名称不能为空")
|
||||
@Size(min=0, max=64, message="分类名称长度不能超过 64 个字符")
|
||||
public String getCategoryName() {
|
||||
return categoryName;
|
||||
}
|
||||
|
||||
public void setCategoryName(String categoryName) {
|
||||
this.categoryName = categoryName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.sys.service;
|
||||
|
||||
import com.jeesite.common.service.api.TreeServiceApi;
|
||||
import com.jeesite.modules.sys.entity.BizCategory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务分类Service
|
||||
* @author ThinkGem
|
||||
* @version 2019-08-12
|
||||
*/
|
||||
public interface BizCategoryService extends TreeServiceApi<BizCategory> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bpmCategory
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
BizCategory get(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bpmCategory
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
List<BizCategory> findList(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bpmCategory
|
||||
*/
|
||||
@Override
|
||||
void save(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param bpmCategory
|
||||
*/
|
||||
@Override
|
||||
void updateStatus(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bpmCategory
|
||||
*/
|
||||
@Override
|
||||
void delete(BizCategory bpmCategory);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.sys.service.support;
|
||||
|
||||
import com.jeesite.common.service.TreeService;
|
||||
import com.jeesite.modules.sys.dao.BizCategoryDao;
|
||||
import com.jeesite.modules.sys.entity.BizCategory;
|
||||
import com.jeesite.modules.sys.service.BizCategoryService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务分类Service
|
||||
* @author ThinkGem
|
||||
* @version 2019-08-12
|
||||
*/
|
||||
public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCategory>
|
||||
implements BizCategoryService{
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bizCategory
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public BizCategory get(BizCategory bizCategory) {
|
||||
return super.get(bizCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bizCategory
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BizCategory> findList(BizCategory bizCategory) {
|
||||
return super.findList(bizCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bizCategory
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(BizCategory bizCategory) {
|
||||
if (bizCategory.getIsNewRecord()){
|
||||
// 生成主键,并验证改主键是否存在,如存在则抛出验证信息
|
||||
genIdAndValid(bizCategory, bizCategory.getViewCode());
|
||||
}
|
||||
super.save(bizCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param bizCategory
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateStatus(BizCategory bizCategory) {
|
||||
super.updateStatus(bizCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bizCategory
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(BizCategory bizCategory) {
|
||||
bizCategory.sqlMap().markIdDelete();
|
||||
super.delete(bizCategory);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,11 +12,12 @@ import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import com.jeesite.modules.sys.entity.Company;
|
||||
import com.jeesite.modules.sys.service.AreaService;
|
||||
import com.jeesite.modules.sys.utils.AreaUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -28,8 +29,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -60,7 +59,7 @@ public class AreaController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("sys:area:view")
|
||||
@RequestMapping(value = "index")
|
||||
public String index(Company area, Model model) {
|
||||
public String index(Area area, Model model) {
|
||||
model.addAttribute("area", area);
|
||||
return "modules/sys/areaIndex";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.sys.web;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.BizCategory;
|
||||
import com.jeesite.modules.sys.service.BizCategoryService;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务分类Controller
|
||||
* @author ThinkGem
|
||||
* @version 2019-08-12
|
||||
*/
|
||||
@Controller
|
||||
@Tag(name = "BizCategory - 业务分类")
|
||||
@RequestMapping(value = "${adminPath}/sys/bizCategory")
|
||||
public class BizCategoryController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BizCategoryService bizCategoryService;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public BizCategory get(String categoryCode, boolean isNewRecord) {
|
||||
return bizCategoryService.get(categoryCode, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理首页
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:view")
|
||||
@RequestMapping(value = "index")
|
||||
public String index(BizCategory bizCategory, Model model) {
|
||||
model.addAttribute("bizCategory", bizCategory);
|
||||
return "modules/sys/bizCategoryIndex";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(BizCategory bizCategory, Model model) {
|
||||
model.addAttribute("bizCategory", bizCategory);
|
||||
return "modules/sys/bizCategoryList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public List<BizCategory> listData(BizCategory bizCategory) {
|
||||
if (StringUtils.isBlank(bizCategory.getParentCode())) {
|
||||
bizCategory.setParentCode(BizCategory.ROOT_CODE);
|
||||
}
|
||||
if (StringUtils.isNotBlank(bizCategory.getViewCode())) {
|
||||
bizCategory.setParentCode(null);
|
||||
}
|
||||
if (StringUtils.isNotBlank(bizCategory.getCategoryName())){
|
||||
bizCategory.setParentCode(null);
|
||||
}
|
||||
if (StringUtils.isNotBlank(bizCategory.getRemarks())){
|
||||
bizCategory.setParentCode(null);
|
||||
}
|
||||
List<BizCategory> list = bizCategoryService.findList(bizCategory);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(BizCategory bizCategory, Model model) {
|
||||
// 创建并初始化下一个节点信息
|
||||
bizCategory = createNextNode(bizCategory);
|
||||
model.addAttribute("bizCategory", bizCategory);
|
||||
return "modules/sys/bizCategoryForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建并初始化下一个节点信息,如:排序号、默认值
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:edit")
|
||||
@RequestMapping(value = "createNextNode")
|
||||
@ResponseBody
|
||||
public BizCategory createNextNode(BizCategory bizCategory) {
|
||||
if (StringUtils.isNotBlank(bizCategory.getParentCode())){
|
||||
bizCategory.setParent(bizCategoryService.get(bizCategory.getParentCode()));
|
||||
}
|
||||
if (bizCategory.getIsNewRecord()) {
|
||||
BizCategory where = new BizCategory();
|
||||
where.setParentCode(bizCategory.getParentCode());
|
||||
BizCategory last = bizCategoryService.getLastByParentCode(where);
|
||||
// 获取到下级最后一个节点
|
||||
if (last != null){
|
||||
bizCategory.setTreeSort(last.getTreeSort() + 30);
|
||||
bizCategory.setViewCode(IdGen.nextCode(last.getViewCode()));
|
||||
}else if (bizCategory.getParent() != null){
|
||||
bizCategory.setViewCode(bizCategory.getParent().getViewCode() + "001");
|
||||
}
|
||||
}
|
||||
// 以下设置表单默认数据
|
||||
if (bizCategory.getTreeSort() == null){
|
||||
bizCategory.setTreeSort(BizCategory.DEFAULT_TREE_SORT);
|
||||
}
|
||||
return bizCategory;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存业务分类
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizCategory bizCategory) {
|
||||
bizCategoryService.save(bizCategory);
|
||||
return renderResult(Global.TRUE, text("保存业务分类成功"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用业务分类
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:edit")
|
||||
@RequestMapping(value = "disable")
|
||||
@ResponseBody
|
||||
public String disable(BizCategory bizCategory) {
|
||||
BizCategory where = new BizCategory();
|
||||
where.setStatus(BizCategory.STATUS_NORMAL);
|
||||
where.setParentCodes("," + bizCategory.getId() + ",");
|
||||
long count = bizCategoryService.findCount(where);
|
||||
if (count > 0) {
|
||||
return renderResult(Global.FALSE, text("该业务分类包含未停用的子业务分类!"));
|
||||
}
|
||||
bizCategory.setStatus(BizCategory.STATUS_DISABLE);
|
||||
bizCategoryService.updateStatus(bizCategory);
|
||||
return renderResult(Global.TRUE, text("停用业务分类成功"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用业务分类
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:edit")
|
||||
@RequestMapping(value = "enable")
|
||||
@ResponseBody
|
||||
public String enable(BizCategory bizCategory) {
|
||||
bizCategory.setStatus(BizCategory.STATUS_NORMAL);
|
||||
bizCategoryService.updateStatus(bizCategory);
|
||||
return renderResult(Global.TRUE, text("启用业务分类成功"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除业务分类
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(BizCategory bizCategory) {
|
||||
bizCategoryService.delete(bizCategory);
|
||||
return renderResult(Global.TRUE, text("删除业务分类成功"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树结构数据
|
||||
* @param excludeCode 排除的Code
|
||||
* @param parentCode 设置父级编码返回一级
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:view")
|
||||
@RequestMapping(value = "treeData")
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData(String excludeCode, String parentCode, String isShowCode) {
|
||||
List<Map<String, Object>> mapList = ListUtils.newArrayList();
|
||||
BizCategory where = new BizCategory();
|
||||
where.setStatus(BizCategory.STATUS_NORMAL);
|
||||
if (StringUtils.isNotBlank(parentCode)){
|
||||
where.setParentCode(parentCode);
|
||||
}
|
||||
List<BizCategory> list = bizCategoryService.findList(where);
|
||||
for (int i=0; i<list.size(); i++){
|
||||
BizCategory e = list.get(i);
|
||||
// 过滤非正常的数据
|
||||
if (!BizCategory.STATUS_NORMAL.equals(e.getStatus())){
|
||||
continue;
|
||||
}
|
||||
// 过滤被排除的编码(包括所有子级)
|
||||
if (StringUtils.isNotBlank(excludeCode)){
|
||||
if (e.getId().equals(excludeCode)){
|
||||
continue;
|
||||
}
|
||||
if (e.getParentCodes().contains("," + excludeCode + ",")){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = MapUtils.newHashMap();
|
||||
map.put("id", e.getId());
|
||||
map.put("pId", e.getParentCode());
|
||||
map.put("name", StringUtils.getTreeNodeName(isShowCode, e.getCategoryCode(), e.getCategoryName()));
|
||||
map.put("value", e.getId());
|
||||
map.put("isParent", !e.getIsTreeLeaf());
|
||||
mapList.add(map);
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修复表结构相关数据
|
||||
*/
|
||||
@RequiresPermissions("sys:bizCategory:edit")
|
||||
@RequestMapping(value = "fixTreeData")
|
||||
@ResponseBody
|
||||
public String fixTreeData(BizCategory bizCategory){
|
||||
if (!UserUtils.getUser().isAdmin()){
|
||||
return renderResult(Global.FALSE, "操作失败,只有管理员才能进行修复!");
|
||||
}
|
||||
bizCategoryService.fixTreeData();
|
||||
return renderResult(Global.TRUE, "数据修复成功");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,6 +79,31 @@ CREATE TABLE ${_prefix}sys_area
|
||||
);
|
||||
|
||||
|
||||
-- 业务分类
|
||||
CREATE TABLE ${_prefix}sys_biz_category
|
||||
(
|
||||
category_code varchar(64) NOT NULL,
|
||||
view_code varchar(500),
|
||||
category_name varchar(64) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(767) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(767) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(767) NOT NULL,
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks vargraphic(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name vargraphic(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (category_code)
|
||||
);
|
||||
|
||||
|
||||
-- 公司表
|
||||
CREATE TABLE ${_prefix}sys_company
|
||||
(
|
||||
|
||||
@@ -79,6 +79,31 @@ CREATE TABLE ${_prefix}sys_area
|
||||
);
|
||||
|
||||
|
||||
-- 业务分类
|
||||
CREATE TABLE ${_prefix}sys_biz_category
|
||||
(
|
||||
category_code varchar(64) NOT NULL,
|
||||
view_code varchar(500),
|
||||
category_name varchar(64) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(767) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(767) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(767) NOT NULL,
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date datetime NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date datetime NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (category_code)
|
||||
);
|
||||
|
||||
|
||||
-- 公司表
|
||||
CREATE TABLE ${_prefix}sys_company
|
||||
(
|
||||
|
||||
@@ -79,6 +79,31 @@ CREATE TABLE [${_prefix}sys_area]
|
||||
);
|
||||
|
||||
|
||||
-- 业务分类
|
||||
CREATE TABLE [${_prefix}sys_biz_category]
|
||||
(
|
||||
[category_code] varchar(64) NOT NULL,
|
||||
[view_code] varchar(500),
|
||||
[category_name] varchar(64) NOT NULL,
|
||||
[parent_code] varchar(64) NOT NULL,
|
||||
[parent_codes] varchar(767) NOT NULL,
|
||||
[tree_sort] decimal(10) NOT NULL,
|
||||
[tree_sorts] varchar(767) NOT NULL,
|
||||
[tree_leaf] char(1) NOT NULL,
|
||||
[tree_level] decimal(4) NOT NULL,
|
||||
[tree_names] varchar(767) NOT NULL,
|
||||
[status] char(1) DEFAULT '0' NOT NULL,
|
||||
[create_by] varchar(64) NOT NULL,
|
||||
[create_date] datetime NOT NULL,
|
||||
[update_by] varchar(64) NOT NULL,
|
||||
[update_date] datetime NOT NULL,
|
||||
[remarks] nvarchar(500),
|
||||
[corp_code] varchar(64) DEFAULT '0' NOT NULL,
|
||||
[corp_name] nvarchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY ([category_code])
|
||||
);
|
||||
|
||||
|
||||
-- 公司表
|
||||
CREATE TABLE [${_prefix}sys_company]
|
||||
(
|
||||
|
||||
@@ -80,6 +80,31 @@ CREATE TABLE ${_prefix}sys_area
|
||||
) COMMENT = '行政区划';
|
||||
|
||||
|
||||
-- 业务分类
|
||||
CREATE TABLE ${_prefix}sys_biz_category
|
||||
(
|
||||
category_code varchar(64) NOT NULL COMMENT '流程分类',
|
||||
view_code varchar(500) COMMENT '分类代码',
|
||||
category_name varchar(64) NOT NULL COMMENT '分类名称',
|
||||
parent_code varchar(64) NOT NULL COMMENT '父级编号',
|
||||
parent_codes varchar(767) NOT NULL COMMENT '所有父级编号',
|
||||
tree_sort decimal(10) NOT NULL COMMENT '排序号(升序)',
|
||||
tree_sorts varchar(767) NOT NULL COMMENT '所有排序号',
|
||||
tree_leaf char(1) NOT NULL COMMENT '是否最末级',
|
||||
tree_level decimal(4) NOT NULL COMMENT '层次级别',
|
||||
tree_names varchar(767) NOT NULL COMMENT '全节点名',
|
||||
status char(1) DEFAULT '0' NOT NULL COMMENT '状态(0正常 1删除 2停用)',
|
||||
create_by varchar(64) NOT NULL COMMENT '创建者',
|
||||
create_date datetime NOT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) NOT NULL COMMENT '更新者',
|
||||
update_date datetime NOT NULL COMMENT '更新时间',
|
||||
remarks varchar(500) COMMENT '备注信息',
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL COMMENT '租户代码',
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL COMMENT '租户名称',
|
||||
PRIMARY KEY (category_code)
|
||||
) COMMENT = '业务分类';
|
||||
|
||||
|
||||
-- 公司表
|
||||
CREATE TABLE ${_prefix}sys_company
|
||||
(
|
||||
|
||||
@@ -79,6 +79,31 @@ CREATE TABLE ${_prefix}sys_area
|
||||
);
|
||||
|
||||
|
||||
-- 业务分类
|
||||
CREATE TABLE ${_prefix}sys_biz_category
|
||||
(
|
||||
category_code varchar2(64) NOT NULL,
|
||||
view_code varchar2(500),
|
||||
category_name varchar2(64) NOT NULL,
|
||||
parent_code varchar2(64) NOT NULL,
|
||||
parent_codes varchar2(767) NOT NULL,
|
||||
tree_sort number(10) NOT NULL,
|
||||
tree_sorts varchar2(767) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level number(4) NOT NULL,
|
||||
tree_names varchar2(767) NOT NULL,
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar2(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar2(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks nvarchar2(500),
|
||||
corp_code varchar2(64) DEFAULT '0' NOT NULL,
|
||||
corp_name nvarchar2(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (category_code)
|
||||
);
|
||||
|
||||
|
||||
-- 公司表
|
||||
CREATE TABLE ${_prefix}sys_company
|
||||
(
|
||||
@@ -1033,6 +1058,25 @@ COMMENT ON COLUMN ${_prefix}sys_area.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_area.update_by IS '更新者';
|
||||
COMMENT ON COLUMN ${_prefix}sys_area.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_area.remarks IS '备注信息';
|
||||
COMMENT ON TABLE ${_prefix}sys_biz_category IS '业务分类';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.category_code IS '流程分类';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.view_code IS '分类代码';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.category_name IS '分类名称';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.parent_code IS '父级编号';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.parent_codes IS '所有父级编号';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_sort IS '排序号(升序)';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_sorts IS '所有排序号';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_leaf IS '是否最末级';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_level IS '层次级别';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_names IS '全节点名';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.status IS '状态(0正常 1删除 2停用)';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.create_by IS '创建者';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.update_by IS '更新者';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.remarks IS '备注信息';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.corp_code IS '租户代码';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.corp_name IS '租户名称';
|
||||
COMMENT ON TABLE ${_prefix}sys_company IS '公司表';
|
||||
COMMENT ON COLUMN ${_prefix}sys_company.company_code IS '公司编码';
|
||||
COMMENT ON COLUMN ${_prefix}sys_company.view_code IS '公司代码';
|
||||
|
||||
@@ -79,6 +79,31 @@ CREATE TABLE ${_prefix}sys_area
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
-- 业务分类
|
||||
CREATE TABLE ${_prefix}sys_biz_category
|
||||
(
|
||||
category_code varchar(64) NOT NULL,
|
||||
view_code varchar(500),
|
||||
category_name varchar(64) NOT NULL,
|
||||
parent_code varchar(64) NOT NULL,
|
||||
parent_codes varchar(767) NOT NULL,
|
||||
tree_sort decimal(10) NOT NULL,
|
||||
tree_sorts varchar(767) NOT NULL,
|
||||
tree_leaf char(1) NOT NULL,
|
||||
tree_level decimal(4) NOT NULL,
|
||||
tree_names varchar(767) NOT NULL,
|
||||
status char(1) DEFAULT '0' NOT NULL,
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
corp_code varchar(64) DEFAULT '0' NOT NULL,
|
||||
corp_name varchar(100) DEFAULT 'JeeSite' NOT NULL,
|
||||
PRIMARY KEY (category_code)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
-- 公司表
|
||||
CREATE TABLE ${_prefix}sys_company
|
||||
(
|
||||
@@ -1033,6 +1058,25 @@ COMMENT ON COLUMN ${_prefix}sys_area.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_area.update_by IS '更新者';
|
||||
COMMENT ON COLUMN ${_prefix}sys_area.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_area.remarks IS '备注信息';
|
||||
COMMENT ON TABLE ${_prefix}sys_biz_category IS '业务分类';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.category_code IS '流程分类';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.view_code IS '分类代码';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.category_name IS '分类名称';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.parent_code IS '父级编号';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.parent_codes IS '所有父级编号';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_sort IS '排序号(升序)';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_sorts IS '所有排序号';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_leaf IS '是否最末级';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_level IS '层次级别';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.tree_names IS '全节点名';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.status IS '状态(0正常 1删除 2停用)';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.create_by IS '创建者';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.update_by IS '更新者';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.remarks IS '备注信息';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.corp_code IS '租户代码';
|
||||
COMMENT ON COLUMN ${_prefix}sys_biz_category.corp_name IS '租户名称';
|
||||
COMMENT ON TABLE ${_prefix}sys_company IS '公司表';
|
||||
COMMENT ON COLUMN ${_prefix}sys_company.company_code IS '公司编码';
|
||||
COMMENT ON COLUMN ${_prefix}sys_company.view_code IS '公司代码';
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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="com.jeesite.modules.sys.dao.BizCategoryDao">
|
||||
|
||||
<!-- 查询数据
|
||||
<select id="findList" resultType="BizCategory">
|
||||
SELECT ${sqlMap.column.toSql()}
|
||||
FROM ${sqlMap.table.toSql()}
|
||||
<where>
|
||||
${sqlMap.where.toSql()}
|
||||
</where>
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select> -->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,109 @@
|
||||
<% layout('/layouts/default.html', {title: '分类管理', libs: ['validate']}){ %>
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header with-border">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-note"></i> ${text(bizCategory.isNewRecord ? '新增分类' : '编辑分类')}
|
||||
</div>
|
||||
<div class="box-tools pull-right hide">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<#form:form id="inputForm" model="${bizCategory}" action="${ctx}/sys/bizCategory/save" method="post" class="form-horizontal">
|
||||
<div class="box-body mt10">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4">${text('上级分类')}:</label>
|
||||
<div class="col-sm-8">
|
||||
<#form:treeselect id="parent" title="${text('上级分类')}"
|
||||
path="parent.id" labelPath="parent.categoryName"
|
||||
url="${ctx}/sys/bizCategory/treeData?excludeCode=${bizCategory.id}"
|
||||
class="" allowClear="true" canSelectRoot="true" canSelectParent="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required ">*</span> ${text('分类编码')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:hidden path="isNewRecord"/>
|
||||
<#form:hidden path="categoryCode"/>
|
||||
<#form:input path="viewCode" maxlength="64" readonly="${!bizCategory.isNewRecord}" class="form-control required abc"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required ">*</span> ${text('分类名称')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="categoryName" maxlength="64" class="form-control required"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-4" title="">
|
||||
<span class="required ">*</span> ${text('排序号')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<#form:input path="treeSort" class="form-control required digits"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required hide">*</span> ${text('备注信息')}:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<% if (hasPermi('sys:bizCategory:edit')){ %>
|
||||
<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>
|
||||
<% } %>
|
||||
<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#form:form>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>
|
||||
$('#inputForm').validate({
|
||||
submitHandler: function(form){
|
||||
js.ajaxSubmitForm($(form), function(data){
|
||||
js.showMessage(data.message);
|
||||
if(data.result == Global.TRUE){
|
||||
js.closeCurrentTabPage(function(contentWindow){
|
||||
(contentWindow.win||contentWindow).$('#dataGrid').dataGrid('refreshTreeChildren',
|
||||
$('#parentCode').val(), '${bizCategory.id}');
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
|
||||
// 选择上级节点回调方法
|
||||
function treeselectCallback(id, act, index, layero){
|
||||
if (id == 'parent' && (act == 'ok' || act == 'clear')){
|
||||
// 创建并初始化下一个节点信息,如:排序号、默认值
|
||||
$.get('${ctx}/sys/bizCategory/createNextNode?parentCode='
|
||||
+$('#parentCode').val(), function(data){
|
||||
$('#treeSort').val(data.treeSort);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,76 @@
|
||||
<% layout('/layouts/default.html', {title: '分类管理', libs: ['layout','zTree']}){ %>
|
||||
<div class="ui-layout-west">
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-grid"></i> ${text('分类管理')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" id="btnExpand" title="${text('展开')}" style="display:none;"><i class="fa fa-chevron-up"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="${text('折叠')}"><i class="fa fa-chevron-down"></i></button>
|
||||
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="${text('刷新')}"><i class="fa fa-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-content">
|
||||
<div id="tree" class="ztree"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-center">
|
||||
<iframe id="mainFrame" name="mainFrame" class="ui-layout-content p0"
|
||||
src="${ctx}/sys/bizCategory/list"></iframe>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>
|
||||
//# // 初始化布局
|
||||
$('body').layout({
|
||||
west__initClosed: $(window).width() <= 767, // 是否默认关闭
|
||||
west__size: 190
|
||||
});
|
||||
//# // 主页框架
|
||||
var win = $("#mainFrame")[0].contentWindow;
|
||||
//# // 树结构初始化加载
|
||||
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:{enable:true}},
|
||||
async:{enable:true,autoParam:["id=parentCode"],url:"${ctx}/sys/bizCategory/treeData"},
|
||||
callback:{onClick:function(event, treeId, treeNode){
|
||||
tree.expandNode(treeNode);
|
||||
win.$('button[type=reset]').click();
|
||||
win.$('#categoryCode').val(treeNode.id);
|
||||
win.$('#categoryName').val(treeNode.name);
|
||||
win.page();
|
||||
}}
|
||||
}, tree, loadTree = function(){
|
||||
js.ajaxSubmit(setting.async.url+"?___t="+new Date().getTime(), {
|
||||
parentCode:'${parameter.parentCode!}'}, function(data){
|
||||
tree = $.fn.zTree.init($("#tree"), setting, data);
|
||||
var level = -1, nodes;
|
||||
while (++level <= 1) {
|
||||
nodes = tree.getNodesByParam("level", level);
|
||||
if (nodes.length > 10) { break; }
|
||||
for(var i=0; i<nodes.length; i++) {
|
||||
tree.expandNode(nodes[i], true, false, false);
|
||||
}
|
||||
}
|
||||
}, null, null, js.text('loading.message'));
|
||||
};loadTree();
|
||||
//# // 工具栏按钮绑定
|
||||
$('#btnExpand').click(function(){
|
||||
tree.expandAll(true);
|
||||
$(this).hide();
|
||||
$('#btnCollapse').show();
|
||||
});
|
||||
$('#btnCollapse').click(function(){
|
||||
tree.expandAll(false);
|
||||
$(this).hide();
|
||||
$('#btnExpand').show();
|
||||
});
|
||||
$('#btnRefresh').click(function(){
|
||||
loadTree();
|
||||
});
|
||||
//# // 调用子页分页函数
|
||||
function page(){
|
||||
win.page();
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,94 @@
|
||||
<% layout('/layouts/default.html', {title: '分类管理', libs: ['dataGrid']}){ %>
|
||||
<div class="main-content">
|
||||
<div class="box box-main">
|
||||
<div class="box-header">
|
||||
<div class="box-title">
|
||||
<i class="fa icon-menu"></i> ${text('分类管理')}
|
||||
</div>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
|
||||
<a href="#" class="btn btn-default" id="btnRefreshTree" title="${text('刷新')}"><i class="fa fa-refresh"></i> ${text('刷新')}</a>
|
||||
<a href="#" class="btn btn-default" id="btnExpandTreeNode" title="${text('展开一级')}"><i class="fa fa-angle-double-down"></i> ${text('展开')}</a>
|
||||
<a href="#" class="btn btn-default" id="btnCollapseTreeNode" title="${text('折叠全部')}"><i class="fa fa-angle-double-up"></i> ${text('折叠')}</a>
|
||||
<% if(hasPermi('sys:bizCategory:edit')){ %>
|
||||
<a href="${ctx}/sys/bizCategory/form" class="btn btn-default btnTool" title="${text('新增分类')}" data-layer="true" data-layer-width="900" data-layer-height="400"><i class="fa fa-plus"></i> ${text('新增')}</a>
|
||||
<% } %>
|
||||
<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<#form:form id="searchForm" model="${bizCategory}" action="${ctx}/sys/bizCategory/listData" method="post" class="form-inline hide"
|
||||
data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
|
||||
<#form:hidden path="categoryCode"/>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('分类代码')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="viewCode" maxlength="64" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('分类名称')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="categoryName" maxlength="64" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('状态')}:</label>
|
||||
<div class="control-inline width-120">
|
||||
<#form:select path="status" dictType="sys_search_status" blankOption="true" class="form-control isQuick"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">${text('备注信息')}:</label>
|
||||
<div class="control-inline">
|
||||
<#form:input path="remarks" maxlength="500" class="form-control width-120"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary btn-sm"><i class="glyphicon glyphicon-search"></i> ${text('查询')}</button>
|
||||
<button type="reset" class="btn btn-default btn-sm isQuick"><i class="glyphicon glyphicon-repeat"></i> ${text('重置')}</button>
|
||||
</div>
|
||||
</#form:form>
|
||||
<table id="dataGrid"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
<script>
|
||||
//# // 初始化DataGrid对象
|
||||
$('#dataGrid').dataGrid({
|
||||
searchForm: $('#searchForm'),
|
||||
columnModel: [
|
||||
{header:'${text("分类名称")}', name:'categoryName', index:'a.category_name', width:250, align:"left", frozen:true, formatter: function(val, obj, row, act){
|
||||
return '( '+row.viewCode+' ) '+'<a href="${ctx}/sys/bizCategory/form?categoryCode='+row.categoryCode+'" class="btnList" data-title="${text("编辑分类")}" data-layer="true" data-layer-width="900" data-layer-height="400">'+(val||row.id)+'</a>';
|
||||
}},
|
||||
{header:'${text("排序号")}', name:'treeSort', index:'a.tree_sort', width:80, align:"center"},
|
||||
{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:100, align:"center"},
|
||||
{header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:100, align:"left"},
|
||||
{header:'${text("状态")}', name:'status', index:'a.status', width:80, align:"center", formatter: function(val, obj, row, act){
|
||||
return js.getDictLabel("#{@DictUtils.getDictListJson('sys_search_status')}", val, '${text("未知")}', true);
|
||||
}},
|
||||
{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
|
||||
var actions = [];
|
||||
//# if(hasPermi('sys:bizCategory:edit')){
|
||||
actions.push('<a href="${ctx}/sys/bizCategory/form?categoryCode='+row.categoryCode+'" class="btnList" title="${text("编辑分类")}" data-layer="true" data-layer-width="900" data-layer-height="400"><i class="fa fa-pencil"></i></a> ');
|
||||
if (row.status == Global.STATUS_NORMAL){
|
||||
actions.push('<a href="${ctx}/sys/bizCategory/disable?categoryCode='+row.categoryCode+'" class="btnList" title="${text("停用分类")}" data-confirm="${text("确认要停用该分类吗?")}"><i class="glyphicon glyphicon-ban-circle"></i></a> ');
|
||||
} else if (row.status == Global.STATUS_DISABLE){
|
||||
actions.push('<a href="${ctx}/sys/bizCategory/enable?categoryCode='+row.categoryCode+'" class="btnList" title="${text("启用分类")}" data-confirm="${text("确认要启用该分类吗?")}"><i class="glyphicon glyphicon-ok-circle"></i></a> ');
|
||||
}
|
||||
actions.push('<a href="${ctx}/sys/bizCategory/delete?categoryCode='+row.categoryCode+'" class="btnList" title="${text("删除分类")}" data-confirm="${text("确认要删除该分类及所有子分类吗?")}" data-deltreenode="'+row.id+'"><i class="fa fa-trash-o"></i></a> ');
|
||||
actions.push('<a href="${ctx}/sys/bizCategory/form?parentCode='+row.id+'" class="btnList" title="${text("新增下级分类")}"><i class="fa fa-plus-square"></i></a> ');
|
||||
//# }
|
||||
return actions.join('');
|
||||
}}
|
||||
],
|
||||
treeGrid: true, // 启用树结构表格
|
||||
defaultExpandLevel: 0, // 默认展开的层次
|
||||
expandNodeClearPostData: 'viewCode,categoryName,remarks,', // 展开节点清理请求参数数据(一般设置查询条件的字段属性,否则在查询后,不能展开子节点数据)
|
||||
//# // 加载成功后执行事件
|
||||
ajaxSuccess: function(data){
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user