Browse Source

- 章节模板表基础功能
- 问卷模板表基础功能

wangggziwen 10 months ago
parent
commit
a0f2b036cf
21 changed files with 1851 additions and 17 deletions
  1. 123 0
      rc-admin/src/main/java/com/ruoyi/web/controller/rc/TChapterTemplateController.java
  2. 129 0
      rc-admin/src/main/java/com/ruoyi/web/controller/rc/TQuestionnaireTemplateController.java
  3. 1 1
      rc-admin/src/main/resources/application.yml
  4. 90 0
      rc-buisness/src/main/java/com/ruoyi/rc/domain/TChapterTemplate.java
  5. 142 0
      rc-buisness/src/main/java/com/ruoyi/rc/domain/TQuestionnaireTemplate.java
  6. 61 0
      rc-buisness/src/main/java/com/ruoyi/rc/mapper/TChapterTemplateMapper.java
  7. 61 0
      rc-buisness/src/main/java/com/ruoyi/rc/mapper/TQuestionnaireTemplateMapper.java
  8. 61 0
      rc-buisness/src/main/java/com/ruoyi/rc/service/ITChapterTemplateService.java
  9. 61 0
      rc-buisness/src/main/java/com/ruoyi/rc/service/ITQuestionnaireTemplateService.java
  10. 93 0
      rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TChapterTemplateServiceImpl.java
  11. 93 0
      rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TQuestionnaireTemplateServiceImpl.java
  12. 66 0
      rc-buisness/src/main/resources/mapper/rc/TChapterTemplateMapper.xml
  13. 85 0
      rc-buisness/src/main/resources/mapper/rc/TQuestionnaireTemplateMapper.xml
  14. 53 0
      ruoyi-ui/src/api/rc/chaptertemplate.js
  15. 44 0
      ruoyi-ui/src/api/rc/questionnairetemplate.js
  16. 0 8
      ruoyi-ui/src/layout/components/Navbar.vue
  17. 287 0
      ruoyi-ui/src/views/rc/chaptertemplate/index.vue
  18. 11 7
      ruoyi-ui/src/views/rc/openitem/index.vue
  19. 365 0
      ruoyi-ui/src/views/rc/questionnairetemplate/index.vue
  20. 1 1
      ruoyi-ui/vue.config.js
  21. 24 0
      sql/create.sql

+ 123 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TChapterTemplateController.java

@@ -0,0 +1,123 @@
+package com.ruoyi.web.controller.rc;
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.system.service.ISysDeptService;
+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.rc.domain.TChapterTemplate;
+import com.ruoyi.rc.service.ITChapterTemplateService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.StringUtils;
+
+/**
+ * 章节模板Controller
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+@RestController
+@RequestMapping("/rc/chaptertemplate")
+public class TChapterTemplateController extends BaseController
+{
+    @Autowired
+    private ITChapterTemplateService tChapterTemplateService;
+
+    @Autowired
+    private ISysDeptService deptService;
+
+    /**
+     * 查询全部章节模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chaptertemplate:list')")
+    @GetMapping("/listAll")
+    public AjaxResult listAll(TChapterTemplate tChapterTemplate)
+    {
+        return success(tChapterTemplateService.selectTChapterTemplateList(tChapterTemplate));
+    }
+
+    /**
+     * 查询章节模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chaptertemplate:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TChapterTemplate tChapterTemplate)
+    {
+        startPage();
+        List<TChapterTemplate> list = tChapterTemplateService.selectTChapterTemplateList(tChapterTemplate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出章节模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chaptertemplate:export')")
+    @Log(title = "章节模板", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TChapterTemplate tChapterTemplate)
+    {
+        List<TChapterTemplate> list = tChapterTemplateService.selectTChapterTemplateList(tChapterTemplate);
+        ExcelUtil<TChapterTemplate> util = new ExcelUtil<TChapterTemplate>(TChapterTemplate.class);
+        util.exportExcel(response, list, "章节模板数据");
+    }
+
+    /**
+     * 获取章节模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chaptertemplate:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tChapterTemplateService.selectTChapterTemplateById(id));
+    }
+
+    /**
+     * 新增章节模板
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chaptertemplate:add')")
+    @Log(title = "章节模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TChapterTemplate tChapterTemplate)
+    {
+        if (StringUtils.isNull(tChapterTemplate.getDeptId()) || "".equals(tChapterTemplate.getDeptId())) {
+            tChapterTemplate.setDeptId(getLoginUser().getDeptId().toString());
+        }
+        return toAjax(tChapterTemplateService.insertTChapterTemplate(tChapterTemplate));
+    }
+
+    /**
+     * 修改章节模板
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chaptertemplate:edit')")
+    @Log(title = "章节模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TChapterTemplate tChapterTemplate)
+    {
+        return toAjax(tChapterTemplateService.updateTChapterTemplate(tChapterTemplate));
+    }
+
+    /**
+     * 删除章节模板
+     */
+    @PreAuthorize("@ss.hasPermi('rc:chaptertemplate:remove')")
+    @Log(title = "章节模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tChapterTemplateService.deleteTChapterTemplateByIds(ids));
+    }
+}

+ 129 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TQuestionnaireTemplateController.java

@@ -0,0 +1,129 @@
+package com.ruoyi.web.controller.rc;
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.system.service.ISysDeptService;
+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.rc.domain.TQuestionnaireTemplate;
+import com.ruoyi.rc.service.ITQuestionnaireTemplateService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.StringUtils;
+
+/**
+ * 问卷模板Controller
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+@RestController
+@RequestMapping("/rc/questionnairetemplate")
+public class TQuestionnaireTemplateController extends BaseController
+{
+    @Autowired
+    private ITQuestionnaireTemplateService tQuestionnaireTemplateService;
+
+    @Autowired
+    private ISysDeptService deptService;
+
+    /**
+     * 查询问卷模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnairetemplate:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TQuestionnaireTemplate tQuestionnaireTemplate)
+    {
+        startPage();
+        List<TQuestionnaireTemplate> list = tQuestionnaireTemplateService.selectTQuestionnaireTemplateList(tQuestionnaireTemplate);
+        for (TQuestionnaireTemplate obj : list) {
+            String deptId = obj.getDeptId();
+            if (StringUtils.isNotEmpty(deptId)) {
+                if (deptId.indexOf(",") != -1) {
+                    StringBuffer sb = new StringBuffer();
+                    String[] ids = deptId.split(",");
+                    for (String id : ids) {
+                        SysDept sysDept = deptService.selectDeptById(Long.parseLong(id));
+                        sb.append(sysDept.getDeptName()).append(" / ");
+                    }
+                    obj.setDeptName(sb.toString().substring(0, sb.length() - 3));
+                } else {
+                    obj.setDeptName(deptService.selectDeptById(Long.parseLong(deptId)).getDeptName());
+                }
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出问卷模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnairetemplate:export')")
+    @Log(title = "问卷模板", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TQuestionnaireTemplate tQuestionnaireTemplate)
+    {
+        List<TQuestionnaireTemplate> list = tQuestionnaireTemplateService.selectTQuestionnaireTemplateList(tQuestionnaireTemplate);
+        ExcelUtil<TQuestionnaireTemplate> util = new ExcelUtil<TQuestionnaireTemplate>(TQuestionnaireTemplate.class);
+        util.exportExcel(response, list, "问卷模板数据");
+    }
+
+    /**
+     * 获取问卷模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnairetemplate:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tQuestionnaireTemplateService.selectTQuestionnaireTemplateById(id));
+    }
+
+    /**
+     * 新增问卷模板
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnairetemplate:add')")
+    @Log(title = "问卷模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TQuestionnaireTemplate tQuestionnaireTemplate)
+    {
+        if (StringUtils.isNull(tQuestionnaireTemplate.getDeptId()) || "".equals(tQuestionnaireTemplate.getDeptId())) {
+            tQuestionnaireTemplate.setDeptId(getLoginUser().getDeptId().toString());
+        }
+        return toAjax(tQuestionnaireTemplateService.insertTQuestionnaireTemplate(tQuestionnaireTemplate));
+    }
+
+    /**
+     * 修改问卷模板
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnairetemplate:edit')")
+    @Log(title = "问卷模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TQuestionnaireTemplate tQuestionnaireTemplate)
+    {
+        return toAjax(tQuestionnaireTemplateService.updateTQuestionnaireTemplate(tQuestionnaireTemplate));
+    }
+
+    /**
+     * 删除问卷模板
+     */
+    @PreAuthorize("@ss.hasPermi('rc:questionnairetemplate:remove')")
+    @Log(title = "问卷模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tQuestionnaireTemplateService.deleteTQuestionnaireTemplateByIds(ids));
+    }
+}

+ 1 - 1
rc-admin/src/main/resources/application.yml

@@ -16,7 +16,7 @@ ruoyi:
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080
-  port: 8080
+  port: 8081
   servlet:
     # 应用的访问路径
     context-path: /

+ 90 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TChapterTemplate.java

@@ -0,0 +1,90 @@
+package com.ruoyi.rc.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;
+
+/**
+ * 章节模板对象 t_chapter_template
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+public class TChapterTemplate extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 序号 */
+    @Excel(name = "序号")
+    private String code;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** 装置id */
+    @Excel(name = "装置id")
+    private String deptId;
+
+    /** 装置 */
+    @Excel(name = "装置")
+    private String deptName;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setCode(String code) 
+    {
+        this.code = code;
+    }
+
+    public String getCode() 
+    {
+        return code;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setDeptId(String deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public String getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("code", getCode())
+            .append("name", getName())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 142 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TQuestionnaireTemplate.java

@@ -0,0 +1,142 @@
+package com.ruoyi.rc.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;
+
+/**
+ * 问卷模板对象 t_questionnaire_template
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+public class TQuestionnaireTemplate extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 章节id */
+    @Excel(name = "章节id")
+    private Long chapterId;
+
+    private String chapterName;
+
+    /** 问卷类型 */
+    @Excel(name = "问卷类型")
+    private String type;
+
+    /** 目录 */
+    @Excel(name = "目录")
+    private String directory;
+
+    /** 序号 */
+    @Excel(name = "序号")
+    private Long code;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** 装置id */
+    @Excel(name = "装置id")
+    private String deptId;
+
+    /** 装置 */
+    @Excel(name = "装置")
+    private String deptName;
+
+    public String getChapterName() {
+        return chapterName;
+    }
+
+    public void setChapterName(String chapterName) {
+        this.chapterName = chapterName;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setChapterId(Long chapterId) 
+    {
+        this.chapterId = chapterId;
+    }
+
+    public Long getChapterId() 
+    {
+        return chapterId;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+    public void setDirectory(String directory) 
+    {
+        this.directory = directory;
+    }
+
+    public String getDirectory() 
+    {
+        return directory;
+    }
+    public void setCode(Long code) 
+    {
+        this.code = code;
+    }
+
+    public Long getCode() 
+    {
+        return code;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setDeptId(String deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public String getDeptId() 
+    {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("chapterId", getChapterId())
+            .append("type", getType())
+            .append("directory", getDirectory())
+            .append("code", getCode())
+            .append("name", getName())
+            .append("deptId", getDeptId())
+            .toString();
+    }
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/mapper/TChapterTemplateMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.mapper;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TChapterTemplate;
+
+/**
+ * 章节模板Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+public interface TChapterTemplateMapper 
+{
+    /**
+     * 查询章节模板
+     * 
+     * @param id 章节模板主键
+     * @return 章节模板
+     */
+    public TChapterTemplate selectTChapterTemplateById(Long id);
+
+    /**
+     * 查询章节模板列表
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 章节模板集合
+     */
+    public List<TChapterTemplate> selectTChapterTemplateList(TChapterTemplate tChapterTemplate);
+
+    /**
+     * 新增章节模板
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 结果
+     */
+    public int insertTChapterTemplate(TChapterTemplate tChapterTemplate);
+
+    /**
+     * 修改章节模板
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 结果
+     */
+    public int updateTChapterTemplate(TChapterTemplate tChapterTemplate);
+
+    /**
+     * 删除章节模板
+     * 
+     * @param id 章节模板主键
+     * @return 结果
+     */
+    public int deleteTChapterTemplateById(Long id);
+
+    /**
+     * 批量删除章节模板
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTChapterTemplateByIds(Long[] ids);
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/mapper/TQuestionnaireTemplateMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.mapper;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TQuestionnaireTemplate;
+
+/**
+ * 问卷模板Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+public interface TQuestionnaireTemplateMapper 
+{
+    /**
+     * 查询问卷模板
+     * 
+     * @param id 问卷模板主键
+     * @return 问卷模板
+     */
+    public TQuestionnaireTemplate selectTQuestionnaireTemplateById(Long id);
+
+    /**
+     * 查询问卷模板列表
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 问卷模板集合
+     */
+    public List<TQuestionnaireTemplate> selectTQuestionnaireTemplateList(TQuestionnaireTemplate tQuestionnaireTemplate);
+
+    /**
+     * 新增问卷模板
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 结果
+     */
+    public int insertTQuestionnaireTemplate(TQuestionnaireTemplate tQuestionnaireTemplate);
+
+    /**
+     * 修改问卷模板
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 结果
+     */
+    public int updateTQuestionnaireTemplate(TQuestionnaireTemplate tQuestionnaireTemplate);
+
+    /**
+     * 删除问卷模板
+     * 
+     * @param id 问卷模板主键
+     * @return 结果
+     */
+    public int deleteTQuestionnaireTemplateById(Long id);
+
+    /**
+     * 批量删除问卷模板
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTQuestionnaireTemplateByIds(Long[] ids);
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/ITChapterTemplateService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.service;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TChapterTemplate;
+
+/**
+ * 章节模板Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+public interface ITChapterTemplateService 
+{
+    /**
+     * 查询章节模板
+     * 
+     * @param id 章节模板主键
+     * @return 章节模板
+     */
+    public TChapterTemplate selectTChapterTemplateById(Long id);
+
+    /**
+     * 查询章节模板列表
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 章节模板集合
+     */
+    public List<TChapterTemplate> selectTChapterTemplateList(TChapterTemplate tChapterTemplate);
+
+    /**
+     * 新增章节模板
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 结果
+     */
+    public int insertTChapterTemplate(TChapterTemplate tChapterTemplate);
+
+    /**
+     * 修改章节模板
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 结果
+     */
+    public int updateTChapterTemplate(TChapterTemplate tChapterTemplate);
+
+    /**
+     * 批量删除章节模板
+     * 
+     * @param ids 需要删除的章节模板主键集合
+     * @return 结果
+     */
+    public int deleteTChapterTemplateByIds(Long[] ids);
+
+    /**
+     * 删除章节模板信息
+     * 
+     * @param id 章节模板主键
+     * @return 结果
+     */
+    public int deleteTChapterTemplateById(Long id);
+}

+ 61 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/ITQuestionnaireTemplateService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.rc.service;
+
+import java.util.List;
+import com.ruoyi.rc.domain.TQuestionnaireTemplate;
+
+/**
+ * 问卷模板Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+public interface ITQuestionnaireTemplateService 
+{
+    /**
+     * 查询问卷模板
+     * 
+     * @param id 问卷模板主键
+     * @return 问卷模板
+     */
+    public TQuestionnaireTemplate selectTQuestionnaireTemplateById(Long id);
+
+    /**
+     * 查询问卷模板列表
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 问卷模板集合
+     */
+    public List<TQuestionnaireTemplate> selectTQuestionnaireTemplateList(TQuestionnaireTemplate tQuestionnaireTemplate);
+
+    /**
+     * 新增问卷模板
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 结果
+     */
+    public int insertTQuestionnaireTemplate(TQuestionnaireTemplate tQuestionnaireTemplate);
+
+    /**
+     * 修改问卷模板
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 结果
+     */
+    public int updateTQuestionnaireTemplate(TQuestionnaireTemplate tQuestionnaireTemplate);
+
+    /**
+     * 批量删除问卷模板
+     * 
+     * @param ids 需要删除的问卷模板主键集合
+     * @return 结果
+     */
+    public int deleteTQuestionnaireTemplateByIds(Long[] ids);
+
+    /**
+     * 删除问卷模板信息
+     * 
+     * @param id 问卷模板主键
+     * @return 结果
+     */
+    public int deleteTQuestionnaireTemplateById(Long id);
+}

+ 93 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TChapterTemplateServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.rc.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.rc.mapper.TChapterTemplateMapper;
+import com.ruoyi.rc.domain.TChapterTemplate;
+import com.ruoyi.rc.service.ITChapterTemplateService;
+
+/**
+ * 章节模板Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+@Service
+public class TChapterTemplateServiceImpl implements ITChapterTemplateService 
+{
+    @Autowired
+    private TChapterTemplateMapper tChapterTemplateMapper;
+
+    /**
+     * 查询章节模板
+     * 
+     * @param id 章节模板主键
+     * @return 章节模板
+     */
+    @Override
+    public TChapterTemplate selectTChapterTemplateById(Long id)
+    {
+        return tChapterTemplateMapper.selectTChapterTemplateById(id);
+    }
+
+    /**
+     * 查询章节模板列表
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 章节模板
+     */
+    @Override
+    public List<TChapterTemplate> selectTChapterTemplateList(TChapterTemplate tChapterTemplate)
+    {
+        return tChapterTemplateMapper.selectTChapterTemplateList(tChapterTemplate);
+    }
+
+    /**
+     * 新增章节模板
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 结果
+     */
+    @Override
+    public int insertTChapterTemplate(TChapterTemplate tChapterTemplate)
+    {
+        return tChapterTemplateMapper.insertTChapterTemplate(tChapterTemplate);
+    }
+
+    /**
+     * 修改章节模板
+     * 
+     * @param tChapterTemplate 章节模板
+     * @return 结果
+     */
+    @Override
+    public int updateTChapterTemplate(TChapterTemplate tChapterTemplate)
+    {
+        return tChapterTemplateMapper.updateTChapterTemplate(tChapterTemplate);
+    }
+
+    /**
+     * 批量删除章节模板
+     * 
+     * @param ids 需要删除的章节模板主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTChapterTemplateByIds(Long[] ids)
+    {
+        return tChapterTemplateMapper.deleteTChapterTemplateByIds(ids);
+    }
+
+    /**
+     * 删除章节模板信息
+     * 
+     * @param id 章节模板主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTChapterTemplateById(Long id)
+    {
+        return tChapterTemplateMapper.deleteTChapterTemplateById(id);
+    }
+}

+ 93 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TQuestionnaireTemplateServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.rc.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.rc.mapper.TQuestionnaireTemplateMapper;
+import com.ruoyi.rc.domain.TQuestionnaireTemplate;
+import com.ruoyi.rc.service.ITQuestionnaireTemplateService;
+
+/**
+ * 问卷模板Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-07-31
+ */
+@Service
+public class TQuestionnaireTemplateServiceImpl implements ITQuestionnaireTemplateService 
+{
+    @Autowired
+    private TQuestionnaireTemplateMapper tQuestionnaireTemplateMapper;
+
+    /**
+     * 查询问卷模板
+     * 
+     * @param id 问卷模板主键
+     * @return 问卷模板
+     */
+    @Override
+    public TQuestionnaireTemplate selectTQuestionnaireTemplateById(Long id)
+    {
+        return tQuestionnaireTemplateMapper.selectTQuestionnaireTemplateById(id);
+    }
+
+    /**
+     * 查询问卷模板列表
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 问卷模板
+     */
+    @Override
+    public List<TQuestionnaireTemplate> selectTQuestionnaireTemplateList(TQuestionnaireTemplate tQuestionnaireTemplate)
+    {
+        return tQuestionnaireTemplateMapper.selectTQuestionnaireTemplateList(tQuestionnaireTemplate);
+    }
+
+    /**
+     * 新增问卷模板
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 结果
+     */
+    @Override
+    public int insertTQuestionnaireTemplate(TQuestionnaireTemplate tQuestionnaireTemplate)
+    {
+        return tQuestionnaireTemplateMapper.insertTQuestionnaireTemplate(tQuestionnaireTemplate);
+    }
+
+    /**
+     * 修改问卷模板
+     * 
+     * @param tQuestionnaireTemplate 问卷模板
+     * @return 结果
+     */
+    @Override
+    public int updateTQuestionnaireTemplate(TQuestionnaireTemplate tQuestionnaireTemplate)
+    {
+        return tQuestionnaireTemplateMapper.updateTQuestionnaireTemplate(tQuestionnaireTemplate);
+    }
+
+    /**
+     * 批量删除问卷模板
+     * 
+     * @param ids 需要删除的问卷模板主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTQuestionnaireTemplateByIds(Long[] ids)
+    {
+        return tQuestionnaireTemplateMapper.deleteTQuestionnaireTemplateByIds(ids);
+    }
+
+    /**
+     * 删除问卷模板信息
+     * 
+     * @param id 问卷模板主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTQuestionnaireTemplateById(Long id)
+    {
+        return tQuestionnaireTemplateMapper.deleteTQuestionnaireTemplateById(id);
+    }
+}

+ 66 - 0
rc-buisness/src/main/resources/mapper/rc/TChapterTemplateMapper.xml

@@ -0,0 +1,66 @@
+<?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.rc.mapper.TChapterTemplateMapper">
+    
+    <resultMap type="TChapterTemplate" id="TChapterTemplateResult">
+        <result property="id"    column="id"    />
+        <result property="code"    column="code"    />
+        <result property="name"    column="name"    />
+        <result property="deptId"    column="dept_id"    />
+    </resultMap>
+
+    <sql id="selectTChapterTemplateVo">
+        select id, code, name, dept_id from t_chapter_template
+    </sql>
+
+    <select id="selectTChapterTemplateList" parameterType="TChapterTemplate" resultMap="TChapterTemplateResult">
+        <include refid="selectTChapterTemplateVo"/>
+        <where>  
+            <if test="code != null  and code != ''"> and code = #{code}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
+        </where>
+    </select>
+    
+    <select id="selectTChapterTemplateById" parameterType="Long" resultMap="TChapterTemplateResult">
+        <include refid="selectTChapterTemplateVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTChapterTemplate" parameterType="TChapterTemplate" useGeneratedKeys="true" keyProperty="id">
+        insert into t_chapter_template
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="code != null">code,</if>
+            <if test="name != null">name,</if>
+            <if test="deptId != null">dept_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="code != null">#{code},</if>
+            <if test="name != null">#{name},</if>
+            <if test="deptId != null">#{deptId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTChapterTemplate" parameterType="TChapterTemplate">
+        update t_chapter_template
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="code != null">code = #{code},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTChapterTemplateById" parameterType="Long">
+        delete from t_chapter_template where id = #{id}
+    </delete>
+
+    <delete id="deleteTChapterTemplateByIds" parameterType="String">
+        delete from t_chapter_template where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 85 - 0
rc-buisness/src/main/resources/mapper/rc/TQuestionnaireTemplateMapper.xml

@@ -0,0 +1,85 @@
+<?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.rc.mapper.TQuestionnaireTemplateMapper">
+    
+    <resultMap type="TQuestionnaireTemplate" id="TQuestionnaireTemplateResult">
+        <result property="id"    column="id"    />
+        <result property="chapterId"    column="chapter_id"    />
+        <result property="type"    column="type"    />
+        <result property="directory"    column="directory"    />
+        <result property="code"    column="code"    />
+        <result property="name"    column="name"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="chapterName"    column="chapter_name"    />
+    </resultMap>
+
+    <sql id="selectTQuestionnaireTemplateVo">
+        select qt.id, qt.chapter_id, qt.type, qt.directory, qt.code, qt.name, qt.dept_id, ct.name as chapter_name
+        from t_questionnaire_template qt
+        left join t_chapter_template ct
+        on qt.chapter_id=ct.id
+    </sql>
+
+    <select id="selectTQuestionnaireTemplateList" parameterType="TQuestionnaireTemplate" resultMap="TQuestionnaireTemplateResult">
+        <include refid="selectTQuestionnaireTemplateVo"/>
+        <where>  
+            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="directory != null  and directory != ''"> and directory = #{directory}</if>
+            <if test="code != null "> and code = #{code}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
+        </where>
+    </select>
+    
+    <select id="selectTQuestionnaireTemplateById" parameterType="Long" resultMap="TQuestionnaireTemplateResult">
+        <include refid="selectTQuestionnaireTemplateVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTQuestionnaireTemplate" parameterType="TQuestionnaireTemplate" useGeneratedKeys="true" keyProperty="id">
+        insert into t_questionnaire_template
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="chapterId != null">chapter_id,</if>
+            <if test="type != null">type,</if>
+            <if test="directory != null">directory,</if>
+            <if test="code != null">code,</if>
+            <if test="name != null">name,</if>
+            <if test="deptId != null">dept_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="chapterId != null">#{chapterId},</if>
+            <if test="type != null">#{type},</if>
+            <if test="directory != null">#{directory},</if>
+            <if test="code != null">#{code},</if>
+            <if test="name != null">#{name},</if>
+            <if test="deptId != null">#{deptId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTQuestionnaireTemplate" parameterType="TQuestionnaireTemplate">
+        update t_questionnaire_template
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="chapterId != null">chapter_id = #{chapterId},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="directory != null">directory = #{directory},</if>
+            <if test="code != null">code = #{code},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTQuestionnaireTemplateById" parameterType="Long">
+        delete from t_questionnaire_template where id = #{id}
+    </delete>
+
+    <delete id="deleteTQuestionnaireTemplateByIds" parameterType="String">
+        delete from t_questionnaire_template where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 53 - 0
ruoyi-ui/src/api/rc/chaptertemplate.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询全部章节模板列表
+export function listAllChaptertemplate(query) {
+  return request({
+    url: '/rc/chaptertemplate/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询章节模板列表
+export function listChaptertemplate(query) {
+  return request({
+    url: '/rc/chaptertemplate/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询章节模板详细
+export function getChaptertemplate(id) {
+  return request({
+    url: '/rc/chaptertemplate/' + id,
+    method: 'get'
+  })
+}
+
+// 新增章节模板
+export function addChaptertemplate(data) {
+  return request({
+    url: '/rc/chaptertemplate',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改章节模板
+export function updateChaptertemplate(data) {
+  return request({
+    url: '/rc/chaptertemplate',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除章节模板
+export function delChaptertemplate(id) {
+  return request({
+    url: '/rc/chaptertemplate/' + id,
+    method: 'delete'
+  })
+}

+ 44 - 0
ruoyi-ui/src/api/rc/questionnairetemplate.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询问卷模板列表
+export function listQuestionnairetemplate(query) {
+  return request({
+    url: '/rc/questionnairetemplate/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询问卷模板详细
+export function getQuestionnairetemplate(id) {
+  return request({
+    url: '/rc/questionnairetemplate/' + id,
+    method: 'get'
+  })
+}
+
+// 新增问卷模板
+export function addQuestionnairetemplate(data) {
+  return request({
+    url: '/rc/questionnairetemplate',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改问卷模板
+export function updateQuestionnairetemplate(data) {
+  return request({
+    url: '/rc/questionnairetemplate',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除问卷模板
+export function delQuestionnairetemplate(id) {
+  return request({
+    url: '/rc/questionnairetemplate/' + id,
+    method: 'delete'
+  })
+}

+ 0 - 8
ruoyi-ui/src/layout/components/Navbar.vue

@@ -9,14 +9,6 @@
       <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
 
-        <el-tooltip content="源码地址" effect="dark" placement="bottom">
-          <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
-        </el-tooltip>
-
-        <el-tooltip content="文档地址" effect="dark" placement="bottom">
-          <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
-        </el-tooltip>
-
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
 
         <el-tooltip content="布局大小" effect="dark" placement="bottom">

+ 287 - 0
ruoyi-ui/src/views/rc/chaptertemplate/index.vue

@@ -0,0 +1,287 @@
+<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="code">
+        <el-input
+          v-model="queryParams.code"
+          placeholder="请输入序号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          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="['rc:chaptertemplate: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="['rc:chaptertemplate: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="['rc:chaptertemplate: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="['rc:chaptertemplate:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="chaptertemplateList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="序号" align="center" prop="code" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="操作" align="center" width="120" fixed="right" 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="['rc:chaptertemplate:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['rc:chaptertemplate: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="code">
+          <el-input v-model="form.code" placeholder="请输入序号" />
+        </el-form-item>
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" type="textarea" placeholder="请输入内容" />
+        </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 { listChaptertemplate, getChaptertemplate, delChaptertemplate, addChaptertemplate, updateChaptertemplate } from "@/api/rc/chaptertemplate";
+import { listDept } from "@/api/system/dept";
+
+export default {
+  name: "Chaptertemplate",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 章节模板表格数据
+      chaptertemplateList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        name: null,
+        deptId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      // 装置列表
+      deptOptions: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getDeptList();
+  },
+  methods: {
+    /** 查询章节模板列表 */
+    getList() {
+      this.loading = true;
+      listChaptertemplate(this.queryParams).then(response => {
+        this.chaptertemplateList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 查询装置列表 */
+    getDeptList() {
+      listDept().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          // 非顶级节点
+          if (data[i].parentId !== 0) {
+            // 插入装置列表
+            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId + ""});
+          }
+        }
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        code: null,
+        name: null,
+        deptId: 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
+      getChaptertemplate(id).then(response => {
+        // 字符串转数组
+        if (response.data.deptId != null && response.data.deptId != "") {
+            response.data.deptId = response.data.deptId.split(",").map(Number);
+        } else {
+            response.data.deptId = [];
+        }
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改章节模板";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // 数组转字符串
+          if (this.form.deptId != null) {
+              this.form.deptId = this.form.deptId.toString();
+          }
+          if (this.form.id != null) {
+            updateChaptertemplate(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addChaptertemplate(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 delChaptertemplate(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('rc/chaptertemplate/export', {
+        ...this.queryParams
+      }, `chaptertemplate_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 11 - 7
ruoyi-ui/src/views/rc/openitem/index.vue

@@ -157,29 +157,34 @@
 
     <el-table border v-loading="loading" :data="openitemList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="装置" align="center" prop="deptName" width="120"/>
       <el-table-column label="问题类型" align="center" prop="type">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.t_open_item_type" :value="scope.row.type"/>
         </template>
       </el-table-column>
       <el-table-column label="涉及整改code" align="center" prop="questionnaireId" />
-      <el-table-column label="存在问题描述" align="center" prop="description" />
+      <el-table-column label="存在问题描述" align="center" prop="description" width="200" />
       <el-table-column label="开项级别" align="center" prop="level">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.t_open_item_level" :value="scope.row.level"/>
         </template>
       </el-table-column>
-      <el-table-column label="开项时间" align="center" prop="openTime" width="180">
+      <el-table-column label="开项时间" align="center" prop="openTime" width="120">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.openTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="闭项时间" align="center" prop="closeTime" width="180">
+      <el-table-column label="闭项时间" align="center" prop="closeTime" width="120">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.closeTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="问题处理状态" align="center" prop="status" />
+      <el-table-column label="问题处理状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.t_open_item_status" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
       <el-table-column label="负责人" align="center" prop="personInChargeName" />
       <el-table-column label="审核人" align="center" prop="reviewerName" />
       <el-table-column label="责任人确认" align="center" prop="result">
@@ -187,13 +192,12 @@
           <dict-tag :options="dict.type.t_open_item_result" :value="scope.row.result"/>
         </template>
       </el-table-column>
-      <el-table-column label="截至时间" align="center" prop="deadline" width="180">
+      <el-table-column label="截至时间" align="center" prop="deadline" width="120">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.deadline, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="备注" align="center" prop="remarks" />
-      <el-table-column label="装置" align="center" prop="deptName" />
+      <el-table-column label="备注" align="center" prop="remarks" width="200"/>
       <el-table-column label="操作" align="center" width="120" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button

+ 365 - 0
ruoyi-ui/src/views/rc/questionnairetemplate/index.vue

@@ -0,0 +1,365 @@
+<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="chapterId">
+        <el-select clearable v-model="queryParams.chapterId" placeholder="请选择章节">
+          <el-option
+            v-for="dict in chapterTemplateOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="问卷类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择问卷类型" clearable>
+          <el-option
+            v-for="dict in dict.type.t_sec_sub_chap_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="目录" prop="directory">
+        <el-input
+          v-model="queryParams.directory"
+          placeholder="请输入目录"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="序号" prop="code">
+        <el-input
+          v-model="queryParams.code"
+          placeholder="请输入序号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          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="['rc:questionnairetemplate: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="['rc:questionnairetemplate: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="['rc:questionnairetemplate: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="['rc:questionnairetemplate:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="questionnairetemplateList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="章节" align="center" prop="chapterName" />
+      <el-table-column label="问卷类型" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.t_sec_sub_chap_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="目录" align="center" prop="directory" />
+      <el-table-column label="序号" align="center" prop="code" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="操作" align="center" width="120" fixed="right" 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="['rc:questionnairetemplate:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['rc:questionnairetemplate: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="chapterId">
+          <el-select clearable v-model="form.chapterId" placeholder="请选择章节">
+            <el-option
+              v-for="dict in chapterTemplateOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="问卷类型" prop="type">
+          <el-select v-model="form.type" placeholder="请选择问卷类型">
+            <el-option
+              v-for="dict in dict.type.t_sec_sub_chap_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="目录" prop="directory">
+          <el-input v-model="form.directory" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="序号" prop="code">
+          <el-input v-model="form.code" placeholder="请输入序号" />
+        </el-form-item>
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" type="textarea" placeholder="请输入内容" />
+        </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 { listQuestionnairetemplate, getQuestionnairetemplate, delQuestionnairetemplate, addQuestionnairetemplate, updateQuestionnairetemplate } from "@/api/rc/questionnairetemplate";
+import { listDept } from "@/api/system/dept";
+import { listAllChaptertemplate } from "@/api/rc/chaptertemplate";
+
+export default {
+  name: "Questionnairetemplate",
+  dicts: ['t_sec_sub_chap_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 问卷模板表格数据
+      questionnairetemplateList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        chapterId: null,
+        type: null,
+        directory: null,
+        code: null,
+        name: null,
+        deptId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      // 装置列表
+      deptOptions: [],
+      // 章节模板列表
+      chapterTemplateOptions: [],
+    };
+  },
+  created() {
+    this.getList();
+    this.getDeptList();
+    this.getChapterTemplateList();
+  },
+  methods: {
+    /** 查询问卷模板列表 */
+    getList() {
+      this.loading = true;
+      listQuestionnairetemplate(this.queryParams).then(response => {
+        this.questionnairetemplateList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 查询章节模板列表 */
+    getChapterTemplateList() {
+      listAllChaptertemplate().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          this.chapterTemplateOptions.push({"dictLabel": data[i].name, "dictValue": data[i].id + ""});
+        }
+      });
+    },
+    /** 查询装置列表 */
+    getDeptList() {
+      listDept().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          // 非顶级节点
+          if (data[i].parentId !== 0) {
+            // 插入装置列表
+            this.deptOptions.push({"dictLabel": data[i].deptName, "dictValue": data[i].deptId + ""});
+          }
+        }
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        chapterId: null,
+        type: null,
+        directory: null,
+        code: null,
+        name: null,
+        deptId: 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
+      getQuestionnairetemplate(id).then(response => {
+        // 字符串转数组
+        if (response.data.deptId != null && response.data.deptId != "") {
+            response.data.deptId = response.data.deptId.split(",").map(Number);
+        } else {
+            response.data.deptId = [];
+        }
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改问卷模板";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // 数组转字符串
+          if (this.form.deptId != null) {
+              this.form.deptId = this.form.deptId.toString();
+          }
+          if (this.form.id != null) {
+            updateQuestionnairetemplate(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addQuestionnairetemplate(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 delQuestionnairetemplate(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('rc/questionnairetemplate/export', {
+        ...this.queryParams
+      }, `questionnairetemplate_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 1 - 1
ruoyi-ui/vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:8080`,
+        target: `http://localhost:8081`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''

+ 24 - 0
sql/create.sql

@@ -35,6 +35,17 @@ create table t_chapter (
   primary key (id)
 ) engine=innodb auto_increment=100 comment = '章节表';
 
+-- ----------------------------
+-- 章节模板表
+-- ----------------------------
+create table t_chapter_template (
+  id                bigint(20)    comment 'id'  not null  auto_increment,
+  code              varchar(8)    comment '序号',
+  name              varchar(500)  comment '名称',
+  dept_id           varchar(255)  comment '装置id',
+  primary key (id)
+) engine=innodb auto_increment=100 comment = '章节模板表';
+
 -- ----------------------------
 -- 问卷表
 -- ----------------------------
@@ -59,6 +70,19 @@ create table t_questionnaire (
   primary key (id)
 ) engine=innodb auto_increment=100 comment = '问卷表';
 
+-- ----------------------------
+-- 问卷模板表
+-- ----------------------------
+create table t_questionnaire_template (
+  id                bigint(20)    comment 'id'  not null  auto_increment,
+  chapter_id        bigint(20)    comment '章节id',
+  type              char(1)       comment '问卷类型',
+  directory         varchar(500)  comment '目录',
+  code              bigint(20)    comment '序号',
+  name              varchar(500)  comment '名称',
+  dept_id           varchar(255)  comment '装置id',
+  primary key (id)
+) engine=innodb auto_increment=100 comment = '问卷模板表';
 
 -- ----------------------------
 -- 进度表