Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
557672ba
提交
557672ba
authored
6月 10, 2021
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
系统布局配置支持动态标题开关
上级
a3116cd2
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
55 行增加
和
7 行删除
+55
-7
.env.development
ruoyi-ui/.env.development
+3
-0
.env.production
ruoyi-ui/.env.production
+3
-0
.env.staging
ruoyi-ui/.env.staging
+3
-0
package.json
ruoyi-ui/package.json
+1
-0
App.vue
ruoyi-ui/src/App.vue
+9
-1
index.vue
ruoyi-ui/src/layout/components/Settings/index.vue
+17
-0
main.js
ruoyi-ui/src/main.js
+3
-0
permission.js
ruoyi-ui/src/permission.js
+1
-0
settings.js
ruoyi-ui/src/settings.js
+5
-2
settings.js
ruoyi-ui/src/store/modules/settings.js
+9
-2
vue.config.js
ruoyi-ui/vue.config.js
+1
-2
没有找到文件。
ruoyi-ui/.env.development
浏览文件 @
557672ba
# 页面标题
VUE_APP_TITLE = 若依管理系统
# 开发环境配置
ENV = 'development'
...
...
ruoyi-ui/.env.production
浏览文件 @
557672ba
# 页面标题
VUE_APP_TITLE = 若依管理系统
# 生产环境配置
ENV = 'production'
...
...
ruoyi-ui/.env.staging
浏览文件 @
557672ba
# 页面标题
VUE_APP_TITLE = 若依管理系统
NODE_ENV = production
# 测试环境配置
...
...
ruoyi-ui/package.json
浏览文件 @
557672ba
...
...
@@ -55,6 +55,7 @@
"vue"
:
"2.6.12"
,
"vue-count-to"
:
"1.0.13"
,
"vue-cropper"
:
"0.5.5"
,
"vue-meta"
:
"^2.4.0"
,
"vue-router"
:
"3.4.9"
,
"vuedraggable"
:
"2.24.3"
,
"vuex"
:
"3.6.0"
...
...
ruoyi-ui/src/App.vue
浏览文件 @
557672ba
...
...
@@ -6,6 +6,14 @@
<
script
>
export
default
{
name
:
'App'
name
:
'App'
,
metaInfo
()
{
return
{
title
:
this
.
$store
.
state
.
settings
.
dynamicTitle
&&
this
.
$store
.
state
.
settings
.
title
,
titleTemplate
:
title
=>
{
return
title
?
`
${
title
}
-
${
process
.
env
.
VUE_APP_TITLE
}
`
:
process
.
env
.
VUE_APP_TITLE
}
}
}
}
</
script
>
ruoyi-ui/src/layout/components/Settings/index.vue
浏览文件 @
557672ba
...
...
@@ -62,6 +62,11 @@
<el-switch
v-model=
"sidebarLogo"
class=
"drawer-switch"
/>
</div>
<div
class=
"drawer-item"
>
<span>
动态标题
</span>
<el-switch
v-model=
"dynamicTitle"
class=
"drawer-switch"
/>
</div>
<el-divider/>
<el-button
size=
"small"
type=
"primary"
plain
icon=
"el-icon-document-add"
@
click=
"saveSetting"
>
保存配置
</el-button>
...
...
@@ -129,6 +134,17 @@ export default {
})
}
},
dynamicTitle
:
{
get
()
{
return
this
.
$store
.
state
.
settings
.
dynamicTitle
},
set
(
val
)
{
this
.
$store
.
dispatch
(
'settings/changeSetting'
,
{
key
:
'dynamicTitle'
,
value
:
val
})
}
},
},
methods
:
{
themeChange
(
val
)
{
...
...
@@ -160,6 +176,7 @@ export default {
"tagsView":
${
this
.
tagsView
}
,
"fixedHeader":
${
this
.
fixedHeader
}
,
"sidebarLogo":
${
this
.
sidebarLogo
}
,
"dynamicTitle":
${
this
.
dynamicTitle
}
,
"sideTheme":"
${
this
.
sideTheme
}
",
"theme":"
${
this
.
theme
}
"
}`
...
...
ruoyi-ui/src/main.js
浏览文件 @
557672ba
...
...
@@ -20,6 +20,8 @@ import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels,
import
Pagination
from
"@/components/Pagination"
;
// 自定义表格工具扩展
import
RightToolbar
from
"@/components/RightToolbar"
// 头部标签插件
import
VueMeta
from
'vue-meta'
// 全局方法挂载
Vue
.
prototype
.
getDicts
=
getDicts
...
...
@@ -49,6 +51,7 @@ Vue.component('Pagination', Pagination)
Vue
.
component
(
'RightToolbar'
,
RightToolbar
)
Vue
.
use
(
permission
)
Vue
.
use
(
VueMeta
)
/**
* If you don't want to use mock-server
...
...
ruoyi-ui/src/permission.js
浏览文件 @
557672ba
...
...
@@ -12,6 +12,7 @@ const whiteList = ['/login', '/auth-redirect', '/bind', '/register']
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
if
(
getToken
())
{
to
.
meta
.
title
&&
store
.
dispatch
(
'settings/setTitle'
,
to
.
meta
.
title
)
/* has token*/
if
(
to
.
path
===
'/login'
)
{
next
({
path
:
'/'
})
...
...
ruoyi-ui/src/settings.js
浏览文件 @
557672ba
module
.
exports
=
{
title
:
'若依管理系统'
,
/**
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
*/
...
...
@@ -31,6 +29,11 @@ module.exports = {
*/
sidebarLogo
:
true
,
/**
* 是否显示动态标题
*/
dynamicTitle
:
false
,
/**
* @type {string | array} 'production' | ['production', 'development']
* @description Need show err logs component.
...
...
ruoyi-ui/src/store/modules/settings.js
浏览文件 @
557672ba
import
variables
from
'@/assets/styles/element-variables.scss'
import
defaultSettings
from
'@/settings'
const
{
sideTheme
,
showSettings
,
topNav
,
tagsView
,
fixedHeader
,
sidebarLogo
}
=
defaultSettings
const
{
sideTheme
,
showSettings
,
topNav
,
tagsView
,
fixedHeader
,
sidebarLogo
,
dynamicTitle
}
=
defaultSettings
const
storageSetting
=
JSON
.
parse
(
localStorage
.
getItem
(
'layout-setting'
))
||
''
const
state
=
{
title
:
''
,
theme
:
storageSetting
.
theme
||
variables
.
theme
,
sideTheme
:
storageSetting
.
sideTheme
||
sideTheme
,
showSettings
:
showSettings
,
topNav
:
storageSetting
.
topNav
===
undefined
?
topNav
:
storageSetting
.
topNav
,
tagsView
:
storageSetting
.
tagsView
===
undefined
?
tagsView
:
storageSetting
.
tagsView
,
fixedHeader
:
storageSetting
.
fixedHeader
===
undefined
?
fixedHeader
:
storageSetting
.
fixedHeader
,
sidebarLogo
:
storageSetting
.
sidebarLogo
===
undefined
?
sidebarLogo
:
storageSetting
.
sidebarLogo
sidebarLogo
:
storageSetting
.
sidebarLogo
===
undefined
?
sidebarLogo
:
storageSetting
.
sidebarLogo
,
dynamicTitle
:
storageSetting
.
dynamicTitle
===
undefined
?
dynamicTitle
:
storageSetting
.
dynamicTitle
}
const
mutations
=
{
CHANGE_SETTING
:
(
state
,
{
key
,
value
})
=>
{
...
...
@@ -22,8 +24,13 @@ const mutations = {
}
const
actions
=
{
// 修改布局设置
changeSetting
({
commit
},
data
)
{
commit
(
'CHANGE_SETTING'
,
data
)
},
// 设置网页标题
setTitle
({
commit
},
title
)
{
state
.
title
=
title
}
}
...
...
ruoyi-ui/vue.config.js
浏览文件 @
557672ba
'use strict'
const
path
=
require
(
'path'
)
const
defaultSettings
=
require
(
'./src/settings.js'
)
function
resolve
(
dir
)
{
return
path
.
join
(
__dirname
,
dir
)
}
const
name
=
defaultSettings
.
title
||
'若依管理系统'
//
标题
const
name
=
process
.
env
.
VUE_APP_TITLE
||
'若依管理系统'
// 网页
标题
const
port
=
process
.
env
.
port
||
process
.
env
.
npm_config_port
||
80
// 端口
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论