diff --git a/README.md b/README.md index a46023682..c91056066 100644 --- a/README.md +++ b/README.md @@ -4,39 +4,45 @@ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/blob/master/LICENSE) [![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
-[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-3.1.0-success.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus) +[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-3.2.0-success.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus) [![Spring Boot](https://img.shields.io/badge/Spring%20Boot-2.5-blue.svg)]() -[![JDK-8+](https://img.shields.io/badge/JDK-8+-green.svg)]() +[![JDK-8+](https://img.shields.io/badge/JDK-8-green.svg)]() [![JDK-11](https://img.shields.io/badge/JDK-11-green.svg)]() +[![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]() -RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级 定期与 RuoYi-Vue 同步 +RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级(不兼容原框架) -集成 Lock4j dynamic-datasource OSS存储 等分布式场景解决方案 - -集成 Mybatis-Plus Lombok Hutool 等便捷开发工具 适配重写相关业务 便于开发 - -* 前端开发框架 Vue、Element UI -* 后端开发框架 Spring Boot、Redis -* 容器框架 Undertow 基于 Netty 的高性能容器 -* 权限认证框架 Spring Security、Jwt,支持多终端认证系统 -* 关系数据库 MySQL 适配 8.X -* 缓存数据库 Redis 适配 6.X -* 数据库框架 Mybatis-Plus 快速 CRUD 增加开发效率 插件化支持各类需求 -* 数据库框架 多数据源框架 dynamic-datasource 支持主从与多种类数据库异构 -* 数据库框架 Redis客户端 采用 Redisson 性能更强 -* 数据库框架 性能分析插件 p6spy 更强劲的 SQL 分析 -* 序列化框架 统一使用 jackson 高效可靠 -* 网络框架 Feign、OkHttp3 接口化管理 HTTP 请求 -* 分布式锁 Lock4j 注解锁、工具锁 多种多样 -* 文件存储 OSS 对象存储模块 支持(Minio、七牛、阿里、腾讯) -* 监控框架 spring-boot-admin 全方位服务监控 -* 校验框架 validation 增强接口安全性 严谨性 -* Excel框架 Alibaba EasyExcel 性能优异 扩展性强 -* 文档框架 knife4j 美化接口文档 -* 工具类框架 Hutool、Lombok 减少代码冗余 增加安全性 -* 代码生成器 一键生成前后端代码 -* 部署方式 Docker 容器编排 一键部署业务集群 -* 国际化 Spring 标准国际化方解决方案 +| 功能介绍 | 使用技术 | 文档地址 | 特性注意事项 | +|---|---|---|---| +| 当前框架 | RuoYi-Vue-Plus | [RuoYi-Vue-Plus文档](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/pages) | 重写RuoYi-Vue全方位升级(不兼容原框架) | +| satoken分支 | RuoYi-Vue-Plus-satoken | [satoken分支地址](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/satoken/) | 使用satoken重构权限鉴权(仅供学习不推荐上生产) | +| 单体分支 | RuoYi-Vue-Plus-fast | [fast分支地址](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/fast/) | 单体应用结构 | +| 原框架 | RuoYi-Vue | [RuoYi-Vue官网](http://ruoyi.vip/) | 定期同步需要的功能 | +| 前端开发框架 | Vue、Element UI | [Element UI官网](https://element.eleme.cn/#/zh-CN) | | +| 后端开发框架 | SpringBoot | [SpringBoot官网](https://spring.io/projects/spring-boot/#learn) | | +| 容器框架 | Undertow | [Undertow官网](https://undertow.io/) | 基于 Netty 的高性能容器 | +| 权限认证框架 | Spring Security、Jwt | [SpringSecurity官网](https://spring.io/projects/spring-security#learn) | 支持多终端认证系统 | +| 关系数据库 | MySQL | [MySQL官网](https://dev.mysql.com/) | 适配 8.X 最低 5.7 | +| 缓存数据库 | Redis | [Redis官网](https://redis.io/) | 适配 6.X 最低 4.X | +| 数据库框架 | Mybatis-Plus | [Mybatis-Plus文档](https://baomidou.com/guide/) | 快速 CRUD 增加开发效率 | +| 数据库框架 | p6spy | [p6spy官网](https://p6spy.readthedocs.io/) | 更强劲的 SQL 分析 | +| 多数据源框架 | dynamic-datasource | [dynamic-ds文档](https://www.kancloud.cn/tracy5546/dynamic-datasource/content) | 支持主从与多种类数据库异构 | +| 序列化框架 | Jackson | [Jackson官网](https://github.com/FasterXML/jackson) | 统一使用 jackson 高效可靠 | +| 网络框架 | Feign、OkHttp3 | [Feign官网](https://github.com/OpenFeign/feign) | 接口化管理 HTTP 请求 | +| Redis客户端 | Redisson | [Redisson文档](https://github.com/redisson/redisson/wiki/%E7%9B%AE%E5%BD%95) | 支持单机、集群配置 | +| 分布式限流 | Redisson | [Redisson文档](https://github.com/redisson/redisson/wiki/%E7%9B%AE%E5%BD%95) | 全局、请求IP、集群ID 多种限流 | +| 分布式锁 | Lock4j | [Lock4j官网](https://gitee.com/baomidou/lock4j) | 注解锁、工具锁 多种多样 | +| 分布式幂等 | Lock4j | [Lock4j文档](https://gitee.com/baomidou/lock4j) | 基于分布式锁实现 | +| 文件存储 | Minio | [Minio文档](https://docs.min.io/) | 本地存储 | +| 文件存储 | 七牛、阿里、腾讯 | [OSS使用文档](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/pages?sort_id=4359146&doc_id=1469725) | 云存储 | +| 监控框架 | SpringBoot-Admin | [SpringBoot-Admin文档](https://codecentric.github.io/spring-boot-admin/current/) | 全方位服务监控 | +| 校验框架 | Validation | [Validation文档](https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/) | 增强接口安全性、严谨性 | +| Excel框架 | Alibaba EasyExcel | [EasyExcel文档](https://www.yuque.com/easyexcel/doc/easyexcel) | 性能优异 扩展性强 | +| 文档框架 | Knife4j | [Knife4j文档](https://doc.xiaominfo.com/knife4j/documentation/) | 美化接口文档 | +| 工具类框架 | Hutool、Lombok | [Hutool文档](https://www.hutool.cn/docs/) | 减少代码冗余 增加安全性 | +| 代码生成器 | 适配MP、Knife4j规范化代码 | [Hutool文档](https://www.hutool.cn/docs/) | 一键生成前后端代码 | +| 部署方式 | Docker | [Docker文档](https://docs.docker.com/) | 容器编排 一键部署业务集群 | +| 国际化 | SpringMessage | [SpringMVC文档](https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#mvc) | Spring标准国际化方案 | ## 参考文档 @@ -59,48 +65,15 @@ RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级 定期 欢迎各路英雄豪杰 `PR` 代码 请提交到 `dev` 开发分支 统一测试发版 -框架定位为 `通用后台管理系统(分布式集群强化)` 原则上不接受业务 `PR` - -## 修改RuoYi功能 -### 依赖改动 - -* ORM框架 使用 Mybatis-Plus 简化CRUD (不支持主子表) -* Bean简化 使用 Lombok 简化 get set toString 等等 -* 容器改动 Tomcat 改为 并发性能更好的 undertow -* 移除 pagehelper 改为 Mybatis-Plus 分页 -* 集成 p6spy 更强劲的 SQL 分析 -* 升级 swagger 为 knife4j -* 集成 Hutool 5.X 并重写RuoYi部分功能 -* 集成 Feign 接口化管理 Http 请求(如三方请求 支付,短信,推送等) -* 移除 自带服务监控 改为 spring-boot-admin 全方位监控 -* 增加 demo 模块示例(给不会增加模块的小伙伴做参考) -* 增加 redisson 高性能 Redis 客户端 -* 移除 fastjson 统一使用 jackson 序列化 -* 集成 dynamic-datasource 多数据源(默认支持MySQL,其他种类需自行适配) -* 集成 Lock4j 实现分布式 注解锁、工具锁 多种多样 -* 增加 Docker 容器编排 打包插件与部署脚本 -* 移除 通用上传下载 改为 OSS对象存储 支持(Minio、七牛、阿里、腾讯) -* 移除 RuoYi自带 Excel 工具 改为 EasyExcel 工具 - -### 代码改动 - -* 所有原生功能使用 Mybatis-Plus 与 Lombok 重写 -* 增加 IServicePlus 与 BaseMapperPlus 可自定义通用方法 -* 代码生成模板 改为适配 Mybatis-Plus 的代码 -* 代码生成模板 根据 Alibaba 代码规约 拆分出 VO、BO 等领域对象 -* 代码生成模板 增加 文档注解 与 校验注解 简化通用操作 -* 项目修改为 maven多环境配置 -* 项目配置修改为 application.yml 统一管理 -* 数据权限修改为 适配支持单表、多表 -* 使用 redisson 实现 spring-cache 整合 -* 增加 mybatis-plus 二级缓存 redis 存储 +框架定位为 `通用后台管理系统(分布式集群强化)` 原则上不接受业务 `PR` ### 其他 * 同步升级 RuoYi-Vue * GitHub 地址 [RuoYi-Vue-Plus-github](https://github.com/JavaLionLi/RuoYi-Vue-Plus) * 单模块 fast 分支 [RuoYi-Vue-Plus-fast](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/fast/) -* Oracle 模块 oracle 分支 [RuoYi-Vue-Plus-oracle](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/oracle/) +* satoken 分支 [RuoYi-Vue-Plus-satoken](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/tree/satoken/) +* 用户扩展项目 [扩展项目列表](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/pages?sort_id=4478302&doc_id=1469725) ## 加群与捐献 >[加群与捐献](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/wikis/加群与捐献?sort_id=4104598) @@ -111,26 +84,29 @@ RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级 定期 -## 内置功能 +## 业务功能 -1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。 -2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。 -3. 岗位管理:配置系统用户所属担任职务。 -4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。 -5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。 -6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。 -7. 参数管理:对系统动态配置常用参数。 -8. 通知公告:系统通知公告信息发布维护。 -9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。 -10. 登录日志:系统登录日志记录查询包含登录异常。 -11. 在线用户:当前系统中活跃用户状态监控。 -12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。 -13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。 -14. 系统接口:根据业务代码自动生成相关的api接口文档。 -15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。 -16. 缓存监控:对系统的缓存信息查询,命令统计等。 -17. 在线构建器:拖动表单元素生成相应的HTML代码。 -18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。 +| 功能 | 介绍 | +|---|---| +| 用户管理 | 用户是系统操作者,该功能主要完成系统用户配置。 | +| 部门管理 | 配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。 | +| 岗位管理 | 配置系统用户所属担任职务。 | +| 菜单管理 | 配置系统菜单,操作权限,按钮权限标识等。 | +| 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分。 | +| 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护。 | +| 参数管理 | 对系统动态配置常用参数。 | +| 通知公告 | 系统通知公告信息发布维护。 | +| 操作日志 | 系统正常操作日志记录和查询;系统异常信息日志记录和查询。 | +| 登录日志 | 系统登录日志记录查询包含登录异常。 | +| 文件管理 | 系统文件上传、下载等管理。 | +| 定时任务 | 在线(添加、修改、删除)任务调度包含执行结果日志。 | +| 代码生成 | 前后端代码的生成(java、html、xml、sql)支持CRUD下载 。 | +| 系统接口 | 根据业务代码自动生成相关的api接口文档。 | +| 服务监控 | 监视集群系统CPU、内存、磁盘、堆栈、在线日志、Spring相关配置等。 | +| 缓存监控 | 对系统的缓存信息查询,命令统计等。 | +| 在线构建器 | 拖动表单元素生成相应的HTML代码。 | +| 连接池监视 | 监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。 | +| 使用案例 | 系统的一些功能案例 | ## 演示图例 @@ -172,11 +148,3 @@ RuoYi-Vue-Plus 是基于 RuoYi-Vue 针对 `分布式集群` 场景升级 定期 - -## 在线体验 - -- admin/admin123 -- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。 - -演示地址:http://vue.ruoyi.vip -文档地址:http://doc.ruoyi.vip diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1535f3d6f..e676d5607 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -103,7 +103,7 @@ services: ipv4_address: 172.30.0.54 ruoyi-server1: - image: "ruoyi/ruoyi-server:3.1.0" + image: "ruoyi/ruoyi-server:3.2.0" container_name: ruoyi-server1 environment: # 时区上海 @@ -118,7 +118,7 @@ services: ipv4_address: 172.30.0.60 ruoyi-server2: - image: "ruoyi/ruoyi-server:3.1.0" + image: "ruoyi/ruoyi-server:3.2.0" container_name: ruoyi-server2 environment: # 时区上海 @@ -133,7 +133,7 @@ services: ipv4_address: 172.30.0.61 ruoyi-monitor-admin: - image: "ruoyi/ruoyi-monitor-admin:3.1.0" + image: "ruoyi/ruoyi-monitor-admin:3.2.0" container_name: ruoyi-monitor-admin environment: # 时区上海 diff --git a/pom.xml b/pom.xml index 75f36375c..1429d8d80 100644 --- a/pom.xml +++ b/pom.xml @@ -6,40 +6,44 @@ com.ruoyi ruoyi-vue-plus - 3.1.0 + 3.2.0 RuoYi-Vue-Plus https://gitee.com/JavaLionLi/RuoYi-Vue-Plus RuoYi-Vue-Plus后台管理系统 - 3.1.0 - 2.5.4 + 3.2.0 + 2.5.5 UTF-8 UTF-8 1.8 3.2.0 1.2.6 3.0.3 + 1.5.22 4.1.2 - 2.2.10 + 2.2.11 1.7 0.9.1 - 3.4.3.3 + 3.4.3.4 3.9.1 - 5.7.11 + 5.7.13 3.0.3 11.6 4.9.1 2.5.1 - 3.16.2 + 3.16.3 2.2.1 3.4.1 + + 3.0.1 + 7.8.0 3.13.1 - 5.6.51 + 5.6.55 8.3.0 @@ -48,7 +52,7 @@ ruoyi 1.2.2 - + @@ -73,6 +77,18 @@ com.github.xiaoymin knife4j-spring-boot-starter ${knife4j.version} + + + swagger-annotations + io.swagger + + + + + + io.swagger + swagger-annotations + ${swagger-annotations.version} @@ -86,6 +102,16 @@ com.alibaba easyexcel ${easyexcel.version} + + + org.apache.poi + poi + + + org.apache.poi + poi-ooxml-schemas + + @@ -136,6 +162,12 @@ org.springframework.cloud spring-cloud-starter-openfeign ${feign.version} + + + feign-core + io.github.openfeign + + @@ -184,7 +216,12 @@ - + + + com.sun.xml.bind + jaxb-impl + ${jaxb.version} + @@ -263,48 +300,9 @@ prod warn - health,info + health, info, logfile - - - - jdk8 - - true - 1.8 - - - 1.8 - - - - jdk11 - - 11 - - - 11 - 3.0.1 - - - - - - com.sun.xml.bind - jaxb-impl - ${jaxb.version} - - - - - - - com.sun.xml.bind - jaxb-impl - - - - + \ No newline at end of file diff --git a/ruoyi-extend/pom.xml b/ruoyi-extend/pom.xml index 2a348af4a..6378eb9b8 100644 --- a/ruoyi-extend/pom.xml +++ b/ruoyi-extend/pom.xml @@ -5,7 +5,7 @@ ruoyi-vue-plus com.ruoyi - 3.1.0 + 3.2.0 4.0.0 ruoyi-extend diff --git a/ruoyi-extend/ruoyi-monitor-admin/pom.xml b/ruoyi-extend/ruoyi-monitor-admin/pom.xml index dc0830373..d63b110b9 100644 --- a/ruoyi-extend/ruoyi-monitor-admin/pom.xml +++ b/ruoyi-extend/ruoyi-monitor-admin/pom.xml @@ -5,7 +5,7 @@ ruoyi-extend com.ruoyi - 3.1.0 + 3.2.0 4.0.0 jar diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 58a8c790e..1189455a3 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi-vue-plus", - "version": "3.1.0", + "version": "3.2.0", "description": "RuoYi-Vue-Plus后台管理系统", "author": "LionLi", "license": "MIT", @@ -42,7 +42,7 @@ "core-js": "3.8.1", "echarts": "4.9.0", "element-ui": "2.15.5", - "file-saver": "2.0.4", + "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", "js-beautify": "1.13.0", @@ -71,8 +71,8 @@ "eslint-plugin-vue": "7.2.0", "lint-staged": "10.5.3", "runjs": "4.4.2", - "sass": "1.32.0", - "sass-loader": "10.1.0", + "sass": "1.32.13", + "sass-loader": "10.1.1", "script-ext-html-webpack-plugin": "2.1.5", "svg-sprite-loader": "5.1.1", "vue-template-compiler": "2.6.12" diff --git a/ruoyi-ui/src/api/system/oss.js b/ruoyi-ui/src/api/system/oss.js index 965f137aa..b98bd1f0f 100644 --- a/ruoyi-ui/src/api/system/oss.js +++ b/ruoyi-ui/src/api/system/oss.js @@ -1,6 +1,6 @@ import request from '@/utils/request' -// 查询OSS云存储列表 +// 查询OSS对象存储列表 export function listOss(query) { return request({ url: '/system/oss/list', @@ -9,7 +9,7 @@ export function listOss(query) { }) } -// 删除OSS云存储 +// 删除OSS对象存储 export function delOss(ossId) { return request({ url: '/system/oss/' + ossId, diff --git a/ruoyi-ui/src/api/system/ossConfig.js b/ruoyi-ui/src/api/system/ossConfig.js index 2c6ae0c43..175325e87 100644 --- a/ruoyi-ui/src/api/system/ossConfig.js +++ b/ruoyi-ui/src/api/system/ossConfig.js @@ -1,6 +1,6 @@ import request from '@/utils/request' -// 查询云存储配置列表 +// 查询对象存储配置列表 export function listOssConfig(query) { return request({ url: '/system/oss/config/list', @@ -9,7 +9,7 @@ export function listOssConfig(query) { }) } -// 查询云存储配置详细 +// 查询对象存储配置详细 export function getOssConfig(ossConfigId) { return request({ url: '/system/oss/config/' + ossConfigId, @@ -17,7 +17,7 @@ export function getOssConfig(ossConfigId) { }) } -// 新增云存储配置 +// 新增对象存储配置 export function addOssConfig(data) { return request({ url: '/system/oss/config', @@ -26,7 +26,7 @@ export function addOssConfig(data) { }) } -// 修改云存储配置 +// 修改对象存储配置 export function updateOssConfig(data) { return request({ url: '/system/oss/config', @@ -35,7 +35,7 @@ export function updateOssConfig(data) { }) } -// 删除云存储配置 +// 删除对象存储配置 export function delOssConfig(ossConfigId) { return request({ url: '/system/oss/config/' + ossConfigId, diff --git a/ruoyi-ui/src/components/Crontab/day.vue b/ruoyi-ui/src/components/Crontab/day.vue index 9a38a1ca9..bf9f5664e 100644 --- a/ruoyi-ui/src/components/Crontab/day.vue +++ b/ruoyi-ui/src/components/Crontab/day.vue @@ -75,7 +75,7 @@ export default { if (this.radioValue === 1) { this.$emit('update', 'day', '*', 'day'); this.$emit('update', 'week', '?', 'day'); - this.$emit('update', 'mouth', '*', 'day'); + this.$emit('update', 'month', '*', 'day'); } else { if (this.cron.hour === '*') { this.$emit('update', 'hour', '0', 'day'); @@ -176,4 +176,4 @@ export default { } } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/components/Crontab/index.vue b/ruoyi-ui/src/components/Crontab/index.vue index 629bad7a7..27b4ab36c 100644 --- a/ruoyi-ui/src/components/Crontab/index.vue +++ b/ruoyi-ui/src/components/Crontab/index.vue @@ -2,59 +2,59 @@
- + - - + @@ -70,33 +70,33 @@ - {{contabValueObj.second}} + {{crontabValueObj.second}} - {{contabValueObj.min}} + {{crontabValueObj.min}} - {{contabValueObj.hour}} + {{crontabValueObj.hour}} - {{contabValueObj.day}} + {{crontabValueObj.day}} - {{contabValueObj.mouth}} + {{crontabValueObj.month}} - {{contabValueObj.week}} + {{crontabValueObj.week}} - {{contabValueObj.year}} + {{crontabValueObj.year}} - {{contabValueString}} + {{crontabValueString}}
- +
确定 @@ -112,7 +112,7 @@ import CrontabSecond from "./second.vue"; import CrontabMin from "./min.vue"; import CrontabHour from "./hour.vue"; import CrontabDay from "./day.vue"; -import CrontabMouth from "./mouth.vue"; +import CrontabMonth from "./month.vue"; import CrontabWeek from "./week.vue"; import CrontabYear from "./year.vue"; import CrontabResult from "./result.vue"; @@ -123,12 +123,12 @@ export default { tabTitles: ["秒", "分钟", "小时", "日", "月", "周", "年"], tabActive: 0, myindex: 0, - contabValueObj: { + crontabValueObj: { second: "*", min: "*", hour: "*", day: "*", - mouth: "*", + month: "*", week: "?", year: "", }, @@ -142,7 +142,7 @@ export default { return true; }, resolveExp() { - //反解析 表达式 + // 反解析 表达式 if (this.expression) { let arr = this.expression.split(" "); if (arr.length >= 6) { @@ -152,11 +152,11 @@ export default { min: arr[1], hour: arr[2], day: arr[3], - mouth: arr[4], + month: arr[4], week: arr[5], year: arr[6] ? arr[6] : "", }; - this.contabValueObj = { + this.crontabValueObj = { ...obj, }; for (let i in obj) { @@ -164,7 +164,7 @@ export default { } } } else { - //没有传入的表达式 则还原 + // 没有传入的表达式 则还原 this.clearCron(); } }, @@ -173,122 +173,122 @@ export default { this.tabActive = index; }, // 由子组件触发,更改表达式组成的字段值 - updateContabValue(name, value, from) { - "updateContabValue", name, value, from; - this.contabValueObj[name] = value; + updateCrontabValue(name, value, from) { + "updateCrontabValue", name, value, from; + this.crontabValueObj[name] = value; if (from && from !== name) { console.log(`来自组件 ${from} 改变了 ${name} ${value}`); this.changeRadio(name, value); } }, - //赋值到组件 + // 赋值到组件 changeRadio(name, value) { - let arr = ["second", "min", "hour", "mouth"], + let arr = ["second", "min", "hour", "month"], refName = "cron" + name, - insVlaue; + insValue; if (!this.$refs[refName]) return; if (arr.includes(name)) { if (value === "*") { - insVlaue = 1; + insValue = 1; } else if (value.indexOf("-") > -1) { let indexArr = value.split("-"); isNaN(indexArr[0]) ? (this.$refs[refName].cycle01 = 0) : (this.$refs[refName].cycle01 = indexArr[0]); this.$refs[refName].cycle02 = indexArr[1]; - insVlaue = 2; + insValue = 2; } else if (value.indexOf("/") > -1) { let indexArr = value.split("/"); isNaN(indexArr[0]) ? (this.$refs[refName].average01 = 0) : (this.$refs[refName].average01 = indexArr[0]); this.$refs[refName].average02 = indexArr[1]; - insVlaue = 3; + insValue = 3; } else { - insVlaue = 4; + insValue = 4; this.$refs[refName].checkboxList = value.split(","); } } else if (name == "day") { if (value === "*") { - insVlaue = 1; + insValue = 1; } else if (value == "?") { - insVlaue = 2; + insValue = 2; } else if (value.indexOf("-") > -1) { let indexArr = value.split("-"); isNaN(indexArr[0]) ? (this.$refs[refName].cycle01 = 0) : (this.$refs[refName].cycle01 = indexArr[0]); this.$refs[refName].cycle02 = indexArr[1]; - insVlaue = 3; + insValue = 3; } else if (value.indexOf("/") > -1) { let indexArr = value.split("/"); isNaN(indexArr[0]) ? (this.$refs[refName].average01 = 0) : (this.$refs[refName].average01 = indexArr[0]); this.$refs[refName].average02 = indexArr[1]; - insVlaue = 4; + insValue = 4; } else if (value.indexOf("W") > -1) { let indexArr = value.split("W"); isNaN(indexArr[0]) ? (this.$refs[refName].workday = 0) : (this.$refs[refName].workday = indexArr[0]); - insVlaue = 5; + insValue = 5; } else if (value === "L") { - insVlaue = 6; + insValue = 6; } else { this.$refs[refName].checkboxList = value.split(","); - insVlaue = 7; + insValue = 7; } } else if (name == "week") { if (value === "*") { - insVlaue = 1; + insValue = 1; } else if (value == "?") { - insVlaue = 2; + insValue = 2; } else if (value.indexOf("-") > -1) { let indexArr = value.split("-"); isNaN(indexArr[0]) ? (this.$refs[refName].cycle01 = 0) : (this.$refs[refName].cycle01 = indexArr[0]); this.$refs[refName].cycle02 = indexArr[1]; - insVlaue = 3; + insValue = 3; } else if (value.indexOf("#") > -1) { let indexArr = value.split("#"); isNaN(indexArr[0]) ? (this.$refs[refName].average01 = 1) : (this.$refs[refName].average01 = indexArr[0]); this.$refs[refName].average02 = indexArr[1]; - insVlaue = 4; + insValue = 4; } else if (value.indexOf("L") > -1) { let indexArr = value.split("L"); isNaN(indexArr[0]) ? (this.$refs[refName].weekday = 1) : (this.$refs[refName].weekday = indexArr[0]); - insVlaue = 5; + insValue = 5; } else { this.$refs[refName].checkboxList = value.split(","); - insVlaue = 7; + insValue = 7; } } else if (name == "year") { if (value == "") { - insVlaue = 1; + insValue = 1; } else if (value == "*") { - insVlaue = 2; + insValue = 2; } else if (value.indexOf("-") > -1) { - insVlaue = 3; + insValue = 3; } else if (value.indexOf("/") > -1) { - insVlaue = 4; + insValue = 4; } else { this.$refs[refName].checkboxList = value.split(","); - insVlaue = 5; + insValue = 5; } } - this.$refs[refName].radioValue = insVlaue; + this.$refs[refName].radioValue = insValue; }, // 表单选项的子组件校验数字格式(通过-props传递) checkNumber(value, minLimit, maxLimit) { - //检查必须为整数 + // 检查必须为整数 value = Math.floor(value); if (value < minLimit) { value = minLimit; @@ -303,29 +303,29 @@ export default { }, // 填充表达式 submitFill() { - this.$emit("fill", this.contabValueString); + this.$emit("fill", this.crontabValueString); this.hidePopup(); }, clearCron() { // 还原选择项 ("准备还原"); - this.contabValueObj = { + this.crontabValueObj = { second: "*", min: "*", hour: "*", day: "*", - mouth: "*", + month: "*", week: "?", year: "", }; - for (let j in this.contabValueObj) { - this.changeRadio(j, this.contabValueObj[j]); + for (let j in this.crontabValueObj) { + this.changeRadio(j, this.crontabValueObj[j]); } }, }, computed: { - contabValueString: function() { - let obj = this.contabValueObj; + crontabValueString: function() { + let obj = this.crontabValueObj; let str = obj.second + " " + @@ -335,7 +335,7 @@ export default { " " + obj.day + " " + - obj.mouth + + obj.month + " " + obj.week + (obj.year == "" ? "" : " " + obj.year); @@ -347,7 +347,7 @@ export default { CrontabMin, CrontabHour, CrontabDay, - CrontabMouth, + CrontabMonth, CrontabWeek, CrontabYear, CrontabResult, diff --git a/ruoyi-ui/src/components/Crontab/mouth.vue b/ruoyi-ui/src/components/Crontab/month.vue similarity index 81% rename from ruoyi-ui/src/components/Crontab/mouth.vue rename to ruoyi-ui/src/components/Crontab/month.vue index 7d0e0c84a..619d1e791 100644 --- a/ruoyi-ui/src/components/Crontab/mouth.vue +++ b/ruoyi-ui/src/components/Crontab/month.vue @@ -46,56 +46,56 @@ export default { checkNum: this.check } }, - name: 'crontab-mouth', + name: 'crontab-month', props: ['check', 'cron'], methods: { // 单选按钮值变化时 radioChange() { if (this.radioValue === 1) { - this.$emit('update', 'mouth', '*'); + this.$emit('update', 'month', '*'); this.$emit('update', 'year', '*'); } else { if (this.cron.day === '*') { - this.$emit('update', 'day', '0', 'mouth'); + this.$emit('update', 'day', '0', 'month'); } if (this.cron.hour === '*') { - this.$emit('update', 'hour', '0', 'mouth'); + this.$emit('update', 'hour', '0', 'month'); } if (this.cron.min === '*') { - this.$emit('update', 'min', '0', 'mouth'); + this.$emit('update', 'min', '0', 'month'); } if (this.cron.second === '*') { - this.$emit('update', 'second', '0', 'mouth'); + this.$emit('update', 'second', '0', 'month'); } } switch (this.radioValue) { case 2: - this.$emit('update', 'mouth', this.cycle01 + '-' + this.cycle02); + this.$emit('update', 'month', this.cycle01 + '-' + this.cycle02); break; case 3: - this.$emit('update', 'mouth', this.average01 + '/' + this.average02); + this.$emit('update', 'month', this.average01 + '/' + this.average02); break; case 4: - this.$emit('update', 'mouth', this.checkboxString); + this.$emit('update', 'month', this.checkboxString); break; } }, // 周期两个值变化时 cycleChange() { if (this.radioValue == '2') { - this.$emit('update', 'mouth', this.cycleTotal); + this.$emit('update', 'month', this.cycleTotal); } }, // 平均两个值变化时 averageChange() { if (this.radioValue == '3') { - this.$emit('update', 'mouth', this.averageTotal); + this.$emit('update', 'month', this.averageTotal); } }, // checkbox值变化时 checkboxChange() { if (this.radioValue == '4') { - this.$emit('update', 'mouth', this.checkboxString); + this.$emit('update', 'month', this.checkboxString); } } }, @@ -125,4 +125,4 @@ export default { } } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/components/Crontab/result.vue b/ruoyi-ui/src/components/Crontab/result.vue index 0e75b9ee2..07b963b79 100644 --- a/ruoyi-ui/src/components/Crontab/result.vue +++ b/ruoyi-ui/src/components/Crontab/result.vue @@ -37,7 +37,7 @@ export default { // 获取当前时间精确至[年、月、日、时、分、秒] let nTime = new Date(); let nYear = nTime.getFullYear(); - let nMouth = nTime.getMonth() + 1; + let nMonth = nTime.getMonth() + 1; let nDay = nTime.getDate(); let nHour = nTime.getHours(); let nMin = nTime.getMinutes(); @@ -47,7 +47,7 @@ export default { this.getMinArr(ruleArr[1]); this.getHourArr(ruleArr[2]); this.getDayArr(ruleArr[3]); - this.getMouthArr(ruleArr[4]); + this.getMonthArr(ruleArr[4]); this.getWeekArr(ruleArr[5]); this.getYearArr(ruleArr[6], nYear); // 将获取到的数组赋值-方便使用 @@ -62,7 +62,7 @@ export default { let mIdx = this.getIndex(mDate, nMin); let hIdx = this.getIndex(hDate, nHour); let DIdx = this.getIndex(DDate, nDay); - let MIdx = this.getIndex(MDate, nMouth); + let MIdx = this.getIndex(MDate, nMonth); let YIdx = this.getIndex(YDate, nYear); // 重置月日时分秒的函数(后面用的比较多) const resetSecond = function () { @@ -84,17 +84,17 @@ export default { nDay = DDate[DIdx] resetHour(); } - const resetMouth = function () { + const resetMonth = function () { MIdx = 0; - nMouth = MDate[MIdx] + nMonth = MDate[MIdx] resetDay(); } // 如果当前年份不为数组中当前值 if (nYear !== YDate[YIdx]) { - resetMouth(); + resetMonth(); } // 如果当前月份不为数组中当前值 - if (nMouth !== MDate[MIdx]) { + if (nMonth !== MDate[MIdx]) { resetDay(); } // 如果当前“日”不为数组中当前值 @@ -114,12 +114,12 @@ export default { goYear: for (let Yi = YIdx; Yi < YDate.length; Yi++) { let YY = YDate[Yi]; // 如果到达最大值时 - if (nMouth > MDate[MDate.length - 1]) { - resetMouth(); + if (nMonth > MDate[MDate.length - 1]) { + resetMonth(); continue; } // 循环月份数组 - goMouth: for (let Mi = MIdx; Mi < MDate.length; Mi++) { + goMonth: for (let Mi = MIdx; Mi < MDate.length; Mi++) { // 赋值、方便后面运算 let MM = MDate[Mi]; MM = MM < 10 ? '0' + MM : MM; @@ -127,7 +127,7 @@ export default { if (nDay > DDate[DDate.length - 1]) { resetDay(); if (Mi == MDate.length - 1) { - resetMouth(); + resetMonth(); continue goYear; } continue; @@ -144,10 +144,10 @@ export default { if (Di == DDate.length - 1) { resetDay(); if (Mi == MDate.length - 1) { - resetMouth(); + resetMonth(); continue goYear; } - continue goMouth; + continue goMonth; } continue; } @@ -155,11 +155,11 @@ export default { // 判断日期的合法性,不合法的话也是跳出当前循环 if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true && this.dayRule !== 'workDay' && this.dayRule !== 'lastWeek' && this.dayRule !== 'lastDay') { resetDay(); - continue goMouth; + continue goMonth; } // 如果日期规则中有值时 if (this.dayRule == 'lastDay') { - //如果不是合法日期则需要将前将日期调到合法日期即月末最后一天 + // 如果不是合法日期则需要将前将日期调到合法日期即月末最后一天 if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { @@ -169,7 +169,7 @@ export default { } } } else if (this.dayRule == 'workDay') { - //校验并调整如果是2月30号这种日期传进来时需调整至正常月底 + // 校验并调整如果是2月30号这种日期传进来时需调整至正常月底 if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { DD--; @@ -180,15 +180,15 @@ export default { let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week'); // 当星期日时 if (thisWeek == 0) { - //先找下一个日,并判断是否为月底 + // 先找下一个日,并判断是否为月底 DD++; thisDD = DD < 10 ? '0' + DD : DD; - //判断下一日已经不是合法日期 + // 判断下一日已经不是合法日期 if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { DD -= 3; } } else if (thisWeek == 6) { - //当星期6时只需判断不是1号就可进行操作 + // 当星期6时只需判断不是1号就可进行操作 if (this.dayRuleSup !== 1) { DD--; } else { @@ -196,25 +196,25 @@ export default { } } } else if (this.dayRule == 'weekDay') { - //如果指定了是星期几 - //获取当前日期是属于星期几 + // 如果指定了是星期几 + // 获取当前日期是属于星期几 let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week'); - //校验当前星期是否在星期池(dayRuleSup)中 + // 校验当前星期是否在星期池(dayRuleSup)中 if (Array.indexOf(this.dayRuleSup, thisWeek) < 0) { // 如果到达最大值时 if (Di == DDate.length - 1) { resetDay(); if (Mi == MDate.length - 1) { - resetMouth(); + resetMonth(); continue goYear; } - continue goMouth; + continue goMonth; } continue; } } else if (this.dayRule == 'assWeek') { - //如果指定了是第几周的星期几 - //获取每月1号是属于星期几 + // 如果指定了是第几周的星期几 + // 获取每月1号是属于星期几 let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + DD + ' 00:00:00'), 'week'); if (this.dayRuleSup[1] >= thisWeek) { DD = (this.dayRuleSup[0] - 1) * 7 + this.dayRuleSup[1] - thisWeek + 1; @@ -222,17 +222,17 @@ export default { DD = this.dayRuleSup[0] * 7 + this.dayRuleSup[1] - thisWeek + 1; } } else if (this.dayRule == 'lastWeek') { - //如果指定了每月最后一个星期几 - //校验并调整如果是2月30号这种日期传进来时需调整至正常月底 + // 如果指定了每月最后一个星期几 + // 校验并调整如果是2月30号这种日期传进来时需调整至正常月底 if (this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { while (DD > 0 && this.checkDate(YY + '-' + MM + '-' + thisDD + ' 00:00:00') !== true) { DD--; thisDD = DD < 10 ? '0' + DD : DD; } } - //获取月末最后一天是星期几 + // 获取月末最后一天是星期几 let thisWeek = this.formatDate(new Date(YY + '-' + MM + '-' + thisDD + ' 00:00:00'), 'week'); - //找到要求中最近的那个星期几 + // 找到要求中最近的那个星期几 if (this.dayRuleSup < thisWeek) { DD -= thisWeek - this.dayRuleSup; } else if (this.dayRuleSup > thisWeek) { @@ -254,10 +254,10 @@ export default { if (Di == DDate.length - 1) { resetDay(); if (Mi == MDate.length - 1) { - resetMouth(); + resetMonth(); continue goYear; } - continue goMouth; + continue goMonth; } continue goDay; } @@ -277,10 +277,10 @@ export default { if (Di == DDate.length - 1) { resetDay(); if (Mi == MDate.length - 1) { - resetMouth(); + resetMonth(); continue goYear; } - continue goMouth; + continue goMonth; } continue goDay; } @@ -296,9 +296,9 @@ export default { resultArr.push(YY + '-' + MM + '-' + DD + ' ' + hh + ':' + mm + ':' + ss) nums++; } - //如果条数满了就退出循环 + // 如果条数满了就退出循环 if (nums == 5) break goYear; - //如果到达最大值时 + // 如果到达最大值时 if (si == sDate.length - 1) { resetSecond(); if (mi == mDate.length - 1) { @@ -308,10 +308,10 @@ export default { if (Di == DDate.length - 1) { resetDay(); if (Mi == MDate.length - 1) { - resetMouth(); + resetMonth(); continue goYear; } - continue goMouth; + continue goMonth; } continue goDay; } @@ -323,7 +323,7 @@ export default { } //goMin }//goHour }//goDay - }//goMouth + }//goMonth } // 判断100年内的结果条数 if (resultArr.length == 0) { @@ -339,7 +339,7 @@ export default { }, - //用于计算某位数字在数组中的索引 + // 用于计算某位数字在数组中的索引 getIndex(arr, value) { if (value <= arr[0] || value > arr[arr.length - 1]) { return 0; @@ -365,7 +365,7 @@ export default { } }, // 获取"月"数组 - getMouthArr(rule) { + getMonthArr(rule) { this.dateArr[4] = this.getOrderArr(1, 12); if (rule.indexOf('-') >= 0) { this.dateArr[4] = this.getCycleArr(rule, 12, false) @@ -377,7 +377,7 @@ export default { }, // 获取"日"数组-主要为日期规则 getWeekArr(rule) { - //只有当日期规则的两个值均为“”时则表达日期是有选项的 + // 只有当日期规则的两个值均为“”时则表达日期是有选项的 if (this.dayRule == '' && this.dayRuleSup == '') { if (rule.indexOf('-') >= 0) { this.dayRule = 'weekDay'; @@ -401,7 +401,7 @@ export default { this.dayRule = 'weekDay'; this.dayRuleSup = this.getAssignArr(rule) } - //如果weekDay时将7调整为0【week值0即是星期日】 + // 如果weekDay时将7调整为0【week值0即是星期日】 if (this.dayRule == 'weekDay') { for (let i = 0; i < this.dayRuleSup.length; i++) { if (this.dayRuleSup[i] == 7) { @@ -502,7 +502,7 @@ export default { }, // 根据规则返回一个具有周期性的数组 getCycleArr(rule, limit, status) { - //status--表示是否从0开始(则从1开始) + // status--表示是否从0开始(则从1开始) let arr = []; let cycleArr = rule.split('-'); let min = Number(cycleArr[0]); @@ -520,7 +520,7 @@ export default { arr.sort(this.compare) return arr; }, - //比较数字大小(用于Array.sort) + // 比较数字大小(用于Array.sort) compare(value1, value2) { if (value2 - value1 > 0) { return -1; @@ -563,4 +563,4 @@ export default { } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/components/Crontab/second.vue b/ruoyi-ui/src/components/Crontab/second.vue index 0776e7597..0fdf3386d 100644 --- a/ruoyi-ui/src/components/Crontab/second.vue +++ b/ruoyi-ui/src/components/Crontab/second.vue @@ -86,7 +86,7 @@ export default { } }, othChange() { - //反解析 + // 反解析 let ins = this.cron.second ('反解析 second', ins); if (ins === '*') { @@ -130,4 +130,4 @@ export default { } } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/components/Crontab/week.vue b/ruoyi-ui/src/components/Crontab/week.vue index cb4c542ba..5ad949d6b 100644 --- a/ruoyi-ui/src/components/Crontab/week.vue +++ b/ruoyi-ui/src/components/Crontab/week.vue @@ -71,8 +71,8 @@ export default { this.$emit('update', 'week', '*'); this.$emit('update', 'year', '*'); } else { - if (this.cron.mouth === '*') { - this.$emit('update', 'mouth', '0', 'week'); + if (this.cron.month === '*') { + this.$emit('update', 'month', '0', 'week'); } if (this.cron.day === '*') { this.$emit('update', 'day', '0', 'week'); @@ -164,4 +164,4 @@ export default { } } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/components/Crontab/year.vue b/ruoyi-ui/src/components/Crontab/year.vue index 8cb886f76..800dfa522 100644 --- a/ruoyi-ui/src/components/Crontab/year.vue +++ b/ruoyi-ui/src/components/Crontab/year.vue @@ -55,12 +55,12 @@ export default { } }, name: 'crontab-year', - props: ['check', 'mouth', 'cron'], + props: ['check', 'month', 'cron'], methods: { // 单选按钮值变化时 radioChange() { - if (this.cron.mouth === '*') { - this.$emit('update', 'mouth', '0', 'year'); + if (this.cron.month === '*') { + this.$emit('update', 'month', '0', 'year'); } if (this.cron.day === '*') { this.$emit('update', 'day', '0', 'year'); @@ -141,4 +141,4 @@ export default { this.fullYear = Number(new Date().getFullYear()); } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/components/DictData/index.js b/ruoyi-ui/src/components/DictData/index.js new file mode 100644 index 000000000..c2a0359cc --- /dev/null +++ b/ruoyi-ui/src/components/DictData/index.js @@ -0,0 +1,21 @@ +import Vue from 'vue' +import DataDict from '@/utils/dict' +import { getDicts as getDicts } from '@/api/system/dict/data' + +function install() { + Vue.use(DataDict, { + metas: { + '*': { + labelField: 'dictLabel', + valueField: 'dictValue', + request(dictMeta) { + return getDicts(dictMeta.type).then(res => res.data) + }, + }, + }, + }) +} + +export default { + install, +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/DictTag/index.vue b/ruoyi-ui/src/components/DictTag/index.vue index 742f38c0c..4c196c489 100644 --- a/ruoyi-ui/src/components/DictTag/index.vue +++ b/ruoyi-ui/src/components/DictTag/index.vue @@ -1,22 +1,23 @@