173 Commits

Author SHA1 Message Date
RuoYi
d97c94ffc8 用户密码支持自定义配置规则 2026-04-17 14:48:40 +08:00
RuoYi
fc9d7cb4d8 优化代码生成同步操作column_type没更新问题 2026-04-16 14:25:56 +08:00
RuoYi
24f28090e0 优化白名单支持对通配符路径匹配 2026-04-16 13:44:20 +08:00
RuoYi
48d94f7b48 通知公告新增阅读用户&详细 2026-04-14 16:44:19 +08:00
RuoYi
44fa3cebc3 新增标签页样式chrome风格 2026-04-13 10:11:21 +08:00
RuoYi
6f17a6077e 新增代码生成详情页功能 2026-04-12 10:42:21 +08:00
RuoYi
c922c9d68c 自动导入配置 2026-04-10 16:38:20 +08:00
RuoYi
c58a9eacde 代码生成修改拖拽时显示手指样式 2026-04-10 16:36:50 +08:00
RuoYi
f3b34285f3 用户列表新增抽屉效果详细信息 2026-04-09 14:14:14 +08:00
RuoYi
2b26b1457e 优化样式 2026-04-03 22:34:44 +08:00
RuoYi
8befe8a1c3 数据权限注解支持自定义字段名 2026-04-03 15:41:27 +08:00
RuoYi
6f57599599 新增Excel导入组件ExcelImportDialog 2026-04-03 08:57:01 +08:00
RuoYi
3b35a0d76a 新增树分割组件TreePanel 2026-04-02 11:37:10 +08:00
RuoYi
27d87d3101 代码生成支持表单布局选项 2026-04-02 11:11:37 +08:00
RuoYi
a57fbeb1a3 支持表格列显隐状态记忆 2026-03-31 19:50:13 +08:00
RuoYi
9753007f94 支持多sheet导出 2026-03-31 18:49:10 +08:00
RuoYi
37143acc77 若依 3.6.8 2026-03-30 08:01:54 +08:00
RuoYi
f02efef9ef 优化页签全屏显示 2026-03-26 00:53:54 +08:00
RuoYi
20c6c6d0bd 优化快速点击页签刷新出现404问题 2026-03-25 21:23:05 +08:00
RuoYi
9565ac51a4 修复typescript版多表代码生成报错问题 2026-03-25 13:03:39 +08:00
RuoYi
34335db4a0 菜单管理列表新增类型显示 2026-03-24 15:34:47 +08:00
RuoYi
0027382952 优化菜单主题风格 2026-03-24 10:55:55 +08:00
RuoYi
5ee971821b 升级axios到最新版本0.30.3 2026-03-23 11:45:26 +08:00
RuoYi
427b313376 优化页签显示 2026-03-23 11:43:53 +08:00
RuoYi
535658af9f 添加持久化标签页开关功能 2026-03-22 23:30:14 +08:00
RuoYi
d5e8ebfc31 添加持久化标签页开关功能 2026-03-22 21:17:01 +08:00
RuoYi
14d99de58c 优化tag全屏为页签内区域 2026-03-22 21:16:51 +08:00
RuoYi
23278020ac 菜单搜索支持文本高亮&数量提示 2026-03-22 16:56:32 +08:00
RuoYi
3550349018 首页新增通知公告消息提醒 2026-03-22 00:15:57 +08:00
RuoYi
06f6d1b47f 新增锁定屏幕功能 2026-03-21 23:30:00 +08:00
RuoYi
c363bf88f5 菜单管理支持批量保存排序 2026-03-21 22:53:07 +08:00
RuoYi
4681d299d7 保存排序添加编辑权限 2026-03-21 22:41:08 +08:00
RuoYi
51d4d129fb 优化定时任务详情页展示&补充执行时间字段 2026-03-21 22:21:21 +08:00
RuoYi
bbc899dc45 字典类型列表新增抽屉效果详细信息 2026-03-21 22:07:33 +08:00
RuoYi
771c775120 操作日志详细页面优化 2026-03-21 21:19:16 +08:00
RuoYi
0c4d414e08 优化RightToolbar搜索栏切换动画 2026-03-21 21:19:04 +08:00
RuoYi
a42431e012 TypeScript前端代码生成模板同步到最新 2026-03-21 21:18:53 +08:00
若依
8dadbd9a51 !454 readme中添加nacos版本说明
Merge pull request !454 from magic/update/readme-sp3
2026-03-14 05:38:38 +00:00
gowshwah
ea6ea5755f readme中添加nacos版本说明 2026-03-14 00:35:05 +08:00
若依
996e0eb48b !451 update docker image version for springboot3 branch
Merge pull request !451 from magic/fix/docker-sp3
2026-03-12 14:22:36 +00:00
gowshwah
c3d3a1cbdb update docker image version for springboot3 branch 2026-03-12 17:09:00 +08:00
RuoYi
255d2aa813 TypeScript前端代码生成模板同步到最新 2026-03-12 14:13:44 +08:00
RuoYi
3b24a44cf0 update README.md 2026-03-11 14:42:17 +08:00
RuoYi
43728c99f0 升级spring-cloud相关组件到最新版 2026-03-10 11:47:38 +08:00
RuoYi
c600cb7ac1 升级fastjson到最新版2.0.61 2026-03-09 17:58:01 +08:00
RuoYi
6a074c8832 update deprecated 2026-03-09 17:57:51 +08:00
RuoYi
fefad4e147 update userid default value 2026-03-09 17:57:03 +08:00
RuoYi
316117524d 优化Excel自定义格式样式重复创建问题 2026-03-09 15:14:51 +08:00
RuoYi
c5cd75fe17 优化字典类型属性提醒说明 2026-02-11 15:38:32 +08:00
RuoYi
704fefced2 update README.md 2026-01-28 21:19:53 +08:00
RuoYi
15e0913714 优化代码 2026-01-28 21:19:42 +08:00
RuoYi
df0f7d16a4 添加菜单路由地址和名称的校验规则 2026-01-09 11:19:12 +08:00
RuoYi
a5ced3b531 优化防重提交间隔时间可自定义 2026-01-08 13:42:35 +08:00
RuoYi
2d9ce89b2e 修复Excel自定义格式样式污染问题 2026-01-06 13:55:05 +08:00
RuoYi
ec8e955955 copyright 2026 2026-01-05 15:10:29 +08:00
RuoYi
0398aa0333 将isAdmin方法统一到SecurityUtils 2026-01-05 15:10:16 +08:00
RuoYi
14063cd6ed 若依 3.6.7 2025-12-22 09:17:25 +08:00
RuoYi
a8b6799d8d 优化topbar顶部菜单样式 2025-12-18 14:46:55 +08:00
RuoYi
a492ebf41e 默认固定头部 2025-12-18 14:42:47 +08:00
RuoYi
8d6790b358 优化字典组件值宽松匹配 2025-12-16 16:42:25 +08:00
RuoYi
c763a0f356 升级fastjson到最新版2.0.60 2025-12-16 13:47:55 +08:00
RuoYi
227f62dbe2 升级commons.io到最新版本2.21.0 2025-12-16 13:47:39 +08:00
RuoYi
e5d494d018 升级druid到最新版本1.2.27 2025-12-16 13:47:17 +08:00
RuoYi
0f9e698fb5 菜单导航设置支持纯顶部 2025-12-16 13:03:25 +08:00
RuoYi
3d4c6f4fa1 优化数据权限控制逻辑,放开permission限制 2025-12-04 17:36:17 +08:00
RuoYi
40a52af8ee 优化代码 2025-12-04 16:51:23 +08:00
RuoYi
9e67041290 优化表单构建关闭页签销毁复制插件 2025-12-04 13:55:04 +08:00
RuoYi
c17ed8bb04 支持Excel导出对象的多个子列表 2025-12-03 11:26:41 +08:00
RuoYi
64e5288625 优化生成代码下载的zip文件名 2025-12-03 10:28:19 +08:00
RuoYi
afe8236b42 网页标题设置新增SET_TITLE方法 2025-12-02 19:31:12 +08:00
RuoYi
21ee628202 支持Excel导出对象的多个子列表 2025-12-02 19:14:14 +08:00
RuoYi
b54e00529a 登录/注册页面底部版权信息修改为读取配置 2025-12-02 15:34:40 +08:00
RuoYi
3f4484107a 修复v3时间控件between选择后清空报错问题 2025-12-02 15:00:49 +08:00
RuoYi
341c9a8851 修复表单构建移除所有控件后切换路由回来空白问题 2025-12-02 13:14:02 +08:00
RuoYi
81bfef9a3c 修复combo属性过多sheet出现的异常问题 2025-11-13 11:58:59 +08:00
RuoYi
7238dbb807 修复固定头部时出现的导航栏偏移问题 2025-09-04 20:06:41 +08:00
RuoYi
ff9068b9d4 文件支持防盗链配置 2025-09-02 13:27:08 +08:00
RuoYi
ea8351cce0 优化代码 2025-08-28 13:52:06 +08:00
RuoYi
8ef3b5490e 优化代码 2025-08-27 16:02:32 +08:00
RuoYi
1284f6763f 用户导入添加验证提示 2025-08-23 11:47:17 +08:00
RuoYi
eeb6303200 优化布局设置显示 2025-08-23 11:47:07 +08:00
RuoYi
513335d9db 修复用户归属部门无法修改为空问题 2025-08-21 15:00:54 +08:00
RuoYi
1a373f41e6 columns default value 2025-08-09 16:14:01 +08:00
RuoYi
e73aa3b497 显示列信息支持对象格式 2025-08-09 15:19:23 +08:00
RuoYi
d5d6b9789c 自动识别json对象白名单配置范围缩小 2025-08-09 15:18:37 +08:00
RuoYi
6b0bd81f56 添加新群号:112869560 2025-07-19 19:28:57 +08:00
RuoYi
0be3a0720d 优化定时任务包名白名单匹配方式 2025-06-20 11:56:39 +08:00
RuoYi
83e5f2e24d 优化Excel统计行数值的单元格样式显示 2025-06-19 14:54:12 +08:00
RuoYi
942df70c21 用户头像更换后移除旧头像文件 2025-06-06 19:38:36 +08:00
RuoYi
32cb5e8851 若依 3.6.6 2025-05-30 08:03:15 +08:00
若依
ffce2af11e !412 升级到springboot3后 HttpServletResponse的包名发生变化
Merge pull request !412 from coach-tam/N/A
2025-05-28 01:52:58 +00:00
coach-tam
aeb698985b 升级到springboot3后 HttpServletResponse的包名发生变化
Signed-off-by: coach-tam <yaorange2019@sina.com>
2025-05-28 01:44:11 +00:00
RuoYi
ec15604725 升级fastjson到最新版2.0.57 2025-05-26 11:17:18 +08:00
RuoYi
67642ed19a 注册账号设置默认密码最后更新时间 2025-05-26 11:17:06 +08:00
RuoYi
604345f72b 添加底部版权信息及开关 2025-05-24 14:34:05 +08:00
RuoYi
eb01cde0b1 添加页签图标显示开关功能 2025-05-23 14:58:02 +08:00
RuoYi
217119575d 账号密码支持自定义更新周期 2025-05-23 10:35:58 +08:00
RuoYi
86d5eae71f 初始密码支持自定义修改策略 2025-05-23 10:33:48 +08:00
RuoYi
aa72ac20d1 升级commons.io到最新版本2.19.0 2025-05-15 10:28:53 +08:00
RuoYi
b1e0418c77 delete eslint&vue-meta 2025-05-15 10:28:18 +08:00
RuoYi
8e32654d46 优化导航栏显示昵称&设置 2025-05-09 14:02:42 +08:00
RuoYi
c8c0127185 菜单搜索支持键盘选择&悬浮主题背景 2025-05-07 13:25:29 +08:00
RuoYi
46e75b4d7e 图片上传组件新增disabled属性 2025-05-06 19:15:04 +08:00
RuoYi
a735ed90f7 add columnName Drag 2025-05-06 14:54:22 +08:00
RuoYi
e64bb2d7be 修复上传组件被多次引用拖动仅对第一个有效的问题 2025-05-06 13:47:03 +08:00
RuoYi
496d6113c4 update icon 2025-05-06 11:09:46 +08:00
RuoYi
f871171d32 上传组件新增拖动排序属性 2025-04-30 10:31:53 +08:00
RuoYi
a36e19d88e 优化Excel匹配数值型.0结尾 2025-04-28 11:22:04 +08:00
RuoYi
235728fdb9 remove all semicolons 2025-04-27 11:56:31 +08:00
RuoYi
381077253d 使用Gateway CacheRequestBody代替CacheRequestFilter 2025-04-25 15:12:16 +08:00
RuoYi
5f3a93d12e 优化代码 2025-04-25 15:12:03 +08:00
RuoYi
e22323971e 富文本复制粘贴图片上传至url 2025-04-24 18:20:01 +08:00
RuoYi
f593d36745 update package.json 2025-04-24 18:19:44 +08:00
RuoYi
9978594069 优化低版本node无法启动的问题 2025-04-22 12:07:33 +08:00
RuoYi
9026c8e49e 优化代码 2025-04-22 12:07:27 +08:00
RuoYi
c359924d4e 显隐列组件支持全选/全不选 2025-04-21 15:30:44 +08:00
RuoYi
f8d726f966 优化菜单搜索查询页 2025-04-21 13:28:45 +08:00
RuoYi
cbdbc91784 支持文件&图片组件自定义地址&参数 2025-04-18 13:25:08 +08:00
RuoYi
3a61e8df5a 优化角色禁用不允许分配 2025-04-17 15:42:20 +08:00
RuoYi
9d242f0182 update status name 2025-04-17 15:42:03 +08:00
RuoYi
2afad16eba remove dev runjs 2025-03-18 16:04:35 +08:00
RuoYi
637a628cfc 登录页和注册页表头使用VUE_APP_TITLE配置值 2025-03-18 16:04:25 +08:00
RuoYi
785f3c3515 update handleTree 2025-03-14 16:14:24 +08:00
RuoYi
85dc2aef8f 优化代码 2025-03-11 12:55:20 +08:00
RuoYi
3a91cb47a4 修复actuator暴漏问题 2025-03-10 11:47:59 +08:00
RuoYi
7d611b754f 优化isAdmin方法,避免脱敏模块security依赖 2025-03-07 12:59:16 +08:00
RuoYi
6be79bd7d4 菜单管理新增路由名称 2025-03-06 11:09:28 +08:00
RuoYi
13942b41b2 优化顶部菜单搜索栏为多层级显示 2025-03-05 20:32:38 +08:00
RuoYi
583f653890 文件上传组件新增disabled属性&类型 2025-03-05 20:32:30 +08:00
RuoYi
9ebb230d66 优化导出Excel日期格式双击离开后与设定的格式不一致问题 2025-03-05 20:32:18 +08:00
RuoYi
65cc92286f 代码生成列表支持按时间排序 2025-03-05 20:31:10 +08:00
RuoYi
fe1badd9a6 优化空指针异常时无法获取错误信息问题 2025-03-05 20:30:52 +08:00
RuoYi
48830b1181 优化定时任务字符包含多个括号导致数据错误 2025-03-05 20:30:04 +08:00
RuoYi
4257ca91b2 优化代码 2025-03-05 20:28:38 +08:00
RuoYi
15b2502ffa update ry_config_20250224 2025-02-24 16:26:28 +08:00
RuoYi
eb035d179b add nacos2.5.0 sql 2025-02-18 08:42:57 +08:00
RuoYi
b959a91d26 copyright 2025 2025-01-07 10:58:41 +08:00
RuoYi
28377670bb 代码生成新增配置是否允许文件覆盖到本地 2024-12-25 16:40:33 +08:00
RuoYi
1215d5d474 优化导入带标题文件关闭清理 2024-12-25 16:37:26 +08:00
RuoYi
7b4fbf4e13 update sqlkeyword 2024-12-25 16:37:14 +08:00
RuoYi
eaeb8d759e 优化特殊字符密码修改失败问题 2024-12-17 14:40:29 +08:00
RuoYi
bba6433113 优化TopNav内链菜单点击没有高亮(IB8WHJ) 2024-12-17 14:39:49 +08:00
RuoYi
61a49b5951 优化菜单管理切换Mini布局错乱问题 2024-12-17 14:39:37 +08:00
RuoYi
8d631d1325 用户管理过滤掉已禁用部门 2024-12-11 11:52:50 +08:00
RuoYi
d302cdb324 修改主题样式本地读取 2024-12-10 16:43:28 +08:00
RuoYi
33af14461f 优化文件异常输入流未关闭的问题 2024-12-07 14:53:38 +08:00
RuoYi
cff2e611c5 白名单支持对通配符路径匹配 2024-12-07 14:53:07 +08:00
RuoYi
72bc8bfc53 Excel注解支持wrapText是否允许内容换行 2024-12-07 14:52:52 +08:00
RuoYi
4a6603d8b3 修复导出子列表对象只能在最后的问题 2024-12-07 14:52:31 +08:00
RuoYi
2b425e62e4 修复默认关闭Tags-Views时,内链页面打不开 2024-11-27 20:02:51 +08:00
RuoYi
a837f49291 修复TopNav无法正确获取active的问题 2024-11-27 20:02:40 +08:00
RuoYi
3a2e434a53 菜单面包屑导航支持多层级显示 2024-11-25 22:40:49 +08:00
RuoYi
08484eea75 优化代码 2024-11-25 22:40:21 +08:00
RuoYi
a5f3be78ec 分栏参数微调 2024-11-22 14:53:51 +08:00
RuoYi
0fc5c7199e 用户管理支持分栏拖动 2024-11-22 14:16:07 +08:00
RuoYi
1af0861a3b 优化代码 2024-11-22 14:15:50 +08:00
RuoYi
bea8f763bb update .env.staging 2024-11-22 14:15:13 +08:00
RuoYi
78d958ec8c 若依 3.6.5 2024-11-13 11:21:07 +08:00
RuoYi
101f7e3cf7 升级quill到最新版本2.0.2 2024-11-13 11:10:27 +08:00
RuoYi
b92fb20439 支持自定义显示Excel属性列 2024-11-07 22:48:35 +08:00
RuoYi
264d6e320e update pom.xml 2024-11-06 22:07:16 +08:00
RuoYi
1f0eb72a58 优化代码 2024-11-06 22:06:44 +08:00
RuoYi
eb2e089d57 优化无用户编号不校验数据权限 2024-11-05 16:45:33 +08:00
RuoYi
efdc96abb6 校检文件名是否包含特殊字符 2024-11-05 16:44:17 +08:00
RuoYi
64dc968949 优化身份证脱敏正则 2024-10-21 17:31:33 +08:00
RuoYi
dcc303a8d4 优化权限更新后同步缓存 2024-10-21 17:31:22 +08:00
RuoYi
cc0c6deb38 操作日志记录DELETE请求参数 2024-10-17 13:20:28 +08:00
RuoYi
c2157d7f2a 修改代码生成上级菜单字段类型 2024-10-17 13:20:06 +08:00
RuoYi
f6c8be3285 修复角色禁用权限不失效问题 2024-09-21 12:06:51 +08:00
RuoYi
4f8c2215b3 update ry_config 2024-09-14 12:52:24 +08:00
RuoYi
6f94f4d1e0 update ry_config 2024-09-02 20:30:38 +08:00
RuoYi
f2aad7a76c 优化提示 2024-09-02 20:26:00 +08:00
RuoYi
c50a2b4200 update springboot3 2024-08-29 21:00:35 +08:00
62 changed files with 1635 additions and 708 deletions

View File

@@ -13,8 +13,8 @@
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
* 采用前后端分离的模式,微服务版本前端(基于 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue))
* 后端采用Spring Boot、Spring Cloud & Alibaba。
* 本仓库为RuoYi-Cloud的Spring Boot 3 的版本,保持同步更新
* 后端采用Spring Boot3、Spring Cloud & Alibaba。
* 注册中心、配置中心选型Nacos权限认证使用Redis。
* 流量控制框架选型Sentinel分布式事务选型Seata。
* 阿里云优惠券:[点我进入](http://aly.ruoyi.vip),腾讯云优惠券:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
@@ -23,11 +23,11 @@
RuoYi-Cloud 后端项目提供 Spring Boot 2.x / 3.x / 4.x 多版本分支的并行维护。
| 名称 | 说明 | 地址 |
| :---------------- | :----------------------------------- | :-------------------------------------------------------- |
| 名称 | 说明 | 地址 |
| :---------------- | :------------------------ | :-------------------------------------------------------- |
| master 默认分支 | Spring Boot 4.x (JDK 17+、Nacos 3.x) | https://gitee.com/y_project/RuoYi-Cloud |
| springboot3 分支 | Spring Boot 3.x (JDK 17+、Nacos 3.x) | https://gitee.com/y_project/RuoYi-Cloud/tree/springboot3 |
| springboot2 分支 | Spring Boot 2.x (JDK 8+、 Nacos 2.x) | https://gitee.com/y_project/RuoYi-Cloud/tree/springboot2 |
| springboot2 分支 | Spring Boot 2.x (JDK 8+、Nacos 2.x) | https://gitee.com/y_project/RuoYi-Cloud/tree/springboot2 |
RuoYi-Cloud 前端项目提供 Vue 2.x / 3.x / JavaScript TypeScript 版本均可混用搭配

20
pom.xml
View File

@@ -17,14 +17,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<spring-boot.version>4.0.3</spring-boot.version>
<spring-cloud.version>2025.1.0</spring-cloud.version>
<spring-cloud-alibaba.version>2025.1.0.0</spring-cloud-alibaba.version>
<spring-boot-admin.version>4.0.2</spring-boot-admin.version>
<mybatis-spring-boot.version>4.0.1</mybatis-spring-boot.version>
<spring-boot.version>3.5.11</spring-boot.version>
<spring-cloud.version>2025.0.1</spring-cloud.version>
<spring-cloud-alibaba.version>2025.0.0.0</spring-cloud-alibaba.version>
<spring-boot-admin.version>3.5.8</spring-boot-admin.version>
<mybatis-spring.version>3.0.5</mybatis-spring.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>2.1.0</pagehelper.boot.version>
<druid.version>1.2.28</druid.version>
<druid.version>1.2.27</druid.version>
<dynamic-ds.version>4.5.0</dynamic-ds.version>
<commons.io.version>2.21.0</commons.io.version>
<velocity.version>2.3</velocity.version>
@@ -32,7 +32,7 @@
<jjwt.version>0.9.1</jjwt.version>
<minio.version>8.2.2</minio.version>
<poi.version>4.1.2</poi.version>
<springdoc.version>3.0.2</springdoc.version>
<springdoc.version>2.8.16</springdoc.version>
<transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
</properties>
@@ -95,9 +95,9 @@
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot.version}</version>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<!-- io常用工具类 -->

View File

@@ -37,7 +37,7 @@
<!-- SpringBoot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- SpringBoot Actuator -->

View File

@@ -2,7 +2,7 @@ package com.ruoyi.auth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
/**

View File

@@ -55,8 +55,8 @@
<!-- Mybatis Spring -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</dependency>
<!-- Hibernate Validator -->
@@ -68,7 +68,7 @@
<!-- Spring Aop -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aspectj</artifactId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!-- Jackson -->

View File

@@ -31,6 +31,9 @@ public class GenConstants
/** 上级菜单名称字段 */
public static final String PARENT_MENU_NAME = "parentMenuName";
/** 生成详情页开关 */
public static final String GEN_VIEW = "genView";
/** 数据库字符串类型 */
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };

View File

@@ -1,12 +1,8 @@
package com.ruoyi.common.core.utils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.Strings;
import org.springframework.util.AntPathMatcher;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.text.StrFormatter;
@@ -371,87 +367,12 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
}
/**
* 字符串转set
*
* @param str 字符串
* @param sep 分隔符
* @return set集合
*/
public static final Set<String> str2Set(String str, String sep)
{
return new HashSet<String>(str2List(str, sep, true, false));
}
/**
* 字符串转list
*
* @param str 字符串
* @param sep 分隔符
* @return list集合
*/
public static final List<String> str2List(String str, String sep)
{
return str2List(str, sep, true, false);
}
/**
* 字符串转list
*
* @param str 字符串
* @param sep 分隔符
* @param filterBlank 过滤纯空白
* @param trim 去掉首尾空白
* @return list集合
*/
public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim)
{
List<String> list = new ArrayList<String>();
if (StringUtils.isEmpty(str))
{
return list;
}
// 过滤空白字符串
if (filterBlank && StringUtils.isBlank(str))
{
return list;
}
String[] split = str.split(sep);
for (String string : split)
{
if (filterBlank && StringUtils.isBlank(string))
{
continue;
}
if (trim)
{
string = string.trim();
}
list.add(string);
}
return list;
}
/**
* 检查子字符串是否存在
*
* @param seq 检查的字符串
* @param searchSeq 查找的字符串
* @return 结果
*/
public static boolean contains(final CharSequence seq, final CharSequence searchSeq)
{
return Strings.CS.contains(seq, searchSeq);
}
/**
* 判断给定的collection列表中是否包含数组array 判断给定的数组array中是否包含给定的元素value
*
* @param collection 给定的集合
* @param array 给定的数组
* @return 结果
* @return boolean 结果
*/
public static boolean containsAny(Collection<String> collection, String... array)
{
@@ -472,198 +393,6 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
}
/**
* 判断是否包含给定数组中的任意一个。
*
* @param cs 要判断的字符串
* @param searchCharSequences 要判断的数组
* @return 结果
*/
public static boolean containsAny(final CharSequence cs, final CharSequence... searchCharSequences)
{
return Strings.CS.containsAny(cs, searchCharSequences);
}
/**
* 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
*
* @param cs 指定字符串
* @param searchCharSequences 需要检查的字符串数组
* @return 是否包含任意一个字符串
*/
public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences)
{
if (isEmpty(cs) || isEmpty(searchCharSequences))
{
return false;
}
for (CharSequence testStr : searchCharSequences)
{
if (containsIgnoreCase(cs, testStr))
{
return true;
}
}
return false;
}
/**
* 检查是否包含要搜索的字符串,忽略大小写
*
* @param str 要检查的字符串
* @param searchStr 要查找的字符串
* @return 如果包含要搜索的字符串忽略大小写则返回true如果不包含或返回false
*/
public static boolean containsIgnoreCase(final CharSequence str, final CharSequence searchStr)
{
return Strings.CI.contains(str, searchStr);
}
/**
* 检查字符串是否以任意前缀开始
*
* @param sequence 要检查的字符串
* @param searchStrings 区分大小写的字符串前缀数组
* @return 结果
*/
public static boolean startsWithAny(final CharSequence sequence, final CharSequence... searchStrings)
{
return Strings.CS.startsWithAny(sequence, searchStrings);
}
/**
* 不区分大小写地检查一个字符串是否以指定前缀开头。
*
* @param str 待检查的字符串
* @param 要查找的前缀
* @return 结果
*/
public static boolean startsWithIgnoreCase(final CharSequence str, final CharSequence prefix)
{
return Strings.CI.startsWith(str, prefix);
}
/**
* 比较两个字符串是否相同
*
* @param cs1 第一个字符串
* @param cs2 第二个字符串
* @return 如果给定对象与字符串相等,则返回 true否则返回 false
*/
public static boolean equals(final CharSequence cs1, final CharSequence cs2)
{
return Strings.CS.equals(cs1, cs2);
}
/**
* 替换字符串中所有匹配的字符
*
* @param text 要搜索和替换的文本
* @param searchString 要搜索的字符串
* @param replacement 用于替换的字符串
* @return 处理完所有替换后的文本
*/
public static String replace(final String text, final String searchString, final String replacement)
{
return Strings.CS.replace(text, searchString, replacement);
}
/**
* 仅当子字符串位于源字符串末尾时才将其移除,否则返回源字符串。
* @param str 要搜索的源字符串
* @param remove 要搜索并移除的字符串
* @return 如果找到并移除了字符串,则返回移除后的子字符串
*/
public static String removeEnd(final String str, final String remove)
{
return Strings.CS.removeEnd(str, remove);
}
/**
* 查找字符串首次出现位置的索引
*
* @param seq 要检查的字符串
* @param searchSeq 要查找的字符串
* @return 返回指定字符在字符串中第一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1
*/
public static int indexOf(final CharSequence seq, final CharSequence searchSeq)
{
return Strings.CS.indexOf(seq, searchSeq);
}
/**
* 检查字符串是否以指定的后缀结尾
*
* @param str 要检查的字符
* @param suffix 要检查的后缀
* @return 若参数与该字符串末尾相符 true;否则 false
*/
public static boolean endsWith(final CharSequence str, final CharSequence suffix)
{
return Strings.CS.endsWith(str, suffix);
}
/**
* 将给定的字符串与数组进行比较
*
* @param string 要比较的字符串
* @param searchStrings 字符串数组
* @return 如果字符串等于(区分大小写){@code searchStrings}中的任意其他元素则返回true如果{@code searchStrings}为null或不包含匹配项则返回false
*/
public static boolean equalsAny(final CharSequence string, final CharSequence... searchStrings)
{
return Strings.CS.equalsAny(string, searchStrings);
}
/**
* 检查一个字符串是否以任意提供的区分大小写的后缀结尾。
*
* @param sequence 要检查的字符串
* @param searchStrings 要查找的区分大小写的字符串数组
* @return 如果输入参数{@code sequence}为null且未提供任何{@code searchStrings},或者输入{@code sequence}以任意提供的区分大小写的{@code searchStrings}结尾,则返回{@code true}。
*/
public static boolean endsWithAny(final CharSequence sequence, final CharSequence... searchStrings)
{
return Strings.CS.endsWithAny(sequence, searchStrings);
}
/**
* 不区分大小写地检查字符序列是否以指定的后缀结尾
*
* @param str 要检查的字符序列
* @param suffix 要查找的后缀
* @return 如果字符序列以该后缀结尾(不区分大小写),或两者均为{@code null},则返回{@code true}
*/
public static boolean endsWithIgnoreCase(final CharSequence str, final CharSequence suffix)
{
return Strings.CI.endsWith(str, suffix);
}
/**
* 指定范围内查找字符串,忽略大小写
*
* @param str 要检查的字符串
* @param searchStr 要查找的字符串
* @return 搜索字符串的第一个索引,如果未找到匹配项则返回 -1
*/
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr)
{
return Strings.CI.indexOf(str, searchStr);
}
/**
* Compares given {@code string} to a CharSequences vararg of {@code searchStrings},
* returning {@code true} if the {@code string} is equal to any of the {@code searchStrings}, ignoring case.
*
* @param string to compare, may be {@code null}.
* @param searchStrings a vararg of strings, may be {@code null}.
* @return {@code true} if the string is equal (case-insensitive) to any other element of {@code searchStrings};
*/
public static boolean equalsAnyIgnoreCase(final CharSequence string, final CharSequence... searchStrings)
{
return Strings.CI.equalsAny(string, searchStrings);
}
/**
* 驼峰转下划线命名
*/
@@ -735,22 +464,6 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
return false;
}
/**
* 删除最后一个字符串
*
* @param str 输入字符串
* @param spit 以什么类型结尾的
* @return 截取后的字符串
*/
public static String lastStringDel(String str, String spit)
{
if (!StringUtils.isEmpty(str) && str.endsWith(spit))
{
return str.subSequence(0, str.length() - 1).toString();
}
return str;
}
/**
* 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如HELLO_WORLD->HelloWorld
*

View File

@@ -7,13 +7,13 @@ import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.apache.poi.ss.usermodel.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
/**
* 反射工具类. 提供调用getter/setter方法, 访问私有变量, 调用私有方法, 获取泛型类型Class, 被AOP过的真实类等工具函数.

View File

@@ -7,17 +7,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.constant.HttpStatus;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.PageUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.sql.SqlUtil;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageDomain;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.core.web.page.TableSupport;
/**
* web层通用数据处理
@@ -53,19 +48,6 @@ public class BaseController
PageUtils.startPage();
}
/**
* 设置请求排序数据
*/
protected void startOrderBy()
{
PageDomain pageDomain = TableSupport.buildPageRequest();
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
{
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.orderBy(orderBy);
}
}
/**
* 清理分页的线程变量
*/

View File

@@ -20,21 +20,15 @@
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-4-starter</artifactId>
<artifactId>druid-spring-boot-3-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- Dynamic DataSource -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot4-starter</artifactId>
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
<version>${dynamic-ds.version}</version>
<exclusions>
<exclusion>
<artifactId>mybatis-spring</artifactId>
<groupId>org.mybatis</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

View File

@@ -1,10 +1,11 @@
package com.ruoyi.common.redis.configure;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@@ -14,15 +15,15 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
*
* @author ruoyi
*/
@SuppressWarnings("deprecation")
@Configuration
@EnableCaching
@AutoConfigureBefore(RedisAutoConfiguration.class)
@SuppressWarnings("deprecation")
public class RedisConfig extends CachingConfigurerSupport
{
@Bean(name = "ruoyiRedisTemplate")
@Primary
@Bean
@SuppressWarnings(value = { "unchecked", "rawtypes" })
public RedisTemplate<Object, Object> ruoyiRedisTemplate(RedisConnectionFactory connectionFactory)
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
{
RedisTemplate<Object, Object> template = new RedisTemplate<>();
template.setConnectionFactory(connectionFactory);

View File

@@ -1,7 +1,6 @@
package com.ruoyi.common.security.annotation;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.core.annotation.AliasFor;
import java.lang.annotation.*;
/**
@@ -18,7 +17,6 @@ public @interface EnableRyFeignClients
{
String[] value() default {};
@AliasFor(annotation = EnableFeignClients.class, attribute = "basePackages")
String[] basePackages() default { "com.ruoyi" };
Class<?>[] basePackageClasses() default {};

View File

@@ -1,8 +1,7 @@
package com.ruoyi.common.security.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import java.util.TimeZone;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
/**
@@ -16,11 +15,8 @@ public class ApplicationConfig
* 时区配置
*/
@Bean
public ObjectMapper objectMapper()
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization()
{
ObjectMapper objectMapper = JsonMapper.builder().build();
objectMapper.findAndRegisterModules();
objectMapper.setTimeZone(TimeZone.getDefault());
return objectMapper;
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
}
}

View File

@@ -20,7 +20,7 @@
<!-- SpringBoot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- SpringDoc webmvc -->

View File

@@ -2,6 +2,8 @@ package com.ruoyi.common.swagger.config;
import java.util.ArrayList;
import java.util.List;
import org.springdoc.core.configuration.SpringDocConfiguration;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -19,6 +21,7 @@ import io.swagger.v3.oas.models.servers.Server;
*
* @author ruoyi
*/
@AutoConfiguration(before = SpringDocConfiguration.class)
@EnableConfigurationProperties(SpringDocProperties.class)
@ConditionalOnProperty(name = "springdoc.api-docs.enabled", havingValue = "true", matchIfMissing = true)
public class SpringDocAutoConfiguration

View File

@@ -2,7 +2,7 @@ package com.ruoyi.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* 网关启动程序

View File

@@ -3,12 +3,12 @@ package com.ruoyi.gateway.handler;
import org.springframework.cloud.gateway.support.NotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.web.server.ResponseStatusException;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.WebExceptionHandler;
import com.ruoyi.common.core.utils.ServletUtils;
import reactor.core.publisher.Mono;
@@ -19,7 +19,7 @@ import reactor.core.publisher.Mono;
*/
@Order(-1)
@Configuration
public class GatewayExceptionHandler implements WebExceptionHandler
public class GatewayExceptionHandler implements ErrorWebExceptionHandler
{
private static final Logger log = LoggerFactory.getLogger(GatewayExceptionHandler.class);

View File

@@ -44,7 +44,7 @@
<!-- SpringBoot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Minio -->

View File

@@ -2,7 +2,7 @@ package com.ruoyi.file;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
/**
* 文件服务

View File

@@ -101,6 +101,9 @@ public class GenTable extends BaseEntity
/** 上级菜单名称字段 */
private String parentMenuName;
/** 是否生成详情页 */
private boolean isView;
public Long getTableId()
{
return tableId;
@@ -351,6 +354,16 @@ public class GenTable extends BaseEntity
this.parentMenuName = parentMenuName;
}
public boolean isView()
{
return isView;
}
public void setView(boolean isView)
{
this.isView = isView;
}
public boolean isSub()
{
return isSub(this.tplCategory);

View File

@@ -209,7 +209,7 @@ public class GenTableServiceImpl implements IGenTableService
VelocityContext context = VelocityUtils.prepareContext(table);
// 获取模板列表
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
List<String> templates = VelocityUtils.getTemplateList(table);
for (String template : templates)
{
// 渲染模板
@@ -253,10 +253,10 @@ public class GenTableServiceImpl implements IGenTableService
VelocityContext context = VelocityUtils.prepareContext(table);
// 获取模板列表
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
List<String> templates = VelocityUtils.getTemplateList(table);
for (String template : templates)
{
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "api.ts.vm", "type.ts.vm", "index.ts.vm", "index.vue.vm", "index-tree.vue.vm", "view.vue.vm"))
{
// 渲染模板
StringWriter sw = new StringWriter();
@@ -371,7 +371,7 @@ public class GenTableServiceImpl implements IGenTableService
VelocityContext context = VelocityUtils.prepareContext(table);
// 获取模板列表
List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory(), table.getTplWebType());
List<String> templates = VelocityUtils.getTemplateList(table);
for (String template : templates)
{
// 渲染模板
@@ -524,12 +524,14 @@ public class GenTableServiceImpl implements IGenTableService
String treeName = paramsObj.getString(GenConstants.TREE_NAME);
Long parentMenuId = paramsObj.getLongValue(GenConstants.PARENT_MENU_ID);
String parentMenuName = paramsObj.getString(GenConstants.PARENT_MENU_NAME);
boolean isView = paramsObj.getBooleanValue(GenConstants.GEN_VIEW);
genTable.setTreeCode(treeCode);
genTable.setTreeParentCode(treeParentCode);
genTable.setTreeName(treeName);
genTable.setParentMenuId(parentMenuId);
genTable.setParentMenuName(parentMenuName);
genTable.setView(isView);
}
}

View File

@@ -14,7 +14,7 @@ import com.ruoyi.gen.domain.GenTable;
import com.ruoyi.gen.domain.GenTableColumn;
/**
* 模板工具类
* 模板处理工具类
*
* @author ruoyi
*/
@@ -68,6 +68,7 @@ public class VelocityUtils
velocityContext.put("columns", genTable.getColumns());
velocityContext.put("table", genTable);
velocityContext.put("dicts", getDicts(genTable));
setExtensionsContext(velocityContext, genTable.getOptions());
setMenuVelocityContext(velocityContext, genTable);
if (GenConstants.TPL_TREE.equals(tplCategory))
{
@@ -80,6 +81,13 @@ public class VelocityUtils
return velocityContext;
}
public static void setExtensionsContext(VelocityContext context, String options)
{
JSONObject paramsObj = JSONObject.parseObject(options);
boolean genView = genView(paramsObj);
context.put("genView", genView);
}
public static void setMenuVelocityContext(VelocityContext context, GenTable genTable)
{
String options = genTable.getOptions();
@@ -134,8 +142,12 @@ public class VelocityUtils
* @param tplWebType 前端类型
* @return 模板列表
*/
public static List<String> getTemplateList(String tplCategory, String tplWebType)
public static List<String> getTemplateList(GenTable table)
{
String tplWebType = table.getTplWebType();
String tplCategory = table.getTplCategory();
JSONObject paramsObj = JSONObject.parseObject(table.getOptions());
boolean isView = genView(paramsObj);
String useWebType = "vm/vue";
String apiTemplate = "vm/js/api.js.vm";
if (StringUtils.equals(ELEMENT_PLUS, tplWebType))
@@ -174,6 +186,10 @@ public class VelocityUtils
templates.add(useWebType + "/index.vue.vm");
templates.add("vm/java/sub-domain.java.vm");
}
if (isView)
{
templates.add(useWebType + "/view.vue.vm");
}
return templates;
}
@@ -253,6 +269,10 @@ public class VelocityUtils
{
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
}
else if (template.contains("view.vue.vm"))
{
fileName = StringUtils.format("{}/views/{}/{}/view.vue", vuePath, moduleName, businessName);
}
return fileName;
}
@@ -394,6 +414,21 @@ public class VelocityUtils
return StringUtils.EMPTY;
}
/**
* 扩展功能/生成详情页
*
* @param paramsObj 生成其他选项
* @return 是否生成详细页
*/
public static boolean genView(JSONObject paramsObj)
{
if (StringUtils.isNotNull(paramsObj) && paramsObj.containsKey(GenConstants.GEN_VIEW))
{
return paramsObj.getBoolean(GenConstants.GEN_VIEW);
}
return false;
}
/**
* 获取树名称
*

View File

@@ -94,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<set>
<if test="columnComment != null">column_comment = #{columnComment},</if>
<if test="javaType != null">java_type = #{javaType},</if>
<if test="columnType != null">column_type = #{columnType},</if>
<if test="javaField != null">java_field = #{javaField},</if>
<if test="isInsert != null">is_insert = #{isInsert},</if>
<if test="isEdit != null">is_edit = #{isEdit},</if>

View File

@@ -139,6 +139,15 @@
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
#if($genView)
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleViewData(scope.row)"
v-hasPermi="['${permissionPrefix}:query']"
>详情</el-button>
#end
<el-button
size="mini"
type="text"
@@ -164,6 +173,10 @@
</el-table-column>
</el-table>
#if($genView)
<!-- ${functionName}详情抽屉 -->
<${businessName}-view-drawer ref="${businessName}ViewRef" />
#end
<!-- 添加或修改${functionName}对话框 -->
#if($table.formColNum == 2)
#set($dialogWidth = "800px")
@@ -319,6 +332,9 @@
<script>
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
#if($genView)
import ${BusinessName}ViewDrawer from "./view"
#end
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
@@ -328,6 +344,9 @@ export default {
dicts: [${dicts}],
#end
components: {
#if($genView)
${BusinessName}ViewDrawer,
#end
Treeselect
},
data() {
@@ -483,6 +502,12 @@ export default {
this.refreshTable = true
})
},
#if($genView)
/** 详情按钮操作 */
handleViewData(row) {
this.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
},
#end
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()

View File

@@ -153,6 +153,15 @@
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
#if($genView)
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleViewData(scope.row)"
v-hasPermi="['${permissionPrefix}:query']"
>详情</el-button>
#end
<el-button
size="mini"
type="text"
@@ -179,6 +188,10 @@
@pagination="getList"
/>
#if($genView)
<!-- ${functionName}详情抽屉 -->
<${businessName}-view-drawer ref="${businessName}ViewRef" />
#end
<!-- 添加或修改${functionName}对话框 -->
#if($table.formColNum == 2)
#set($dialogWidth = "800px")
@@ -387,9 +400,15 @@
<script>
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
#if($genView)
import ${BusinessName}ViewDrawer from "./view"
#end
export default {
name: "${BusinessName}",
#if($genView)
components: { ${BusinessName}ViewDrawer },
#end
#if(${dicts} != '')
dicts: [${dicts}],
#end
@@ -623,6 +642,12 @@ export default {
handle${subClassName}SelectionChange(selection) {
this.checked${subClassName} = selection.map(item => item.index)
},
#end
#if($genView)
/** 详情按钮操作 */
handleViewData(row) {
this.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
},
#end
/** 导出按钮操作 */
handleExport() {

View File

@@ -136,6 +136,9 @@
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
#if($genView)
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
#end
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
@@ -143,6 +146,10 @@
</el-table-column>
</el-table>
#if($genView)
<!-- ${functionName}详情抽屉 -->
<${businessName}-view-drawer ref="${businessName}ViewRef" />
#end
<!-- 添加或修改${functionName}对话框 -->
#if($table.formColNum == 2)
#set($dialogWidth = "800px")
@@ -307,6 +314,9 @@
<script setup name="${BusinessName}">
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
#if($genView)
import ${BusinessName}ViewDrawer from "./view"
#end
const { proxy } = getCurrentInstance()
#if(${dicts} != '')
@@ -334,7 +344,7 @@ const data = reactive({
queryParams: {
#foreach ($column in $columns)
#if($column.query)
$column.javaField: null#if($foreach.count != $columns.size()),#end
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
#end
#end
},
@@ -391,13 +401,13 @@ function getTreeselect() {
})
}
// 取消按钮
/** 取消按钮 */
function cancel() {
open.value = false
reset()
}
// 表单重置
/** 表单重置 */
function reset() {
form.value = {
#foreach ($column in $columns)
@@ -449,6 +459,13 @@ function toggleExpandAll() {
refreshTable.value = true
})
}
#if($genView)
/** 详情按钮操作 */
function handleViewData(row) {
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
}
#end
/** 修改按钮操作 */
async function handleUpdate(row) {

View File

@@ -148,6 +148,9 @@
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
#if($genView)
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
#end
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
</template>
@@ -162,6 +165,10 @@
@pagination="getList"
/>
#if($genView)
<!-- ${functionName}详情抽屉 -->
<${businessName}-view-drawer ref="${businessName}ViewRef" />
#end
<!-- 添加或修改${functionName}对话框 -->
#if($table.formColNum == 2)
#set($dialogWidth = "800px")
@@ -381,6 +388,9 @@
<script setup name="${BusinessName}">
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
#if($genView)
import ${BusinessName}ViewDrawer from "./view"
#end
const { proxy } = getCurrentInstance()
#if(${dicts} != '')
@@ -417,7 +427,7 @@ const data = reactive({
pageSize: 10,
#foreach ($column in $columns)
#if($column.query)
$column.javaField: null#if($foreach.count != $columns.size()),#end
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
#end
#end
},
@@ -465,13 +475,13 @@ function getList() {
})
}
// 取消按钮
/** 取消按钮 */
function cancel() {
open.value = false
reset()
}
// 表单重置
/** 表单重置 */
function reset() {
form.value = {
#foreach ($column in $columns)
@@ -506,7 +516,7 @@ function resetQuery() {
handleQuery()
}
// 多选框选中数据
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.${pkColumn.javaField})
single.value = selection.length != 1
@@ -586,7 +596,7 @@ function handleAdd${subClassName}() {
#foreach($column in $subTable.columns)
#if($column.pk || $column.javaField == ${subTableFkclassName})
#elseif($column.list && "" != $javaField)
obj.$column.javaField = ""
obj.$column.javaField = undefined
#end
#end
${subclassName}List.value.push(obj)
@@ -610,6 +620,13 @@ function handle${subClassName}SelectionChange(selection) {
checked${subClassName}.value = selection.map(item => item.index)
}
#end
#if($genView)
/** 详情按钮操作 */
function handleViewData(row) {
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
}
#end
/** 导出按钮操作 */
function handleExport() {

View File

@@ -0,0 +1,83 @@
<template>
<el-drawer title="${functionName}详情" v-model="visible" direction="rtl" size="60%" append-to-body :before-close="handleClose" class="detail-drawer">
<div v-loading="loading" class="drawer-content">
<h4 class="section-header">基本信息</h4>
#set($i = 0)
#foreach($column in $columns)
#if(!$column.pk && $column.list)
#set($dictType=$column.dictType)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($i % 2 == 0)
<el-row :gutter="20" class="mb8">
#end
<el-col :span="12">
<div class="info-item">
<label class="info-label">${comment}</label>
<span class="info-value plaintext">
#if("" != $dictType)
#if($column.htmlType == "checkbox")
<dict-tag :options="${dictType}" :value="info.${javaField} ? info.${javaField}.split(',') : []" />
#else
<dict-tag :options="${dictType}" :value="info.${javaField}" />
#end
#elseif($column.htmlType == "datetime")
{{ parseTime(info.${javaField}, '{y}-{m}-{d}') }}
#elseif($column.htmlType == "imageUpload")
<image-preview :src="info.${javaField}" :width="60" :height="60" />
#else
{{ info.${javaField} }}
#end
</span>
</div>
</el-col>
#set($i = $i + 1)
#if($i % 2 == 0)
</el-row>
#end
#end
#end
#if($i % 2 != 0)
</el-row>
#end
</div>
</el-drawer>
</template>
<script setup name="${BusinessName}ViewDrawer">
import { get${BusinessName} } from '@/api/${moduleName}/${businessName}'
#if(${dicts} != '')
#set($dictsNoSymbol=$dicts.replace("'", ""))
const { ${dictsNoSymbol} } = useDict(${dicts})
#end
const visible = ref(false)
const loading = ref(false)
const info = reactive({})
const open = async (${pkColumn.javaField}) => {
visible.value = true
loading.value = true
try {
const res = await get${BusinessName}(${pkColumn.javaField})
Object.assign(info, res.data || {})
} catch (error) {
console.error('获取${functionName}信息失败:', error)
} finally {
loading.value = false
}
}
function handleClose() {
visible.value = false
Object.keys(info).forEach(key => delete info[key])
}
defineExpose({ open })
</script>

View File

@@ -136,6 +136,9 @@
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
#if($genView)
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
#end
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
@@ -143,6 +146,10 @@
</el-table-column>
</el-table>
#if($genView)
<!-- ${functionName}详情抽屉 -->
<${businessName}-view-drawer ref="${businessName}ViewRef" />
#end
<!-- 添加或修改${functionName}对话框 -->
#if($table.formColNum == 2)
#set($dialogWidth = "800px")
@@ -307,6 +314,9 @@
<script setup lang="ts" name="${BusinessName}">
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
#if($genView)
import ${BusinessName}ViewDrawer from "./view"
#end
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
import type { TreeSelect } from '@/types/api/common'
@@ -393,13 +403,13 @@ function getTreeselect() {
})
}
// 取消按钮
/** 取消按钮 */
function cancel() {
open.value = false
reset()
}
// 表单重置
/** 表单重置 */
function reset() {
form.value = {
#foreach ($column in $columns)
@@ -451,6 +461,13 @@ function toggleExpandAll() {
refreshTable.value = true
})
}
#if($genView)
/** 详情按钮操作 */
function handleViewData(row: ${ClassName}) {
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
}
#end
/** 修改按钮操作 */
async function handleUpdate(row: ${ClassName}) {

View File

@@ -148,6 +148,9 @@
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
#if($genView)
<el-button link type="primary" icon="View" @click="handleViewData(scope.row)" v-hasPermi="['${permissionPrefix}:query']">详情</el-button>
#end
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
</template>
@@ -162,6 +165,10 @@
@pagination="getList"
/>
#if($genView)
<!-- ${functionName}详情抽屉 -->
<${businessName}-view-drawer ref="${businessName}ViewRef" />
#end
<!-- 添加或修改${functionName}对话框 -->
#if($table.formColNum == 2)
#set($dialogWidth = "800px")
@@ -379,13 +386,16 @@
</div>
</template>
<script setup lang="ts" name="Config">
<script setup lang="ts" name="${BusinessName}">
#if($table.sub)
import type { ${ClassName}, ${subClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
#else
import type { ${ClassName}, ${BusinessName}QueryParams } from "@/types/api/${moduleName}/${businessName}"
#end
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}"
#if($genView)
import ${BusinessName}ViewDrawer from "./view"
#end
const { proxy } = getCurrentInstance()
#if(${dicts} != '')
@@ -470,13 +480,13 @@ function getList() {
})
}
// 取消按钮
/** 取消按钮 */
function cancel() {
open.value = false
reset()
}
// 表单重置
/** 表单重置 */
function reset() {
form.value = {
#foreach ($column in $columns)
@@ -511,7 +521,7 @@ function resetQuery() {
handleQuery()
}
// 多选框选中数据
/** 多选框选中数据 */
function handleSelectionChange(selection: ${ClassName}[]) {
ids.value = selection.map(item => item.${pkColumn.javaField})
single.value = selection.length != 1
@@ -615,6 +625,13 @@ function handle${subClassName}SelectionChange(selection: any[]) {
checked${subClassName}.value = selection.map(item => item.index)
}
#end
#if($genView)
/** 详情按钮操作 */
function handleViewData(row: ${ClassName}) {
proxy.#[[$]]#refs["${businessName}ViewRef"].open(row.${pkColumn.javaField})
}
#end
/** 导出按钮操作 */
function handleExport() {

View File

@@ -0,0 +1,84 @@
<template>
<el-drawer title="${functionName}详情" v-model="visible" direction="rtl" size="60%" append-to-body :before-close="handleClose" class="detail-drawer">
<div v-loading="loading" class="drawer-content">
<h4 class="section-header">基本信息</h4>
#set($i = 0)
#foreach($column in $columns)
#if(!$column.pk && $column.list)
#set($dictType=$column.dictType)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($i % 2 == 0)
<el-row :gutter="20" class="mb8">
#end
<el-col :span="12">
<div class="info-item">
<label class="info-label">${comment}</label>
<span class="info-value plaintext">
#if("" != $dictType)
#if($column.htmlType == "checkbox")
<dict-tag :options="${dictType}" :value="info.${javaField} ? info.${javaField}.split(',') : []" />
#else
<dict-tag :options="${dictType}" :value="info.${javaField}" />
#end
#elseif($column.htmlType == "datetime")
{{ parseTime(info.${javaField}, '{y}-{m}-{d}') }}
#elseif($column.htmlType == "imageUpload")
<image-preview :src="info.${javaField}" :width="60" :height="60" />
#else
{{ info.${javaField} }}
#end
</span>
</div>
</el-col>
#set($i = $i + 1)
#if($i % 2 == 0)
</el-row>
#end
#end
#end
#if($i % 2 != 0)
</el-row>
#end
</div>
</el-drawer>
</template>
<script setup lang="ts" name="${BusinessName}ViewDrawer">
import type { ${ClassName} } from "@/types/api/${moduleName}/${businessName}"
import { get${BusinessName} } from '@/api/${moduleName}/${businessName}'
#if(${dicts} != '')
#set($dictsNoSymbol=$dicts.replace("'", ""))
const { ${dictsNoSymbol} } = useDict(${dicts})
#end
const visible = ref<boolean>(false)
const loading = ref<boolean>(false)
const info = reactive<Partial<${ClassName}>>({})
const open = async (#if($pkColumn.javaType == "Long" || $pkColumn.javaType == "Integer")${pkColumn.javaField}: number#else${pkColumn.javaField}: string#end): Promise<void> => {
visible.value = true
loading.value = true
try {
const res = await get${BusinessName}(${pkColumn.javaField})
Object.assign(info, res.data ?? {})
} catch (error) {
console.error('获取${functionName}信息失败:', error)
} finally {
loading.value = false
}
}
const handleClose = (): void => {
visible.value = false
Object.keys(info).forEach(key => delete (info as any)[key])
}
defineExpose({ open })
</script>

View File

@@ -0,0 +1,86 @@
<template>
<el-drawer title="${functionName}详情" :visible.sync="visible" direction="rtl" size="60%" append-to-body :before-close="handleClose" custom-class="detail-drawer">
<div v-loading="loading" class="drawer-content">
<h4 class="section-header">基本信息</h4>
#set($i = 0)
#foreach($column in $columns)
#if(!$column.pk && $column.list)
#set($dictType=$column.dictType)
#set($javaField=$column.javaField)
#set($parentheseIndex=$column.columnComment.indexOf(""))
#if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
#else
#set($comment=$column.columnComment)
#end
#if($i % 2 == 0)
<el-row :gutter="20" class="mb8">
#end
<el-col :span="12">
<div class="info-item">
<label class="info-label">${comment}</label>
<span class="info-value plaintext">
#if("" != $dictType)
#if($column.htmlType == "checkbox")
<dict-tag :options="dict.type.${dictType}" :value="info.${javaField} ? info.${javaField}.split(',') : []" />
#else
<dict-tag :options="dict.type.${dictType}" :value="info.${javaField}" />
#end
#elseif($column.htmlType == "datetime")
{{ parseTime(info.${javaField}, '{y}-{m}-{d}') }}
#else
{{ info.${javaField} }}
#end
</span>
</div>
</el-col>
#set($i = $i + 1)
#if($i % 2 == 0)
</el-row>
#end
#end
#end
#if($i % 2 != 0)
</el-row>
#end
</div>
</el-drawer>
</template>
<script>
import { get${BusinessName} } from '@/api/${moduleName}/${businessName}'
export default {
name: '${BusinessName}ViewDrawer',
#foreach($column in $columns)
#if("" != $column.dictType)
#set($hasDicts = true)
#break
#end
#end
#if($hasDicts)
dicts: [#foreach($column in $columns)#if("" != $column.dictType)'${column.dictType}'#if($foreach.hasNext), #end#end#end],
#end
data() {
return {
visible: false,
loading: false,
info: {}
}
},
methods: {
open(${pkColumn.javaField}) {
this.visible = true
this.loading = true
get${BusinessName}(${pkColumn.javaField}).then(res => {
this.info = res.data || {}
}).finally(() => {
this.loading = false
})
},
handleClose() {
this.visible = false
}
}
}
</script>

View File

@@ -43,8 +43,14 @@
<!-- Quartz -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<exclusions>
<exclusion>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Mysql Connector -->

View File

@@ -54,7 +54,6 @@ public class SysNoticeController extends BaseController
/**
* 根据通知公告编号获取详细信息
*/
@RequiresPermissions("system:notice:query")
@GetMapping(value = "/{noticeId}")
public AjaxResult getInfo(@PathVariable Long noticeId)
{
@@ -125,6 +124,19 @@ public class SysNoticeController extends BaseController
return success();
}
/**
* 已读用户列表数据
*/
@RequiresPermissions("system:notice:list")
@GetMapping("/readUsers/list")
@ResponseBody
public TableDataInfo readUsersList(Long noticeId, String searchValue)
{
startPage();
List<?> list = noticeReadService.selectReadUsersByNoticeId(noticeId, searchValue);
return getDataTable(list);
}
/**
* 删除通知公告
*/

View File

@@ -189,11 +189,18 @@ public class SysUserController extends BaseController
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
ajax.put("pwdChrtype", getSysAccountChrtype());
ajax.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
ajax.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
return ajax;
}
// 获取用户密码自定义配置规则
public String getSysAccountChrtype()
{
return Convert.toStr(configService.selectConfigByKey("sys.account.chrtype"), "0");
}
// 检查初始密码是否提醒修改
public boolean initPasswordIsModify(Date pwdUpdateDate)
{

View File

@@ -1,9 +1,10 @@
package com.ruoyi.system.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysNoticeRead;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.domain.SysNoticeRead;
/**
* 公告已读记录 数据层
@@ -55,6 +56,15 @@ public interface SysNoticeReadMapper
*/
public List<SysNotice> selectNoticeListWithReadStatus(@Param("userId") Long userId, @Param("limit") int limit);
/**
* 查询已阅读某公告的用户列表
*
* @param noticeId 公告ID
* @param searchValue 搜索值
* @return 已读用户列表
*/
public List<Map<String, Object>> selectReadUsersByNoticeId(@Param("noticeId") Long noticeId, @Param("searchValue") String searchValue);
/**
* 公告删除时清理对应已读记录
*

View File

@@ -1,6 +1,7 @@
package com.ruoyi.system.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.system.domain.SysNotice;
/**
@@ -43,6 +44,15 @@ public interface ISysNoticeReadService
*/
public void markReadBatch(Long userId, Long[] noticeIds);
/**
* 查询已阅读某公告的用户列表
*
* @param noticeId 公告ID
* @param searchValue 搜索值
* @return 已读用户列表
*/
public List<Map<String, Object>> selectReadUsersByNoticeId(Long noticeId, String searchValue);
/**
* 删除公告时清理对应已读记录
*

View File

@@ -49,7 +49,7 @@ public interface ISysNoticeService
* @return 结果
*/
public int deleteNoticeById(Long noticeId);
/**
* 批量删除公告信息
*

View File

@@ -1,10 +1,11 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.domain.SysNoticeRead;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.domain.SysNoticeRead;
import com.ruoyi.system.mapper.SysNoticeReadMapper;
import com.ruoyi.system.service.ISysNoticeReadService;
@@ -62,6 +63,15 @@ public class SysNoticeReadServiceImpl implements ISysNoticeReadService
noticeReadMapper.insertNoticeReadBatch(userId, noticeIds);
}
/**
* 查询已阅读某公告的用户列表
*/
@Override
public List<Map<String, Object>> selectReadUsersByNoticeId(Long noticeId, String searchValue)
{
return noticeReadMapper.selectReadUsersByNoticeId(noticeId, searchValue);
}
/**
* 删除公告时清理对应已读记录
*/

View File

@@ -63,4 +63,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<!-- 查询已阅读某公告的用户列表,支持按登录名/用户名模糊筛选 -->
<select id="selectReadUsersByNoticeId" resultType="java.util.Map">
select
u.user_id as userId,
u.user_name as userName,
u.nick_name as nickName,
d.dept_name as deptName,
u.phonenumber as phonenumber,
r.read_time as readTime
from sys_notice_read r
inner join sys_user u on u.user_id = r.user_id and u.del_flag = '0'
left join sys_dept d on d.dept_id = u.dept_id
where r.notice_id = #{noticeId}
<if test="searchValue != null and searchValue != ''">
and (
u.user_name like concat('%', #{searchValue}, '%')
or u.nick_name like concat('%', #{searchValue}, '%')
)
</if>
order by r.read_time desc
</select>
</mapper>

View File

@@ -68,3 +68,12 @@ export function markNoticeReadAll(ids) {
params: { ids }
})
}
// 查询公告已读用户列表
export function listNoticeReadUsers(query) {
return request({
url: '/system/notice/readUsers/list',
method: 'get',
params: query
})
}

View File

@@ -1,170 +1,170 @@
<template>
<el-color-picker
v-model="theme"
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
class="theme-picker"
popper-class="theme-picker-dropdown"
/>
</template>
<script>
const ORIGINAL_THEME = '#409EFF' // default color
export default {
data() {
return {
chalk: '', // content of theme-chalk css
theme: ''
}
},
computed: {
defaultTheme() {
return this.$store.state.settings.theme
}
},
watch: {
defaultTheme: {
handler: function(val, oldVal) {
this.theme = val
},
immediate: true
},
async theme(val) {
await this.setTheme(val)
}
},
created() {
if(this.defaultTheme !== ORIGINAL_THEME) {
this.setTheme(this.defaultTheme)
}
},
methods: {
async setTheme(val) {
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
const getHandler = (variable, id) => {
return () => {
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
let styleTag = document.getElementById(id)
if (!styleTag) {
styleTag = document.createElement('style')
styleTag.setAttribute('id', id)
document.head.appendChild(styleTag)
}
styleTag.innerText = newStyle
}
}
if (!this.chalk) {
const url = `/styles/theme-chalk/index.css`
await this.getCSSString(url, 'chalk')
}
const chalkHandler = getHandler('chalk', 'chalk-style')
chalkHandler()
const styles = [].slice.call(document.querySelectorAll('style'))
.filter(style => {
const text = style.innerText
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
})
styles.forEach(style => {
const { innerText } = style
if (typeof innerText !== 'string') return
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
})
this.$emit('change', val)
},
updateStyle(style, oldCluster, newCluster) {
let newStyle = style
oldCluster.forEach((color, index) => {
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
})
return newStyle
},
getCSSString(url, variable) {
return new Promise(resolve => {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200) {
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
resolve()
}
}
xhr.open('GET', url)
xhr.send()
})
},
getThemeCluster(theme) {
const tintColor = (color, tint) => {
let red = parseInt(color.slice(0, 2), 16)
let green = parseInt(color.slice(2, 4), 16)
let blue = parseInt(color.slice(4, 6), 16)
if (tint === 0) { // when primary color is in its rgb space
return [red, green, blue].join(',')
} else {
red += Math.round(tint * (255 - red))
green += Math.round(tint * (255 - green))
blue += Math.round(tint * (255 - blue))
red = red.toString(16)
green = green.toString(16)
blue = blue.toString(16)
return `#${red}${green}${blue}`
}
}
const shadeColor = (color, shade) => {
let red = parseInt(color.slice(0, 2), 16)
let green = parseInt(color.slice(2, 4), 16)
let blue = parseInt(color.slice(4, 6), 16)
red = Math.round((1 - shade) * red)
green = Math.round((1 - shade) * green)
blue = Math.round((1 - shade) * blue)
red = red.toString(16)
green = green.toString(16)
blue = blue.toString(16)
return `#${red}${green}${blue}`
}
const clusters = [theme]
for (let i = 0; i <= 9; i++) {
clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
}
clusters.push(shadeColor(theme, 0.1))
return clusters
}
}
}
</script>
<style>
.theme-message,
.theme-picker-dropdown {
z-index: 99999 !important;
}
.theme-picker .el-color-picker__trigger {
height: 26px !important;
width: 26px !important;
padding: 2px;
}
.theme-picker-dropdown .el-color-dropdown__link-btn {
display: none;
}
</style>
<template>
<el-color-picker
v-model="theme"
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
class="theme-picker"
popper-class="theme-picker-dropdown"
/>
</template>
<script>
const ORIGINAL_THEME = '#409EFF' // default color
export default {
data() {
return {
chalk: '', // content of theme-chalk css
theme: ''
}
},
computed: {
defaultTheme() {
return this.$store.state.settings.theme
}
},
watch: {
defaultTheme: {
handler: function(val, oldVal) {
this.theme = val
},
immediate: true
},
async theme(val) {
await this.setTheme(val)
}
},
created() {
if(this.defaultTheme !== ORIGINAL_THEME) {
this.setTheme(this.defaultTheme)
}
},
methods: {
async setTheme(val) {
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
const getHandler = (variable, id) => {
return () => {
const originalCluster = this.getThemeCluster(ORIGINAL_THEME.replace('#', ''))
const newStyle = this.updateStyle(this[variable], originalCluster, themeCluster)
let styleTag = document.getElementById(id)
if (!styleTag) {
styleTag = document.createElement('style')
styleTag.setAttribute('id', id)
document.head.appendChild(styleTag)
}
styleTag.innerText = newStyle
}
}
if (!this.chalk) {
const url = `/styles/theme-chalk/index.css`
await this.getCSSString(url, 'chalk')
}
const chalkHandler = getHandler('chalk', 'chalk-style')
chalkHandler()
const styles = [].slice.call(document.querySelectorAll('style'))
.filter(style => {
const text = style.innerText
return new RegExp(oldVal, 'i').test(text) && !/Chalk Variables/.test(text)
})
styles.forEach(style => {
const { innerText } = style
if (typeof innerText !== 'string') return
style.innerText = this.updateStyle(innerText, originalCluster, themeCluster)
})
this.$emit('change', val)
},
updateStyle(style, oldCluster, newCluster) {
let newStyle = style
oldCluster.forEach((color, index) => {
newStyle = newStyle.replace(new RegExp(color, 'ig'), newCluster[index])
})
return newStyle
},
getCSSString(url, variable) {
return new Promise(resolve => {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200) {
this[variable] = xhr.responseText.replace(/@font-face{[^}]+}/, '')
resolve()
}
}
xhr.open('GET', url)
xhr.send()
})
},
getThemeCluster(theme) {
const tintColor = (color, tint) => {
let red = parseInt(color.slice(0, 2), 16)
let green = parseInt(color.slice(2, 4), 16)
let blue = parseInt(color.slice(4, 6), 16)
if (tint === 0) { // when primary color is in its rgb space
return [red, green, blue].join(',')
} else {
red += Math.round(tint * (255 - red))
green += Math.round(tint * (255 - green))
blue += Math.round(tint * (255 - blue))
red = red.toString(16)
green = green.toString(16)
blue = blue.toString(16)
return `#${red}${green}${blue}`
}
}
const shadeColor = (color, shade) => {
let red = parseInt(color.slice(0, 2), 16)
let green = parseInt(color.slice(2, 4), 16)
let blue = parseInt(color.slice(4, 6), 16)
red = Math.round((1 - shade) * red)
green = Math.round((1 - shade) * green)
blue = Math.round((1 - shade) * blue)
red = red.toString(16)
green = green.toString(16)
blue = blue.toString(16)
return `#${red}${green}${blue}`
}
const clusters = [theme]
for (let i = 0; i <= 9; i++) {
clusters.push(tintColor(theme, Number((i / 10).toFixed(2))))
}
clusters.push(shadeColor(theme, 0.1))
return clusters
}
}
}
</script>
<style>
.theme-message,
.theme-picker-dropdown {
z-index: 99999 !important;
}
.theme-picker .el-color-picker__trigger {
height: 26px !important;
width: 26px !important;
padding: 2px;
}
.theme-picker-dropdown .el-color-dropdown__link-btn {
display: none;
}
</style>

View File

@@ -0,0 +1,362 @@
<template>
<el-drawer title="公告详情" :visible.sync="visible" direction="rtl" size="50%" append-to-body :before-close="handleClose" custom-class="notice-detail-drawer">
<div v-loading="loading" class="notice-detail-drawer__body">
<div v-if="!detail" class="notice-empty">
<i class="el-icon-document"></i>
<span>暂无数据</span>
</div>
<div v-else class="notice-page">
<div class="notice-type-wrap">
<span v-if="detail.noticeType === '1'" class="notice-type-tag type-notify">
<i class="el-icon-bell"></i> 通知
</span>
<span v-else-if="detail.noticeType === '2'" class="notice-type-tag type-announce">
<i class="el-icon-message"></i> 公告
</span>
<span v-else class="notice-type-tag type-notify">
<i class="el-icon-document"></i> 消息
</span>
</div>
<h1 class="notice-title">{{ detail.noticeTitle }}</h1>
<div class="notice-meta">
<span class="meta-item">
<i class="el-icon-user"></i>
<span>{{ detail.createBy || '—' }}</span>
</span>
<span class="meta-item">
<i class="el-icon-time"></i>
<span>{{ detail.createTime || '—' }}</span>
</span>
<span class="meta-item">
<span :class="['status-dot', isStatusNormal ? 'status-ok' : 'status-off']"></span>
<span>{{ isStatusNormal ? '正常' : '已关闭' }}</span>
</span>
</div>
<div class="notice-divider">
<span class="notice-divider-dot"></span>
<span class="notice-divider-dot"></span>
<span class="notice-divider-dot"></span>
</div>
<div class="notice-body">
<div v-if="hasContent" class="notice-content" v-html="detail.noticeContent" />
<div v-else class="notice-empty notice-empty--inner">
<i class="el-icon-document"></i> 暂无内容
</div>
</div>
</div>
</div>
</el-drawer>
</template>
<script>
import { getNotice } from '@/api/system/notice'
export default {
name: 'NoticeDetailView',
data() {
return {
visible: false,
loading: false,
detail: null
}
},
computed: {
isStatusNormal() {
const s = this.detail && this.detail.status
return s === '0' || s === 0
},
hasContent() {
const c = this.detail && this.detail.noticeContent
return c != null && String(c).trim() !== ''
}
},
methods: {
open(payload) {
let id = null
let preset = null
if (payload != null && typeof payload === 'object') {
id = payload.noticeId
if (payload.noticeContent != null) {
preset = payload
}
} else {
id = payload
}
this.visible = true
if (preset) {
this.detail = preset
return
}
if (id == null || id === '') {
this.detail = null
return
}
this.loading = true
this.detail = null
getNotice(id).then(res => {
this.detail = res.data
}).catch(() => {
this.detail = null
}).finally(() => {
this.loading = false
})
},
handleClose() {
this.visible = false
this.detail = null
this.loading = false
}
}
}
</script>
<style lang="scss" scoped>
.notice-page {
max-width: 760px;
margin: 0 auto;
padding: 8px 8px 20px;
animation: notice-fade-up 0.28s ease both;
}
@keyframes notice-fade-up {
from {
opacity: 0;
transform: translateY(14px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.notice-type-tag {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 3px 12px;
border-radius: 2px;
font-size: 11px;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
margin-bottom: 14px;
}
.type-notify {
background: #fff8e6;
color: #b7791f;
border-left: 3px solid #d97706;
}
.type-announce {
background: #e8f5e9;
color: #276749;
border-left: 3px solid #38a169;
}
.notice-title {
font-size: 22px;
font-weight: 700;
color: #1a202c;
line-height: 1.45;
margin: 0 0 16px;
letter-spacing: -0.2px;
}
.notice-meta {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16px;
padding: 12px 0;
border-top: 1px solid #e9ecef;
border-bottom: 1px solid #e9ecef;
margin-bottom: 28px;
}
.meta-item {
display: flex;
align-items: center;
gap: 5px;
font-size: 12px;
color: #718096;
}
.meta-item i {
font-size: 12px;
color: #a0aec0;
}
.status-dot {
display: inline-block;
width: 7px;
height: 7px;
border-radius: 50%;
margin-right: 4px;
}
.status-ok {
background: #38a169;
}
.status-off {
background: #e53e3e;
}
.notice-divider {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 24px;
}
.notice-divider::before,
.notice-divider::after {
content: '';
flex: 1;
height: 1px;
background: linear-gradient(to right, transparent, #dee2e6, transparent);
}
.notice-divider-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #cbd5e0;
}
.notice-body {
background: #fff;
border-radius: 6px;
padding: 28px 32px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
min-height: 120px;
}
.notice-content {
font-size: 14px;
line-height: 1.85;
color: #2d3748;
word-break: break-word;
}
.notice-content ::v-deep p {
margin: 0 0 1em;
}
.notice-content ::v-deep h1,
.notice-content ::v-deep h2,
.notice-content ::v-deep h3 {
font-weight: 700;
color: #1a202c;
margin: 1.4em 0 0.6em;
}
.notice-content ::v-deep h1 {
font-size: 18px;
}
.notice-content ::v-deep h2 {
font-size: 16px;
}
.notice-content ::v-deep h3 {
font-size: 14px;
}
.notice-content ::v-deep a {
color: #3182ce;
text-decoration: underline;
}
.notice-content ::v-deep a:hover {
color: #2b6cb0;
}
.notice-content ::v-deep img {
max-width: 100%;
border-radius: 4px;
margin: 8px 0;
}
.notice-content ::v-deep ul,
.notice-content ::v-deep ol {
padding-left: 20px;
margin: 0 0 1em;
}
.notice-content ::v-deep li {
margin-bottom: 4px;
}
.notice-content ::v-deep blockquote {
border-left: 3px solid #cbd5e0;
margin: 1em 0;
padding: 6px 16px;
color: #718096;
background: #f7fafc;
}
.notice-content ::v-deep table {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
font-size: 13px;
}
.notice-content ::v-deep table th,
.notice-content ::v-deep table td {
border: 1px solid #e2e8f0;
padding: 7px 12px;
}
.notice-content ::v-deep table th {
background: #f7fafc;
font-weight: 600;
}
.notice-empty {
text-align: center;
padding: 40px 0;
color: #a0aec0;
font-size: 13px;
}
.notice-empty i {
font-size: 28px;
display: block;
margin-bottom: 10px;
}
.notice-empty--inner {
padding: 32px 0;
}
.notice-empty--inner i {
font-size: 28px;
}
::v-deep .notice-detail-drawer {
.el-drawer__header {
margin-bottom: 0;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
font-size: 16px;
font-weight: 600;
color: #303133;
}
.el-drawer__body {
background: #f5f6f8;
}
}
.notice-detail-drawer__body {
height: 100%;
overflow: auto;
padding: 10px 16px 22px;
}
</style>

View File

@@ -23,38 +23,24 @@
<span v-if="unreadCount > 0" class="notice-badge">{{ unreadCount }}</span>
</div>
<el-dialog :title="previewTitle" :visible.sync="previewVisible" width="680px" append-to-body custom-class="notice-preview-dialog">
<div class="notice-preview-meta">
<el-tag size="small" :type="previewNoticeType === '1' ? 'warning' : 'success'">
{{ previewNoticeType === '1' ? '通知' : '公告' }}
</el-tag>
<span class="notice-preview-info"><i class="el-icon-user"></i> {{ previewCreateBy }}</span>
<span class="notice-preview-info"><i class="el-icon-time"></i> {{ previewCreateTime }}</span>
</div>
<div class="notice-preview-divider"></div>
<div class="notice-preview-content" v-html="previewContent"></div>
</el-dialog>
<notice-detail-view ref="noticeViewRef" />
</div>
</template>
<script>
import { listNoticeTop, markNoticeRead, markNoticeReadAll, getNotice } from '@/api/system/notice'
import NoticeDetailView from './DetailView'
import { listNoticeTop, markNoticeRead, markNoticeReadAll } from '@/api/system/notice'
export default {
name: 'HeaderNotice',
components: { NoticeDetailView },
data() {
return {
noticeList: [], // 通知列表
unreadCount: 0, // 未读数量
noticeLoading: false, // 加载状态
noticeVisible: false, // 弹出层显示状态
noticeLeaveTimer: null, // 鼠标离开计时器
previewVisible: false, // 预览弹窗显示状态
previewTitle: '', // 预览弹窗标题
previewContent: '', // 预览弹窗内容
previewNoticeType: '', // 预览弹窗类型
previewCreateBy: '', // 预览弹窗创建人
previewCreateTime: '' // 预览弹窗创建时间
noticeLeaveTimer: null // 鼠标离开计时器
}
},
mounted() {
@@ -99,15 +85,7 @@ export default {
if (idx !== -1) this.$set(this.noticeList, idx, { ...item, isRead: true })
this.unreadCount = Math.max(0, this.unreadCount - 1)
}
getNotice(item.noticeId).then(res => {
const notice = res.data
this.previewTitle = notice.noticeTitle
this.previewContent = notice.noticeContent
this.previewNoticeType = notice.noticeType
this.previewCreateBy = notice.createBy
this.previewCreateTime = notice.createTime
this.previewVisible = true
})
this.$refs.noticeViewRef.open(item.noticeId)
},
// 全部已读
markAllRead() {
@@ -200,30 +178,4 @@ export default {
font-size: 11px;
color: #bbb;
}
::v-deep .notice-preview-dialog {
.el-dialog__body { padding: 0 20px 20px; }
.notice-preview-meta {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 0;
font-size: 12px;
color: #888;
.notice-preview-info { display: flex; align-items: center; gap: 4px; }
}
.notice-preview-divider {
height: 1px;
background: linear-gradient(to right, transparent, #e2e8f0, transparent);
margin-bottom: 16px;
}
.notice-preview-content {
font-size: 14px;
line-height: 1.85;
color: #2d3748;
word-break: break-word;
img { max-width: 100%; border-radius: 4px; }
p { margin: 0 0 1em; }
a { color: #409EFF; text-decoration: underline; }
}
}
</style>

View File

@@ -61,7 +61,7 @@
<h3 class="drawer-title">系统布局配置</h3>
<div class="drawer-item">
<span>开启 Tags-Views</span>
<span>开启页签</span>
<el-switch v-model="tagsView" class="drawer-switch" />
</div>
@@ -75,6 +75,14 @@
<el-switch v-model="tagsIcon" :disabled="!tagsView" class="drawer-switch" />
</div>
<div class="drawer-item">
<span>标签页样式</span>
<el-radio-group v-model="tagsViewStyle" :disabled="!tagsView" size="mini" class="drawer-switch">
<el-radio-button label="card">卡片</el-radio-button>
<el-radio-button label="chrome">谷歌</el-radio-button>
</el-radio-group>
</div>
<div class="drawer-item">
<span>固定 Header</span>
<el-switch v-model="fixedHeader" class="drawer-switch" />
@@ -163,6 +171,17 @@ export default {
})
}
},
tagsViewStyle: {
get() {
return this.$store.state.settings.tagsViewStyle
},
set(val) {
this.$store.dispatch('settings/changeSetting', {
key: 'tagsViewStyle',
value: val
})
}
},
sidebarLogo: {
get() {
return this.$store.state.settings.sidebarLogo
@@ -256,6 +275,7 @@ export default {
"navType":${this.navType},
"tagsView":${this.tagsView},
"tagsIcon":${this.tagsIcon},
"tagsViewStyle":"${this.tagsViewStyle}",
"tagsViewPersist":${this.tagsViewPersist},
"fixedHeader":${this.fixedHeader},
"sidebarLogo":${this.sidebarLogo},

View File

@@ -1,5 +1,5 @@
<template>
<div id="tags-view-container" class="tags-view-container">
<div id="tags-view-container" class="tags-view-container" :class="{ 'tags-view-container--chrome': tagsViewStyle === 'chrome' }" :style="chromeVars">
<!-- 左切换箭头 -->
<span class="tags-nav-btn tags-nav-btn--left" :class="{ disabled: !canScrollLeft }" @click="scrollLeft">
<i class="el-icon-arrow-left" />
@@ -15,11 +15,11 @@
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span"
class="tags-view-item"
:style="activeStyle(tag)"
:style="tagActiveStyle(tag)"
@click.middle.native="!isAffix(tag) ? closeSelectedTag(tag) : ''"
@contextmenu.prevent.native="openMenu(tag, $event)"
>
<svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" />
<svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" style="margin-right: 3px;" />
{{ tag.title }}
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
</router-link>
@@ -97,8 +97,20 @@ export default {
tagsIcon() {
return this.$store.state.settings.tagsIcon
},
tagsViewStyle() {
return this.$store.state.settings.tagsViewStyle
},
selectedDropdownTag() {
return this.visitedViews.find(v => this.isActive(v)) || {}
},
chromeVars() {
if (this.tagsViewStyle !== 'chrome') return {}
const primary = this.theme || '#409EFF'
return {
'--chrome-tab-active-bg': this.mixHexWithWhite(primary, 0.15),
'--chrome-tab-text-active': primary,
'--chrome-wing-r': '14px'
}
}
},
watch: {
@@ -136,11 +148,21 @@ export default {
this.toggleFullscreen()
}
},
mixHexWithWhite(hex, ratio) {
const clean = hex.replace('#', '')
const r = parseInt(clean.substring(0, 2), 16)
const g = parseInt(clean.substring(2, 4), 16)
const b = parseInt(clean.substring(4, 6), 16)
const mr = Math.round(r * ratio + 255 * (1 - ratio))
const mg = Math.round(g * ratio + 255 * (1 - ratio))
const mb = Math.round(b * ratio + 255 * (1 - ratio))
return `rgb(${mr}, ${mg}, ${mb})`
},
isActive(route) {
return route.path === this.$route.path
},
activeStyle(tag) {
if (!this.isActive(tag)) return {}
tagActiveStyle(tag) {
if (!this.isActive(tag) || this.tagsViewStyle !== 'card') return {}
return {
"background-color": this.theme,
"border-color": this.theme
@@ -367,13 +389,16 @@ export default {
</script>
<style lang="scss" scoped>
$tags-bar-height: 34px;
.tags-view-container {
height: 34px;
height: $tags-bar-height;
width: 100%;
background: #fff;
border-bottom: 1px solid #d8dce5;
display: flex;
align-items: center;
overflow: hidden;
$btn-width: 28px;
$btn-color: #71717a;
@@ -388,7 +413,7 @@ export default {
align-items: center;
justify-content: center;
width: $btn-width;
height: 34px;
height: $tags-bar-height;
cursor: pointer;
color: $btn-color;
font-size: 13px;
@@ -405,18 +430,14 @@ export default {
cursor: not-allowed;
}
&--left {
border-right: $divider;
}
&--right {
border-left: $divider;
}
&--left { border-right: $divider; }
&--right { border-left: $divider; }
}
.tags-view-wrapper {
flex: 1;
min-width: 0;
height: 100%;
.tags-view-item {
display: inline-block;
@@ -432,31 +453,27 @@ export default {
margin-left: 5px;
border-radius: 3px;
&:first-of-type {
margin-left: 6px;
}
&:last-of-type {
margin-right: 15px;
}
&.active {
background-color: #42b983;
color: #fff;
border-color: #42b983;
&::before {
content: '';
background: #fff;
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
position: relative;
margin-right: 2px;
}
}
&:first-of-type { margin-left: 6px; }
&:last-of-type { margin-right: 15px; }
}
}
&:not(.tags-view-container--chrome) .tags-view-wrapper .tags-view-item.active {
background-color: #42b983;
color: #fff;
border-color: #42b983;
&::before {
content: '';
background: #fff;
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
position: relative;
margin-right: 2px;
}
}
.tags-view-item.active.has-icon::before {
&:not(.tags-view-container--chrome) .tags-view-wrapper .tags-view-item.active.has-icon::before {
content: none !important;
}
@@ -471,7 +488,7 @@ export default {
align-items: center;
justify-content: center;
width: $btn-width;
height: 34px;
height: $tags-bar-height;
cursor: pointer;
color: $btn-color;
font-size: 13px;
@@ -511,11 +528,174 @@ export default {
}
}
}
&.tags-view-container--chrome {
--chrome-strip-bg: #ffffff;
--chrome-strip-border: #e4e7ed;
--chrome-tab-text: #606266;
overflow: visible;
background: var(--chrome-strip-bg);
border-bottom: 1px solid var(--chrome-strip-border);
align-items: flex-end;
.tags-nav-btn {
align-self: stretch;
height: auto;
min-height: $tags-bar-height;
border-color: var(--chrome-strip-border);
}
.tags-action-btn {
border-color: var(--chrome-strip-border);
}
.tags-view-wrapper {
.tags-view-item {
display: inline-flex !important;
align-items: center;
justify-content: center;
position: relative;
z-index: 1;
height: 30px;
min-height: 30px;
margin: 0 0 -1px;
padding: 0 12px;
font-size: 13px;
font-weight: 400;
line-height: 1.2;
border: none !important;
border-radius: 0;
background: transparent !important;
color: var(--chrome-tab-text) !important;
padding-top: 0 !important;
box-shadow: none !important;
transition: background 0.12s ease, color 0.12s ease, border-radius 0.12s ease;
&::before,
&::after {
content: '' !important;
display: block !important;
position: absolute;
bottom: 0;
width: var(--chrome-wing-r);
height: var(--chrome-wing-r);
margin: 0 !important;
pointer-events: none;
background: transparent !important;
border-radius: 0 !important;
transition: box-shadow 0.12s ease;
}
&::before {
left: calc(-1 * var(--chrome-wing-r));
border-bottom-right-radius: var(--chrome-wing-r) !important;
box-shadow: none;
}
&::after {
right: calc(-1 * var(--chrome-wing-r));
border-bottom-left-radius: var(--chrome-wing-r) !important;
box-shadow: none;
}
&:first-of-type { margin-left: 6px; }
&:last-of-type { margin-right: 10px; }
&:not(.active) + .tags-view-item:not(.active) {
border-left: 1px solid #e4e7ed;
padding-left: 11px;
}
&:hover:not(.active) {
background: #f5f7fa !important;
border-radius: 6px 6px 0 0;
color: #303133 !important;
}
&.active {
height: 31px;
min-height: 31px;
padding: 0 14px;
color: var(--chrome-tab-text-active) !important;
font-weight: 500;
background: var(--chrome-tab-active-bg) !important;
border: none !important;
border-radius: var(--chrome-wing-r) var(--chrome-wing-r) 0 0;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
&::before {
box-shadow: calc(var(--chrome-wing-r) * 0.5) calc(var(--chrome-wing-r) * 0.5) 0 calc(var(--chrome-wing-r) * 0.5) var(--chrome-tab-active-bg);
}
&::after {
box-shadow: calc(var(--chrome-wing-r) * -0.5) calc(var(--chrome-wing-r) * 0.5) 0 calc(var(--chrome-wing-r) * 0.5) var(--chrome-tab-active-bg);
}
}
.el-icon-close {
margin-left: 3px;
&:before {
vertical-align: -2px;
}
}
}
}
}
}
</style>
<style lang="scss">
.tags-view-wrapper {
.el-scrollbar {
height: 100%;
overflow: hidden;
}
.el-scrollbar__wrap {
height: 34px !important;
display: flex;
align-items: center;
overflow-x: auto;
overflow-y: hidden;
&::-webkit-scrollbar {
width: 0;
height: 0;
}
.tags-view-container:hover & {
&::-webkit-scrollbar {
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 3px;
transition: background-color 0.2s;
&:hover {
background-color: rgba(0, 0, 0, 0.4);
}
}
}
scrollbar-width: none;
-ms-overflow-style: none;
}
.el-scrollbar__bar {
opacity: 0;
transition: opacity 0.3s;
.tags-view-container:hover & {
opacity: 1;
}
}
.tags-view-item {
.el-icon-close {
width: 16px;
@@ -577,4 +757,4 @@ export default {
min-height: calc(100vh - 34px) !important;
overflow: auto;
}
</style>
</style>

View File

@@ -34,6 +34,11 @@ module.exports = {
*/
tagsIcon: false,
/**
* 标签页样式card 卡片默认、chrome 谷歌浏览器风格
*/
tagsViewStyle: 'card',
/**
* 是否固定头部
*/

View File

@@ -1,7 +1,7 @@
import defaultSettings from '@/settings'
import { useDynamicTitle } from '@/utils/dynamicTitle'
const { sideTheme, showSettings, navType, tagsView, tagsViewPersist, tagsIcon, fixedHeader, sidebarLogo, dynamicTitle, footerVisible, footerContent } = defaultSettings
const { sideTheme, showSettings, navType, tagsView, tagsViewPersist, tagsIcon, tagsViewStyle, fixedHeader, sidebarLogo, dynamicTitle, footerVisible, footerContent } = defaultSettings
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
const state = {
@@ -13,6 +13,7 @@ const state = {
tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
tagsViewPersist: storageSetting.tagsViewPersist === undefined ? tagsViewPersist : storageSetting.tagsViewPersist,
tagsIcon: storageSetting.tagsIcon === undefined ? tagsIcon : storageSetting.tagsIcon,
tagsViewStyle: storageSetting.tagsViewStyle === undefined ? tagsViewStyle : storageSetting.tagsViewStyle,
fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle,

View File

@@ -1,5 +1,6 @@
import store from '@/store'
import router from '@/router'
import cache from '@/plugins/cache'
import { MessageBox, } from 'element-ui'
import { login, logout, getInfo, refreshToken } from '@/api/login'
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
@@ -82,6 +83,7 @@ const user = {
commit('SET_NAME', user.userName)
commit('SET_NICK_NAME', user.nickName)
commit('SET_AVATAR', avatar)
cache.session.set('pwrChrtype', res.pwdChrtype)
/* 初始密码提示 */
if(res.isDefaultModifyPwd) {
MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {

View File

@@ -0,0 +1,71 @@
/**
* 密码强度规则
* 根据参数 chrtype 动态生成校验规则
*
* chrtype 说明:
* 0 - 任意字符(默认)
* 1 - 纯数字0-9
* 2 - 纯字母a-z / A-Z
* 3 - 字母 + 数字(必须同时包含)
* 4 - 字母 + 数字 + 特殊字符(必须同时包含,特殊字符:~!@#$%^&*()-=_+
*/
import cache from '@/plugins/cache'
// 各类型对应的正则、错误提示
const PWD_RULES = {
'0': { pattern: /^[^<>"'|\\]+$/, message: '密码不能包含非法字符:< > " \' \\ |' },
'1': { pattern: /^[0-9]+$/, message: '密码只能为数字0-9' },
'2': { pattern: /^[a-zA-Z]+$/, message: '密码只能为英文字母a-z、A-Z' },
'3': { pattern: /^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]+$/, message: '密码必须同时包含字母和数字' },
'4': { pattern: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[~!@#$%^&*()\-=_+])[A-Za-z\d~!@#$%^&*()\-=_+]+$/, message: '密码必须同时包含字母、数字和特殊字符(~!@#$%^&*()-=_+' }
}
export default {
data() {
return {
// 密码限制类型
pwdChrType: cache.session.get('pwrChrtype') || '0'
}
},
computed: {
// 默认密码校验
pwdValidator() {
const rule = PWD_RULES[this.pwdChrType] || PWD_RULES['0']
return [
{ required: true, message: '密码不能为空', trigger: 'blur' },
{ min: 6, max: 20, message: '密码长度必须介于 6 和 20 之间', trigger: 'blur' },
{ pattern: rule.pattern, message: rule.message, trigger: 'blur' }
]
},
// 校验prompt的inputValidator函数
pwdPromptValidator() {
const rule = PWD_RULES['0']
return (value) => {
if (!value || value.length < 6 || value.length > 20) {
return '密码长度必须介于 6 和 20 之间'
}
if (!rule.pattern.test(value)) {
return rule.message
}
}
},
// 个人中心密码校验
infoPwdValidator() {
const rule = PWD_RULES[this.pwdChrType] || PWD_RULES['0']
return [
{ required: true, message: '新密码不能为空', trigger: 'blur' },
{ min: 6, max: 20, message: '新密码长度必须介于 6 和 20 之间', trigger: 'blur' },
{ pattern: rule.pattern, message: rule.message, trigger: 'blur' }
]
},
// 注册页面密码校验
registerPwdValidator() {
const rule = PWD_RULES['0']
return [
{ required: true, message: '请输入您的密码', trigger: 'blur' },
{ min: 6, max: 20, message: '用户密码长度必须介于 6 和 20 之间', trigger: 'blur' },
{ pattern: rule.pattern, message: rule.message, trigger: 'blur' }
]
}
}
}

View File

@@ -5,7 +5,12 @@
* @returns {Boolean}
*/
export function isPathMatch(pattern, path) {
const regexPattern = pattern.replace(/\//g, '\\/').replace(/\*\*/g, '.*').replace(/\*/g, '[^\\/]*')
const regexPattern = pattern
.replace(/([.+^${}()|\[\]\\])/g, '\\$1')
.replace(/\*\*/g, '__DOUBLE_STAR__')
.replace(/\*/g, '[^/]*')
.replace(/__DOUBLE_STAR__/g, '.*')
.replace(/\?/g, '[^/]')
const regex = new RegExp(`^${regexPattern}$`)
return regex.test(path)
}

View File

@@ -7,7 +7,7 @@
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-form-item prop="password" :rules="registerPwdValidator">
<el-input
v-model="registerForm.password"
type="password"
@@ -68,18 +68,12 @@
<script>
import { getCodeImg, register } from "@/api/login"
import passwordRule from "@/utils/passwordRule"
import defaultSettings from '@/settings'
export default {
name: "Register",
mixins: [passwordRule],
data() {
const equalToPassword = (rule, value, callback) => {
if (this.registerForm.password !== value) {
callback(new Error("两次输入的密码不一致"))
} else {
callback()
}
}
return {
title: process.env.VUE_APP_TITLE,
footerContent: defaultSettings.footerContent,
@@ -91,24 +85,31 @@ export default {
code: "",
uuid: ""
},
registerRules: {
loading: false,
captchaEnabled: true
}
},
computed: {
registerRules() {
return {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" },
{ min: 2, max: 20, message: '用户账号长度必须介于 2 和 20 之间', trigger: 'blur' }
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" },
{ min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" },
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
],
confirmPassword: [
{ required: true, trigger: "blur", message: "请再次输入您的密码" },
{ required: true, validator: equalToPassword, trigger: "blur" }
{ required: true, message: "请再次输入您的密码", trigger: "blur" },
{
validator: (rule, value, callback) => {
if (this.registerForm.password !== value) {
callback(new Error("两次输入的密码不一致"))
} else {
callback()
}
}, trigger: "blur"
}
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
},
loading: false,
captchaEnabled: true
}
}
},
created() {

View File

@@ -0,0 +1,109 @@
<template>
<el-dialog :title="`「${noticeTitle}」已读用户`" :visible.sync="visible" width="760px" top="6vh" append-to-body @close="handleClose">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" style="margin-bottom: 4px;">
<el-form-item prop="searchValue">
<el-input
v-model="queryParams.searchValue"
placeholder="登录名称 / 用户名称"
clearable
prefix-icon="el-icon-search"
style="width: 220px;"
@keyup.enter.native="handleQuery"
@clear="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
<el-form-item style="float: right; margin-right: 0;">
<span class="read-stat">
<strong>{{ total }}</strong> 人已读
</span>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="userList" size="small" stripe height="340px">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="登录名称" prop="userName" align="center" :show-overflow-tooltip="true" />
<el-table-column label="用户名称" prop="nickName" align="center" :show-overflow-tooltip="true" />
<el-table-column label="所属部门" prop="deptName" align="center" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" prop="phonenumber" align="center" width="120" />
<el-table-column label="阅读时间" prop="readTime" align="center" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.readTime) }}</span>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" style="padding: 6px 0px;"/>
</el-dialog>
</template>
<script>
import { listNoticeReadUsers } from "@/api/system/notice"
export default {
name: "ReadUsers",
data() {
return {
visible: false,
loading: false,
noticeId: undefined,
noticeTitle: "",
total: 0,
userList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
noticeId: undefined,
searchValue: undefined
}
}
},
methods: {
open(row) {
this.noticeId = row.noticeId
this.noticeTitle = row.noticeTitle
this.queryParams.noticeId = row.noticeId
this.queryParams.searchValue = undefined
this.queryParams.pageNum = 1
this.visible = true
this.getList()
},
getList() {
this.loading = true
listNoticeReadUsers(this.queryParams).then(res => {
this.userList = res.rows
this.total = res.total
}).finally(() => {
this.loading = false
})
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
handleClose() {
this.userList = []
this.total = 0
this.queryParams.searchValue = undefined
}
}
}
</script>
<style scoped>
.read-stat {
font-size: 13px;
color: #606266;
line-height: 28px;
}
.read-stat strong {
color: #409eff;
font-size: 15px;
margin: 0 2px;
}
</style>

View File

@@ -72,12 +72,11 @@
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table-column
label="公告标题"
align="center"
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
<el-table-column label="公告标题" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<a class="link-type" style="cursor:pointer" @click="handleViewData(scope.row)">{{ scope.row.noticeTitle }}</a>
</template>
</el-table-column>
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
@@ -96,6 +95,13 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-user"
@click="handleReadUsers(scope.row)"
v-hasPermi="['system:notice:list']"
>阅读用户</el-button>
<el-button
size="mini"
type="text"
@@ -166,14 +172,20 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<notice-detail-view ref="noticeViewRef" />
<read-users-dialog ref="readUsersRef" />
</div>
</template>
<script>
import NoticeDetailView from "@/layout/components/HeaderNotice/DetailView"
import ReadUsersDialog from "./ReadUsers"
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"
export default {
name: "Notice",
components: { NoticeDetailView, ReadUsersDialog },
dicts: ['sys_notice_status', 'sys_notice_type'],
data() {
return {
@@ -297,6 +309,14 @@ export default {
}
})
},
/** 查看公告详情 */
handleViewData(row) {
this.$refs.noticeViewRef.open(row)
},
/** 查看已读用户 */
handleReadUsers(row) {
this.$refs.readUsersRef.open(row)
},
/** 删除按钮操作 */
handleDelete(row) {
const noticeIds = row.noticeId || this.ids

View File

@@ -116,7 +116,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password" :rules="pwdValidator">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password />
</el-form-item>
</el-col>
@@ -181,9 +181,11 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css"
import TreePanel from "@/components/TreePanel"
import ExcelImportDialog from "@/components/ExcelImportDialog"
import UserViewDrawer from "./view"
import passwordRule from "@/utils/passwordRule"
export default {
name: "User",
mixins: [passwordRule],
dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { Treeselect, TreePanel, ExcelImportDialog, UserViewDrawer },
data() {
@@ -248,11 +250,6 @@ export default {
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
],
email: [
{
type: "email",
@@ -405,17 +402,11 @@ export default {
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
this.$prompt(`请输入「${row.userName}的新密码`, "重置密码", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{5,20}$/,
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
inputValidator: (value) => {
if (/<|>|"|'|\||\\/.test(value)) {
return "不能包含非法字符:< > \" ' \\\ |"
}
},
inputValidator: this.pwdPromptValidator
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(() => {
this.$modal.msgSuccess("修改成功,新密码是:" + value)

View File

@@ -1,9 +1,9 @@
<template>
<el-form ref="form" :model="user" :rules="rules" label-width="80px">
<el-form ref="form" :model="user" :rules="formRules" label-width="80px">
<el-form-item label="旧密码" prop="oldPassword">
<el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" show-password/>
</el-form-item>
<el-form-item label="新密码" prop="newPassword">
<el-form-item label="新密码" prop="newPassword" :rules="infoPwdValidator">
<el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password/>
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword">
@@ -18,35 +18,36 @@
<script>
import { updateUserPwd } from "@/api/system/user"
import passwordRule from "@/utils/passwordRule"
export default {
mixins: [passwordRule],
data() {
const equalToPassword = (rule, value, callback) => {
if (this.user.newPassword !== value) {
callback(new Error("两次输入的密码不一致"))
} else {
callback()
}
}
return {
user: {
oldPassword: undefined,
newPassword: undefined,
confirmPassword: undefined
},
// 表单校验
rules: {
}
}
},
computed: {
formRules() {
return {
oldPassword: [
{ required: true, message: "旧密码不能为空", trigger: "blur" }
],
newPassword: [
{ required: true, message: "新密码不能为空", trigger: "blur" },
{ min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" },
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
],
confirmPassword: [
{ required: true, message: "确认密码不能为空", trigger: "blur" },
{ required: true, validator: equalToPassword, trigger: "blur" }
{
validator: (rule, value, callback) => {
if (this.user.newPassword !== value) {
callback(new Error("两次输入的密码不一致"))
} else {
callback()
}
}, trigger: "blur"
}
]
}
}

View File

@@ -183,6 +183,7 @@ export default {
const genTable = Object.assign({}, basicForm.model, genForm.model)
genTable.columns = this.columns
genTable.params = {
genView: genTable.view ? '1' : '0',
treeCode: genTable.treeCode,
treeName: genTable.treeName,
treeParentCode: genTable.treeParentCode,

View File

@@ -69,7 +69,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item prop="formColNum">
<span slot="label">
表单布局
@@ -85,6 +85,13 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="genView">
<span slot="label">扩展功能</span>
<el-checkbox v-model="info.view">生成详情页</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="genType">
<span slot="label">

View File

@@ -44,7 +44,7 @@
<!-- SpringBoot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Spring Security -->

View File

@@ -13,7 +13,7 @@ import org.springframework.security.web.authentication.SavedRequestAwareAuthenti
/**
* 监控权限配置
*
*
* @author ruoyi
*/
@EnableWebSecurity

View File

@@ -552,6 +552,7 @@ insert into sys_config values(4, '账号自助-是否开启用户注册功能',
insert into sys_config values(5, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', sysdate(), '', null, '设置登录IP黑名单限制多个匹配项以;分隔,支持匹配(*通配、网段)');
insert into sys_config values(6, '用户管理-初始密码修改策略', 'sys.account.initPasswordModify', '1', 'Y', 'admin', sysdate(), '', null, '0初始密码修改策略关闭没有任何提示1提醒用户如果未修改初始密码则在登录时就会提醒修改密码对话框');
insert into sys_config values(7, '用户管理-账号密码更新周期', 'sys.account.passwordValidateDays', '0', 'Y', 'admin', sysdate(), '', null, '密码更新周期填写数字数据初始化值为0不限制若修改必须为大于0小于365的正整数如果超过这个周期登录系统时则在登录时就会提醒修改密码对话框');
insert into sys_config values(8, '用户管理-密码字符范围', 'sys.account.chrtype', '0', 'Y', 'admin', sysdate(), '', null, '默认任意字符范围0任意密码可以输入任意字符1数字密码只能为0-9数字2英文字母密码只能为a-z和A-Z字母3字母和数字密码必须包含字母数字,4字母数字和特殊字符目前支持的特殊字符包括~!@#$%^&*()-=_+');
-- ----------------------------

View File

@@ -34,7 +34,7 @@ CREATE TABLE `config_info` (
insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema, encrypted_data_key) values
(1,'application-dev.yml','DEFAULT_GROUP','spring:\n autoconfigure:\n exclude: com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure\n\n# feign 配置\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n min-request-size: 8192\n response:\n enabled: true\n\n# 暴露监控端点\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n','9928f41dfb10386ad38b3254af5692e0','2020-05-20 12:00:00','2024-08-29 12:14:45','nacos','0:0:0:0:0:0:0:1','','','通用配置','null','null','yaml','',''),
(2,'ruoyi-gateway-dev.yml','DEFAULT_GROUP','spring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n server:\n webflux:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - name: CacheRequestBody\n args:\n bodyClass: java.lang.String\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','1650061c268e8065f4ca40a1ee99808d','2020-05-14 14:17:55','2026-03-10 10:57:46','nacos_namespace_migrate','192.168.137.1','','','网关模块',NULL,NULL,'yaml',NULL,''),
(2,'ruoyi-gateway-dev.yml','DEFAULT_GROUP','spring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n server:\n webflux:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestBody\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','1650061c268e8065f4ca40a1ee99808d','2020-05-14 14:17:55','2026-03-10 10:57:46','nacos_namespace_migrate','192.168.137.1','','','网关模块',NULL,NULL,'yaml',NULL,''),
(3,'ruoyi-auth-dev.yml','DEFAULT_GROUP','spring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n','72565b1a725e013154ee57c8fd3045c4','2020-11-20 00:00:00','2024-09-14 04:49:42','nacos','0:0:0:0:0:0:0:1','','','认证中心','null','null','yaml','',''),
(4,'ruoyi-monitor-dev.yml','DEFAULT_GROUP','# spring\nspring:\n security:\n user:\n name: ruoyi\n password: 123456\n boot:\n admin:\n ui:\n title: 若依服务状态监控\n','6f122fd2bfb8d45f858e7d6529a9cd44','2020-11-20 00:00:00','2024-08-29 12:15:11','nacos','0:0:0:0:0:0:0:1','','','监控中心','null','null','yaml','',''),
(5,'ruoyi-system-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: ruoyi\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.system\n # 配置mapper的扫描找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: RuoYi\n url: https://ruoyi.vip\n','a79ae256018abb7f3bbaba923baeb6af','2020-11-20 00:00:00','2024-09-14 04:49:54','nacos','0:0:0:0:0:0:0:1','','','系统模块','null','null','yaml','',''),