Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
e048d4ca
提交
e048d4ca
authored
5月 26, 2022
作者:
junjun
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev' into dev
上级
57330d34
70bed251
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
73 行增加
和
254 行删除
+73
-254
SysLogConstants.java
...n/java/io/dataease/commons/constants/SysLogConstants.java
+2
-1
ExtSysLogMapper.xml
backend/src/main/java/io/dataease/ext/ExtSysLogMapper.xml
+11
-0
XAuthServer.java
...src/main/java/io/dataease/plugins/server/XAuthServer.java
+1
-1
LogManager.java
...src/main/java/io/dataease/service/sys/log/LogManager.java
+3
-0
index.vue
frontend/src/components/ElTreeSelect/index.vue
+27
-2
DeSelectTree.vue
frontend/src/components/widget/DeWidget/DeSelectTree.vue
+12
-29
TextSelectTreeServiceImpl.js
...omponents/widget/serviceImpl/TextSelectTreeServiceImpl.js
+5
-1
conditionUtil.js
frontend/src/utils/conditionUtil.js
+12
-1
MyTree.vue
frontend/src/views/system/test/MyTree.vue
+0
-150
index.vue
frontend/src/views/system/test/index.vue
+0
-69
没有找到文件。
backend/src/main/java/io/dataease/commons/constants/SysLogConstants.java
浏览文件 @
e048d4ca
...
...
@@ -55,7 +55,8 @@ public class SysLogConstants {
DEPT
(
7
,
"SOURCE_TYPE_DEPT"
),
ROLE
(
8
,
"SOURCE_TYPE_ROLE"
),
DRIVER
(
9
,
"SOURCE_TYPE_DRIVER"
),
DRIVER_FILE
(
10
,
"SOURCE_TYPE_DRIVER_FILE"
);
DRIVER_FILE
(
10
,
"SOURCE_TYPE_DRIVER_FILE"
),
MENU
(
11
,
"SOURCE_TYPE_MENU"
);
private
Integer
value
;
private
String
name
;
...
...
backend/src/main/java/io/dataease/ext/ExtSysLogMapper.xml
浏览文件 @
e048d4ca
...
...
@@ -153,6 +153,17 @@
</where>
</if>
<if
test=
"type == 11"
>
menu_id as id ,title as name
from sys_menu
<where>
menu_id in
<foreach
collection=
"ids"
item=
"id"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</where>
</if>
</select>
...
...
backend/src/main/java/io/dataease/plugins/server/XAuthServer.java
浏览文件 @
e048d4ca
...
...
@@ -109,7 +109,7 @@ public class XAuthServer {
return
SysLogConstants
.
SOURCE_TYPE
.
DATASOURCE
;
}
if
(
StringUtils
.
equals
(
"menu"
,
sourceType
))
{
return
SysLogConstants
.
SOURCE_TYPE
.
DATASOURCE
;
return
SysLogConstants
.
SOURCE_TYPE
.
MENU
;
}
if
(
StringUtils
.
equals
(
"dataset"
,
sourceType
))
{
return
SysLogConstants
.
SOURCE_TYPE
.
DATASET
;
...
...
backend/src/main/java/io/dataease/service/sys/log/LogManager.java
浏览文件 @
e048d4ca
...
...
@@ -100,6 +100,9 @@ public class LogManager {
case
7
:
typeValue
=
"dept"
;
break
;
case
11
:
typeValue
=
"menu"
;
break
;
default
:
break
;
}
...
...
frontend/src/components/ElTreeSelect/index.vue
浏览文件 @
e048d4ca
...
...
@@ -14,6 +14,7 @@
v-model=
"labels"
v-popover:popover
:style=
"styles"
:collapse-tags=
"showNumber"
class=
"el-tree-select-input"
:disabled=
"disabled"
popper-class=
"select-option"
...
...
@@ -77,7 +78,9 @@ export default {
type
:
Object
,
// {}
default
()
{
return
{}
return
{
width
:
'100%'
}
}
},
// 下拉框 挂类
...
...
@@ -119,8 +122,10 @@ export default {
}
},
// 树渲染方法,具体参考el-tree Function(h, { node, data, store }) {}
// eslint-disable-next-line vue/require-default-prop
treeRenderFun
:
Function
,
// 搜索过滤方法,具体参考el-tree Function(h, { value, data, node }) {}
// eslint-disable-next-line vue/require-default-prop
filterNodeMethod
:
Function
,
/*
文本框参数,几乎支持el-select所有的API<br>
...
...
@@ -215,7 +220,8 @@ export default {
ids
:
[],
// 存储id
visible
:
false
,
// popover v-model
width
:
150
,
showParent
:
false
showParent
:
false
,
showNumber
:
false
}
},
computed
:
{
...
...
@@ -241,6 +247,9 @@ export default {
this
.
ids
=
val
===
''
?
[]
:
[
val
]
}
}
},
labels
:
function
()
{
this
.
setShowNumber
()
}
},
created
()
{
...
...
@@ -549,6 +558,22 @@ export default {
*/
filterFun
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
)
},
setShowNumber
()
{
this
.
showNumber
=
false
this
.
$nextTick
(()
=>
{
if
(
!
this
.
selectParams
.
multiple
||
!
this
.
$refs
.
select
||
!
this
.
$refs
.
select
.
$refs
.
tags
)
{
return
}
const
kids
=
this
.
$refs
.
select
.
$refs
.
tags
.
children
[
0
].
children
let
contentWidth
=
0
kids
.
forEach
(
kid
=>
{
contentWidth
+=
kid
.
offsetWidth
})
this
.
showNumber
=
contentWidth
>
((
this
.
$refs
.
select
.
$refs
.
tags
.
clientWidth
-
35
)
*
0.9
)
})
}
}
}
...
...
frontend/src/components/widget/DeWidget/DeSelectTree.vue
浏览文件 @
e048d4ca
...
...
@@ -5,7 +5,6 @@
ref=
"deSelectTree"
v-model=
"value"
popover-class=
"test-class-wrap"
:is-single=
"isSingle"
:data=
"datas"
:select-params=
"selectParams"
:tree-params=
"treeParams"
...
...
@@ -45,9 +44,8 @@ export default {
},
data
()
{
return
{
showNumber
:
false
,
selectOptionWidth
:
0
,
show
:
true
,
selectOptionWidth
:
0
,
datas
:
[],
value
:
this
.
isSingle
?
''
:
[],
selectParams
:
{
...
...
@@ -135,14 +133,17 @@ export default {
},
'element.options.attrs.multiple'
:
function
(
value
,
old
)
{
if
(
typeof
old
===
'undefined'
||
value
===
old
)
return
if
(
!
this
.
inDraw
)
{
this
.
value
=
value
?
[]
:
null
this
.
element
.
options
.
value
=
''
}
this
.
show
=
false
this
.
$nextTick
(()
=>
{
this
.
show
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
.
deSelectTree
&&
this
.
$refs
.
deSelectTree
.
treeDataUpdateFun
(
this
.
datas
)
})
})
}
...
...
@@ -212,25 +213,14 @@ export default {
this
.
element
.
options
.
manualModify
=
true
}
this
.
setCondition
()
this
.
showNumber
=
false
this
.
$nextTick
(()
=>
{
if
(
!
this
.
element
.
options
.
attrs
.
multiple
||
!
this
.
$refs
.
deSelect
||
!
this
.
$refs
.
deSelect
.
$refs
.
tags
)
{
return
}
const
kids
=
this
.
$refs
.
deSelect
.
$refs
.
tags
.
children
[
0
].
children
let
contentWidth
=
0
kids
.
forEach
(
kid
=>
{
contentWidth
+=
kid
.
offsetWidth
})
this
.
showNumber
=
contentWidth
>
((
this
.
$refs
.
deSelectTree
.
$refs
.
tags
.
clientWidth
-
30
)
*
0.9
)
})
},
setCondition
()
{
const
val
=
this
.
formatFilterValue
()
const
param
=
{
component
:
this
.
element
,
value
:
this
.
formatFilterValue
()
,
value
:
val
,
operator
:
this
.
operator
,
isTree
:
true
}
...
...
@@ -267,7 +257,8 @@ export default {
return
results
// return this.value
}
return
this
.
value
.
split
(
','
)
const
result
=
this
.
value
.
split
(
','
).
map
(
v
=>
v
.
replaceAll
(
SEPARATOR
,
','
))
return
result
},
fillValueDerfault
()
{
...
...
@@ -286,14 +277,6 @@ export default {
return
datas
.
filter
(
item
=>
!!
item
)
},
setOptionWidth
(
event
)
{
// 下拉框弹出时,设置弹框的宽度
this
.
$nextTick
(()
=>
{
// this.selectOptionWidth = event.srcElement.offsetWidth + 'px'
this
.
selectOptionWidth
=
event
.
srcElement
.
parentElement
.
parentElement
.
offsetWidth
+
'px'
})
},
/* 下面是树的渲染方法 */
_filterFun
(
value
,
data
,
node
)
{
...
...
@@ -308,9 +291,9 @@ export default {
_searchFun
(
value
)
{
console
.
log
(
value
,
'<--_searchFun'
)
// 自行判断 是走后台查询,还是前端过滤
this
.
$refs
.
treeSelect
.
filterFun
(
value
)
this
.
$refs
.
deSelectTree
.
filterFun
(
value
)
// 后台查询
// this.$refs.
treeSelect
.treeDataUpdateFun(treeData);
// this.$refs.
deSelectTree
.treeDataUpdateFun(treeData);
},
// 自定义render
_renderFun
(
h
,
{
node
,
data
,
store
})
{
...
...
frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js
浏览文件 @
e048d4ca
...
...
@@ -88,7 +88,11 @@ class TextSelectTreeServiceImpl extends WidgetService {
const
param
=
{
component
:
element
,
value
:
!
value
?
[]
:
Array
.
isArray
(
value
)
?
value
:
value
.
toString
().
split
(
','
),
operator
:
element
.
options
.
attrs
.
multiple
?
'in'
:
'eq'
operator
:
element
.
options
.
attrs
.
multiple
?
'in'
:
'eq'
,
isTree
:
true
}
if
(
param
.
value
&&
param
.
value
.
length
)
{
param
.
value
=
param
.
value
.
map
(
val
=>
val
.
replaceAll
(
'-de-'
,
','
))
}
return
param
}
...
...
frontend/src/utils/conditionUtil.js
浏览文件 @
e048d4ca
...
...
@@ -27,8 +27,19 @@ export const valueValid = condition => {
export
const
formatCondition
=
obj
=>
{
const
{
component
,
value
,
operator
,
isTree
}
=
obj
const
fieldId
=
component
.
options
.
attrs
.
fieldId
let
fieldId
=
component
.
options
.
attrs
.
fieldId
const
viewIds
=
component
.
options
.
attrs
.
viewIds
if
(
isTree
&&
!
component
.
options
.
attrs
.
multiple
&&
value
&&
value
.
length
)
{
// 单选树
const
val
=
value
[
0
]
if
(
val
)
{
const
len
=
val
.
split
(
','
).
length
if
(
len
)
{
fieldId
=
fieldId
.
split
(
','
).
slice
(
0
,
len
).
join
(
','
)
}
}
}
const
condition
=
new
Condition
(
component
.
id
,
fieldId
,
operator
,
value
,
viewIds
,
isTree
)
return
condition
}
...
...
frontend/src/views/system/test/MyTree.vue
deleted
100644 → 0
浏览文件 @
57330d34
<!--
* @Author: dawdler
* @Date: 2020-12-26 11:52:05
* @Description: demo
* @LastModifiedBy: dawdler
-->
<
template
>
<el-tree-select
ref=
"treeSelect"
v-model=
"values"
popover-class=
"test-class-wrap"
:styles=
"styles"
:select-params=
"selectParams"
:tree-params=
"treeParams"
:filter-node-method=
"_filterFun"
:tree-render-fun=
"_renderFun"
@
searchFun=
"_searchFun"
/>
</
template
>
<
script
>
import
ElTreeSelect
from
'@/components/ElTreeSelect'
export
default
{
name
:
'MyTreeSelect'
,
components
:
{
ElTreeSelect
},
props
:
{
params
:
Object
,
isSingle
:
{
type
:
Boolean
,
default
()
{
return
false
}
}
},
data
()
{
return
{
styles
:
{
width
:
'300px'
},
// 单选value为字符串,多选为数组
values
:
this
.
isSingle
?
''
:
[],
selectParams
:
{
clearable
:
true
,
placeholder
:
'请输入内容'
},
treeParams
:
{
clickParent
:
false
,
filterable
:
true
,
// 只想要子节点,不需要父节点
leafOnly
:
false
,
includeHalfChecked
:
false
,
'check-strictly'
:
false
,
'default-expand-all'
:
true
,
'expand-on-click-node'
:
false
,
'render-content'
:
this
.
_renderFun
,
data
:
[],
props
:
{
children
:
'children'
,
label
:
'name'
,
rootId
:
'0'
,
disabled
:
'disabled'
,
parentId
:
'parentId'
,
value
:
'id'
},
...
this
.
params
}
}
},
watch
:
{},
created
()
{},
mounted
()
{
// 手动更新树数据
const
data
=
[]
const
{
label
,
children
,
parentId
,
value
,
rootId
}
=
this
.
treeParams
.
props
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
const
rootNode
=
{
[
label
]:
`节点
${
i
}
`
,
[
parentId
]:
rootId
,
[
value
]:
i
,
[
children
]:
[]
}
for
(
let
a
=
0
;
a
<
5
;
a
++
)
{
const
subId
=
`
${
rootNode
[
value
]}
_
${
a
}
`
const
subNode
=
{
[
label
]:
`子节点
${
subId
}
`
,
[
parentId
]:
rootNode
[
value
],
[
value
]:
subId
,
[
children
]:
[]
}
for
(
let
b
=
0
;
b
<
5
;
b
++
)
{
const
endId
=
`
${
subId
}
_
${
b
}
`
const
endNode
=
{
[
label
]:
`末级节点
${
endId
}
`
,
[
parentId
]:
subNode
[
value
],
[
value
]:
endId
,
[
children
]:
[]
}
subNode
[
children
].
push
(
endNode
)
}
rootNode
[
children
].
push
(
subNode
)
}
data
.
push
(
rootNode
)
}
const
myNode
=
{
[
label
]:
'测试超长节点啊啊啊测试超长节点啊啊啊测试超长节点啊啊啊测试超长节点啊啊啊测试超长节点啊啊啊测试超长节点啊啊啊'
,
[
parentId
]:
rootId
,
[
value
]:
1000
,
[
children
]:
[]
}
data
.
push
(
myNode
)
this
.
$nextTick
(()
=>
{
this
.
$refs
.
treeSelect
.
treeDataUpdateFun
(
data
)
})
},
methods
:
{
_filterFun
(
value
,
data
,
node
)
{
if
(
!
value
)
return
true
return
data
.
id
.
toString
().
indexOf
(
value
.
toString
())
!==
-
1
},
// 树点击
_nodeClickFun
(
data
,
node
,
vm
)
{
console
.
log
(
'this _nodeClickFun'
,
this
.
values
,
data
,
node
)
},
// 树过滤
_searchFun
(
value
)
{
console
.
log
(
value
,
'<--_searchFun'
)
// 自行判断 是走后台查询,还是前端过滤
this
.
$refs
.
treeSelect
.
filterFun
(
value
)
// 后台查询
// this.$refs.treeSelect.treeDataUpdateFun(treeData);
},
// 自定义render
_renderFun
(
h
,
{
node
,
data
,
store
})
{
const
{
props
,
clickParent
}
=
this
.
treeParams
return
(
<
span
class
=
{[
'custom-tree-node'
,
!
clickParent
&&
data
[
props
.
children
]
&&
data
[
props
.
children
].
length
?
'disabled'
:
null
]}
>
<
span
>
{
node
.
label
}
<
/span
>
<
/span
>
)
}
}
}
</
script
>
<
style
lang=
"less"
>
.disabled {
cursor: no-drop;
}
.custom-tree-node {
width: calc(100% - 40px);
}
</
style
>
frontend/src/views/system/test/index.vue
deleted
100644 → 0
浏览文件 @
57330d34
<!--
* @moduleName: 测试el-tree-select
* @Author: dawdler
* @Date: 2018-12-19 14:03:03
* @LastModifiedBy: dawdler
-->
<
template
>
<div
id=
"app111"
>
<el-form
label-width=
"120px"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"单选"
>
<MyTree
:is-single=
"true"
:params=
"
{ clickParent: true, showParent: true }" />
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"多选"
>
<MyTree
:params=
"
{ clickParent: true, showParent: true }" />
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"弹框关闭调试"
>
<el-select
v-model=
"test"
multiple
placeholder=
"请选择"
@
change=
"_selectChange"
>
<el-option
v-for=
"item in testData"
:key=
"item"
:label=
"item"
:value=
"item"
/>
</el-select>
<div>
测试焦点触发
<svg>
<circle
cx=
"100"
cy=
"50"
r=
"40"
stroke=
"black"
stroke-width=
"2"
fill=
"red"
/>
</svg>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</
template
>
<
script
>
import
MyTree
from
'./MyTree'
export
default
{
name
:
'App111'
,
components
:
{
MyTree
},
data
()
{
return
{
test
:
''
,
testData
:
[
'test1'
,
'test2'
]
}
},
created
()
{},
mounted
()
{},
methods
:
{
// 下拉框修改
_selectChange
(
val
)
{
console
.
log
(
val
,
'<-select change'
)
}
}
}
</
script
>
<
style
lang=
"less"
>
#app111 {
display: flex;
justify-content: space-between;
width: 100%;
}
.el-select {
width: 300px;
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论