mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-02-01 14:31:56 +08:00
Compare commits
3 Commits
83fdbdd21b
...
6923567069
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6923567069 | ||
|
|
2c82079d04 | ||
|
|
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, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,29 +1,37 @@
|
|||||||
export default [
|
export const drawingDefaultValue = []
|
||||||
{
|
|
||||||
layout: 'colFormItem',
|
export function initDrawingDefaultValue() {
|
||||||
tagIcon: 'input',
|
if (drawingDefaultValue.length === 0) {
|
||||||
label: '手机号',
|
drawingDefaultValue.push({
|
||||||
vModel: 'mobile',
|
layout: 'colFormItem',
|
||||||
formId: 6,
|
tagIcon: 'input',
|
||||||
tag: 'el-input',
|
label: '手机号',
|
||||||
placeholder: '请输入手机号',
|
vModel: 'mobile',
|
||||||
defaultValue: '',
|
formId: 6,
|
||||||
span: 24,
|
tag: 'el-input',
|
||||||
style: { width: '100%' },
|
placeholder: '请输入手机号',
|
||||||
clearable: true,
|
defaultValue: '',
|
||||||
prepend: '',
|
span: 24,
|
||||||
append: '',
|
style: {width: '100%'},
|
||||||
'prefix-icon': 'el-icon-mobile',
|
clearable: true,
|
||||||
'suffix-icon': '',
|
prepend: '',
|
||||||
maxlength: 11,
|
append: '',
|
||||||
'show-word-limit': true,
|
'prefix-icon': 'el-icon-mobile',
|
||||||
readonly: false,
|
'suffix-icon': '',
|
||||||
disabled: false,
|
maxlength: 11,
|
||||||
required: true,
|
'show-word-limit': true,
|
||||||
changeTag: true,
|
readonly: false,
|
||||||
regList: [{
|
disabled: false,
|
||||||
pattern: '/^1(3|4|5|7|8|9)\\d{9}$/',
|
required: true,
|
||||||
message: '手机号格式错误'
|
changeTag: true,
|
||||||
}]
|
regList: [{
|
||||||
|
pattern: '/^1(3|4|5|7|8|9)\\d{9}$/',
|
||||||
|
message: '手机号格式错误'
|
||||||
|
}]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
|
|
||||||
|
export function cleanDrawingDefaultValue() {
|
||||||
|
drawingDefaultValue.splice(0, drawingDefaultValue.length)
|
||||||
|
}
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ import { beautifierConf, titleCase } from '@/utils/index'
|
|||||||
import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html'
|
import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html'
|
||||||
import { makeUpJs } from '@/utils/generator/js'
|
import { makeUpJs } from '@/utils/generator/js'
|
||||||
import { makeUpCss } from '@/utils/generator/css'
|
import { makeUpCss } from '@/utils/generator/css'
|
||||||
import drawingDefault from '@/utils/generator/drawingDefault'
|
import { drawingDefaultValue, initDrawingDefaultValue, cleanDrawingDefaultValue } from '@/utils/generator/drawingDefault'
|
||||||
import logo from '@/assets/logo/logo.png'
|
import logo from '@/assets/logo/logo.png'
|
||||||
import CodeTypeDialog from './CodeTypeDialog'
|
import CodeTypeDialog from './CodeTypeDialog'
|
||||||
import DraggableItem from './DraggableItem'
|
import DraggableItem from './DraggableItem'
|
||||||
@@ -171,17 +171,20 @@ export default {
|
|||||||
selectComponents,
|
selectComponents,
|
||||||
layoutComponents,
|
layoutComponents,
|
||||||
labelWidth: 100,
|
labelWidth: 100,
|
||||||
drawingList: drawingDefault,
|
drawingList: drawingDefaultValue,
|
||||||
drawingData: {},
|
drawingData: {},
|
||||||
activeId: drawingDefault[0].formId,
|
activeId: drawingDefaultValue[0].formId,
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formData: {},
|
formData: {},
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
generateConf: null,
|
generateConf: null,
|
||||||
showFileName: false,
|
showFileName: false,
|
||||||
activeData: drawingDefault[0]
|
activeData: drawingDefaultValue[0]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
initDrawingDefaultValue()
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
// 防止 firefox 下 拖拽 会新打卡一个选项卡
|
// 防止 firefox 下 拖拽 会新打卡一个选项卡
|
||||||
document.body.ondrop = event => {
|
document.body.ondrop = event => {
|
||||||
@@ -284,6 +287,7 @@ export default {
|
|||||||
this.$confirm('确定要清空所有组件吗?', '提示', { type: 'warning' }).then(
|
this.$confirm('确定要清空所有组件吗?', '提示', { type: 'warning' }).then(
|
||||||
() => {
|
() => {
|
||||||
this.drawingList = []
|
this.drawingList = []
|
||||||
|
cleanDrawingDefaultValue()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user