15143018065 2 anos atrás
pai
commit
cbb6639554
28 arquivos alterados com 2510 adições e 9 exclusões
  1. 185 0
      okc/src/main/java/com/ruoyi/okc/domain/DocPro.java
  2. 227 0
      okc/src/main/java/com/ruoyi/okc/domain/DocTree.java
  3. 61 0
      okc/src/main/java/com/ruoyi/okc/mapper/DocProMapper.java
  4. 61 0
      okc/src/main/java/com/ruoyi/okc/mapper/DocTreeMapper.java
  5. 61 0
      okc/src/main/java/com/ruoyi/okc/service/IDocProService.java
  6. 61 0
      okc/src/main/java/com/ruoyi/okc/service/IDocTreeService.java
  7. 118 0
      okc/src/main/java/com/ruoyi/okc/service/impl/DocProServiceImpl.java
  8. 110 0
      okc/src/main/java/com/ruoyi/okc/service/impl/DocTreeServiceImpl.java
  9. 15 0
      okc/src/main/java/com/ruoyi/okc/service/impl/OkcVideoProServiceImpl.java
  10. 110 0
      okc/src/main/resources/mapper/okc/DocProMapper.xml
  11. 134 0
      okc/src/main/resources/mapper/okc/DocTreeMapper.xml
  12. 114 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/okc/DocProController.java
  13. 102 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/okc/DocTreeController.java
  14. 12 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
  15. 3 5
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java
  16. 84 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/SysObjDictRet.java
  17. 38 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/SysObjDictType.java
  18. 6 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
  19. 4 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java
  20. 44 3
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
  21. 9 1
      ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
  22. 57 0
      ruoyi-ui/src/api/okc/docPro.js
  23. 44 0
      ruoyi-ui/src/api/okc/docTree.js
  24. 9 0
      ruoyi-ui/src/api/system/dict/type.js
  25. 205 0
      ruoyi-ui/src/components/BizDict/index.vue
  26. 4 0
      ruoyi-ui/src/main.js
  27. 303 0
      ruoyi-ui/src/views/okc/docPro/index.vue
  28. 329 0
      ruoyi-ui/src/views/okc/docTree/index.vue

+ 185 - 0
okc/src/main/java/com/ruoyi/okc/domain/DocPro.java

@@ -0,0 +1,185 @@
+package com.ruoyi.okc.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 模板项目对象 doc_pro
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+public class DocPro extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键标识 */
+    private String id;
+
+    /** 项目名称 */
+    @Excel(name = "项目名称")
+    private String docName;
+
+    /** 创建时间 */
+    private String createTimeStr;
+
+    /** 创建用户Id */
+    private String createUserId;
+
+    /** 创建人用户类型 */
+    private String createUserType;
+
+    /** 创建单位Id */
+    private String createUnit;
+
+    /** 创建单位 */
+    private String createUnitName;
+
+    /** 更新时间 */
+    private String updateTimeStr;
+
+    /** 更新用户Id */
+    private String updateUserId;
+
+    /** 更新单位Id */
+    private String updateUnit;
+
+    /** 更新单位 */
+    private String updateUnitName;
+
+    /** 数据状态 */
+    @Excel(name = "数据状态")
+    private String status;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setDocName(String docName) 
+    {
+        this.docName = docName;
+    }
+
+    public String getDocName() 
+    {
+        return docName;
+    }
+    public void setCreateTimeStr(String createTimeStr) 
+    {
+        this.createTimeStr = createTimeStr;
+    }
+
+    public String getCreateTimeStr() 
+    {
+        return createTimeStr;
+    }
+    public void setCreateUserId(String createUserId) 
+    {
+        this.createUserId = createUserId;
+    }
+
+    public String getCreateUserId() 
+    {
+        return createUserId;
+    }
+    public void setCreateUserType(String createUserType) 
+    {
+        this.createUserType = createUserType;
+    }
+
+    public String getCreateUserType() 
+    {
+        return createUserType;
+    }
+    public void setCreateUnit(String createUnit) 
+    {
+        this.createUnit = createUnit;
+    }
+
+    public String getCreateUnit() 
+    {
+        return createUnit;
+    }
+    public void setCreateUnitName(String createUnitName) 
+    {
+        this.createUnitName = createUnitName;
+    }
+
+    public String getCreateUnitName() 
+    {
+        return createUnitName;
+    }
+    public void setUpdateTimeStr(String updateTimeStr) 
+    {
+        this.updateTimeStr = updateTimeStr;
+    }
+
+    public String getUpdateTimeStr() 
+    {
+        return updateTimeStr;
+    }
+    public void setUpdateUserId(String updateUserId) 
+    {
+        this.updateUserId = updateUserId;
+    }
+
+    public String getUpdateUserId() 
+    {
+        return updateUserId;
+    }
+    public void setUpdateUnit(String updateUnit) 
+    {
+        this.updateUnit = updateUnit;
+    }
+
+    public String getUpdateUnit() 
+    {
+        return updateUnit;
+    }
+    public void setUpdateUnitName(String updateUnitName) 
+    {
+        this.updateUnitName = updateUnitName;
+    }
+
+    public String getUpdateUnitName() 
+    {
+        return updateUnitName;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("docName", getDocName())
+            .append("remark", getRemark())
+            .append("createTimeStr", getCreateTimeStr())
+            .append("createUserId", getCreateUserId())
+            .append("createBy", getCreateBy())
+            .append("createUserType", getCreateUserType())
+            .append("createUnit", getCreateUnit())
+            .append("createUnitName", getCreateUnitName())
+            .append("updateTimeStr", getUpdateTimeStr())
+            .append("updateUserId", getUpdateUserId())
+            .append("updateBy", getUpdateBy())
+            .append("updateUnit", getUpdateUnit())
+            .append("updateUnitName", getUpdateUnitName())
+            .append("status", getStatus())
+            .toString();
+    }
+}

+ 227 - 0
okc/src/main/java/com/ruoyi/okc/domain/DocTree.java

@@ -0,0 +1,227 @@
+package com.ruoyi.okc.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.TreeEntity;
+
+/**
+ * 模板标题树对象 doc_tree
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+public class DocTree extends TreeEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键标识 */
+    private String id;
+
+    /** 模板主键标识 */
+    private String docId;
+
+    /** 标题名称 */
+    @Excel(name = "标题名称")
+    private String treeName;
+
+    /** 内容 */
+    private String content;
+
+    /** 标题样式 */
+    private String css;
+
+    /** 创建时间 */
+    private String createTimeStr;
+
+    /** 创建用户Id */
+    private String createUserId;
+
+    /** 创建人用户类型 */
+    private String createUserType;
+
+    /** 创建单位Id */
+    private String createUnit;
+
+    /** 创建单位 */
+    private String createUnitName;
+
+    /** 更新时间 */
+    private String updateTimeStr;
+
+    /** 更新用户Id */
+    private String updateUserId;
+
+    /** 更新单位Id */
+    private String updateUnit;
+
+    /** 更新单位 */
+    private String updateUnitName;
+
+    /** 数据状态 */
+    @Excel(name = "数据状态")
+    private String status;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setDocId(String docId) 
+    {
+        this.docId = docId;
+    }
+
+    public String getDocId() 
+    {
+        return docId;
+    }
+    public void setTreeName(String treeName) 
+    {
+        this.treeName = treeName;
+    }
+
+    public String getTreeName() 
+    {
+        return treeName;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setCss(String css) 
+    {
+        this.css = css;
+    }
+
+    public String getCss() 
+    {
+        return css;
+    }
+    public void setCreateTimeStr(String createTimeStr) 
+    {
+        this.createTimeStr = createTimeStr;
+    }
+
+    public String getCreateTimeStr() 
+    {
+        return createTimeStr;
+    }
+    public void setCreateUserId(String createUserId) 
+    {
+        this.createUserId = createUserId;
+    }
+
+    public String getCreateUserId() 
+    {
+        return createUserId;
+    }
+    public void setCreateUserType(String createUserType) 
+    {
+        this.createUserType = createUserType;
+    }
+
+    public String getCreateUserType() 
+    {
+        return createUserType;
+    }
+    public void setCreateUnit(String createUnit) 
+    {
+        this.createUnit = createUnit;
+    }
+
+    public String getCreateUnit() 
+    {
+        return createUnit;
+    }
+    public void setCreateUnitName(String createUnitName) 
+    {
+        this.createUnitName = createUnitName;
+    }
+
+    public String getCreateUnitName() 
+    {
+        return createUnitName;
+    }
+    public void setUpdateTimeStr(String updateTimeStr) 
+    {
+        this.updateTimeStr = updateTimeStr;
+    }
+
+    public String getUpdateTimeStr() 
+    {
+        return updateTimeStr;
+    }
+    public void setUpdateUserId(String updateUserId) 
+    {
+        this.updateUserId = updateUserId;
+    }
+
+    public String getUpdateUserId() 
+    {
+        return updateUserId;
+    }
+    public void setUpdateUnit(String updateUnit) 
+    {
+        this.updateUnit = updateUnit;
+    }
+
+    public String getUpdateUnit() 
+    {
+        return updateUnit;
+    }
+    public void setUpdateUnitName(String updateUnitName) 
+    {
+        this.updateUnitName = updateUnitName;
+    }
+
+    public String getUpdateUnitName() 
+    {
+        return updateUnitName;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("parentId", getParentId())
+            .append("docId", getDocId())
+            .append("treeName", getTreeName())
+            .append("orderNum", getOrderNum())
+            .append("ancestors", getAncestors())
+            .append("content", getContent())
+            .append("css", getCss())
+            .append("remark", getRemark())
+            .append("createTimeStr", getCreateTimeStr())
+            .append("createUserId", getCreateUserId())
+            .append("createBy", getCreateBy())
+            .append("createUserType", getCreateUserType())
+            .append("createUnit", getCreateUnit())
+            .append("createUnitName", getCreateUnitName())
+            .append("updateTimeStr", getUpdateTimeStr())
+            .append("updateUserId", getUpdateUserId())
+            .append("updateBy", getUpdateBy())
+            .append("updateUnit", getUpdateUnit())
+            .append("updateUnitName", getUpdateUnitName())
+            .append("status", getStatus())
+            .toString();
+    }
+}

+ 61 - 0
okc/src/main/java/com/ruoyi/okc/mapper/DocProMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.okc.mapper;
+
+import java.util.List;
+import com.ruoyi.okc.domain.DocPro;
+
+/**
+ * 模板项目Mapper接口
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+public interface DocProMapper 
+{
+    /**
+     * 查询模板项目
+     * 
+     * @param id 模板项目主键
+     * @return 模板项目
+     */
+    public DocPro selectDocProById(String id);
+
+    /**
+     * 查询模板项目列表
+     * 
+     * @param docPro 模板项目
+     * @return 模板项目集合
+     */
+    public List<DocPro> selectDocProList(DocPro docPro);
+
+    /**
+     * 新增模板项目
+     * 
+     * @param docPro 模板项目
+     * @return 结果
+     */
+    public int insertDocPro(DocPro docPro);
+
+    /**
+     * 修改模板项目
+     * 
+     * @param docPro 模板项目
+     * @return 结果
+     */
+    public int updateDocPro(DocPro docPro);
+
+    /**
+     * 删除模板项目
+     * 
+     * @param id 模板项目主键
+     * @return 结果
+     */
+    public int deleteDocProById(String id);
+
+    /**
+     * 批量删除模板项目
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDocProByIds(String[] ids);
+}

+ 61 - 0
okc/src/main/java/com/ruoyi/okc/mapper/DocTreeMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.okc.mapper;
+
+import java.util.List;
+import com.ruoyi.okc.domain.DocTree;
+
+/**
+ * 模板标题树Mapper接口
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+public interface DocTreeMapper 
+{
+    /**
+     * 查询模板标题树
+     * 
+     * @param id 模板标题树主键
+     * @return 模板标题树
+     */
+    public DocTree selectDocTreeById(String id);
+
+    /**
+     * 查询模板标题树列表
+     * 
+     * @param docTree 模板标题树
+     * @return 模板标题树集合
+     */
+    public List<DocTree> selectDocTreeList(DocTree docTree);
+
+    /**
+     * 新增模板标题树
+     * 
+     * @param docTree 模板标题树
+     * @return 结果
+     */
+    public int insertDocTree(DocTree docTree);
+
+    /**
+     * 修改模板标题树
+     * 
+     * @param docTree 模板标题树
+     * @return 结果
+     */
+    public int updateDocTree(DocTree docTree);
+
+    /**
+     * 删除模板标题树
+     * 
+     * @param id 模板标题树主键
+     * @return 结果
+     */
+    public int deleteDocTreeById(String id);
+
+    /**
+     * 批量删除模板标题树
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDocTreeByIds(String[] ids);
+}

+ 61 - 0
okc/src/main/java/com/ruoyi/okc/service/IDocProService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.okc.service;
+
+import java.util.List;
+import com.ruoyi.okc.domain.DocPro;
+
+/**
+ * 模板项目Service接口
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+public interface IDocProService 
+{
+    /**
+     * 查询模板项目
+     * 
+     * @param id 模板项目主键
+     * @return 模板项目
+     */
+    public DocPro selectDocProById(String id);
+
+    /**
+     * 查询模板项目列表
+     * 
+     * @param docPro 模板项目
+     * @return 模板项目集合
+     */
+    public List<DocPro> selectDocProList(DocPro docPro);
+
+    /**
+     * 新增模板项目
+     * 
+     * @param docPro 模板项目
+     * @return 结果
+     */
+    public int insertDocPro(DocPro docPro);
+
+    /**
+     * 修改模板项目
+     * 
+     * @param docPro 模板项目
+     * @return 结果
+     */
+    public int updateDocPro(DocPro docPro);
+
+    /**
+     * 批量删除模板项目
+     * 
+     * @param ids 需要删除的模板项目主键集合
+     * @return 结果
+     */
+    public int deleteDocProByIds(String[] ids);
+
+    /**
+     * 删除模板项目信息
+     * 
+     * @param id 模板项目主键
+     * @return 结果
+     */
+    public int deleteDocProById(String id);
+}

+ 61 - 0
okc/src/main/java/com/ruoyi/okc/service/IDocTreeService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.okc.service;
+
+import java.util.List;
+import com.ruoyi.okc.domain.DocTree;
+
+/**
+ * 模板标题树Service接口
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+public interface IDocTreeService 
+{
+    /**
+     * 查询模板标题树
+     * 
+     * @param id 模板标题树主键
+     * @return 模板标题树
+     */
+    public DocTree selectDocTreeById(String id);
+
+    /**
+     * 查询模板标题树列表
+     * 
+     * @param docTree 模板标题树
+     * @return 模板标题树集合
+     */
+    public List<DocTree> selectDocTreeList(DocTree docTree);
+
+    /**
+     * 新增模板标题树
+     * 
+     * @param docTree 模板标题树
+     * @return 结果
+     */
+    public int insertDocTree(DocTree docTree);
+
+    /**
+     * 修改模板标题树
+     * 
+     * @param docTree 模板标题树
+     * @return 结果
+     */
+    public int updateDocTree(DocTree docTree);
+
+    /**
+     * 批量删除模板标题树
+     * 
+     * @param ids 需要删除的模板标题树主键集合
+     * @return 结果
+     */
+    public int deleteDocTreeByIds(String[] ids);
+
+    /**
+     * 删除模板标题树信息
+     * 
+     * @param id 模板标题树主键
+     * @return 结果
+     */
+    public int deleteDocTreeById(String id);
+}

+ 118 - 0
okc/src/main/java/com/ruoyi/okc/service/impl/DocProServiceImpl.java

@@ -0,0 +1,118 @@
+package com.ruoyi.okc.service.impl;
+
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.uuid.IdUtils;
+import com.ruoyi.okc.mapper.DocTreeMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.okc.mapper.DocProMapper;
+import com.ruoyi.okc.domain.DocPro;
+import com.ruoyi.okc.service.IDocProService;
+
+import static com.ruoyi.common.utils.DateUtils.YYYYMMDDHHMMSS;
+
+/**
+ * 模板项目Service业务层处理
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+@Service
+public class DocProServiceImpl implements IDocProService 
+{
+    @Autowired
+    private DocProMapper docProMapper;
+
+    @Autowired
+    private DocTreeMapper docTreeMapper;
+
+    /**
+     * 查询模板项目
+     * 
+     * @param id 模板项目主键
+     * @return 模板项目
+     */
+    @Override
+    public DocPro selectDocProById(String id)
+    {
+        return docProMapper.selectDocProById(id);
+    }
+
+    /**
+     * 查询模板项目列表
+     * 
+     * @param docPro 模板项目
+     * @return 模板项目
+     */
+    @Override
+    public List<DocPro> selectDocProList(DocPro docPro)
+    {
+        docPro.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
+        return docProMapper.selectDocProList(docPro);
+    }
+
+    /**
+     * 新增模板项目
+     * 
+     * @param docPro 模板项目
+     * @return 结果
+     */
+    @Override
+    public int insertDocPro(DocPro docPro)
+    {
+        docPro.setId(IdUtils.simpleUUID());
+        docPro.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
+        docPro.setCreateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
+        docPro.setCreateBy(SecurityUtils.getUsername());
+        docPro.setCreateUnit(String.valueOf(SecurityUtils.getDeptId()));
+        return docProMapper.insertDocPro(docPro);
+    }
+
+    /**
+     * 修改模板项目
+     * 
+     * @param docPro 模板项目
+     * @return 结果
+     */
+    @Override
+    public int updateDocPro(DocPro docPro)
+    {
+        docPro.setUpdateUserId(String.valueOf(SecurityUtils.getUserId()));
+        docPro.setUpdateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
+        docPro.setUpdateBy(SecurityUtils.getUsername());
+        docPro.setUpdateUnit(String.valueOf(SecurityUtils.getDeptId()));
+        return docProMapper.updateDocPro(docPro);
+    }
+
+    /**
+     * 批量删除模板项目
+     * 
+     * @param ids 需要删除的模板项目主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocProByIds(String[] ids)
+    {
+        List<String> idList = Stream.of(ids).collect(Collectors.toList());
+//        idList.forEach(i -> docTreeMapper.deleteDocTreeById(i));
+        return docProMapper.deleteDocProByIds(ids);
+    }
+
+    /**
+     * 删除模板项目信息
+     * 
+     * @param id 模板项目主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocProById(String id)
+    {
+        return docProMapper.deleteDocProById(id);
+    }
+}

+ 110 - 0
okc/src/main/java/com/ruoyi/okc/service/impl/DocTreeServiceImpl.java

@@ -0,0 +1,110 @@
+package com.ruoyi.okc.service.impl;
+
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.uuid.IdUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.okc.mapper.DocTreeMapper;
+import com.ruoyi.okc.domain.DocTree;
+import com.ruoyi.okc.service.IDocTreeService;
+
+import static com.ruoyi.common.utils.DateUtils.YYYYMMDDHHMMSS;
+
+/**
+ * 模板标题树Service业务层处理
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+@Service
+public class DocTreeServiceImpl implements IDocTreeService 
+{
+    @Autowired
+    private DocTreeMapper docTreeMapper;
+
+    /**
+     * 查询模板标题树
+     * 
+     * @param id 模板标题树主键
+     * @return 模板标题树
+     */
+    @Override
+    public DocTree selectDocTreeById(String id)
+    {
+        return docTreeMapper.selectDocTreeById(id);
+    }
+
+    /**
+     * 查询模板标题树列表
+     * 
+     * @param docTree 模板标题树
+     * @return 模板标题树
+     */
+    @Override
+    public List<DocTree> selectDocTreeList(DocTree docTree)
+    {
+        docTree.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
+        return docTreeMapper.selectDocTreeList(docTree);
+    }
+
+    /**
+     * 新增模板标题树
+     * 
+     * @param docTree 模板标题树
+     * @return 结果
+     */
+    @Override
+    public int insertDocTree(DocTree docTree)
+    {
+        docTree.setId(IdUtils.simpleUUID());
+        docTree.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
+        docTree.setCreateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
+        docTree.setCreateBy(SecurityUtils.getUsername());
+        docTree.setCreateUnit(String.valueOf(SecurityUtils.getDeptId()));
+        return docTreeMapper.insertDocTree(docTree);
+    }
+
+    /**
+     * 修改模板标题树
+     * 
+     * @param docTree 模板标题树
+     * @return 结果
+     */
+    @Override
+    public int updateDocTree(DocTree docTree)
+    {
+        docTree.setUpdateUserId(String.valueOf(SecurityUtils.getUserId()));
+        docTree.setUpdateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
+        docTree.setUpdateBy(SecurityUtils.getUsername());
+        docTree.setUpdateUnit(String.valueOf(SecurityUtils.getDeptId()));
+        return docTreeMapper.updateDocTree(docTree);
+    }
+
+    /**
+     * 批量删除模板标题树
+     * 
+     * @param ids 需要删除的模板标题树主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocTreeByIds(String[] ids)
+    {
+        return docTreeMapper.deleteDocTreeByIds(ids);
+    }
+
+    /**
+     * 删除模板标题树信息
+     * 
+     * @param id 模板标题树主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocTreeById(String id)
+    {
+        return docTreeMapper.deleteDocTreeById(id);
+    }
+}

+ 15 - 0
okc/src/main/java/com/ruoyi/okc/service/impl/OkcVideoProServiceImpl.java

@@ -22,6 +22,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.enums.*;
 import com.ruoyi.common.enums.*;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.*;
 import com.ruoyi.common.utils.*;
+import com.ruoyi.common.utils.uuid.IdUtils;
 import com.ruoyi.okc.domain.OkcVideoRec;
 import com.ruoyi.okc.domain.OkcVideoRec;
 import com.ruoyi.okc.mapper.OkcVideoRecMapper;
 import com.ruoyi.okc.mapper.OkcVideoRecMapper;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.ObjectUtils;
@@ -59,6 +60,19 @@ public class OkcVideoProServiceImpl implements IOkcVideoProService
     @Autowired
     @Autowired
     private OkcVideoRecMapper okcVideoRecMapper;
     private OkcVideoRecMapper okcVideoRecMapper;
 
 
+    /**
+     * RC值奇怪的逻辑计算
+     * 首先,取得整个视频第一次提交开始时间与最后一次提交结束时间的时间段
+     * 时间段/3秒 得到切割次数
+     * 每当出现一个教师行为behavior时,stList新增切割次数的1,非教师行为behavior时,stList新增切割次数的0
+     * stList[1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0]
+     * t_num, g_num, last_num
+     * 循环stList,每次出现1,即教师行为behavior时,t_num + 1,每次stList[i]变动时,g_num + 1
+     * rt = t_num / stList.count
+     * ch = g_num - 1 / stList.count
+     */
+
+
     /**
     /**
      * 查询视频项目信息
      * 查询视频项目信息
      *
      *
@@ -100,6 +114,7 @@ public class OkcVideoProServiceImpl implements IOkcVideoProService
     @Override
     @Override
     public int insertOkcVideoPro(OkcVideoPro okcVideoPro)
     public int insertOkcVideoPro(OkcVideoPro okcVideoPro)
     {
     {
+        okcVideoPro.setId(IdUtils.simpleUUID());
         okcVideoPro.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
         okcVideoPro.setCreateUserId(String.valueOf(SecurityUtils.getUserId()));
         okcVideoPro.setCreateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
         okcVideoPro.setCreateTimeStr(DateUtils.parseDateToStr(YYYYMMDDHHMMSS, new Date()));
         okcVideoPro.setCreateBy(SecurityUtils.getUsername());
         okcVideoPro.setCreateBy(SecurityUtils.getUsername());

+ 110 - 0
okc/src/main/resources/mapper/okc/DocProMapper.xml

@@ -0,0 +1,110 @@
+<?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.ruoyi.okc.mapper.DocProMapper">
+    
+    <resultMap type="DocPro" id="DocProResult">
+        <result property="id"    column="id"    />
+        <result property="docName"    column="doc_name"    />
+        <result property="remark"    column="remark"    />
+        <result property="createTimeStr"    column="create_time_str"    />
+        <result property="createUserId"    column="create_user_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createUserType"    column="create_user_type"    />
+        <result property="createUnit"    column="create_unit"    />
+        <result property="createUnitName"    column="create_unit_name"    />
+        <result property="updateTimeStr"    column="update_time_str"    />
+        <result property="updateUserId"    column="update_user_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateUnit"    column="update_unit"    />
+        <result property="updateUnitName"    column="update_unit_name"    />
+        <result property="status"    column="status"    />
+    </resultMap>
+
+    <sql id="selectDocProVo">
+        select id, doc_name, remark, create_time_str, create_user_id, create_by, create_user_type, create_unit, create_unit_name, update_time_str, update_user_id, update_by, update_unit, update_unit_name, status from doc_pro
+    </sql>
+
+    <select id="selectDocProList" parameterType="DocPro" resultMap="DocProResult">
+        <include refid="selectDocProVo"/>
+        <where>  
+            <if test="docName != null  and docName != ''"> and doc_name like concat('%', #{docName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectDocProById" parameterType="String" resultMap="DocProResult">
+        <include refid="selectDocProVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertDocPro" parameterType="DocPro">
+        insert into doc_pro
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="docName != null and docName != ''">doc_name,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createTimeStr != null">create_time_str,</if>
+            <if test="createUserId != null">create_user_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createUserType != null">create_user_type,</if>
+            <if test="createUnit != null">create_unit,</if>
+            <if test="createUnitName != null">create_unit_name,</if>
+            <if test="updateTimeStr != null">update_time_str,</if>
+            <if test="updateUserId != null">update_user_id,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateUnit != null">update_unit,</if>
+            <if test="updateUnitName != null">update_unit_name,</if>
+            <if test="status != null and status != ''">status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="docName != null and docName != ''">#{docName},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createTimeStr != null">#{createTimeStr},</if>
+            <if test="createUserId != null">#{createUserId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createUserType != null">#{createUserType},</if>
+            <if test="createUnit != null">#{createUnit},</if>
+            <if test="createUnitName != null">#{createUnitName},</if>
+            <if test="updateTimeStr != null">#{updateTimeStr},</if>
+            <if test="updateUserId != null">#{updateUserId},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateUnit != null">#{updateUnit},</if>
+            <if test="updateUnitName != null">#{updateUnitName},</if>
+            <if test="status != null and status != ''">#{status},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDocPro" parameterType="DocPro">
+        update doc_pro
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="docName != null and docName != ''">doc_name = #{docName},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createTimeStr != null">create_time_str = #{createTimeStr},</if>
+            <if test="createUserId != null">create_user_id = #{createUserId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createUserType != null">create_user_type = #{createUserType},</if>
+            <if test="createUnit != null">create_unit = #{createUnit},</if>
+            <if test="createUnitName != null">create_unit_name = #{createUnitName},</if>
+            <if test="updateTimeStr != null">update_time_str = #{updateTimeStr},</if>
+            <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateUnit != null">update_unit = #{updateUnit},</if>
+            <if test="updateUnitName != null">update_unit_name = #{updateUnitName},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDocProById" parameterType="String">
+        delete from doc_pro where id = #{id}
+    </delete>
+
+    <delete id="deleteDocProByIds" parameterType="String">
+        delete from doc_pro where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 134 - 0
okc/src/main/resources/mapper/okc/DocTreeMapper.xml

@@ -0,0 +1,134 @@
+<?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.ruoyi.okc.mapper.DocTreeMapper">
+    
+    <resultMap type="DocTree" id="DocTreeResult">
+        <result property="id"    column="id"    />
+        <result property="parentId"    column="parent_id"    />
+        <result property="docId"    column="doc_id"    />
+        <result property="treeName"    column="tree_name"    />
+        <result property="orderNum"    column="order_num"    />
+        <result property="ancestors"    column="ancestors"    />
+        <result property="content"    column="content"    />
+        <result property="css"    column="css"    />
+        <result property="remark"    column="remark"    />
+        <result property="createTimeStr"    column="create_time_str"    />
+        <result property="createUserId"    column="create_user_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createUserType"    column="create_user_type"    />
+        <result property="createUnit"    column="create_unit"    />
+        <result property="createUnitName"    column="create_unit_name"    />
+        <result property="updateTimeStr"    column="update_time_str"    />
+        <result property="updateUserId"    column="update_user_id"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateUnit"    column="update_unit"    />
+        <result property="updateUnitName"    column="update_unit_name"    />
+        <result property="status"    column="status"    />
+    </resultMap>
+
+    <sql id="selectDocTreeVo">
+        select id, parent_id, doc_id, tree_name, order_num, ancestors, content, css, remark, create_time_str, create_user_id, create_by, create_user_type, create_unit, create_unit_name, update_time_str, update_user_id, update_by, update_unit, update_unit_name, status from doc_tree
+    </sql>
+
+    <select id="selectDocTreeList" parameterType="DocTree" resultMap="DocTreeResult">
+        <include refid="selectDocTreeVo"/>
+        <where>  
+            <if test="treeName != null  and treeName != ''"> and tree_name like concat('%', #{treeName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectDocTreeById" parameterType="String" resultMap="DocTreeResult">
+        <include refid="selectDocTreeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertDocTree" parameterType="DocTree">
+        insert into doc_tree
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="parentId != null and parentId != ''">parent_id,</if>
+            <if test="docId != null and docId != ''">doc_id,</if>
+            <if test="treeName != null and treeName != ''">tree_name,</if>
+            <if test="orderNum != null">order_num,</if>
+            <if test="ancestors != null">ancestors,</if>
+            <if test="content != null">content,</if>
+            <if test="css != null">css,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createTimeStr != null">create_time_str,</if>
+            <if test="createUserId != null">create_user_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createUserType != null">create_user_type,</if>
+            <if test="createUnit != null">create_unit,</if>
+            <if test="createUnitName != null">create_unit_name,</if>
+            <if test="updateTimeStr != null">update_time_str,</if>
+            <if test="updateUserId != null">update_user_id,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateUnit != null">update_unit,</if>
+            <if test="updateUnitName != null">update_unit_name,</if>
+            <if test="status != null and status != ''">status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="parentId != null and parentId != ''">#{parentId},</if>
+            <if test="docId != null and docId != ''">#{docId},</if>
+            <if test="treeName != null and treeName != ''">#{treeName},</if>
+            <if test="orderNum != null">#{orderNum},</if>
+            <if test="ancestors != null">#{ancestors},</if>
+            <if test="content != null">#{content},</if>
+            <if test="css != null">#{css},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createTimeStr != null">#{createTimeStr},</if>
+            <if test="createUserId != null">#{createUserId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createUserType != null">#{createUserType},</if>
+            <if test="createUnit != null">#{createUnit},</if>
+            <if test="createUnitName != null">#{createUnitName},</if>
+            <if test="updateTimeStr != null">#{updateTimeStr},</if>
+            <if test="updateUserId != null">#{updateUserId},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateUnit != null">#{updateUnit},</if>
+            <if test="updateUnitName != null">#{updateUnitName},</if>
+            <if test="status != null and status != ''">#{status},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDocTree" parameterType="DocTree">
+        update doc_tree
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
+            <if test="docId != null and docId != ''">doc_id = #{docId},</if>
+            <if test="treeName != null and treeName != ''">tree_name = #{treeName},</if>
+            <if test="orderNum != null">order_num = #{orderNum},</if>
+            <if test="ancestors != null">ancestors = #{ancestors},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="css != null">css = #{css},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createTimeStr != null">create_time_str = #{createTimeStr},</if>
+            <if test="createUserId != null">create_user_id = #{createUserId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createUserType != null">create_user_type = #{createUserType},</if>
+            <if test="createUnit != null">create_unit = #{createUnit},</if>
+            <if test="createUnitName != null">create_unit_name = #{createUnitName},</if>
+            <if test="updateTimeStr != null">update_time_str = #{updateTimeStr},</if>
+            <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateUnit != null">update_unit = #{updateUnit},</if>
+            <if test="updateUnitName != null">update_unit_name = #{updateUnitName},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDocTreeById" parameterType="String">
+        delete from doc_tree where id = #{id}
+    </delete>
+
+    <delete id="deleteDocTreeByIds" parameterType="String">
+        delete from doc_tree where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 114 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/okc/DocProController.java

@@ -0,0 +1,114 @@
+package com.ruoyi.web.controller.okc;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.core.domain.entity.SysUser;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.okc.domain.DocPro;
+import com.ruoyi.okc.service.IDocProService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 模板项目Controller
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+@RestController
+@RequestMapping("/okc/docPro")
+public class DocProController extends BaseController
+{
+    @Autowired
+    private IDocProService docProService;
+
+    /**
+     * 查询模板项目列表
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docPro:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DocPro docPro)
+    {
+        startPage();
+        List<DocPro> list = docProService.selectDocProList(docPro);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出模板项目列表
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docPro:export')")
+    @Log(title = "模板项目", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DocPro docPro)
+    {
+        List<DocPro> list = docProService.selectDocProList(docPro);
+        ExcelUtil<DocPro> util = new ExcelUtil<DocPro>(DocPro.class);
+        util.exportExcel(response, list, "模板项目数据");
+    }
+
+    /**
+     * 获取模板项目详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docPro:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(docProService.selectDocProById(id));
+    }
+
+    /**
+     * 新增模板项目
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docPro:add')")
+    @Log(title = "模板项目", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DocPro docPro)
+    {
+        return toAjax(docProService.insertDocPro(docPro));
+    }
+
+    /**
+     * 修改模板项目
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docPro:edit')")
+    @Log(title = "模板项目", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DocPro docPro)
+    {
+        return toAjax(docProService.updateDocPro(docPro));
+    }
+
+    /**
+     * 删除模板项目
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docPro:remove')")
+    @Log(title = "模板项目", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(docProService.deleteDocProByIds(ids));
+    }
+
+    @PreAuthorize("@ss.hasPermi('okc:docPro:edit')")
+    @Log(title = "模板项目", businessType = BusinessType.UPDATE)
+    @PutMapping("/changeStatus")
+    public AjaxResult changeStatus(@RequestBody DocPro docPro)
+    {
+        return toAjax(docProService.updateDocPro(docPro));
+    }
+}

+ 102 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/okc/DocTreeController.java

@@ -0,0 +1,102 @@
+package com.ruoyi.web.controller.okc;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.okc.domain.DocTree;
+import com.ruoyi.okc.service.IDocTreeService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+
+/**
+ * 模板标题树Controller
+ * 
+ * @author sun
+ * @date 2023-02-20
+ */
+@RestController
+@RequestMapping("/okc/docTree")
+public class DocTreeController extends BaseController
+{
+    @Autowired
+    private IDocTreeService docTreeService;
+
+    /**
+     * 查询模板标题树列表
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docTree:list')")
+    @GetMapping("/list")
+    public AjaxResult list(DocTree docTree)
+    {
+        List<DocTree> list = docTreeService.selectDocTreeList(docTree);
+        return success(list);
+    }
+
+    /**
+     * 导出模板标题树列表
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docTree:export')")
+    @Log(title = "模板标题树", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DocTree docTree)
+    {
+        List<DocTree> list = docTreeService.selectDocTreeList(docTree);
+        ExcelUtil<DocTree> util = new ExcelUtil<DocTree>(DocTree.class);
+        util.exportExcel(response, list, "模板标题树数据");
+    }
+
+    /**
+     * 获取模板标题树详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docTree:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(docTreeService.selectDocTreeById(id));
+    }
+
+    /**
+     * 新增模板标题树
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docTree:add')")
+    @Log(title = "模板标题树", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DocTree docTree)
+    {
+        return toAjax(docTreeService.insertDocTree(docTree));
+    }
+
+    /**
+     * 修改模板标题树
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docTree:edit')")
+    @Log(title = "模板标题树", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DocTree docTree)
+    {
+        return toAjax(docTreeService.updateDocTree(docTree));
+    }
+
+    /**
+     * 删除模板标题树
+     */
+    @PreAuthorize("@ss.hasPermi('okc:docTree:remove')")
+    @Log(title = "模板标题树", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(docTreeService.deleteDocTreeByIds(ids));
+    }
+}

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java

@@ -2,6 +2,9 @@ package com.ruoyi.web.controller.system;
 
 
 import java.util.List;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.SysObjDictRet;
+import com.ruoyi.system.domain.SysObjDictType;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
@@ -129,4 +132,13 @@ public class SysDictTypeController extends BaseController
         List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
         List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
         return success(dictTypes);
         return success(dictTypes);
     }
     }
+
+    /**
+     * 获取字典选择框列表
+     */
+    @GetMapping("/objdict")
+    public AjaxResult objdict(@Validated SysObjDictType dictType)
+    {
+        return success(dictTypeService.objDictList(dictType));
+    }
 }
 }

+ 3 - 5
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java

@@ -16,7 +16,7 @@ public class TreeEntity extends BaseEntity
     private String parentName;
     private String parentName;
 
 
     /** 父菜单ID */
     /** 父菜单ID */
-    private Long parentId;
+    private String parentId;
 
 
     /** 显示顺序 */
     /** 显示顺序 */
     private Integer orderNum;
     private Integer orderNum;
@@ -37,13 +37,11 @@ public class TreeEntity extends BaseEntity
         this.parentName = parentName;
         this.parentName = parentName;
     }
     }
 
 
-    public Long getParentId()
-    {
+    public String getParentId() {
         return parentId;
         return parentId;
     }
     }
 
 
-    public void setParentId(Long parentId)
-    {
+    public void setParentId(String parentId) {
         this.parentId = parentId;
         this.parentId = parentId;
     }
     }
 
 

+ 84 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysObjDictRet.java

@@ -0,0 +1,84 @@
+package com.ruoyi.system.domain;
+
+public class SysObjDictRet {
+
+    private String title;
+
+    private Integer fieldcount;
+
+    private Integer count;
+
+    private String[] fields;
+
+    private String[] fieldwidths;
+
+    private String[] headers;
+
+    private String[] mask;
+
+    private String[][] data;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Integer getFieldcount() {
+        return fieldcount;
+    }
+
+    public void setFieldcount(Integer fieldcount) {
+        this.fieldcount = fieldcount;
+    }
+
+    public Integer getCount() {
+        return count;
+    }
+
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+
+    public String[] getFields() {
+        return fields;
+    }
+
+    public void setFields(String[] fields) {
+        this.fields = fields;
+    }
+
+    public String[] getFieldwidths() {
+        return fieldwidths;
+    }
+
+    public void setFieldwidths(String[] fieldwidths) {
+        this.fieldwidths = fieldwidths;
+    }
+
+    public String[] getHeaders() {
+        return headers;
+    }
+
+    public void setHeaders(String[] headers) {
+        this.headers = headers;
+    }
+
+    public String[] getMask() {
+        return mask;
+    }
+
+    public void setMask(String[] mask) {
+        this.mask = mask;
+    }
+
+    public String[][] getData() {
+        return data;
+    }
+
+    public void setData(String[][] data) {
+        this.data = data;
+    }
+}

+ 38 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysObjDictType.java

@@ -0,0 +1,38 @@
+package com.ruoyi.system.domain;
+
+import java.io.Serializable;
+
+public class SysObjDictType implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String dictType;
+
+    private String outType;
+
+    private String para1;
+
+    public String getDictType() {
+        return dictType;
+    }
+
+    public void setDictType(String dictType) {
+        this.dictType = dictType;
+    }
+
+    public String getOutType() {
+        return outType;
+    }
+
+    public void setOutType(String outType) {
+        this.outType = outType;
+    }
+
+    public String getPara1() {
+        return para1;
+    }
+
+    public void setPara1(String para1) {
+        this.para1 = para1;
+    }
+}

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java

@@ -1,7 +1,11 @@
 package com.ruoyi.system.mapper;
 package com.ruoyi.system.mapper;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.common.core.domain.entity.SysDictType;
 import com.ruoyi.common.core.domain.entity.SysDictType;
+import com.ruoyi.system.domain.SysObjDictType;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
  * 字典表 数据层
  * 字典表 数据层
@@ -80,4 +84,6 @@ public interface SysDictTypeMapper
      * @return 结果
      * @return 结果
      */
      */
     public SysDictType checkDictTypeUnique(String dictType);
     public SysDictType checkDictTypeUnique(String dictType);
+
+    public List<Map<String,Object>> selectObjDict(@Param("dicttype") String dicttype, @Param("outtype") String outtype, @Param("userid") String userid, @Param("para1") String para1);
 }
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java

@@ -3,6 +3,8 @@ package com.ruoyi.system.service;
 import java.util.List;
 import java.util.List;
 import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.domain.entity.SysDictType;
 import com.ruoyi.common.core.domain.entity.SysDictType;
+import com.ruoyi.system.domain.SysObjDictRet;
+import com.ruoyi.system.domain.SysObjDictType;
 
 
 /**
 /**
  * 字典 业务层
  * 字典 业务层
@@ -95,4 +97,6 @@ public interface ISysDictTypeService
      * @return 结果
      * @return 结果
      */
      */
     public String checkDictTypeUnique(SysDictType dictType);
     public String checkDictTypeUnique(SysDictType dictType);
+
+    public SysObjDictRet objDictList(SysObjDictType dictType);
 }
 }

+ 44 - 3
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java

@@ -1,10 +1,12 @@
 package com.ruoyi.system.service.impl;
 package com.ruoyi.system.service.impl;
 
 
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 import javax.annotation.PostConstruct;
 import javax.annotation.PostConstruct;
+
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.SysObjDictRet;
+import com.ruoyi.system.domain.SysObjDictType;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -220,4 +222,43 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
         }
         }
         return UserConstants.UNIQUE;
         return UserConstants.UNIQUE;
     }
     }
+
+    @Override
+    public SysObjDictRet objDictList(SysObjDictType dictType) {
+        List<Map<String,Object>> mapList =  dictTypeMapper.selectObjDict(dictType.getDictType(), dictType.getOutType(),
+                String.valueOf(SecurityUtils.getUserId()), dictType.getPara1());
+        SysObjDictRet ObjDictRet= new SysObjDictRet();
+        int count=0;
+        ArrayList datas=(ArrayList) mapList;
+        int fieldcount=7;
+        String masks="0,0,0,0,0,0,0";
+        String[] hfields=new String [fieldcount];
+        String[] masksl=new String [fieldcount];
+        hfields[0]="bm";hfields[1]="mc";hfields[2]="att1";hfields[3]="att2";hfields[4]="att3";hfields[5]="att4";hfields[6]="att5";
+        count=datas.size();
+        String[][] hdatas=new String[count][fieldcount];
+        for (int i=0;i<count;i++)
+        {
+            Object obmask=((HashMap) ((ArrayList) datas).get(i)).get("ismask");
+            if (obmask!=null)
+            {
+                masks=obmask.toString();
+            };
+            masksl=masks.split(",");
+            for (int j=0;j<fieldcount;j++) {
+                Object ob=((HashMap) ((ArrayList) datas).get(i)).get(hfields[j]);
+                if (ob==null)
+                    hdatas[i][j] ="";
+                else {
+                    if(masksl[j].equals("0"))
+                        hdatas[i][j] = ob.toString();
+                }
+            }
+        }
+        ObjDictRet.setCount(count);
+        ObjDictRet.setData(hdatas);
+        ObjDictRet.setFields(hfields);
+        ObjDictRet.setMask(masks.split(","));
+        return ObjDictRet;
+    }
 }
 }

+ 9 - 1
ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml

@@ -101,5 +101,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			sysdate()
  			sysdate()
  		)
  		)
 	</insert>
 	</insert>
-	
+
+	<select id="selectObjDict" resultType="java.util.Map">
+		{call getobjdictdata(
+				#{dicttype,jdbcType=VARCHAR, mode=IN},
+				#{outtype,jdbcType=VARCHAR, mode=IN},
+				#{userid,jdbcType=VARCHAR, mode=IN},
+				#{para1,jdbcType=VARCHAR, mode=IN})}
+	</select>
+
 </mapper> 
 </mapper> 

+ 57 - 0
ruoyi-ui/src/api/okc/docPro.js

@@ -0,0 +1,57 @@
+import request from '@/utils/request'
+
+// 查询模板项目列表
+export function listDocPro(query) {
+  return request({
+    url: '/okc/docPro/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询模板项目详细
+export function getDocPro(id) {
+  return request({
+    url: '/okc/docPro/' + id,
+    method: 'get'
+  })
+}
+
+// 新增模板项目
+export function addDocPro(data) {
+  return request({
+    url: '/okc/docPro',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改模板项目
+export function updateDocPro(data) {
+  return request({
+    url: '/okc/docPro',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除模板项目
+export function delDocPro(id) {
+  return request({
+    url: '/okc/docPro/' + id,
+    method: 'delete'
+  })
+}
+
+// 模板项目状态修改
+export function changeDocStatus(id, status) {
+  const data = {
+    id,
+    status
+  }
+  return request({
+    url: '/okc/docPro/changeStatus',
+    method: 'put',
+    data: data
+  })
+}

+ 44 - 0
ruoyi-ui/src/api/okc/docTree.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询模板标题树列表
+export function listDocTree(query) {
+  return request({
+    url: '/okc/docTree/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询模板标题树详细
+export function getDocTree(id) {
+  return request({
+    url: '/okc/docTree/' + id,
+    method: 'get'
+  })
+}
+
+// 新增模板标题树
+export function addDocTree(data) {
+  return request({
+    url: '/okc/docTree',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改模板标题树
+export function updateDocTree(data) {
+  return request({
+    url: '/okc/docTree',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除模板标题树
+export function delDocTree(id) {
+  return request({
+    url: '/okc/docTree/' + id,
+    method: 'delete'
+  })
+}

+ 9 - 0
ruoyi-ui/src/api/system/dict/type.js

@@ -57,4 +57,13 @@ export function optionselect() {
     url: '/system/dict/type/optionselect',
     url: '/system/dict/type/optionselect',
     method: 'get'
     method: 'get'
   })
   })
+}
+
+// 业务字典查询
+export function objdictList(query) {
+  return request({
+    url: '/system/dict/type/objdict',
+    method: 'get',
+    params: query
+  })
 }
 }

+ 205 - 0
ruoyi-ui/src/components/BizDict/index.vue

@@ -0,0 +1,205 @@
+<template>
+    <!--<div>-->
+      <el-select v-model="valueData" :clearable="clearable" @clear="clearData()" placeholder="请选择" @visible-change="visibleChange"
+                 :loading="loading" @change="change(valueData)" :disabled="disabled">
+        <el-option
+          v-for="item in options"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value">
+        </el-option>
+      </el-select>
+    <!--</div>-->
+  </template>
+  <script>
+  import { objdictList } from "@/api/system/dict/type";
+  
+  export default {
+      name: "BizDict",
+      model: {
+        prop: 'value',
+        event: 'changeValue'
+      },
+      props: {
+        //是否是单独使用
+        isCoom:{
+          type:Boolean,
+          default:false,
+        },
+        value: {
+          type: [String,Number,Object],
+          default: "",
+        },
+        //参数1
+        para1: {
+          type: [String,Number,Object],
+          default: "",
+        },
+        disabled:{
+          type:Boolean,
+          default:false
+        },
+        //固定配置
+        parmar: {
+          type: Object,
+          default: () => {
+            return {
+              dictType: 'ds',
+            }
+          },
+        },
+        //value和label对应哪个字段
+        arrayOpt: {
+          type: Object,
+          default: () => {
+            return {
+              numberOne: 0,
+              numberTwo: 1
+            }
+          },
+        },
+        //是否默认加载选择第一项
+        isLoding:{
+          type:Boolean,
+          default:false
+        }
+      },
+      data() {
+        return {
+          options: [],
+          valueData:"",
+          loading: false,
+          isNumber: 0,
+          clearable:true,
+        }
+      },
+      watch: {
+        para1: {
+          handler(newName, oldName) {
+            this.isNumber = 0;
+            this.options = [];
+            this.valueData = "";
+            this.para1 = newName;
+            this.$emit('changeData', this.value);
+          },
+          // 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
+          immediate: true,
+          deep:true,
+        },
+        value: {
+           handler(newName, oldName) {
+            //  console.log(newName,'newName');
+             //单独组件根据监听进行回显,级联组件通过页面v-if进行刷新
+             //    if(this.isCoom) {
+                  this.options = [];
+                  this.showData(newName)
+                // }else {
+                //   this.valueData=newName;
+                // }
+          },
+          // 代表在wacth里声明了firstName这个方法之后立即先去执行handler方法
+          immediate: true,
+          deep:true,
+        }
+      },
+      methods: {
+        async visibleChange(is) {
+          if(this.isLoding)
+          {
+            return false
+          }
+          //防止二次触发刷新
+          if (is && this.isNumber < 1) {
+            this.loading = true;
+            let data = await objdictList({...this.parmar, outType: 0, para1: this.para1});
+            if (data.code == 200) {
+              this.isNumber++;
+              this.options = [];
+              data.data.data.forEach(items => {
+                let obj={};
+                items.map((item,index)=>{
+                  obj[data.data.fields[index]]=item;
+                });
+                this.options.push({
+                  ...obj,
+                  label: items[this.arrayOpt.numberTwo],
+                  value: items[this.arrayOpt.numberOne]
+                })
+              });
+              this.loading = false;
+            }
+          }
+        },
+        change(value) {
+          let data=null;
+          this.options.forEach(item=>{
+            if(item.value==value)
+            {
+              data=item;
+            }
+          });
+          this.$emit('changeData', value,data);
+  
+        },
+        clearData() {
+          this.valueData = "";
+          this.$emit('changeData', "");
+        },
+        async showData(value) {
+          if(this.isCoom)
+          {
+            this.options=[];
+          }
+          //回显列表只有一条数据,当进行下拉才进行全部数据的加载
+          let data = await objdictList({...this.parmar, outType: 1, para1: value});
+          if (data.code == 200) {
+            if (this.options.length === 0) {
+              data.data.data.forEach(items => {
+                this.options.push({
+                  label: items[this.arrayOpt.numberTwo],
+                  value: items[this.arrayOpt.numberOne]
+                })
+              });
+              this.valueData=value;
+              this.isNumber=0;
+            }
+          }
+        }
+      },
+      async created() {
+        if(this.isLoding)
+        {
+          this.clearable=false;
+          this.loading = true;
+          let data = await objdictList({...this.parmar, outType: 0, para1: this.para1});
+          if (data.code == 200) {
+            this.options = [];
+            data.data.data.forEach(items => {
+              let obj={};
+              items.map((item,index)=>{
+                obj[data.data.fields[index]]=item;
+              });
+              this.options.push({
+                ...obj,
+                label: items[this.arrayOpt.numberTwo],
+                value: items[this.arrayOpt.numberOne]
+              })
+            });
+            this.loading = false;
+            if(this.options.length>0)
+            {
+              this.valueData=this.options[0].value;
+              this.$emit('changeData',this.valueData,this.options[0]);
+            }
+          }
+          return
+        }
+        this.showData(this.value);
+      }
+    }
+  </script>
+  
+  <style scoped>
+  
+  </style>
+  

+ 4 - 0
ruoyi-ui/src/main.js

@@ -42,6 +42,9 @@ import VueMeta from 'vue-meta'
 // 字典数据组件
 // 字典数据组件
 import DictData from '@/components/DictData'
 import DictData from '@/components/DictData'
 
 
+//业务字典组件
+import BizDict from '@/components/BizDict/index'
+
 // 全局方法挂载
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts
 Vue.prototype.getDicts = getDicts
 Vue.prototype.getConfigKey = getConfigKey
 Vue.prototype.getConfigKey = getConfigKey
@@ -61,6 +64,7 @@ Vue.component('Editor', Editor)
 Vue.component('FileUpload', FileUpload)
 Vue.component('FileUpload', FileUpload)
 Vue.component('ImageUpload', ImageUpload)
 Vue.component('ImageUpload', ImageUpload)
 Vue.component('ImagePreview', ImagePreview)
 Vue.component('ImagePreview', ImagePreview)
+Vue.component('BizDict', BizDict)
 
 
 Vue.use(directive)
 Vue.use(directive)
 Vue.use(plugins)
 Vue.use(plugins)

+ 303 - 0
ruoyi-ui/src/views/okc/docPro/index.vue

@@ -0,0 +1,303 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="项目名称" prop="docName">
+        <el-input
+          v-model="queryParams.docName"
+          placeholder="请输入项目名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['okc:docPro:add']"
+        >新增</el-button>
+      </el-col>
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['okc:docPro:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['okc:docPro:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['okc:docPro:export']"
+        >导出</el-button> -->
+      <!-- </el-col> -->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="docProList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="主键标识" align="center" prop="id" />
+      <el-table-column label="项目名称" align="center" prop="docName" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="数据状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.status"
+            active-value="00"
+            inactive-value="99"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+<!-- 
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.status" :value="scope.row.status"/>
+        </template> -->
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['okc:docPro:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['okc:docPro:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改模板项目对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="项目名称" prop="docName">
+          <el-input v-model="form.docName" placeholder="请输入项目名称" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+        <!-- <el-form-item label="数据状态" prop="status">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in dict.type.status"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item> -->
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listDocPro, getDocPro, delDocPro, addDocPro, updateDocPro, changeDocStatus } from "@/api/okc/docPro";
+
+export default {
+  name: "DocPro",
+  dicts: ['status'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 模板项目表格数据
+      docProList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        docName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        docName: [
+          { required: true, message: "项目名称不能为空", trigger: "blur" }
+        ],
+        status: [
+          { required: true, message: "数据状态不能为空", trigger: "change" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    // 模板项目状态修改
+    handleStatusChange(row) {
+      let text = row.status === "0" ? "启用" : "停用";
+      this.$modal.confirm('确认要"' + text + '""' + row.docName + '"项目吗?').then(function() {
+        return changeDocStatus(row.id, row.status);
+      }).then(() => {
+        this.$modal.msgSuccess(text + "成功");
+      }).catch(function() {
+        row.status = row.status === "0" ? "1" : "0";
+      });
+    },
+    /** 查询模板项目列表 */
+    getList() {
+      this.loading = true;
+      listDocPro(this.queryParams).then(response => {
+        this.docProList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        docName: null,
+        remark: null,
+        createTimeStr: null,
+        createUserId: null,
+        createBy: null,
+        createUserType: null,
+        createUnit: null,
+        createUnitName: null,
+        updateTimeStr: null,
+        updateUserId: null,
+        updateBy: null,
+        updateUnit: null,
+        updateUnitName: null,
+        status: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加模板项目";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getDocPro(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改模板项目";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateDocPro(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addDocPro(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除模板项目编号为"' + ids + '"的数据项?').then(function() {
+        return delDocPro(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('okc/docPro/export', {
+        ...this.queryParams
+      }, `docPro_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 329 - 0
ruoyi-ui/src/views/okc/docTree/index.vue

@@ -0,0 +1,329 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="项目模板" prop="docId">
+        <BizDict :parmar="docParam" :value="queryParams.docId" @changeData="changDoc" :isCoom="true" :isLoding="false">
+        </BizDict>
+      </el-form-item>
+
+      <el-form-item label="标题名称" prop="treeName">
+        <el-input
+          v-model="queryParams.treeName"
+          placeholder="请输入标题名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+	    <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['okc:docTree:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-sort"
+          size="mini"
+          @click="toggleExpandAll"
+        >展开/折叠</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table
+      v-if="refreshTable"
+      v-loading="loading"
+      :data="docTreeList"
+      row-key="id"
+      :default-expand-all="isExpandAll"
+      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+      <el-table-column label="标题名称" align="center" prop="treeName" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="数据状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.status" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['okc:docTree:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-plus"
+            @click="handleAdd(scope.row)"
+            v-hasPermi="['okc:docTree:add']"
+          >新增</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['okc:docTree:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 添加或修改模板标题树对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="父节点" prop="parentId">
+          <treeselect v-model="form.parentId" :options="docTreeOptions" :normalizer="normalizer" placeholder="请选择父主键标识" />
+        </el-form-item>
+        <el-form-item label="模板主键标识" prop="docId" style="display:none">
+          <el-input v-model="form.docId" placeholder="请输入模板主键标识" />
+        </el-form-item>
+        <el-form-item label="标题名称" prop="treeName">
+          <el-input v-model="form.treeName" placeholder="请输入标题名称" />
+        </el-form-item>
+        <el-form-item label="显示顺序" prop="orderNum">
+          <el-input v-model="form.orderNum" placeholder="请输入显示顺序" />
+        </el-form-item>
+        <el-form-item label="内容">
+          <editor v-model="form.content" :min-height="192"/>
+        </el-form-item>
+        <el-form-item label="标题样式" prop="css" style="display:none">
+          <el-input v-model="form.css" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+        <!-- <el-form-item label="数据状态" prop="status">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in dict.type.status"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item> -->
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listDocTree, getDocTree, delDocTree, addDocTree, updateDocTree } from "@/api/okc/docTree";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "DocTree",
+  dicts: ['status'],
+  components: {
+    Treeselect
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 模板标题树表格数据
+      docTreeList: [],
+      // 模板标题树树选项
+      docTreeOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 是否展开,默认全部展开
+      isExpandAll: true,
+      // 重新渲染表格状态
+      refreshTable: true,
+      // 查询参数
+      queryParams: {
+        treeName: null,
+        docId: null,
+      },
+      docParam: {
+        dictType: "docPro",
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        parentId: [
+          { required: true, message: "父主键标识不能为空", trigger: "blur" }
+        ],
+        docId: [
+          { required: true, message: "模板主键标识不能为空", trigger: "blur" }
+        ],
+        treeName: [
+          { required: true, message: "标题名称不能为空", trigger: "blur" }
+        ],
+        status: [
+          { required: true, message: "数据状态不能为空", trigger: "change" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询模板标题树列表 */
+    getList() {
+      this.loading = true;
+      listDocTree(this.queryParams).then(response => {
+        this.docTreeList = this.handleTree(response.data, "id", "parentId");
+        this.loading = false;
+      });
+    },
+    /** 转换模板标题树数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.treeName,
+        children: node.children
+      };
+    },
+	/** 查询模板标题树下拉树结构 */
+    getTreeselect() {
+      listDocTree().then(response => {
+        this.docTreeOptions = [];
+        const data = { id: 0, treeName: '顶级节点', children: [] };
+        data.children = this.handleTree(response.data, "id", "parentId");
+        this.docTreeOptions.push(data);
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        parentId: null,
+        docId: null,
+        treeName: null,
+        orderNum: null,
+        ancestors: null,
+        content: null,
+        css: null,
+        remark: null,
+        createTimeStr: null,
+        createUserId: null,
+        createBy: null,
+        createUserType: null,
+        createUnit: null,
+        createUnitName: null,
+        updateTimeStr: null,
+        updateUserId: null,
+        updateBy: null,
+        updateUnit: null,
+        updateUnitName: null,
+        status: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd(row) {
+      this.reset();
+      this.getTreeselect();
+      if (row != null && row.id) {
+        this.form.parentId = row.id;
+      } else {
+        this.form.parentId = 0;
+      }
+      this.open = true;
+      this.title = "添加模板标题树";
+    },
+    /** 展开/折叠操作 */
+    toggleExpandAll() {
+      this.refreshTable = false;
+      this.isExpandAll = !this.isExpandAll;
+      this.$nextTick(() => {
+        this.refreshTable = true;
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.getTreeselect();
+      if (row != null) {
+        this.form.parentId = row.id;
+      }
+      getDocTree(row.id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改模板标题树";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      if (!this.form.docId) {
+        this.form.docId = this.queryParams.docId;
+      }
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateDocTree(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addDocTree(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    changDoc(id, data) {
+      this.queryParams.docId = id;
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      this.$modal.confirm('是否确认删除模板标题树编号为"' + row.id + '"的数据项?').then(function() {
+        return delDocTree(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    }
+  }
+};
+</script>