提交 27592b4f authored 作者: YunaiV's avatar YunaiV

Merge branch 'master' of https://gitee.com/zhijiantianya/yudao-cloud into feat/springdoc

# Conflicts: # yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java # yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthMenuRespVO.java # yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/permission/vo/menu/MenuBaseVO.java
...@@ -36,12 +36,12 @@ ...@@ -36,12 +36,12 @@
* 集成阿里云、腾讯云等短信渠道,集成 MinIO、阿里云、腾讯云、七牛云等云存储服务 * 集成阿里云、腾讯云等短信渠道,集成 MinIO、阿里云、腾讯云、七牛云等云存储服务
* 集成报表设计器、大屏设计器,通过拖拽即可生成酷炫的报表与大屏 * 集成报表设计器、大屏设计器,通过拖拽即可生成酷炫的报表与大屏
| 项目名 | 说明 | 传送门 | | 项目名 | 说明 | 传送门 |
|----------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------| |----------------------|------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| `ruoyi-vue-pro` | Spring Boot 多模块 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro)**     [Github](https://github.com/YunaiV/ruoyi-vue-pro) | | `ruoyi-vue-pro` | Spring Boot 多模块 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro)**     [Github](https://github.com/YunaiV/ruoyi-vue-pro) |
| `yudao-cloud` | Spring Cloud 微服务 | **[Gitee](https://gitee.com/zhijiantianya/yudao-cloud)**     [Github](https://github.com/YunaiV/yudao-cloud) | | `yudao-cloud` | Spring Cloud 微服务 | **[Gitee](https://gitee.com/zhijiantianya/yudao-cloud)**     [Github](https://github.com/YunaiV/yudao-cloud) |
| `Spring-Boot-Labs` | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/zhijiantianya/SpringBoot-Labs)**     [Github](https://github.com/YunaiV/SpringBoot-Labs) | | `Spring-Boot-Labs` | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/yudaocode/SpringBoot-Labs)**     [Github](https://github.com/yudaocode/SpringBoot-Labs) |
| `ruoyi-vue-pro-mini` | 精简版:移除工作流、支付等模块 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/mini)** | | `ruoyi-vue-pro-mini` | 精简版:移除工作流、支付等模块 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/mini)** |
## 😎 开源协议 ## 😎 开源协议
...@@ -194,21 +194,28 @@ ps:核心功能已经实现,正在对接微信小程序中... ...@@ -194,21 +194,28 @@ ps:核心功能已经实现,正在对接微信小程序中...
## 🐨 技术栈 ## 🐨 技术栈
| 项目 | 说明 |
|-------------------------|--------------------| | 项目 | 说明 |
| `yudao-dependencies` | Maven 依赖版本管理 | |--------------------------------------------------------------------------|--------------------|
| `yudao-framework` | Java 框架拓展 | | `yudao-dependencies` | Maven 依赖版本管理 |
| `yudao-ui-admin` | 管理后台的 Vue2 前端项目 | | `yudao-framework` | Java 框架拓展 |
| `yudao-ui-admin-vue3` | 管理后台的 Vue3 前端项目 | | `yudao-server` | 管理后台 + 用户 APP 的服务端 |
| `yudao-ui-admin-uniapp` | 管理后台的 uni-app 多端项目 | | `yudao-module-system` | 系统功能的 Module 模块 |
| `yudao-ui-app` | 用户 APP 的 UI 界面 | | `yudao-module-member` | 会员中心的 Module 模块 |
| `yudao-gateway` | 服务网关的 Module 模块 | | `yudao-module-infra` | 基础设施的 Module 模块 |
| `yudao-module-system` | 系统功能的 Module 模块 | | `yudao-module-bpm` | 工作流程的 Module 模块 |
| `yudao-module-member` | 会员中心的 Module 模块 | | `yudao-module-pay` | 支付系统的 Module 模块 |
| `yudao-module-infra` | 基础设施的 Module 模块 | | `yudao-module-mall` | 商城系统的 Module 模块 |
| `yudao-module-bpm` | 工作流程的 Module 模块 | | `yudao-module-mp` | 微信公众号的 Module 模块 |
| `yudao-module-pay` | 支付系统的 Module 模块 | | `yudao-module-report` | 大屏报表 Module 模块 |
| `yudao-module-report` | 大屏报表 Module 模块 |
> 前端项目的地址:
>
> * [`yudao-ui-admin-vue3`](https://gitee.com/yudaocode/yudao-ui-admin-vue3):基于 Vue3 + element-plus 实现的管理后台
> * `yudao-ui-admin`:基于 Vue2 + element-ui 实现的管理后台
> * [`yudao-ui-go-view`](https://gitee.com/yudaocode/yudao-ui-go-view):基于 Vue3 + naive-ui 实现的大屏报表
> * `yudao-ui-admin-uniapp`:基于 uni-app + uni-ui 实现的管理后台的小程序
> * `yudao-ui-app`:基于 uni-app + uview 实现的用户 App
### 后端 ### 后端
...@@ -247,18 +254,6 @@ ps:核心功能已经实现,正在对接微信小程序中... ...@@ -247,18 +254,6 @@ ps:核心功能已经实现,正在对接微信小程序中...
| [Vue](https://cn.vuejs.org/index.html) | JavaScript 框架 | 2.7.14 | | [Vue](https://cn.vuejs.org/index.html) | JavaScript 框架 | 2.7.14 |
| [Vue Element Admin](https://panjiachen.github.io/vue-element-admin-site/zh/) | 后台前端解决方案 | - | | [Vue Element Admin](https://panjiachen.github.io/vue-element-admin-site/zh/) | 后台前端解决方案 | - |
### [管理后台 Vue3 前端](./yudao-ui-admin-vue3)
| 框架 | 说明 | 版本 |
|----------------------------------------------------------------------|:------------:|:------:|
| [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.45 |
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.0.4 |
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.2.28 |
| [TypeScript](https://www.typescriptlang.org/docs/) | TypeScript | 4.9.4 |
| [pinia](https://pinia.vuejs.org/) | vuex5 | 2.0.29 |
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 9.2.2 |
| [vxe-table](https://vxetable.cn/) | vue最强表单 | 4.3.9 |
### [管理后台 uni-app 跨端](./yudao-ui-admin-uniapp) ### [管理后台 uni-app 跨端](./yudao-ui-admin-uniapp)
| 框架 | 说明 | 版本 | | 框架 | 说明 | 版本 |
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url> <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties> <properties>
<revision>1.6.6-snapshot</revision> <revision>1.7.1-snapshot</revision>
<!-- Maven 相关 --> <!-- Maven 相关 -->
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<!-- 看看咋放到 bom 里 --> <!-- 看看咋放到 bom 里 -->
<lombok.version>1.18.24</lombok.version> <lombok.version>1.18.24</lombok.version>
<spring.boot.version>2.7.7</spring.boot.version> <spring.boot.version>2.7.8</spring.boot.version>
<mapstruct.version>1.5.3.Final</mapstruct.version> <mapstruct.version>1.5.3.Final</mapstruct.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url> <url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties> <properties>
<revision>1.6.6-snapshot</revision> <revision>1.7.1-snapshot</revision>
<!-- 统一依赖管理 --> <!-- 统一依赖管理 -->
<spring.boot.version>2.7.8</spring.boot.version> <spring.boot.version>2.7.8</spring.boot.version>
<spring.cloud.version>2021.0.5</spring.cloud.version> <spring.cloud.version>2021.0.5</spring.cloud.version>
...@@ -45,17 +45,17 @@ ...@@ -45,17 +45,17 @@
<opentracing.version>0.33.0</opentracing.version> <opentracing.version>0.33.0</opentracing.version>
<!-- Test 测试相关 --> <!-- Test 测试相关 -->
<podam.version>7.2.11.RELEASE</podam.version> <podam.version>7.2.11.RELEASE</podam.version>
<jedis-mock.version>1.0.5</jedis-mock.version> <jedis-mock.version>1.0.6</jedis-mock.version>
<mockito-inline.version>4.11.0</mockito-inline.version> <mockito-inline.version>4.11.0</mockito-inline.version>
<!-- Bpm 工作流相关 --> <!-- Bpm 工作流相关 -->
<flowable.version>6.8.0</flowable.version> <flowable.version>6.8.0</flowable.version>
<!-- 工具类相关 --> <!-- 工具类相关 -->
<captcha-plus.version>1.0.1</captcha-plus.version> <captcha-plus.version>1.0.2</captcha-plus.version>
<jsoup.version>1.15.3</jsoup.version> <jsoup.version>1.15.3</jsoup.version>
<lombok.version>1.18.24</lombok.version> <lombok.version>1.18.24</lombok.version>
<mapstruct.version>1.5.3.Final</mapstruct.version> <mapstruct.version>1.5.3.Final</mapstruct.version>
<hutool.version>5.8.11</hutool.version> <hutool.version>5.8.11</hutool.version>
<easyexcel.verion>3.1.5</easyexcel.verion> <easyexcel.verion>3.2.0</easyexcel.verion>
<velocity.version>2.3</velocity.version> <velocity.version>2.3</velocity.version>
<screw.version>1.0.5</screw.version> <screw.version>1.0.5</screw.version>
<fastjson.version>1.2.83</fastjson.version> <fastjson.version>1.2.83</fastjson.version>
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.7</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> <version>2.7.8</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 -->
<configuration> <configuration>
<fork>true</fork> <fork>true</fork>
</configuration> </configuration>
......
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task; package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.annotations.ApiModel;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
...@@ -12,21 +12,17 @@ import java.time.LocalDateTime; ...@@ -12,21 +12,17 @@ import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 流程任务的 TODO 待办的分页 Request VO") @ApiModel("管理后台 - 流程任务的 TODO 待办的分页 Request VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class BpmTaskTodoPageReqVO extends PageParam { public class BpmTaskTodoPageReqVO extends PageParam {
@Schema(description = "流程任务名", example = "芋道") @ApiModelProperty(value = "流程任务名", example = "芋道")
private String name; private String name;
@Schema(description = "开始的创建收间") @ApiModelProperty(value = "创建收间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime beginCreateTime; private LocalDateTime[] createTime;
@Schema(description = "结束的创建时间") }
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime endCreateTime;
}
\ No newline at end of file
...@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.service.definition; ...@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.service.definition;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormCreateReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormCreateReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormUpdateReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormUpdateReqVO;
...@@ -21,7 +20,8 @@ import javax.annotation.Resource; ...@@ -21,7 +20,8 @@ import javax.annotation.Resource;
import java.util.*; import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.FORM_NOT_EXISTS;
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.MODEL_DEPLOY_FAIL_FORM_NOT_CONFIG;
/** /**
* 动态表单 Service 实现类 * 动态表单 Service 实现类
...@@ -107,17 +107,15 @@ public class BpmFormServiceImpl implements BpmFormService { ...@@ -107,17 +107,15 @@ public class BpmFormServiceImpl implements BpmFormService {
return null; return null;
} }
private void checkKeyNCName(String key) {
if (!ValidationUtils.isXmlNCName(key)) {
throw exception(MODEL_KEY_VALID);
}
}
/** /**
* 校验 Field,避免 field 重复 * 校验 Field,避免 field 重复
* *
* @param fields field 数组 * @param fields field 数组
*/ */
private void checkFields(List<String> fields) { private void checkFields(List<String> fields) {
if (true) { // TODO 芋艿:兼容 Vue3 工作流:因为采用了新的表单设计器,所以暂时不校验
return;
}
Map<String, String> fieldMap = new HashMap<>(); // key 是 vModel,value 是 label Map<String, String> fieldMap = new HashMap<>(); // key 是 vModel,value 是 label
for (String field : fields) { for (String field : fields) {
BpmFormFieldRespDTO fieldDTO = JsonUtils.parseObject(field, BpmFormFieldRespDTO.class); BpmFormFieldRespDTO fieldDTO = JsonUtils.parseObject(field, BpmFormFieldRespDTO.class);
......
package cn.iocoder.yudao.module.bpm.service.task; package cn.iocoder.yudao.module.bpm.service.task;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.common.util.date.DateUtils;
...@@ -75,11 +76,11 @@ public class BpmTaskServiceImpl implements BpmTaskService { ...@@ -75,11 +76,11 @@ public class BpmTaskServiceImpl implements BpmTaskService {
if (StrUtil.isNotBlank(pageVO.getName())) { if (StrUtil.isNotBlank(pageVO.getName())) {
taskQuery.taskNameLike("%" + pageVO.getName() + "%"); taskQuery.taskNameLike("%" + pageVO.getName() + "%");
} }
if (pageVO.getBeginCreateTime() != null) { if (ArrayUtil.get(pageVO.getCreateTime(), 0) != null) {
taskQuery.taskCreatedAfter(DateUtils.of(pageVO.getBeginCreateTime())); taskQuery.taskCreatedAfter(DateUtils.of(pageVO.getCreateTime()[0]));
} }
if (pageVO.getEndCreateTime() != null) { if (ArrayUtil.get(pageVO.getCreateTime(), 1) != null) {
taskQuery.taskCreatedBefore(DateUtils.of(pageVO.getEndCreateTime())); taskQuery.taskCreatedBefore(DateUtils.of(pageVO.getCreateTime()[1]));
} }
// 执行查询 // 执行查询
List<Task> tasks = taskQuery.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize()); List<Task> tasks = taskQuery.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());
......
...@@ -158,7 +158,7 @@ public class CodegenServiceImpl implements CodegenService { ...@@ -158,7 +158,7 @@ public class CodegenServiceImpl implements CodegenService {
//计算需要修改的字段,插入时重新插入,删除时将原来的删除 //计算需要修改的字段,插入时重新插入,删除时将原来的删除
BiPredicate<TableField, CodegenColumnDO> pr = BiPredicate<TableField, CodegenColumnDO> pr =
(tableField, codegenColumn) -> tableField.getType().equals(codegenColumn.getDataType()) (tableField, codegenColumn) -> tableField.getMetaInfo().getJdbcType().name().equals(codegenColumn.getDataType())
&& tableField.getMetaInfo().isNullable() == codegenColumn.getNullable() && tableField.getMetaInfo().isNullable() == codegenColumn.getNullable()
&& tableField.isKeyFlag() == codegenColumn.getPrimaryKey() && tableField.isKeyFlag() == codegenColumn.getPrimaryKey()
&& tableField.getComment().equals(codegenColumn.getColumnComment()); && tableField.getComment().equals(codegenColumn.getColumnComment());
......
package cn.iocoder.yudao.module.system.controller.admin.auth.vo; package cn.iocoder.yudao.module.system.controller.admin.auth.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.annotations.ApiModel;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -9,40 +9,46 @@ import lombok.NoArgsConstructor; ...@@ -9,40 +9,46 @@ import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
@Schema(description = "管理后台 - 登录用户的菜单信息 Response VO") @ApiModel("管理后台 - 登录用户的菜单信息 Response VO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
public class AuthMenuRespVO { public class AuthMenuRespVO {
@Schema(description = "菜单名称", required = true, example = "芋道") @ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
private Long id; private Long id;
@Schema(description = "父菜单 ID", required = true, example = "1024") @ApiModelProperty(value = "父菜单 ID", required = true, example = "1024")
private Long parentId; private Long parentId;
@Schema(description = "菜单名称", required = true, example = "芋道") @ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
private String name; private String name;
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post") @ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传")
private String path; private String path;
@Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index") @ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传")
private String component; private String component;
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list") @ApiModelProperty(value = "组件名", example = "SystemUser")
private String componentName;
@ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传")
private String icon; private String icon;
@Schema(description = "是否可见", required = true, example = "false") @ApiModelProperty(value = "是否可见", required = true, example = "false")
private Boolean visible; private Boolean visible;
@Schema(description = "是否缓存", required = true, example = "false") @ApiModelProperty(value = "是否缓存", required = true, example = "false")
private Boolean keepAlive; private Boolean keepAlive;
@ApiModelProperty(value = "是否总是显示", example = "false")
private Boolean alwaysShow;
/** /**
* 子路由 * 子路由
*/ */
private List<AuthMenuRespVO> children; private List<AuthMenuRespVO> children;
} }
\ No newline at end of file
package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu; package cn.iocoder.yudao.module.system.controller.admin.permission.vo.menu;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
...@@ -14,46 +14,52 @@ import javax.validation.constraints.Size; ...@@ -14,46 +14,52 @@ import javax.validation.constraints.Size;
@Data @Data
public class MenuBaseVO { public class MenuBaseVO {
@Schema(description = "菜单名称", required = true, example = "芋道") @ApiModelProperty(value = "菜单名称", required = true, example = "芋道")
@NotBlank(message = "菜单名称不能为空") @NotBlank(message = "菜单名称不能为空")
@Size(max = 50, message = "菜单名称长度不能超过50个字符") @Size(max = 50, message = "菜单名称长度不能超过50个字符")
private String name; private String name;
@Schema(description = "权限标识,仅菜单类型为按钮时,才需要传递", example = "sys:menu:add") @ApiModelProperty(value = "权限标识", example = "sys:menu:add", notes = "仅菜单类型为按钮时,才需要传递")
@Size(max = 100) @Size(max = 100)
private String permission; private String permission;
@Schema(description = "类型,参见 MenuTypeEnum 枚举类", required = true, example = "1") @ApiModelProperty(value = "类型", required = true, example = "1", notes = "参见 MenuTypeEnum 枚举类")
@NotNull(message = "菜单类型不能为空") @NotNull(message = "菜单类型不能为空")
private Integer type; private Integer type;
@Schema(description = "显示顺序不能为空", required = true, example = "1024") @ApiModelProperty(value = "显示顺序不能为空", required = true, example = "1024")
@NotNull(message = "显示顺序不能为空") @NotNull(message = "显示顺序不能为空")
private Integer sort; private Integer sort;
@Schema(description = "父菜单 ID", required = true, example = "1024") @ApiModelProperty(value = "父菜单 ID", required = true, example = "1024")
@NotNull(message = "父菜单 ID 不能为空") @NotNull(message = "父菜单 ID 不能为空")
private Long parentId; private Long parentId;
@Schema(description = "路由地址,仅菜单类型为菜单或者目录时,才需要传", example = "post") @ApiModelProperty(value = "路由地址", example = "post", notes = "仅菜单类型为菜单或者目录时,才需要传")
@Size(max = 200, message = "路由地址不能超过200个字符") @Size(max = 200, message = "路由地址不能超过200个字符")
private String path; private String path;
@Schema(description = "菜单图标,仅菜单类型为菜单或者目录时,才需要传", example = "/menu/list") @ApiModelProperty(value = "菜单图标", example = "/menu/list", notes = "仅菜单类型为菜单或者目录时,才需要传")
private String icon; private String icon;
@Schema(description = "组件路径,仅菜单类型为菜单时,才需要传", example = "system/post/index") @ApiModelProperty(value = "组件路径", example = "system/post/index", notes = "仅菜单类型为菜单时,才需要传")
@Size(max = 200, message = "组件路径不能超过255个字符") @Size(max = 200, message = "组件路径不能超过255个字符")
private String component; private String component;
@Schema(description = "状态,见 CommonStatusEnum 枚举", required = true, example = "1") @ApiModelProperty(value = "组件名", example = "SystemUser")
private String componentName;
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
private Integer status; private Integer status;
@Schema(description = "是否可见", example = "false") @ApiModelProperty(value = "是否可见", example = "false")
private Boolean visible; private Boolean visible;
@Schema(description = "是否缓存", example = "false") @ApiModelProperty(value = "是否缓存", example = "false")
private Boolean keepAlive; private Boolean keepAlive;
} @ApiModelProperty(value = "是否总是显示", example = "false")
\ No newline at end of file private Boolean alwaysShow;
}
...@@ -61,6 +61,8 @@ public class MenuDO extends BaseDO { ...@@ -61,6 +61,8 @@ public class MenuDO extends BaseDO {
private Long parentId; private Long parentId;
/** /**
* 路由地址 * 路由地址
*
* 如果 path 为 http(s) 时,则它是外链
*/ */
private String path; private String path;
/** /**
...@@ -71,6 +73,10 @@ public class MenuDO extends BaseDO { ...@@ -71,6 +73,10 @@ public class MenuDO extends BaseDO {
* 组件路径 * 组件路径
*/ */
private String component; private String component;
/**
* 组件名
*/
private String componentName;
/** /**
* 状态 * 状态
* *
...@@ -87,9 +93,15 @@ public class MenuDO extends BaseDO { ...@@ -87,9 +93,15 @@ public class MenuDO extends BaseDO {
/** /**
* 是否缓存 * 是否缓存
* *
* 只有菜单、目录使用 * 只有菜单、目录使用,否使用 Vue 路由的 keep-alive 特性
* 是否使用 Vue 路由的 keep-alive 特性 * 注意:如果开启缓存,则必须填写 {@link #componentName} 属性,否则无法缓存
*/ */
private Boolean keepAlive; private Boolean keepAlive;
/**
* 是否总是显示
*
* 如果为 false 时,当该菜单只有一个子菜单时,不展示自己,直接展示子菜单
*/
private Boolean alwaysShow;
} }
...@@ -279,6 +279,7 @@ public class MenuServiceImpl implements MenuService { ...@@ -279,6 +279,7 @@ public class MenuServiceImpl implements MenuService {
// 菜单为按钮类型时,无需 component、icon、path 属性,进行置空 // 菜单为按钮类型时,无需 component、icon、path 属性,进行置空
if (MenuTypeEnum.BUTTON.getType().equals(menu.getType())) { if (MenuTypeEnum.BUTTON.getType().equals(menu.getType())) {
menu.setComponent(""); menu.setComponent("");
menu.setComponentName("");
menu.setIcon(""); menu.setIcon("");
menu.setPath(""); menu.setPath("");
} }
......
...@@ -76,9 +76,11 @@ CREATE TABLE IF NOT EXISTS "system_menu" ( ...@@ -76,9 +76,11 @@ CREATE TABLE IF NOT EXISTS "system_menu" (
"path" varchar(200) DEFAULT '', "path" varchar(200) DEFAULT '',
"icon" varchar(100) DEFAULT '#', "icon" varchar(100) DEFAULT '#',
"component" varchar(255) DEFAULT NULL, "component" varchar(255) DEFAULT NULL,
"component_name" varchar(255) DEFAULT NULL,
"status" tinyint NOT NULL DEFAULT '0', "status" tinyint NOT NULL DEFAULT '0',
"visible" bit NOT NULL DEFAULT TRUE, "visible" bit NOT NULL DEFAULT TRUE,
"keep_alive" bit NOT NULL DEFAULT TRUE, "keep_alive" bit NOT NULL DEFAULT TRUE,
"always_show" bit NOT NULL DEFAULT TRUE,
"creator" varchar(64) DEFAULT '', "creator" varchar(64) DEFAULT '',
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updater" varchar(64) DEFAULT '', "updater" varchar(64) DEFAULT '',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论