From 5424267bf7a953e87d150bb08419ea147b547ad2 Mon Sep 17 00:00:00 2001 From: zhanli <719901725@qq.com> Date: Sun, 14 Jul 2024 00:43:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E7=BA=BF=E5=90=88=E5=B9=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81v0.0.1=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysOssController.java | 6 +- .../workflow/WfProcessController.java | 40 +- .../ruoyi/common/core/domain/PageQuery.java | 10 + .../resources/mapper/demo/TestDemoMapper.xml | 1 - .../com/ruoyi/flowable/core/FormConf.java | 2 +- .../flowable/factory/FlowServiceFactory.java | 2 +- .../ProjectApplicationController.java | 108 + .../project/domain/ProjectApplication.java | 61 + .../domain/bo/ProjectApplicationBo.java | 76 + .../domain/vo/ProjectApplicationVo.java | 76 + .../mapper/ProjectApplicationMapper.java | 15 + .../service/IProjectApplicationService.java | 49 + .../impl/ProjectApplicationServiceImpl.java | 115 + .../ruoyi/workflow/domain/vo/WfDetailVo.java | 7 +- .../workflow/domain/vo/WfTaskInfoVo.java | 31 + .../workflow/service/IWfProcessService.java | 10 + .../service/impl/WfModelServiceImpl.java | 10 + .../service/impl/WfProcessServiceImpl.java | 184 +- .../project/ProjectApplicationMapper.xml | 19 + ruoyi-ui/package.json | 4 +- ruoyi-ui/src/api/project/application.js | 44 + ruoyi-ui/src/api/workflow/process.js | 25 + .../src/layout/components/Sidebar/Logo.vue | 2 +- ruoyi-ui/src/utils/generator/config.js | 36 + ruoyi-ui/src/utils/generator/parser.js | 29 +- .../src/views/project/application/index.vue | 395 ++ .../src/views/scientific/handbook_apply.vue | 117 + .../views/scientific/handbook_apply_bak.vue | 117 + .../src/views/scientific/handbook_query.vue | 412 +++ .../views/scientific/handbook_query_bak.vue | 472 +++ ruoyi-ui/src/views/tool/build/RightPanel.vue | 6 +- ruoyi-ui/src/views/tool/build/index.vue | 50 +- ruoyi-ui/src/views/workflow/model/index.vue | 12 +- ruoyi-ui/src/views/workflow/test/index.vue | 243 ++ ruoyi-ui/src/views/workflow/work/approval.vue | 326 ++ ruoyi-ui/src/views/workflow/work/detail.vue | 2 +- ruoyi-ui/src/views/workflow/work/index.vue | 47 +- ruoyi-ui/src/views/workflow/work/my_proj.vue | 309 ++ ruoyi-ui/src/views/workflow/work/own.vue | 37 +- ruoyi-ui/src/views/workflow/work/own_proj.vue | 300 ++ ruoyi-ui/src/views/workflow/work/plan.vue | 226 ++ ruoyi-ui/src/views/workflow/work/proj_app.vue | 318 ++ ruoyi-ui/src/views/workflow/work/start.vue | 7 +- script/sql/mysql/ry-flowable-plus-240703.sql | 3022 +++++++++++++++ script/sql/mysql/ry-flowable-plus-240709.sql | 3153 ++++++++++++++++ script/sql/mysql/ry-flowable-plus-240712.sql | 3251 +++++++++++++++++ script/sql/mysql/ry-flowable-plus-240714.sql | 3057 ++++++++++++++++ script/sql/mysql/ry-flowable-plus-jzq.sql | 2830 ++++++++++++++ 环境配置.md | 73 - 49 files changed, 19611 insertions(+), 133 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/project/controller/ProjectApplicationController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectApplication.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/project/domain/bo/ProjectApplicationBo.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/project/domain/vo/ProjectApplicationVo.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectApplicationMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/project/service/IProjectApplicationService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectApplicationServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfTaskInfoVo.java create mode 100644 ruoyi-system/src/main/resources/mapper/project/ProjectApplicationMapper.xml create mode 100644 ruoyi-ui/src/api/project/application.js create mode 100644 ruoyi-ui/src/views/project/application/index.vue create mode 100644 ruoyi-ui/src/views/scientific/handbook_apply.vue create mode 100644 ruoyi-ui/src/views/scientific/handbook_apply_bak.vue create mode 100644 ruoyi-ui/src/views/scientific/handbook_query.vue create mode 100644 ruoyi-ui/src/views/scientific/handbook_query_bak.vue create mode 100644 ruoyi-ui/src/views/workflow/test/index.vue create mode 100644 ruoyi-ui/src/views/workflow/work/approval.vue create mode 100644 ruoyi-ui/src/views/workflow/work/my_proj.vue create mode 100644 ruoyi-ui/src/views/workflow/work/own_proj.vue create mode 100644 ruoyi-ui/src/views/workflow/work/plan.vue create mode 100644 ruoyi-ui/src/views/workflow/work/proj_app.vue create mode 100644 script/sql/mysql/ry-flowable-plus-240703.sql create mode 100644 script/sql/mysql/ry-flowable-plus-240709.sql create mode 100644 script/sql/mysql/ry-flowable-plus-240712.sql create mode 100644 script/sql/mysql/ry-flowable-plus-240714.sql create mode 100644 script/sql/mysql/ry-flowable-plus-jzq.sql delete mode 100644 环境配置.md diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java index 2a7cc11..8d310fb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysOssController.java @@ -67,7 +67,8 @@ public class SysOssController extends BaseController { * * @param file 文件 */ - @SaCheckPermission("system:oss:upload") +// @SaCheckPermission("system:oss:upload") +// zqjia:这个权限校验打开的话普通用户无法上传文件,导致无法上传指南和申报书 @Log(title = "OSS对象存储", businessType = BusinessType.INSERT) @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public R> upload(@RequestPart("file") MultipartFile file) { @@ -87,7 +88,8 @@ public class SysOssController extends BaseController { * * @param ossId OSS对象ID */ - @SaCheckPermission("system:oss:download") + // @SaCheckPermission("system:oss:download") + // zqjia:这个权限校验打开的话普通用户无法下载文件,导致无法下载指南 @GetMapping("/download/{ossId}") public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException { iSysOssService.download(ossId,response); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java index 04f48ad..03219af 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java @@ -17,13 +17,17 @@ import com.ruoyi.workflow.service.IWfCopyService; import com.ruoyi.workflow.service.IWfProcessService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.Page; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; + /** * 工作流流程管理 * @@ -51,7 +55,7 @@ public class WfProcessController extends BaseController { } /** - * 我拥有的流程 + * 我拥有的流程: 这个地方挺奇怪的,这个不是单个表获取的信息 */ @SaCheckPermission("workflow:process:ownList") @GetMapping(value = "/ownList") @@ -59,6 +63,23 @@ public class WfProcessController extends BaseController { return processService.selectPageOwnProcessList(processQuery, pageQuery); } + /** + * 列出handbook流程 + * zqjia: 这个地方的权限还没弄明白 + */ + @SaCheckPermission("workflow:process:handbookList") + @GetMapping(value = "/handbookList") + public TableDataInfo handbookList(ProcessQuery processQuery, PageQuery pageQuery) { + return processService.selectPageHandbookList(processQuery, pageQuery); + } + + + @SaCheckPermission("workflow:process:ownList") + @GetMapping(value = "/ownInfoList") + public TableDataInfo ownProcessInfoList(ProcessQuery processQuery, PageQuery pageQuery) { + return processService.selectPageOwnProcessInfoList(processQuery, pageQuery); + } + /** * 获取待办列表 */ @@ -182,10 +203,11 @@ public class WfProcessController extends BaseController { * 查询流程部署关联表单信息 * * @param definitionId 流程定义id - * @param deployId 流程部署id + * @param deployId 流程部署id + * @param procInsId 这个参数可选 */ - @GetMapping("/getProcessForm") @SaCheckPermission("workflow:process:start") + @GetMapping("/getProcessForm") public R getForm(@RequestParam(value = "definitionId") String definitionId, @RequestParam(value = "deployId") String deployId, @RequestParam(value = "procInsId", required = false) String procInsId) { @@ -203,7 +225,6 @@ public class WfProcessController extends BaseController { public R start(@PathVariable(value = "processDefId") String processDefId, @RequestBody Map variables) { processService.startProcessByDefId(processDefId, variables); return R.ok("流程启动成功"); - } /** @@ -236,4 +257,15 @@ public class WfProcessController extends BaseController { public R detail(String procInsId, String taskId) { return R.ok(processService.queryProcessDetail(procInsId, taskId)); } + + @PostMapping("/details") + public TableDataInfo details(@RequestBody List procInsIds) { + List processDetails = new ArrayList<>(); + for (int i = 0; i < procInsIds.size(); i++) { + String procInsId = procInsIds.get(i); + WfDetailVo detailVo = processService.queryProcessDetail(procInsId, null); + processDetails.add(detailVo); + } + return TableDataInfo.build(processDetails); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java index 8a45905..f89e8af 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/PageQuery.java @@ -44,6 +44,16 @@ public class PageQuery implements Serializable { */ private String isAsc; + /** + * 跟项目申报相关的细节名 + */ + private String detailTitleName; + + /** + * 跟项目申报相关的细节名的负责人名字 + */ + private String detailDirectorName; + /** * 当前记录起始索引 默认值 */ diff --git a/ruoyi-demo/src/main/resources/mapper/demo/TestDemoMapper.xml b/ruoyi-demo/src/main/resources/mapper/demo/TestDemoMapper.xml index 3caf98a..00fdb79 100644 --- a/ruoyi-demo/src/main/resources/mapper/demo/TestDemoMapper.xml +++ b/ruoyi-demo/src/main/resources/mapper/demo/TestDemoMapper.xml @@ -22,5 +22,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT * FROM test_demo ${ew.customSqlSegment} - diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/core/FormConf.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/core/FormConf.java index 2deb259..d91d7fa 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/core/FormConf.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/core/FormConf.java @@ -59,7 +59,7 @@ public class FormConf { */ private Boolean formBtns = true; /** - * 表单项 + * 表单项, fields是一个list,所以先遍历 */ private List> fields; } diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/factory/FlowServiceFactory.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/factory/FlowServiceFactory.java index 2c22dda..76f2e8f 100644 --- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/factory/FlowServiceFactory.java +++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/factory/FlowServiceFactory.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; /** - * flowable 引擎注入封装 + * flowable 引擎注入封装, 这个是流程引擎的封装。 * @author XuanXuan * @date 2021-04-03 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/project/controller/ProjectApplicationController.java b/ruoyi-system/src/main/java/com/ruoyi/project/controller/ProjectApplicationController.java new file mode 100644 index 0000000..e0a0895 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/project/controller/ProjectApplicationController.java @@ -0,0 +1,108 @@ +package com.ruoyi.project.controller; + +import java.util.List; +import java.util.Arrays; +import java.util.concurrent.TimeUnit; + +import lombok.RequiredArgsConstructor; +import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.annotation.RepeatSubmit; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.core.validate.QueryGroup; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.project.domain.vo.ProjectApplicationVo; +import com.ruoyi.project.domain.bo.ProjectApplicationBo; +import com.ruoyi.project.service.IProjectApplicationService; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 项目申报 + * + * @author ruoyi + * @date 2024-06-14 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/project/application") +public class ProjectApplicationController extends BaseController { + + private final IProjectApplicationService iProjectApplicationService; + + /** + * 查询项目申报列表 + */ + @SaCheckPermission("project:application:list") + @GetMapping("/list") + public TableDataInfo list(ProjectApplicationBo bo, PageQuery pageQuery) { + return iProjectApplicationService.queryPageList(bo, pageQuery); + } + + /** + * 导出项目申报列表 + */ + @SaCheckPermission("project:application:export") + @Log(title = "项目申报", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(ProjectApplicationBo bo, HttpServletResponse response) { + List list = iProjectApplicationService.queryList(bo); + ExcelUtil.exportExcel(list, "项目申报", ProjectApplicationVo.class, response); + } + + /** + * 获取项目申报详细信息 + * + * @param projectId 主键 + */ + @SaCheckPermission("project:application:query") + @GetMapping("/{projectId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long projectId) { + return R.ok(iProjectApplicationService.queryById(projectId)); + } + + /** + * 新增项目申报 + */ + @SaCheckPermission("project:application:add") + @Log(title = "项目申报", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody ProjectApplicationBo bo) { + return toAjax(iProjectApplicationService.insertByBo(bo)); + } + + /** + * 修改项目申报 + */ + @SaCheckPermission("project:application:edit") + @Log(title = "项目申报", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody ProjectApplicationBo bo) { + return toAjax(iProjectApplicationService.updateByBo(bo)); + } + + /** + * 删除项目申报 + * + * @param projectIds 主键串 + */ + @SaCheckPermission("project:application:remove") + @Log(title = "项目申报", businessType = BusinessType.DELETE) + @DeleteMapping("/{projectIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] projectIds) { + return toAjax(iProjectApplicationService.deleteWithValidByIds(Arrays.asList(projectIds), true)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectApplication.java b/ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectApplication.java new file mode 100644 index 0000000..77604cc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectApplication.java @@ -0,0 +1,61 @@ +package com.ruoyi.project.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.io.Serializable; +import java.util.Date; +import java.math.BigDecimal; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 项目申报对象 project_application + * + * @author ruoyi + * @date 2024-06-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("project_application") +public class ProjectApplication extends BaseEntity { + + private static final long serialVersionUID=1L; + + /** + * 项目ID + */ + @TableId(value = "project_id") + private Long projectId; + /** + * 项目名称 + */ + private String projectName; + /** + * 状态(0正常 1停用) + */ + private String projectStatus; + /** + * 申报开始日期 + */ + private Date projectAppStTime; + /** + * 申报结束日期 + */ + private Date projectAppEndTime; + /** + * 项目负责人 + */ + private String projectLeader; + /** + * 项目预算(万) + */ + private Long projectBudget; + /** + * 项目负责人联系电话 + */ + private String projectLeaderPhone; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/project/domain/bo/ProjectApplicationBo.java b/ruoyi-system/src/main/java/com/ruoyi/project/domain/bo/ProjectApplicationBo.java new file mode 100644 index 0000000..fff6447 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/project/domain/bo/ProjectApplicationBo.java @@ -0,0 +1,76 @@ +package com.ruoyi.project.domain.bo; + +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import lombok.Data; +import lombok.EqualsAndHashCode; +import javax.validation.constraints.*; + +import java.util.Date; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 项目申报业务对象 project_application + * + * @author ruoyi + * @date 2024-06-14 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +/* 这个地方继承了BaseEntity, 实际可以认为就是包含了一个特定成员变量而已。*/ +public class ProjectApplicationBo extends BaseEntity { + + /** + * 项目ID + */ + @NotNull(message = "项目ID不能为空", groups = { EditGroup.class }) + private Long projectId; + + /** + * 项目名称 + */ + @NotBlank(message = "项目名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String projectName; + + /** + * 状态(0正常 1停用) + */ + @NotBlank(message = "状态(0正常 1停用)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String projectStatus; + + /** + * 申报开始日期 + */ + @NotNull(message = "申报开始日期不能为空", groups = { AddGroup.class, EditGroup.class }) + private Date projectAppStTime; + + /** + * 申报结束日期 + */ + @NotNull(message = "申报结束日期不能为空", groups = { AddGroup.class, EditGroup.class }) + private Date projectAppEndTime; + + /** + * 项目负责人 + */ + @NotBlank(message = "项目负责人不能为空", groups = { AddGroup.class, EditGroup.class }) + private String projectLeader; + + /** + * 项目预算(万) + */ + @NotNull(message = "项目预算(万)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long projectBudget; + + /** + * 项目负责人联系电话 + */ + @NotBlank(message = "项目负责人联系电话不能为空", groups = { AddGroup.class, EditGroup.class }) + private String projectLeaderPhone; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/project/domain/vo/ProjectApplicationVo.java b/ruoyi-system/src/main/java/com/ruoyi/project/domain/vo/ProjectApplicationVo.java new file mode 100644 index 0000000..35c9316 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/project/domain/vo/ProjectApplicationVo.java @@ -0,0 +1,76 @@ +package com.ruoyi.project.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.annotation.ExcelDictFormat; +import com.ruoyi.common.convert.ExcelDictConvert; +import lombok.Data; +import java.util.Date; + + + +/** + * 项目申报视图对象 project_application + * + * @author ruoyi + * @date 2024-06-14 + */ +@Data +@ExcelIgnoreUnannotated +public class ProjectApplicationVo { + + private static final long serialVersionUID = 1L; + + /** + * 项目ID + */ + @ExcelProperty(value = "项目ID") + private Long projectId; + + /** + * 项目名称 + */ + @ExcelProperty(value = "项目名称") + private String projectName; + + /** + * 状态(0正常 1停用) + */ + @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=正常,1=停用") + private String projectStatus; + + /** + * 申报开始日期 + */ + @ExcelProperty(value = "申报开始日期") + private Date projectAppStTime; + + /** + * 申报结束日期 + */ + @ExcelProperty(value = "申报结束日期") + private Date projectAppEndTime; + + /** + * 项目负责人 + */ + @ExcelProperty(value = "项目负责人") + private String projectLeader; + + /** + * 项目预算(万) + */ + @ExcelProperty(value = "项目预算(万)") + private Long projectBudget; + + /** + * 项目负责人联系电话 + */ + @ExcelProperty(value = "项目负责人联系电话") + private String projectLeaderPhone; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectApplicationMapper.java new file mode 100644 index 0000000..dbc557c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectApplicationMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.project.mapper; + +import com.ruoyi.project.domain.ProjectApplication; +import com.ruoyi.project.domain.vo.ProjectApplicationVo; +import com.ruoyi.common.core.mapper.BaseMapperPlus; + +/** + * 项目申报Mapper接口 + * + * @author ruoyi + * @date 2024-06-14 + */ +public interface ProjectApplicationMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/project/service/IProjectApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/project/service/IProjectApplicationService.java new file mode 100644 index 0000000..950d449 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/project/service/IProjectApplicationService.java @@ -0,0 +1,49 @@ +package com.ruoyi.project.service; + +import com.ruoyi.project.domain.ProjectApplication; +import com.ruoyi.project.domain.vo.ProjectApplicationVo; +import com.ruoyi.project.domain.bo.ProjectApplicationBo; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 项目申报Service接口 + * + * @author ruoyi + * @date 2024-06-14 + */ +public interface IProjectApplicationService { + + /** + * 查询项目申报 + */ + ProjectApplicationVo queryById(Long projectId); + + /** + * 查询项目申报列表 + */ + TableDataInfo queryPageList(ProjectApplicationBo bo, PageQuery pageQuery); + + /** + * 查询项目申报列表 + */ + List queryList(ProjectApplicationBo bo); + + /** + * 新增项目申报 + */ + Boolean insertByBo(ProjectApplicationBo bo); + + /** + * 修改项目申报 + */ + Boolean updateByBo(ProjectApplicationBo bo); + + /** + * 校验并批量删除项目申报信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectApplicationServiceImpl.java new file mode 100644 index 0000000..09ed005 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectApplicationServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.project.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import com.ruoyi.project.domain.bo.ProjectApplicationBo; +import com.ruoyi.project.domain.vo.ProjectApplicationVo; +import com.ruoyi.project.domain.ProjectApplication; +import com.ruoyi.project.mapper.ProjectApplicationMapper; +import com.ruoyi.project.service.IProjectApplicationService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 项目申报Service业务层处理 + * + * @author ruoyi + * @date 2024-06-14 + */ +@RequiredArgsConstructor +@Service +public class ProjectApplicationServiceImpl implements IProjectApplicationService { + + private final ProjectApplicationMapper baseMapper; + + /** + * 查询项目申报 + */ + @Override + public ProjectApplicationVo queryById(Long projectId){ + return baseMapper.selectVoById(projectId); + } + + /** + * 查询项目申报列表 + */ + @Override + public TableDataInfo queryPageList(ProjectApplicationBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询项目申报列表 + */ + @Override + public List queryList(ProjectApplicationBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(ProjectApplicationBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getProjectName()), ProjectApplication::getProjectName, bo.getProjectName()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectStatus()), ProjectApplication::getProjectStatus, bo.getProjectStatus()); + lqw.eq(bo.getProjectAppStTime() != null, ProjectApplication::getProjectAppStTime, bo.getProjectAppStTime()); + lqw.eq(bo.getProjectAppEndTime() != null, ProjectApplication::getProjectAppEndTime, bo.getProjectAppEndTime()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectLeader()), ProjectApplication::getProjectLeader, bo.getProjectLeader()); + lqw.eq(bo.getProjectBudget() != null, ProjectApplication::getProjectBudget, bo.getProjectBudget()); + lqw.eq(StringUtils.isNotBlank(bo.getProjectLeaderPhone()), ProjectApplication::getProjectLeaderPhone, bo.getProjectLeaderPhone()); + return lqw; + } + + /** + * 新增项目申报 + */ + @Override + public Boolean insertByBo(ProjectApplicationBo bo) { + ProjectApplication add = BeanUtil.toBean(bo, ProjectApplication.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setProjectId(add.getProjectId()); + } + return flag; + } + + /** + * 修改项目申报 + */ + @Override + public Boolean updateByBo(ProjectApplicationBo bo) { + ProjectApplication update = BeanUtil.toBean(bo, ProjectApplication.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(ProjectApplication entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 批量删除项目申报 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfDetailVo.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfDetailVo.java index aba1548..66cb04c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfDetailVo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfDetailVo.java @@ -26,7 +26,7 @@ public class WfDetailVo { private List historyProcNodeList; /** - * 流程表单列表 + * 流程表单列表, 这个地方是表单的核心信息了,表单的各种变量信息例如标题在这里面 */ private List processFormList; @@ -37,6 +37,11 @@ public class WfDetailVo { private WfViewerVo flowViewer; + /** + * zqjia: 新增字段,流程实例ID,和项目申报关联用 + */ + private String procInsId; + /** * 是否存在任务表单信息 * @return true:存在;false:不存在 diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfTaskInfoVo.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfTaskInfoVo.java new file mode 100644 index 0000000..82b88a8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/domain/vo/WfTaskInfoVo.java @@ -0,0 +1,31 @@ +package com.ruoyi.workflow.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.workflow.domain.dto.WfCommentDto; +import lombok.Data; +import org.flowable.engine.task.Comment; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 工作流任务视图对象 + * + * @author logzhan + * @createTime 2022/3/10 00:12 + */ +@Data +@ExcelIgnoreUnannotated +public class WfTaskInfoVo extends WfTaskVo { + + /** + * 流程详情的标题信息 + */ + private String processTitle; + /** + * 项目负责人名字 + */ + private String director; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/IWfProcessService.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/IWfProcessService.java index 1befc0b..f20b72a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/IWfProcessService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/IWfProcessService.java @@ -6,6 +6,7 @@ import com.ruoyi.flowable.core.FormConf; import com.ruoyi.flowable.core.domain.ProcessQuery; import com.ruoyi.workflow.domain.vo.WfDefinitionVo; import com.ruoyi.workflow.domain.vo.WfDetailVo; +import com.ruoyi.workflow.domain.vo.WfTaskInfoVo; import com.ruoyi.workflow.domain.vo.WfTaskVo; import java.util.List; @@ -35,6 +36,12 @@ public interface IWfProcessService { */ TableDataInfo selectPageOwnProcessList(ProcessQuery processQuery, PageQuery pageQuery); + /** + * 查询申报指南 + * @param pageQuery 分页参数 + */ + TableDataInfo selectPageHandbookList(ProcessQuery processQuery, PageQuery pageQuery); + /** * 查询我的流程列表 */ @@ -113,4 +120,7 @@ public interface IWfProcessService { * @param taskId 任务ID */ WfDetailVo queryProcessDetail(String procInsId, String taskId); + + + TableDataInfo selectPageOwnProcessInfoList(ProcessQuery processQuery, PageQuery pageQuery); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfModelServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfModelServiceImpl.java index ab66dd7..5270e1c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfModelServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfModelServiceImpl.java @@ -198,13 +198,22 @@ public class WfModelServiceImpl extends FlowServiceFactory implements IWfModelSe return StrUtil.utf8Str(bpmnBytes); } + /** + * 这个地方本质还是调用底层的repositoryService插入模型,这里WfModel是 + * 起到转换的作用 + */ @Override public void insertModel(WfModelBo modelBo) { Model model = repositoryService.newModel(); model.setName(modelBo.getModelName()); model.setKey(modelBo.getModelKey()); + // 这里只是设置一个字符串(分类信息) model.setCategory(modelBo.getCategory()); + // 这个地方非常关键, 这里把WorkFlow的一些额外信息转换为Json + // 后续能否扩展一些信息非常依靠这个metaInfo + // 值得注意的是这里的WfMetaInfoDto是新构建的说明是空的, 用于后续的改进扩展东西 String metaInfo = buildMetaInfo(new WfMetaInfoDto(), modelBo.getDescription()); + // workflow库模型保存扩展元信息 model.setMetaInfo(metaInfo); // 保存流程模型 repositoryService.saveModel(model); @@ -354,6 +363,7 @@ public class WfModelServiceImpl extends FlowServiceFactory implements IWfModelSe if (StringUtils.isNotEmpty(metaInfo.getCreateUser())) { metaInfo.setCreateUser(LoginHelper.getUsername()); } + // 把结构体转成字符串保存 return JsonUtils.toJsonString(metaInfo); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java index 10ce59a..32be8df 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java @@ -37,6 +37,7 @@ import com.ruoyi.workflow.domain.vo.*; import com.ruoyi.workflow.mapper.WfDeployFormMapper; import com.ruoyi.workflow.service.IWfProcessService; import com.ruoyi.workflow.service.IWfTaskService; +import liquibase.pro.packaged.W; import lombok.RequiredArgsConstructor; import org.flowable.bpmn.constants.BpmnXMLConstants; import org.flowable.bpmn.model.Process; @@ -153,12 +154,79 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce } return definitionVoList; } - + /**、 + * 获取自有的流程列表信息 + * @author : zhanli + */ @Override public TableDataInfo selectPageOwnProcessList(ProcessQuery processQuery, PageQuery pageQuery) { + Page page = new Page<>(); + // 创建历史信息查询对象 + // 利用流程历史服务查询信息 + HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery() + .startedBy(TaskUtils.getUserId()) // 数据必须是指定用户信息开头的 + .orderByProcessInstanceStartTime() // 按照流程实例开始的时间排序 + .desc(); + // 构建搜索条件 + ProcessUtils.buildProcessSearch(historicProcessInstanceQuery, processQuery); + + int offset = pageQuery.getPageSize() * (pageQuery.getPageNum() - 1); + + // 按照给定的页面的信息进行数据的过滤 + List historicProcessInstances = historicProcessInstanceQuery + .listPage(offset, pageQuery.getPageSize()); + // historicProcessInstances是返回信息的合集,一共3条项目, 对应我的流程(ownProcessList) + + page.setTotal(historicProcessInstanceQuery.count()); + List taskVoList = new ArrayList<>(); + for (HistoricProcessInstance hisIns : historicProcessInstances) { + WfTaskVo taskVo = new WfTaskVo(); + // 获取流程状态 + HistoricVariableInstance processStatusVariable = historyService.createHistoricVariableInstanceQuery() + .processInstanceId(hisIns.getId()) + .variableName(ProcessConstants.PROCESS_STATUS_KEY) + .singleResult(); + String processStatus = null; + if (ObjectUtil.isNotNull(processStatusVariable)) { + processStatus = Convert.toStr(processStatusVariable.getValue()); + } + // 兼容旧流程 + if (processStatus == null) { + processStatus = ObjectUtil.isNull(hisIns.getEndTime()) ? ProcessStatus.RUNNING.getStatus() : ProcessStatus.COMPLETED.getStatus(); + } + taskVo.setProcessStatus(processStatus); + taskVo.setCreateTime(hisIns.getStartTime()); + taskVo.setFinishTime(hisIns.getEndTime()); + taskVo.setProcInsId(hisIns.getId()); + + // 计算耗时 + if (Objects.nonNull(hisIns.getEndTime())) { + taskVo.setDuration(DateUtils.getDatePoor(hisIns.getEndTime(), hisIns.getStartTime())); + } else { + taskVo.setDuration(DateUtils.getDatePoor(DateUtils.getNowDate(), hisIns.getStartTime())); + } + // 流程部署实例信息 + Deployment deployment = repositoryService.createDeploymentQuery() + .deploymentId(hisIns.getDeploymentId()).singleResult(); + taskVo.setDeployId(hisIns.getDeploymentId()); + taskVo.setProcDefId(hisIns.getProcessDefinitionId()); + taskVo.setProcDefName(hisIns.getProcessDefinitionName()); + taskVo.setProcDefVersion(hisIns.getProcessDefinitionVersion()); + taskVo.setCategory(deployment.getCategory()); + // 当前所处流程 + List taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).includeIdentityLinks().list(); + if (CollUtil.isNotEmpty(taskList)) { + taskVo.setTaskName(taskList.stream().map(Task::getName).filter(StringUtils::isNotEmpty).collect(Collectors.joining(","))); + } + taskVoList.add(taskVo); + } + page.setRecords(taskVoList); + return TableDataInfo.build(page); + } + + public TableDataInfo selectPageHandbookList(ProcessQuery processQuery, PageQuery pageQuery) { Page page = new Page<>(); HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery() - .startedBy(TaskUtils.getUserId()) .orderByProcessInstanceStartTime() .desc(); // 构建搜索条件 @@ -183,6 +251,10 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce if (processStatus == null) { processStatus = ObjectUtil.isNull(hisIns.getEndTime()) ? ProcessStatus.RUNNING.getStatus() : ProcessStatus.COMPLETED.getStatus(); } +// zqjia:只返回完成的指南 + if (!"completed".equals(processStatus)) { + continue; + } taskVo.setProcessStatus(processStatus); taskVo.setCreateTime(hisIns.getStartTime()); taskVo.setFinishTime(hisIns.getEndTime()); @@ -643,36 +715,46 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce * * @param procInsId 流程实例ID * @param taskId 任务ID - * @return + * @return WfDetailVo 细节 */ @Override public WfDetailVo queryProcessDetail(String procInsId, String taskId) { WfDetailVo detailVo = new WfDetailVo(); // 获取流程实例 + // historyService这个服务非常的关键 HistoricProcessInstance historicProcIns = historyService.createHistoricProcessInstanceQuery() .processInstanceId(procInsId) .includeProcessVariables() .singleResult(); + // 判断taskID是否为空 if (StringUtils.isNotBlank(taskId)) { + // 创建历史信息查询 HistoricTaskInstance taskIns = historyService.createHistoricTaskInstanceQuery() .taskId(taskId) .includeIdentityLinks() .includeProcessVariables() .includeTaskLocalVariables() .singleResult(); + // 如果查询的信息为null if (taskIns == null) { throw new ServiceException("没有可办理的任务!"); } detailVo.setTaskFormData(currTaskFormData(historicProcIns.getDeploymentId(), taskIns)); } + // 获取Bpmn模型信息 InputStream inputStream = repositoryService.getProcessModel(historicProcIns.getProcessDefinitionId()); String bpmnXmlStr = StrUtil.utf8Str(IoUtil.readBytes(inputStream, false)); BpmnModel bpmnModel = ModelUtils.getBpmnModel(bpmnXmlStr); + // 把BpmXml信息存放到detailVo中 detailVo.setBpmnXml(bpmnXmlStr); + // 下面的是干什么的? detailVo.setHistoryProcNodeList(historyProcNodeList(historicProcIns)); + // /* 设置流程表单列表, 这个地方的信息非常的关键,核心的标题的各种信息都传递在这里 */ detailVo.setProcessFormList(processFormList(bpmnModel, historicProcIns)); + // 设置流观察器 detailVo.setFlowViewer(getFlowViewer(bpmnModel, procInsId)); + detailVo.setProcInsId(procInsId); return detailVo; } @@ -981,4 +1063,100 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce Set rejectedSet = FlowableUtils.dfsFindRejects(bpmnModel, unfinishedTaskSet, finishedSequenceFlowSet, finishedTaskSet); return new WfViewerVo(finishedTaskSet, finishedSequenceFlowSet, unfinishedTaskSet, rejectedSet); } + + @SuppressWarnings("unchecked") + public TableDataInfo selectPageOwnProcessInfoList(ProcessQuery processQuery, PageQuery pageQuery) { + TableDataInfo t = selectPageOwnProcessList(processQuery, pageQuery); + + List targetList = new ArrayList<>(); + // 获取 rows 列表 + List taskList = t.getRows(); + // 使用增强 for 循环遍历列表 + for (WfTaskVo task : taskList) { + + WfTaskInfoVo taskVo = new WfTaskInfoVo(); + + // 获取流程状态 + HistoricVariableInstance processStatusVariable = historyService.createHistoricVariableInstanceQuery() + .processInstanceId(task.getProcInsId()) + .variableName(ProcessConstants.PROCESS_STATUS_KEY) + .singleResult(); + + String processStatus = null; + if (ObjectUtil.isNotNull(processStatusVariable)) { + processStatus = Convert.toStr(processStatusVariable.getValue()); + } + // 兼容旧流程 + if (processStatus == null) { + processStatus = ObjectUtil.isNull(task.getFinishTime()) ? + ProcessStatus.RUNNING.getStatus() : ProcessStatus.COMPLETED.getStatus(); + } + taskVo.setProcessStatus(processStatus); + + taskVo.setCreateTime(task.getCreateTime()); + taskVo.setFinishTime(task.getFinishTime()); + taskVo.setProcInsId(task.getProcInsId()); + taskVo.setDuration(task.getDuration()); + + taskVo.setDeployId(task.getDeployId()); + taskVo.setProcDefId(task.getProcDefId()); + taskVo.setProcDefName(task.getProcDefName()); + taskVo.setProcDefVersion(task.getProcDefVersion()); + taskVo.setCategory(task.getCategory()); + taskVo.setTaskName(task.getTaskName()); + + // 在这里处理每个 task 对象 + WfDetailVo detailVo = queryProcessDetail(task.getProcInsId(), ""); + // 获取表单列表 + List processFormList = detailVo.getProcessFormList(); + // 获取项目名字 + if(pageQuery.getDetailTitleName() != null){ + String res = getFormData(processFormList, pageQuery.getDetailTitleName(), pageQuery); + taskVo.setProcessTitle(res); + } + // 获取项目负责人名字 + if(pageQuery.getDetailDirectorName() != null){ + String director = getFormData(processFormList, pageQuery.getDetailDirectorName(), pageQuery); + taskVo.setDirector(director); + } + targetList.add(taskVo); + } + + TableDataInfo target = new TableDataInfo<>(); + target.setRows(targetList); + target.setTotal(t.getTotal()); + target.setCode(t.getCode()); + target.setMsg(t.getMsg()); + return target; + } + + @SuppressWarnings("unchecked") + private String getFormData(List processFormList, String fieldsName, PageQuery pageQuery){ + String title; + + // 使用增强 for 循环遍历列表 + for (FormConf form : processFormList) { + for (Map map : form.getFields()) { + // 检查当前 map 是否包含指定的 key + if (!map.containsKey("__config__") || !map.containsKey("__vModel__")) { + continue; + } + // 判断字段名和请求的请求的字段名是否相同 + String name = (String)map.get("__vModel__"); + if(!fieldsName.equals(name)){ + continue; + } + // 获取指定 key 的值 + Object value = map.get("__config__"); + if (value instanceof HashMap) { + HashMap innerMap = (HashMap)value; + if(pageQuery.getDetailTitleName() != null && innerMap.containsKey("defaultValue")){ + title = (String) innerMap.get("defaultValue"); + return title; + } + } + } + } + return ""; + } } diff --git a/ruoyi-system/src/main/resources/mapper/project/ProjectApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/project/ProjectApplicationMapper.xml new file mode 100644 index 0000000..b332c03 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/project/ProjectApplicationMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 45f249b..46cc1f8 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -5,8 +5,8 @@ "author": "KonBAI", "license": "MIT", "scripts": { - "dev": "vue-cli-service serve", - "build:prod": "vue-cli-service build", + "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", + "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src" }, diff --git a/ruoyi-ui/src/api/project/application.js b/ruoyi-ui/src/api/project/application.js new file mode 100644 index 0000000..730c3ca --- /dev/null +++ b/ruoyi-ui/src/api/project/application.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询项目申报列表 +export function listApplication(query) { + return request({ + url: '/project/application/list', + method: 'get', + params: query + }) +} + +// 查询项目申报详细 +export function getApplication(projectId) { + return request({ + url: '/project/application/' + projectId, + method: 'get' + }) +} + +// 新增项目申报 +export function addApplication(data) { + return request({ + url: '/project/application', + method: 'post', + data: data + }) +} + +// 修改项目申报 +export function updateApplication(data) { + return request({ + url: '/project/application', + method: 'put', + data: data + }) +} + +// 删除项目申报 +export function delApplication(projectId) { + return request({ + url: '/project/application/' + projectId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/workflow/process.js b/ruoyi-ui/src/api/workflow/process.js index a6a8862..14c44e6 100644 --- a/ruoyi-ui/src/api/workflow/process.js +++ b/ruoyi-ui/src/api/workflow/process.js @@ -51,6 +51,23 @@ export function detailProcess(query) { }) } +// 我的发起的流程 +export function listOwnInfoProcess(query) { + return request({ + url: '/workflow/process/ownInfoList', + method: 'get', + params: query + }) +} + +export function detailProcesses(arr) { + return request({ + url: '/workflow/process/details', + method: 'post', + data: arr + }) +} + // 我的发起的流程 export function listOwnProcess(query) { return request({ @@ -60,6 +77,14 @@ export function listOwnProcess(query) { }) } +export function listHandbook(query) { + return request({ + url: '/workflow/process/handbookList', + method: 'get', + params: query + }) +} + // 我待办的流程 export function listTodoProcess(query) { return request({ diff --git a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue index a39cc30..31ac594 100644 --- a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue +++ b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue @@ -35,7 +35,7 @@ export default { }, data() { return { - title: 'вϵͳ', + title: '科研财务管理系统', logo: logoImg } } diff --git a/ruoyi-ui/src/utils/generator/config.js b/ruoyi-ui/src/utils/generator/config.js index 9ab35fa..cd0e172 100644 --- a/ruoyi-ui/src/utils/generator/config.js +++ b/ruoyi-ui/src/utils/generator/config.js @@ -12,6 +12,42 @@ export const formConf = { formBtns: true } +export const textComponents = [ + { + // 组件的自定义配置 + __config__: { + label: '文本显示', + labelWidth: null, + showLabel: false, + changeTag: true, + tag: 'el-input', + tagIcon: 'text', + defaultValue: undefined, + required: false, + layout: 'colFormItem', + span: 24, + document: 'https://element.eleme.cn/#/zh-CN/component/el-input', + // 正则校验规则 + regList: [], + }, + // 组件的插槽属性 + __slot__: { + prepend: '', + append: '' + }, + // 其余的为可直接写在组件标签上的属性 + style: {width: '100%'}, + placeholder: '请输入要显示的字符然后打开只读属性', + clearable: false, + 'prefix-icon': '', + 'suffix-icon': '', + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false + } + ] + // 输入型组件 【左面板】 export const inputComponents = [ { diff --git a/ruoyi-ui/src/utils/generator/parser.js b/ruoyi-ui/src/utils/generator/parser.js index 15f1938..9ce595d 100644 --- a/ruoyi-ui/src/utils/generator/parser.js +++ b/ruoyi-ui/src/utils/generator/parser.js @@ -26,14 +26,26 @@ const layouts = { let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null if (config.showLabel === false) labelWidth = '0' - return ( - - - - - - ) + if(config.tagIcon === 'text') { + return ( + + + + + + ) + } + else { + return ( + + + + + + ) + } }, rowFormItem(h, scheme) { let child = renderChildren.apply(this, arguments) @@ -87,7 +99,6 @@ function renderFormItem(h, elementList) { return elementList.map(scheme => { const config = scheme.__config__ const layout = layouts[config.layout] - if (layout) { return layout.call(this, h, scheme) } diff --git a/ruoyi-ui/src/views/project/application/index.vue b/ruoyi-ui/src/views/project/application/index.vue new file mode 100644 index 0000000..8a2a2f6 --- /dev/null +++ b/ruoyi-ui/src/views/project/application/index.vue @@ -0,0 +1,395 @@ + + + diff --git a/ruoyi-ui/src/views/scientific/handbook_apply.vue b/ruoyi-ui/src/views/scientific/handbook_apply.vue new file mode 100644 index 0000000..8accffc --- /dev/null +++ b/ruoyi-ui/src/views/scientific/handbook_apply.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/ruoyi-ui/src/views/scientific/handbook_apply_bak.vue b/ruoyi-ui/src/views/scientific/handbook_apply_bak.vue new file mode 100644 index 0000000..f72b60a --- /dev/null +++ b/ruoyi-ui/src/views/scientific/handbook_apply_bak.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/ruoyi-ui/src/views/scientific/handbook_query.vue b/ruoyi-ui/src/views/scientific/handbook_query.vue new file mode 100644 index 0000000..1aac596 --- /dev/null +++ b/ruoyi-ui/src/views/scientific/handbook_query.vue @@ -0,0 +1,412 @@ + + + + + + diff --git a/ruoyi-ui/src/views/scientific/handbook_query_bak.vue b/ruoyi-ui/src/views/scientific/handbook_query_bak.vue new file mode 100644 index 0000000..792bbb6 --- /dev/null +++ b/ruoyi-ui/src/views/scientific/handbook_query_bak.vue @@ -0,0 +1,472 @@ + + + + + + diff --git a/ruoyi-ui/src/views/tool/build/RightPanel.vue b/ruoyi-ui/src/views/tool/build/RightPanel.vue index 968cc8f..2ed4474 100644 --- a/ruoyi-ui/src/views/tool/build/RightPanel.vue +++ b/ruoyi-ui/src/views/tool/build/RightPanel.vue @@ -645,7 +645,7 @@ import TreeNodeDialog from './TreeNodeDialog' import { isNumberStr } from '@/utils/index' import IconsDialog from './IconsDialog' import { - inputComponents, selectComponents, layoutComponents + inputComponents, selectComponents, layoutComponents, textComponents } from '@/utils/generator/config' import { saveFormConf } from '@/utils/db' @@ -785,6 +785,10 @@ export default { }, tagList() { return [ + { + label: '显示型组件', + options: textComponents + }, { label: '输入型组件', options: inputComponents diff --git a/ruoyi-ui/src/views/tool/build/index.vue b/ruoyi-ui/src/views/tool/build/index.vue index 8a279a8..bd2883a 100644 --- a/ruoyi-ui/src/views/tool/build/index.vue +++ b/ruoyi-ui/src/views/tool/build/index.vue @@ -71,6 +71,7 @@ +// zqjia: set the style for el-input__inner in textShow component +// for textShow component with width 22 +.el-col { + .text { + .el-input__inner, .el-input { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: bold; + font-size: 14px; + color: #606266; + + border: 0 !important; + box-shadow: none !important; + background-color: transparent !important; + text-align: center; + } + } +} + +// for multi textShow component in a line with width 24 +.el-col-24 { + .text { + .el-input__inner, .el-input { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + font-weight: bold; + font-size: 14px; + color: #606266; + + border: 0 !important; + box-shadow: none !important; + background-color: transparent !important; + text-align: left; + } + } +} + + .editor-tabs{ background: #121315; .el-tabs__header{ diff --git a/ruoyi-ui/src/views/workflow/model/index.vue b/ruoyi-ui/src/views/workflow/model/index.vue index e2dabed..56a83b3 100644 --- a/ruoyi-ui/src/views/workflow/model/index.vue +++ b/ruoyi-ui/src/views/workflow/model/index.vue @@ -83,7 +83,7 @@ - +