Compare commits

..

10 Commits

Author SHA1 Message Date
RuoYi
0e2d75c23c 若依 3.9.2 2026-03-26 08:23:30 +08:00
RuoYi
2a26aa1356 优化页签全屏显示 2026-03-26 00:52:04 +08:00
RuoYi
3fa6a4b5df 优化快速点击页签刷新出现404问题 2026-03-25 21:21:58 +08:00
RuoYi
3c2186cf73 修复typescript版多表代码生成报错问题 2026-03-25 12:32:24 +08:00
RuoYi
7282667d41 菜单管理列表新增类型显示 2026-03-24 15:33:27 +08:00
RuoYi
4b1fad5f18 优化菜单主题风格 2026-03-24 10:30:32 +08:00
RuoYi
58bc7043a0 升级axios到最新版本0.30.3 2026-03-23 11:42:53 +08:00
RuoYi
677400b933 优化页签显示 2026-03-23 11:42:30 +08:00
RuoYi
959a2ffd67 添加持久化标签页开关功能 2026-03-22 23:29:23 +08:00
RuoYi
ec0ca11cc6 添加持久化标签页开关功能 2026-03-22 21:03:58 +08:00
23 changed files with 385 additions and 85 deletions

View File

@@ -1,11 +1,11 @@
<p align="center"> <p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png"> <img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
</p> </p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.9.1</h1> <h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.9.2</h1>
<h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4> <h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4>
<p align="center"> <p align="center">
<a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a> <a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.9.1-brightgreen.svg"></a> <a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.9.2-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a> <a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p> </p>

View File

@@ -6,14 +6,14 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<version>3.9.1</version> <version>3.9.2</version>
<name>ruoyi</name> <name>ruoyi</name>
<url>http://www.ruoyi.vip</url> <url>http://www.ruoyi.vip</url>
<description>若依管理系统</description> <description>若依管理系统</description>
<properties> <properties>
<ruoyi.version>3.9.1</ruoyi.version> <ruoyi.version>3.9.2</ruoyi.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version> <java.version>17</java.version>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.9.1</version> <version>3.9.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging> <packaging>jar</packaging>

View File

@@ -3,7 +3,7 @@ ruoyi:
# 名称 # 名称
name: RuoYi name: RuoYi
# 版本 # 版本
version: 3.9.1 version: 3.9.2
# 版权年份 # 版权年份
copyrightYear: 2026 copyrightYear: 2026
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath # 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.9.1</version> <version>3.9.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.9.1</version> <version>3.9.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.9.1</version> <version>3.9.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -4,6 +4,8 @@ import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.StringWriter; import java.io.StringWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -238,11 +240,7 @@ public class GenTableServiceImpl implements IGenTableService
@Override @Override
public byte[] downloadCode(String tableName) public byte[] downloadCode(String tableName)
{ {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); return downloadCode(new String[] { tableName });
ZipOutputStream zip = new ZipOutputStream(outputStream);
generatorCode(tableName, zip);
IOUtils.closeQuietly(zip);
return outputStream.toByteArray();
} }
/** /**
@@ -353,9 +351,14 @@ public class GenTableServiceImpl implements IGenTableService
{ {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
ZipOutputStream zip = new ZipOutputStream(outputStream); ZipOutputStream zip = new ZipOutputStream(outputStream);
Map<String, StringBuffer> typeFiles = new HashMap<>();
for (String tableName : tableNames) for (String tableName : tableNames)
{ {
generatorCode(tableName, zip); generatorCode(tableName, zip, typeFiles);
}
for (Map.Entry<String, StringBuffer> entry : typeFiles.entrySet())
{
writeToZip(zip, entry.getKey(), entry.getValue().toString());
} }
IOUtils.closeQuietly(zip); IOUtils.closeQuietly(zip);
return outputStream.toByteArray(); return outputStream.toByteArray();
@@ -364,7 +367,7 @@ public class GenTableServiceImpl implements IGenTableService
/** /**
* 查询表信息并生成代码 * 查询表信息并生成代码
*/ */
private void generatorCode(String tableName, ZipOutputStream zip) private void generatorCode(String tableName, ZipOutputStream zip, Map<String, StringBuffer> typeFiles)
{ {
// 查询表信息 // 查询表信息
GenTable table = genTableMapper.selectGenTableByName(tableName); GenTable table = genTableMapper.selectGenTableByName(tableName);
@@ -385,19 +388,46 @@ public class GenTableServiceImpl implements IGenTableService
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
Template tpl = Velocity.getTemplate(template, Constants.UTF8); Template tpl = Velocity.getTemplate(template, Constants.UTF8);
tpl.merge(context, sw); tpl.merge(context, sw);
String fileName = VelocityUtils.getFileName(template, table);
// index-bak.ts 模版,追加内容
if (fileName.contains("index-bak.ts"))
{
if (!typeFiles.containsKey(fileName))
{
typeFiles.put(fileName, new StringBuffer(sw.toString()));
}
else
{
Arrays.stream(sw.toString().split("\n")).filter(line -> line.startsWith("export * from")).forEach(line -> typeFiles.get(fileName).append("\n").append(line));
}
}
else
{
// 其他文件正常添加
writeToZip(zip, fileName, sw.toString());
}
}
}
/**
* 将字符串内容写入ZIP输出流
*
* @param zip ZIP输出流
* @param fileName ZIP条目名称即文件名
* @param content 要写入的内容
*/
private void writeToZip(ZipOutputStream zip, String fileName, String content)
{
try try
{ {
// 添加到zip zip.putNextEntry(new ZipEntry(fileName));
zip.putNextEntry(new ZipEntry(VelocityUtils.getFileName(template, table))); IOUtils.write(content, zip, Constants.UTF8);
IOUtils.write(sw.toString(), zip, Constants.UTF8);
IOUtils.closeQuietly(sw);
zip.flush(); zip.flush();
zip.closeEntry(); zip.closeEntry();
} }
catch (IOException e) catch (IOException e)
{ {
log.error("渲染模板失败,表名:" + table.getTableName(), e); log.error("写入ZIP文件失败文件名: " + fileName, e);
}
} }
} }

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.9.1</version> <version>3.9.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ruoyi</artifactId> <artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<version>3.9.1</version> <version>3.9.2</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -1,6 +1,6 @@
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.9.1", "version": "3.9.2",
"description": "若依管理系统", "description": "若依管理系统",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
@@ -25,7 +25,7 @@
}, },
"dependencies": { "dependencies": {
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"axios": "0.28.1", "axios": "0.30.3",
"clipboard": "2.0.8", "clipboard": "2.0.8",
"core-js": "3.37.1", "core-js": "3.37.1",
"echarts": "5.4.0", "echarts": "5.4.0",

View File

@@ -74,6 +74,8 @@
overflow: hidden !important; overflow: hidden !important;
text-overflow: ellipsis !important; text-overflow: ellipsis !important;
white-space: nowrap !important; white-space: nowrap !important;
height: 44px !important;
line-height: 44px !important;
} }
// menu hover // menu hover
@@ -105,6 +107,96 @@
background-color: $base-sub-menu-hover !important; background-color: $base-sub-menu-hover !important;
} }
} }
// theme-dark 深色主题
&.theme-dark {
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
border-right: none;
.el-menu-item.is-active {
position: relative;
&::before {
content: '';
position: absolute;
inset: 0;
background-color: var(--current-color-dark-bg, rgba(64, 158, 255, 0.2));
border-right: 3px solid var(--current-color, #409eff);
pointer-events: none;
z-index: 1;
}
}
.el-submenu.is-active > .el-submenu__title {
color: var(--current-color, #409eff) !important;
}
.el-menu-item:not(.is-active),
.submenu-title-noDropdown,
.el-submenu__title {
position: relative;
&::before {
content: '';
position: absolute;
inset: 0;
background-color: transparent;
pointer-events: none;
z-index: 1;
transition: background-color 0.2s;
}
&:hover::before {
background-color: var(--current-color-dark-bg, rgba(64, 158, 255, 0.2));
}
}
}
// theme-light 浅色主题
&.theme-light {
border-right: 1px solid #e8eaf0;
box-shadow: none;
.el-menu-item,
.el-submenu__title {
color: rgba(0, 0, 0, 0.65);
}
.el-menu-item.is-active {
color: var(--current-color, #409eff) !important;
position: relative;
&::before {
content: '';
position: absolute;
inset: 0;
background-color: var(--current-color-light, #ecf5ff);
border-right: 3px solid var(--current-color, #409eff);
pointer-events: none;
z-index: 1;
}
}
.el-submenu.is-active > .el-submenu__title {
color: var(--current-color, #409eff) !important;
}
.el-menu-item:not(.is-active):hover,
.submenu-title-noDropdown:hover,
.el-submenu__title:hover {
background-color: #f5f7fa !important;
color: rgba(0, 0, 0, 0.85) !important;
}
.nest-menu .el-submenu > .el-submenu__title,
.el-submenu .el-menu-item {
background-color: #fafafa !important;
&:hover {
background-color: #f0f5ff !important;
}
}
}
} }
.hideSidebar { .hideSidebar {

View File

@@ -10,31 +10,16 @@ $panGreen: #30B08F;
// 默认菜单主题风格 // 默认菜单主题风格
$base-menu-color: #bfcbd9; $base-menu-color: #bfcbd9;
$base-menu-color-active:#f4f4f5; $base-menu-color-active: #ffffff;
$base-menu-background:#304156; $base-menu-background: #1a1f2e;
$base-logo-title-color: #ffffff; $base-logo-title-color: #ffffff;
$base-menu-light-color:rgba(0,0,0,.70); $base-menu-light-color:rgba(0,0,0,.70);
$base-menu-light-background:#ffffff; $base-menu-light-background:#ffffff;
$base-logo-light-title-color: #001529; $base-logo-light-title-color: #001529;
$base-sub-menu-background:#1f2d3d; $base-sub-menu-background: #141824;
$base-sub-menu-hover:#001528; $base-sub-menu-hover: rgba(255,255,255,.06);
// 自定义暗色菜单风格
/**
$base-menu-color:hsla(0,0%,100%,.65);
$base-menu-color-active:#fff;
$base-menu-background:#001529;
$base-logo-title-color: #ffffff;
$base-menu-light-color:rgba(0,0,0,.70);
$base-menu-light-background:#ffffff;
$base-logo-light-title-color: #001529;
$base-sub-menu-background:#000c17;
$base-sub-menu-hover:#001528;
*/
$base-sidebar-width: 200px; $base-sidebar-width: 200px;

View File

@@ -65,6 +65,11 @@
<el-switch v-model="tagsView" class="drawer-switch" /> <el-switch v-model="tagsView" class="drawer-switch" />
</div> </div>
<div class="drawer-item">
<span>持久化标签页</span>
<el-switch v-model="tagsViewPersist" :disabled="!tagsView" class="drawer-switch" />
</div>
<div class="drawer-item"> <div class="drawer-item">
<span>显示页签图标</span> <span>显示页签图标</span>
<el-switch v-model="tagsIcon" :disabled="!tagsView" class="drawer-switch" /> <el-switch v-model="tagsIcon" :disabled="!tagsView" class="drawer-switch" />
@@ -125,6 +130,17 @@ export default {
}) })
} }
}, },
tagsViewPersist: {
get() {
return this.$store.state.settings.tagsViewPersist
},
set(val) {
this.$store.dispatch('settings/changeSetting', {
key: 'tagsViewPersist',
value: val
})
}
},
tagsView: { tagsView: {
get() { get() {
return this.$store.state.settings.tagsView return this.$store.state.settings.tagsView
@@ -231,12 +247,16 @@ export default {
}, },
saveSetting() { saveSetting() {
this.$modal.loading("正在保存到本地,请稍候...") this.$modal.loading("正在保存到本地,请稍候...")
if (!this.tagsViewPersist) {
this.$cache.local.remove('tags-view-visited')
}
this.$cache.local.set( this.$cache.local.set(
"layout-setting", "layout-setting",
`{ `{
"navType":${this.navType}, "navType":${this.navType},
"tagsView":${this.tagsView}, "tagsView":${this.tagsView},
"tagsIcon":${this.tagsIcon}, "tagsIcon":${this.tagsIcon},
"tagsViewPersist":${this.tagsViewPersist},
"fixedHeader":${this.fixedHeader}, "fixedHeader":${this.fixedHeader},
"sidebarLogo":${this.sidebarLogo}, "sidebarLogo":${this.sidebarLogo},
"dynamicTitle":${this.dynamicTitle}, "dynamicTitle":${this.dynamicTitle},
@@ -249,6 +269,7 @@ export default {
}, },
resetSetting() { resetSetting() {
this.$modal.loading("正在清除设置缓存并刷新,请稍候...") this.$modal.loading("正在清除设置缓存并刷新,请稍候...")
this.$cache.local.remove('tags-view-visited')
this.$cache.local.remove("layout-setting") this.$cache.local.remove("layout-setting")
setTimeout("window.location.reload()", 1000) setTimeout("window.location.reload()", 1000)
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <div :class="['sidebar-theme-wrapper', {'has-logo':showLogo}, settings.sideTheme]" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse" /> <logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper"> <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<el-menu <el-menu

View File

@@ -36,18 +36,21 @@
<i class="el-icon-arrow-down" /> <i class="el-icon-arrow-down" />
</span> </span>
<el-dropdown-menu slot="dropdown" class="tags-dropdown-menu"> <el-dropdown-menu slot="dropdown" class="tags-dropdown-menu">
<el-dropdown-item command="refresh" icon="el-icon-refresh-right">刷新页面</el-dropdown-item>
<el-dropdown-item v-if="!isAffix(selectedDropdownTag)" command="close" icon="el-icon-close">关闭当前</el-dropdown-item> <el-dropdown-item v-if="!isAffix(selectedDropdownTag)" command="close" icon="el-icon-close">关闭当前</el-dropdown-item>
<el-dropdown-item command="closeOthers" icon="el-icon-circle-close">关闭其他</el-dropdown-item> <el-dropdown-item command="closeOthers" icon="el-icon-circle-close">关闭其他</el-dropdown-item>
<el-dropdown-item command="closeLeft" :disabled="isFirstView()" icon="el-icon-back">关闭左侧</el-dropdown-item> <el-dropdown-item command="closeLeft" :disabled="isFirstView()" icon="el-icon-back">关闭左侧</el-dropdown-item>
<el-dropdown-item command="closeRight" :disabled="isLastView()" icon="el-icon-right">关闭右侧</el-dropdown-item> <el-dropdown-item command="closeRight" :disabled="isLastView()" icon="el-icon-right">关闭右侧</el-dropdown-item>
<el-dropdown-item command="closeAll" icon="el-icon-circle-close" divided>全部关闭</el-dropdown-item> <el-dropdown-item command="closeAll" icon="el-icon-circle-close">全部关闭</el-dropdown-item>
<el-dropdown-item command="fullscreen" divided>
<template v-if="!isFullscreen"><i class="el-icon-full-screen"></i>全屏显示</template>
<template v-else><i class="el-icon-close"></i>退出全屏</template>
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<!-- 全屏按钮 --> <!-- 刷新按钮 -->
<span class="tags-action-btn tags-fullscreen-btn" :title="isFullscreen ? '退出全屏' : '全屏'" @click="toggleFullscreen"> <span class="tags-action-btn tags-refresh-btn" title="刷新页面" @click="refreshSelectedTag(selectedDropdownTag)">
<i :class="isFullscreen ? 'el-icon-aim' : 'el-icon-full-screen'" /> <i class="el-icon-refresh-right" /> 刷新
</span> </span>
<!-- 右键上下文菜单 --> <!-- 右键上下文菜单 -->
@@ -77,7 +80,8 @@ export default {
affixTags: [], affixTags: [],
canScrollLeft: false, canScrollLeft: false,
canScrollRight: false, canScrollRight: false,
isFullscreen: false isFullscreen: false,
hiddenElements: []
} }
}, },
computed: { computed: {
@@ -119,13 +123,19 @@ export default {
this.initTags() this.initTags()
this.addTags() this.addTags()
window.addEventListener('resize', this.updateArrowState) window.addEventListener('resize', this.updateArrowState)
document.addEventListener('fullscreenchange', this.onFullscreenChange) window.addEventListener('keydown', this.handleKeyDown)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', this.updateArrowState) window.removeEventListener('resize', this.updateArrowState)
document.removeEventListener('fullscreenchange', this.onFullscreenChange) window.removeEventListener('keydown', this.handleKeyDown)
}, },
methods: { methods: {
handleKeyDown(event) {
// 当按下Esc键且处于全屏状态时退出全屏
if (event.key === 'Escape' && this.isFullscreen) {
this.toggleFullscreen()
}
},
isActive(route) { isActive(route) {
return route.path === this.$route.path return route.path === this.$route.path
}, },
@@ -177,10 +187,13 @@ export default {
return tags return tags
}, },
initTags() { initTags() {
if (this.$store.state.settings.tagsViewPersist) {
this.$store.dispatch('tagsView/loadPersistedViews')
}
const affixTags = this.affixTags = this.filterAffixTags(this.routes) const affixTags = this.affixTags = this.filterAffixTags(this.routes)
for (const tag of affixTags) { for (const tag of affixTags) {
if (tag.name) { if (tag.name) {
this.$store.dispatch('tagsView/addVisitedView', tag) this.$store.dispatch('tagsView/addAffixView', tag)
} }
} }
}, },
@@ -222,17 +235,39 @@ export default {
}) })
}, },
toggleFullscreen() { toggleFullscreen() {
if (!document.fullscreenElement) { const mainContainer = document.querySelector('.main-container')
const appMain = document.querySelector('.app-main') const navbar = document.querySelector('.navbar')
if (appMain) { const sidebar = document.querySelector('.sidebar-container')
appMain.requestFullscreen() if (!mainContainer) return
if (!this.isFullscreen) {
mainContainer.classList.add('fullscreen-mode')
document.body.style.overflow = 'hidden'
const elementsToHide = [
{ el: navbar, originalDisplay: (navbar && navbar.style.display) || '' },
{ el: sidebar, originalDisplay: (sidebar && sidebar.style.display) || '' }
]
elementsToHide.forEach(item => {
if (item.el && item.el.style.display !== 'none') {
item.originalDisplay = item.el.style.display
item.el.style.display = 'none'
this.hiddenElements.push(item)
} }
})
this.isFullscreen = true
} else { } else {
document.exitFullscreen() mainContainer.classList.remove('fullscreen-mode')
document.body.style.overflow = ''
this.hiddenElements.forEach(item => {
if (item.el) {
item.el.style.display = item.originalDisplay
}
})
this.hiddenElements = []
const btn = document.querySelector('.tags-action-btn')
if (btn) btn.blur()
this.isFullscreen = false
} }
},
onFullscreenChange() {
this.isFullscreen = !!document.fullscreenElement
}, },
handleDropdownCommand(command) { handleDropdownCommand(command) {
const tag = this.selectedDropdownTag const tag = this.selectedDropdownTag
@@ -241,6 +276,9 @@ export default {
case 'refresh': case 'refresh':
this.refreshSelectedTag(tag) this.refreshSelectedTag(tag)
break break
case 'fullscreen':
this.toggleFullscreen()
break
case 'close': case 'close':
this.closeSelectedTag(tag) this.closeSelectedTag(tag)
break break
@@ -392,6 +430,7 @@ export default {
padding: 0 8px; padding: 0 8px;
font-size: 12px; font-size: 12px;
margin-left: 5px; margin-left: 5px;
border-radius: 3px;
&:first-of-type { &:first-of-type {
margin-left: 6px; margin-left: 6px;
@@ -446,8 +485,8 @@ export default {
} }
} }
.tags-fullscreen-btn { .tags-refresh-btn {
border-left: $divider; width: 60px;
} }
.contextmenu { .contextmenu {
@@ -498,4 +537,41 @@ export default {
} }
} }
} }
/* 页签全屏模式样式 */
.main-container.fullscreen-mode {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
}
.main-container.fullscreen-mode .fixed-header {
display: block !important;
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100% !important;
z-index: 1000;
}
.main-container.fullscreen-mode .fixed-header .navbar {
display: none !important;
}
.main-container.fullscreen-mode .app-main {
position: fixed;
top: 34px;
left: 0;
right: 0;
bottom: 0;
margin: 0 !important;
padding: 0 !important;
height: calc(100vh - 34px) !important;
min-height: calc(100vh - 34px) !important;
overflow: auto;
}
</style> </style>

View File

@@ -1,5 +1,5 @@
<template> <template>
<div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}"> <div :class="classObj" class="app-wrapper" :style="{'--current-color': theme, '--current-color-light': theme + '1a', '--current-color-dark-bg': theme + '33'}">
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/> <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<sidebar v-if="!sidebar.hide" class="sidebar-container"/> <sidebar v-if="!sidebar.hide" class="sidebar-container"/>
<div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container"> <div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container">

View File

@@ -5,6 +5,10 @@ export default {
// 刷新当前tab页签 // 刷新当前tab页签
refreshPage(obj) { refreshPage(obj) {
const { path, query, matched } = router.currentRoute const { path, query, matched } = router.currentRoute
// 防止在重定向过程中重复刷新
if (path.startsWith('/redirect/')) {
return Promise.resolve()
}
if (obj === undefined) { if (obj === undefined) {
matched.forEach((m) => { matched.forEach((m) => {
if (m.components && m.components.default && m.components.default.name) { if (m.components && m.components.default && m.components.default.name) {

View File

@@ -24,6 +24,11 @@ module.exports = {
*/ */
tagsView: true, tagsView: true,
/**
* 持久化标签页
*/
tagsViewPersist: false,
/** /**
* 显示页签图标 * 显示页签图标
*/ */

View File

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

View File

@@ -1,3 +1,26 @@
import store from '@/store'
import cache from '@/plugins/cache'
const PERSIST_KEY = 'tags-view-visited'
function isPersistEnabled() {
return store.state.settings.tagsViewPersist
}
function saveVisitedViews(views) {
if (!isPersistEnabled()) return
const toSave = views.filter(v => !(v.meta && v.meta.affix)).map(v => ({ path: v.path, fullPath: v.fullPath, name: v.name, title: v.title, query: v.query, meta: v.meta }))
cache.local.setJSON(PERSIST_KEY, toSave)
}
function loadVisitedViews() {
return cache.local.getJSON(PERSIST_KEY) || []
}
function clearVisitedViews() {
cache.local.remove(PERSIST_KEY)
}
const state = { const state = {
visitedViews: [], visitedViews: [],
cachedViews: [], cachedViews: [],
@@ -20,6 +43,15 @@ const mutations = {
title: view.meta.title || 'no-name' title: view.meta.title || 'no-name'
}) })
) )
saveVisitedViews(state.visitedViews)
},
ADD_VISITED_VIEW_FIRST: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.unshift(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
}, },
ADD_CACHED_VIEW: (state, view) => { ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return if (state.cachedViews.includes(view.name)) return
@@ -35,6 +67,7 @@ const mutations = {
} }
} }
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
saveVisitedViews(state.visitedViews)
}, },
DEL_IFRAME_VIEW: (state, view) => { DEL_IFRAME_VIEW: (state, view) => {
state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) state.iframeViews = state.iframeViews.filter(item => item.path !== view.path)
@@ -49,6 +82,7 @@ const mutations = {
return v.meta.affix || v.path === view.path return v.meta.affix || v.path === view.path
}) })
state.iframeViews = state.iframeViews.filter(item => item.path === view.path) state.iframeViews = state.iframeViews.filter(item => item.path === view.path)
saveVisitedViews(state.visitedViews)
}, },
DEL_OTHERS_CACHED_VIEWS: (state, view) => { DEL_OTHERS_CACHED_VIEWS: (state, view) => {
const index = state.cachedViews.indexOf(view.name) const index = state.cachedViews.indexOf(view.name)
@@ -63,6 +97,7 @@ const mutations = {
const affixTags = state.visitedViews.filter(tag => tag.meta.affix) const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
state.visitedViews = affixTags state.visitedViews = affixTags
state.iframeViews = [] state.iframeViews = []
clearVisitedViews()
}, },
DEL_ALL_CACHED_VIEWS: state => { DEL_ALL_CACHED_VIEWS: state => {
state.cachedViews = [] state.cachedViews = []
@@ -94,6 +129,7 @@ const mutations = {
} }
return false return false
}) })
saveVisitedViews(state.visitedViews)
}, },
DEL_LEFT_VIEWS: (state, view) => { DEL_LEFT_VIEWS: (state, view) => {
const index = state.visitedViews.findIndex(v => v.path === view.path) const index = state.visitedViews.findIndex(v => v.path === view.path)
@@ -114,6 +150,7 @@ const mutations = {
} }
return false return false
}) })
saveVisitedViews(state.visitedViews)
} }
} }
@@ -128,6 +165,9 @@ const actions = {
addVisitedView({ commit }, view) { addVisitedView({ commit }, view) {
commit('ADD_VISITED_VIEW', view) commit('ADD_VISITED_VIEW', view)
}, },
addAffixView({ commit }, view) {
commit('ADD_VISITED_VIEW_FIRST', view)
},
addCachedView({ commit }, view) { addCachedView({ commit }, view) {
commit('ADD_CACHED_VIEW', view) commit('ADD_CACHED_VIEW', view)
}, },
@@ -218,6 +258,13 @@ const actions = {
resolve([...state.visitedViews]) resolve([...state.visitedViews])
}) })
}, },
// 恢复持久化的 tags
loadPersistedViews({ commit }) {
const views = loadVisitedViews()
views.forEach(view => {
commit('ADD_VISITED_VIEW', view)
})
},
} }
export default { export default {

View File

@@ -112,6 +112,41 @@
<span>更新日志</span> <span>更新日志</span>
</div> </div>
<el-collapse accordion> <el-collapse accordion>
<el-collapse-item title="v3.9.2 - 2026-03-26">
<ol>
<li>新增锁定屏幕功能</li>
<li>首页新增通知公告消息提醒</li>
<li>添加持久化标签页开关功能</li>
<li>菜单搜索支持文本高亮&数量提示</li>
<li>添加菜单路由地址和名称的校验规则</li>
<li>字典类型列表新增抽屉效果详细信息</li>
<li>升级axios到最新版本0.30.3</li>
<li>使用SpringDoc代替Swagger</li>
<li>升级spring-boot到最新版本4.0.3</li>
<li>升级yauaa到最新版本8.1.0</li>
<li>升级oshi到最新版本6.10.0</li>
<li>升级druid到最新版本1.2.28</li>
<li>升级fastjson到最新版2.0.61</li>
<li>升级pagehelper到最新版2.1.1</li>
<li>优化操作日志详细页面</li>
<li>更新在线IP地址查询url</li>
<li>部门管理支持批量保存排序</li>
<li>菜单管理支持批量保存排序</li>
<li>菜单管理列表新增类型显示</li>
<li>代码生成模板支持TypeScript版本</li>
<li>优化菜单主题风格显示</li>
<li>优化topbar顶部菜单样式</li>
<li>优化点击任务名称查看详细</li>
<li>优化字典类型属性提醒说明</li>
<li>优化防重提交间隔时间可自定义</li>
<li>优化页签功能&支持全屏按钮操作</li>
<li>优化RightToolbar搜索栏切换动画</li>
<li>修复Excel自定义格式样式污染问题</li>
<li>优化isAdmin方法统一到SecurityUtils</li>
<li>优化定时任务详情页展示&补充执行时间字段</li>
<li>其他细节优化</li>
</ol>
</el-collapse-item>
<el-collapse-item title="v3.9.1 - 2025-12-18"> <el-collapse-item title="v3.9.1 - 2025-12-18">
<ol> <ol>
<li>支持防盗链功能</li> <li>支持防盗链功能</li>
@@ -1096,7 +1131,7 @@ export default {
data() { data() {
return { return {
// 版本号 // 版本号
version: "3.9.1" version: "3.9.2"
} }
}, },
methods: { methods: {

View File

@@ -66,10 +66,19 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
> >
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column> <el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="220">
<el-table-column prop="icon" label="图标" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<svg-icon :icon-class="scope.row.icon" /> <svg-icon :icon-class="scope.row.icon" />
<span class="ml5">{{ scope.row.menuName }}</span>
</template>
</el-table-column>
<el-table-column prop="menuName" label="类型" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.menuType === 'M' && scope.row.isFrame === '0'" type="danger" size="small">外链</el-tag>
<el-tag v-else-if="scope.row.menuType === 'M'" type="primary" size="small">目录</el-tag>
<el-tag v-else-if="scope.row.menuType === 'C' && scope.row.isFrame === '0'" type="danger" size="small">外链</el-tag>
<el-tag v-else-if="scope.row.menuType === 'C'" type="success" size="small">菜单</el-tag>
<el-tag v-else-if="scope.row.menuType === 'F'" type="warning" size="small">按钮</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="orderNum" label="排序" width="200"> <el-table-column prop="orderNum" label="排序" width="200">
@@ -77,18 +86,13 @@
<el-input-number v-model="scope.row.orderNum" controls-position="right" :min="0" size="mini" style="width: 88px" /> <el-input-number v-model="scope.row.orderNum" controls-position="right" :min="0" size="mini" style="width: 88px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true" />
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true" />
<el-table-column prop="status" label="状态" width="80"> <el-table-column prop="status" label="状态" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" /> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button