mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-29 21:11:57 +08:00
Compare commits
3 Commits
a2019536a2
...
f285a08fea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f285a08fea | ||
|
|
cd0ee95b9c | ||
|
|
6fb42d117e |
@@ -113,9 +113,10 @@ public class DataScopeAspect
|
|||||||
}
|
}
|
||||||
if (DATA_SCOPE_ALL.equals(dataScope))
|
if (DATA_SCOPE_ALL.equals(dataScope))
|
||||||
{
|
{
|
||||||
|
// 全部数据权限,不添加额外条件
|
||||||
sqlString = new StringBuilder();
|
sqlString = new StringBuilder();
|
||||||
conditions.add(dataScope);
|
conditions.clear();
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
else if (DATA_SCOPE_CUSTOM.equals(dataScope))
|
else if (DATA_SCOPE_CUSTOM.equals(dataScope))
|
||||||
{
|
{
|
||||||
@@ -143,28 +144,28 @@ public class DataScopeAspect
|
|||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
|
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
|
||||||
}
|
}
|
||||||
else
|
// 当没有 userAlias 时,不添加任何条件
|
||||||
{
|
|
||||||
// 数据权限为仅本人且没有userAlias别名不查询任何数据
|
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
conditions.add(dataScope);
|
conditions.add(dataScope);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 角色都不包含传递过来的权限字符,这个时候sqlString也会为空,所以要限制一下,不查询任何数据
|
// 角色都不包含传递过来的权限字符,这个时候不添加任何条件
|
||||||
if (StringUtils.isEmpty(conditions))
|
if (StringUtils.isEmpty(conditions))
|
||||||
{
|
{
|
||||||
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
sqlString = new StringBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(sqlString.toString()))
|
String sql = sqlString.toString().trim();
|
||||||
|
if (sql.startsWith("OR ")) {
|
||||||
|
sql = sql.substring(3);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(sql))
|
||||||
{
|
{
|
||||||
Object params = joinPoint.getArgs()[0];
|
Object params = joinPoint.getArgs()[0];
|
||||||
if (StringUtils.isNotNull(params) && params instanceof BaseEntity)
|
if (params instanceof BaseEntity)
|
||||||
{
|
{
|
||||||
BaseEntity baseEntity = (BaseEntity) params;
|
BaseEntity baseEntity = (BaseEntity) params;
|
||||||
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
|
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sql + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,4 +182,4 @@ public class DataScopeAspect
|
|||||||
baseEntity.getParams().put(DATA_SCOPE, "");
|
baseEntity.getParams().put(DATA_SCOPE, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,6 +49,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="tagsIcon" :disabled="!tagsView" class="drawer-switch" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="drawer-item">
|
<div class="drawer-item">
|
||||||
<span>固定 Header</span>
|
<span>固定 Header</span>
|
||||||
<el-switch v-model="fixedHeader" class="drawer-switch" />
|
<el-switch v-model="fixedHeader" class="drawer-switch" />
|
||||||
@@ -124,6 +129,17 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
tagsIcon: {
|
||||||
|
get() {
|
||||||
|
return this.$store.state.settings.tagsIcon
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$store.dispatch('settings/changeSetting', {
|
||||||
|
key: 'tagsIcon',
|
||||||
|
value: val
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
sidebarLogo: {
|
sidebarLogo: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.settings.sidebarLogo
|
return this.$store.state.settings.sidebarLogo
|
||||||
@@ -176,6 +192,7 @@ export default {
|
|||||||
`{
|
`{
|
||||||
"topNav":${this.topNav},
|
"topNav":${this.topNav},
|
||||||
"tagsView":${this.tagsView},
|
"tagsView":${this.tagsView},
|
||||||
|
"tagsIcon":${this.tagsIcon},
|
||||||
"fixedHeader":${this.fixedHeader},
|
"fixedHeader":${this.fixedHeader},
|
||||||
"sidebarLogo":${this.sidebarLogo},
|
"sidebarLogo":${this.sidebarLogo},
|
||||||
"dynamicTitle":${this.dynamicTitle},
|
"dynamicTitle":${this.dynamicTitle},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
v-for="tag in visitedViews"
|
v-for="tag in visitedViews"
|
||||||
ref="tag"
|
ref="tag"
|
||||||
:key="tag.path"
|
:key="tag.path"
|
||||||
:class="isActive(tag)?'active':''"
|
:class="{ 'active': isActive(tag), 'has-icon': tagsIcon }"
|
||||||
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
|
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
|
||||||
tag="span"
|
tag="span"
|
||||||
class="tags-view-item"
|
class="tags-view-item"
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
|
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
|
||||||
@contextmenu.prevent.native="openMenu(tag,$event)"
|
@contextmenu.prevent.native="openMenu(tag,$event)"
|
||||||
>
|
>
|
||||||
|
<svg-icon v-if="tagsIcon && tag.meta && tag.meta.icon && tag.meta.icon !== '#'" :icon-class="tag.meta.icon" />
|
||||||
{{ tag.title }}
|
{{ tag.title }}
|
||||||
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
||||||
</router-link>
|
</router-link>
|
||||||
@@ -52,6 +53,9 @@ export default {
|
|||||||
},
|
},
|
||||||
theme() {
|
theme() {
|
||||||
return this.$store.state.settings.theme
|
return this.$store.state.settings.theme
|
||||||
|
},
|
||||||
|
tagsIcon() {
|
||||||
|
return this.$store.state.settings.tagsIcon
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -277,6 +281,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags-view-item.active.has-icon::before {
|
||||||
|
content: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.contextmenu {
|
.contextmenu {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module.exports = {
|
|||||||
sideTheme: 'theme-dark',
|
sideTheme: 'theme-dark',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否系统布局配置
|
* 系统布局配置
|
||||||
*/
|
*/
|
||||||
showSettings: true,
|
showSettings: true,
|
||||||
|
|
||||||
@@ -23,6 +23,11 @@ module.exports = {
|
|||||||
* 是否显示 tagsView
|
* 是否显示 tagsView
|
||||||
*/
|
*/
|
||||||
tagsView: true,
|
tagsView: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示页签图标
|
||||||
|
*/
|
||||||
|
tagsIcon: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否固定头部
|
* 是否固定头部
|
||||||
@@ -37,13 +42,5 @@ module.exports = {
|
|||||||
/**
|
/**
|
||||||
* 是否显示动态标题
|
* 是否显示动态标题
|
||||||
*/
|
*/
|
||||||
dynamicTitle: false,
|
dynamicTitle: false
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {string | array} 'production' | ['production', 'development']
|
|
||||||
* @description Need show err logs component.
|
|
||||||
* The default is only used in the production env
|
|
||||||
* If you want to also use it in dev, you can pass ['production', 'development']
|
|
||||||
*/
|
|
||||||
errorLog: 'production'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
|
const { sideTheme, showSettings, topNav, tagsView, tagsIcon, fixedHeader, sidebarLogo, dynamicTitle } = 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,
|
||||||
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
|
||||||
tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
|
tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
|
||||||
|
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,
|
||||||
dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
|
dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
|
||||||
|
|||||||
Reference in New Issue
Block a user