Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
7a27491b
提交
7a27491b
authored
5月 07, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:修改仪表盘编辑侧边弹框样式
上级
dd17ebe2
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
140 行增加
和
93 行删除
+140
-93
ExtPanelGroupMapper.xml
.../java/io/dataease/base/mapper/ext/ExtPanelGroupMapper.xml
+1
-1
ViewApi.java
...c/main/java/io/dataease/controller/panel/api/ViewApi.java
+6
-1
ViewServer.java
.../java/io/dataease/controller/panel/server/ViewServer.java
+6
-1
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+4
-0
view.js
frontend/src/api/panel/view.js
+9
-0
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+48
-8
index.vue
frontend/src/views/panel/ViewSelect/index.vue
+63
-79
TemplateList.vue
frontend/src/views/panel/template/component/TemplateList.vue
+3
-3
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelGroupMapper.xml
浏览文件 @
7a27491b
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</select>
</select>
<select
id=
"panelGroupList"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"panelGroupList"
resultMap=
"BaseResultMapDTO"
>
select
panel_group.*,panel_group.name
as label from panel_group
select
id, `name`, pid, `level`, node_type, create_by, create_time, panel_type,`name`
as label from panel_group
<where>
<where>
<if
test=
"name != null"
>
<if
test=
"name != null"
>
and panel_group.name like CONCAT('%', #{name},'%')
and panel_group.name like CONCAT('%', #{name},'%')
...
...
backend/src/main/java/io/dataease/controller/panel/api/ViewApi.java
浏览文件 @
7a27491b
...
@@ -2,11 +2,12 @@ package io.dataease.controller.panel.api;
...
@@ -2,11 +2,12 @@ package io.dataease.controller.panel.api;
import
io.dataease.base.domain.ChartView
;
import
io.dataease.base.domain.ChartView
;
import
io.dataease.base.domain.ChartViewWithBLOBs
;
import
io.dataease.controller.sys.base.BaseGridRequest
;
import
io.dataease.controller.sys.base.BaseGridRequest
;
import
io.dataease.dto.panel.PanelViewDto
;
import
io.dataease.dto.panel.PanelViewDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.
PathVariable
;
import
org.springframework.web.bind.annotation.
GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -26,6 +27,10 @@ public interface ViewApi {
...
@@ -26,6 +27,10 @@ public interface ViewApi {
@PostMapping
(
"/viewsWithIds"
)
@PostMapping
(
"/viewsWithIds"
)
List
<
ChartView
>
viewsWithIds
(
List
<
String
>
viewIds
);
List
<
ChartView
>
viewsWithIds
(
List
<
String
>
viewIds
);
@ApiOperation
(
"获取单个视图"
)
@GetMapping
(
"/findOne/{id}"
)
ChartViewWithBLOBs
findOne
(
String
id
);
...
...
backend/src/main/java/io/dataease/controller/panel/server/ViewServer.java
浏览文件 @
7a27491b
package
io
.
dataease
.
controller
.
panel
.
server
;
package
io
.
dataease
.
controller
.
panel
.
server
;
import
io.dataease.base.domain.ChartView
;
import
io.dataease.base.domain.ChartView
;
import
io.dataease.base.domain.ChartViewWithBLOBs
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.controller.panel.api.ViewApi
;
import
io.dataease.controller.panel.api.ViewApi
;
import
io.dataease.controller.sys.base.BaseGridRequest
;
import
io.dataease.controller.sys.base.BaseGridRequest
;
...
@@ -49,7 +50,11 @@ public class ViewServer implements ViewApi {
...
@@ -49,7 +50,11 @@ public class ViewServer implements ViewApi {
@Override
@Override
public
List
<
ChartView
>
viewsWithIds
(
@RequestBody
List
<
String
>
viewIds
)
{
public
List
<
ChartView
>
viewsWithIds
(
@RequestBody
List
<
String
>
viewIds
)
{
return
chartViewService
.
viewsByIds
(
viewIds
);
return
chartViewService
.
viewsByIds
(
viewIds
);
}
}
@Override
public
ChartViewWithBLOBs
findOne
(
@PathVariable
String
id
)
{
return
chartViewService
.
findOne
(
id
);
}
}
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
7a27491b
...
@@ -392,4 +392,8 @@ public class ChartViewService {
...
@@ -392,4 +392,8 @@ public class ChartViewService {
example
.
createCriteria
().
andIdIn
(
viewIds
);
example
.
createCriteria
().
andIdIn
(
viewIds
);
return
chartViewMapper
.
selectByExample
(
example
);
return
chartViewMapper
.
selectByExample
(
example
);
}
}
public
ChartViewWithBLOBs
findOne
(
String
id
)
{
return
chartViewMapper
.
selectByPrimaryKey
(
id
);
}
}
}
frontend/src/api/panel/view.js
浏览文件 @
7a27491b
...
@@ -17,3 +17,12 @@ export function viewsWithIds(data) {
...
@@ -17,3 +17,12 @@ export function viewsWithIds(data) {
data
data
})
})
}
}
export
function
findOne
(
id
)
{
return
request
({
url
:
'/api/panelView/findOne/'
+
id
,
method
:
'get'
,
loading
:
true
})
}
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
7a27491b
...
@@ -434,14 +434,6 @@ export default {
...
@@ -434,14 +434,6 @@ export default {
if
(
getData
)
{
if
(
getData
)
{
this
.
getData
(
response
.
data
.
id
)
this
.
getData
(
response
.
data
.
id
)
}
else
{
}
else
{
debugger
html2canvas
(
this
.
$refs
.
imageWrapper
).
then
(
canvas
=>
{
const
snapshot
=
canvas
.
toDataURL
(
'image/jpeg'
,
0.1
)
// 0.1是图片质量
if
(
snapshot
!==
''
)
{
view
.
snapshot
=
snapshot
post
(
'/chart/view/save'
,
view
)
}
})
this
.
getChart
(
response
.
data
.
id
)
this
.
getChart
(
response
.
data
.
id
)
}
}
...
@@ -450,6 +442,54 @@ export default {
...
@@ -450,6 +442,54 @@ export default {
})
})
},
},
closeEdit
()
{
closeEdit
()
{
html2canvas
(
this
.
$refs
.
imageWrapper
).
then
(
canvas
=>
{
const
snapshot
=
canvas
.
toDataURL
(
'image/jpeg'
,
0.1
)
// 0.1是图片质量
if
(
snapshot
!==
''
)
{
const
view
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
view
))
view
.
id
=
this
.
view
.
id
view
.
sceneId
=
this
.
view
.
sceneId
view
.
name
=
this
.
view
.
name
?
this
.
view
.
name
:
this
.
table
.
name
view
.
tableId
=
this
.
view
.
tableId
view
.
xaxis
.
forEach
(
function
(
ele
)
{
// if (!ele.summary || ele.summary === '') {
// ele.summary = 'sum'
// }
if
(
!
ele
.
sort
||
ele
.
sort
===
''
)
{
ele
.
sort
=
'none'
}
if
(
!
ele
.
filter
)
{
ele
.
filter
=
[]
}
})
view
.
yaxis
.
forEach
(
function
(
ele
)
{
if
(
!
ele
.
summary
||
ele
.
summary
===
''
)
{
if
(
ele
.
id
===
'count'
)
{
ele
.
summary
=
'count'
}
else
{
ele
.
summary
=
'sum'
}
}
if
(
!
ele
.
sort
||
ele
.
sort
===
''
)
{
ele
.
sort
=
'none'
}
if
(
!
ele
.
filter
)
{
ele
.
filter
=
[]
}
})
if
(
view
.
type
.
startsWith
(
'pie'
)
||
view
.
type
.
startsWith
(
'funnel'
))
{
if
(
view
.
yaxis
.
length
>
1
)
{
view
.
yaxis
.
splice
(
1
,
view
.
yaxis
.
length
)
}
}
view
.
xaxis
=
JSON
.
stringify
(
view
.
xaxis
)
view
.
yaxis
=
JSON
.
stringify
(
view
.
yaxis
)
view
.
customAttr
=
JSON
.
stringify
(
view
.
customAttr
)
view
.
customStyle
=
JSON
.
stringify
(
view
.
customStyle
)
view
.
customFilter
=
JSON
.
stringify
(
view
.
customFilter
)
view
.
snapshot
=
snapshot
post
(
'/chart/view/save'
,
view
)
}
})
// 从仪表盘入口关闭
// 从仪表盘入口关闭
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'PanelEdit'
})
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'PanelEdit'
})
this
.
$emit
(
'switchComponent'
,
{
name
:
''
})
this
.
$emit
(
'switchComponent'
,
{
name
:
''
})
...
...
frontend/src/views/panel/ViewSelect/index.vue
浏览文件 @
7a27491b
<
template
>
<
template
>
<div>
<el-col>
<div
class=
"my-top"
>
<el-row
style=
"margin-top: 5px"
>
<el-input
<el-row
style=
"margin-left: 5px;margin-right: 5px"
>
v-model=
"filterText"
<el-input
placeholder=
"按名称搜索"
v-model=
"templateFilterText"
/>
placeholder=
"输入关键字进行过滤"
<el-tree
size=
"mini"
ref=
"tree"
clearable
class=
"filter-tree"
prefix-icon=
"el-icon-search"
:data=
"data"
/>
:props=
"defaultProps"
</el-row>
:render-content=
"renderNode"
<el-row
style=
"margin-top: 5px"
>
draggable
<el-tree
:allow-drop=
"allowDrop"
ref=
"templateTree"
:allow-drag=
"allowDrag"
:default-expanded-keys=
"defaultExpandedKeys"
:filter-node-method=
"filterNode"
:data=
"data"
@
node-drag-start=
"handleDragStart"
node-key=
"id"
/>
:props=
"defaultProps"
</div>
draggable
<div
v-if=
"showdetail"
class=
"detail-class"
>
:allow-drop=
"allowDrop"
<el-card
class=
"filter-card-class"
>
:allow-drag=
"allowDrag"
<div
slot=
"header"
class=
"button-div-class"
>
:expand-on-click-node=
"true"
<span>
{{
detailItem
.
name
}}
</span>
:filter-node-method=
"filterNode"
</div>
:highlight-current=
"true"
<img
class=
"view-list-thumbnails"
:src=
"detailItem.snapshot"
alt=
""
>
@
node-drag-start=
"handleDragStart"
</el-card>
@
node-click=
"nodeClick"
</div>
>
</div>
<span
slot-scope=
"
{ node, data }" class="custom-tree-node">
<span>
<span
v-if=
"data.type==='scene'"
>
<el-button
icon=
"el-icon-folder"
type=
"text"
/>
</span>
<span
v-else
>
<svg-icon
:icon-class=
"data.type"
style=
"width: 14px;height: 14px"
/>
</span>
<span
style=
"margin-left: 6px;font-size: 14px"
>
{{
data
.
name
}}
</span>
</span>
</span>
</el-tree>
</el-row>
<el-row
v-if=
"detailItem&&detailItem.snapshot"
class=
"detail-class"
>
<el-card
class=
"filter-card-class"
>
<div
slot=
"header"
class=
"button-div-class"
>
<span>
{{
detailItem
.
name
}}
</span>
</div>
<img
draggable=
"false"
class=
"view-list-thumbnails"
:src=
"detailItem.snapshot"
alt=
""
>
</el-card>
</el-row>
</el-row>
</el-col>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
tree
}
from
'@/api/panel/view'
import
{
tree
,
findOne
}
from
'@/api/panel/view'
import
{
addClass
,
removeClass
}
from
'@/utils'
import
bus
from
'@/utils/bus'
export
default
{
export
default
{
name
:
'ViewSelect'
,
name
:
'ViewSelect'
,
data
()
{
data
()
{
return
{
return
{
filterText
:
null
,
templateFilterText
:
''
,
defaultExpandedKeys
:
[],
defaultProps
:
{
defaultProps
:
{
children
:
'children'
,
children
:
'children'
,
label
:
'name'
label
:
'name'
...
@@ -48,16 +72,8 @@ export default {
...
@@ -48,16 +72,8 @@ export default {
}
}
},
},
watch
:
{
watch
:
{
filterText
(
val
)
{
templateFilterText
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
)
this
.
$refs
.
templateTree
.
filter
(
val
)
},
showdetail
(
val
)
{
const
dom
=
document
.
querySelector
(
'.my-top'
)
if
(
val
)
{
addClass
(
dom
,
'top-div-class'
)
}
else
{
removeClass
(
dom
,
'top-div-class'
)
}
}
}
},
},
created
()
{
created
()
{
...
@@ -68,46 +84,17 @@ export default {
...
@@ -68,46 +84,17 @@ export default {
if
(
!
value
)
return
true
if
(
!
value
)
return
true
return
data
.
name
.
indexOf
(
value
)
!==
-
1
return
data
.
name
.
indexOf
(
value
)
!==
-
1
},
},
nodeClick
(
data
,
node
)
{
findOne
(
data
.
id
).
then
(
res
=>
{
this
.
detailItem
=
res
.
data
})
},
loadData
()
{
loadData
()
{
const
param
=
{}
const
param
=
{}
tree
(
param
).
then
(
res
=>
{
tree
(
param
).
then
(
res
=>
{
// let arr = []
// for (let index = 0; index
<
10
;
index
++
)
{
// arr = arr.concat(res.data)
// }
// this.data = arr
this
.
data
=
res
.
data
this
.
data
=
res
.
data
})
})
},
},
renderNode
(
h
,
{
node
,
data
,
store
})
{
return
(
<
div
class
=
'custom-tree-node'
on
-
click
=
{()
=>
this
.
detail
(
data
)}
on
-
dblclick
=
{()
=>
this
.
addView2Drawing
(
data
.
id
)}
>
<
span
class
=
'label-span'
>
{
node
.
label
}
<
/span
>
{
data
.
type
!==
'group'
&&
data
.
type
!==
'scene'
?
(
<
svg
-
icon
icon
-
class
=
{
data
.
type
}
class
=
'chart-icon'
/>
)
:
(
''
)}
<
/div
>
)
},
detail
(
data
)
{
this
.
showdetail
=
true
this
.
detailItem
=
data
},
closeDetail
()
{
this
.
showdetail
=
false
this
.
detailItem
=
null
},
addView2Drawing
(
viewId
)
{
// viewInfo(viewId).then(res => {
// const info = res.data
// this.$emit('panel-view-add', info)
// })
bus
.
$emit
(
'panel-view-add'
,
{
id
:
viewId
})
// this.$emit('panel-view-add', viewId)
},
handleDragStart
(
node
,
ev
)
{
handleDragStart
(
node
,
ev
)
{
ev
.
dataTransfer
.
effectAllowed
=
'copy'
ev
.
dataTransfer
.
effectAllowed
=
'copy'
const
dataTrans
=
{
const
dataTrans
=
{
...
@@ -115,7 +102,6 @@ export default {
...
@@ -115,7 +102,6 @@ export default {
id
:
node
.
data
.
id
id
:
node
.
data
.
id
}
}
ev
.
dataTransfer
.
setData
(
'componentInfo'
,
JSON
.
stringify
(
dataTrans
))
ev
.
dataTransfer
.
setData
(
'componentInfo'
,
JSON
.
stringify
(
dataTrans
))
// bus.$emit('component-on-drag')
},
},
// 判断节点能否被拖拽
// 判断节点能否被拖拽
...
@@ -126,7 +112,6 @@ export default {
...
@@ -126,7 +112,6 @@ export default {
return
true
return
true
}
}
},
},
allowDrop
(
draggingNode
,
dropNode
,
type
)
{
allowDrop
(
draggingNode
,
dropNode
,
type
)
{
return
false
return
false
}
}
...
@@ -144,7 +129,6 @@ export default {
...
@@ -144,7 +129,6 @@ export default {
}
}
.detail-class
{
.detail-class
{
width
:
100%
;
width
:
100%
;
min-height
:
200px
;
position
:
fixed
;
position
:
fixed
;
bottom
:
0px
;
bottom
:
0px
;
}
}
...
...
frontend/src/views/panel/template/component/TemplateList.vue
浏览文件 @
7a27491b
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<span>
<span>
<span>
<span>
<el-button
<el-button
icon=
"el-icon-
picture-outline
"
icon=
"el-icon-
folder
"
type=
"text"
type=
"text"
/>
/>
</span>
</span>
...
@@ -41,14 +41,14 @@
...
@@ -41,14 +41,14 @@
<el-dropdown
trigger=
"click"
size=
"small"
@
command=
"clickMore"
>
<el-dropdown
trigger=
"click"
size=
"small"
@
command=
"clickMore"
>
<span
class=
"el-dropdown-link"
>
<span
class=
"el-dropdown-link"
>
<el-button
<el-button
icon=
"el-icon-
plus
"
icon=
"el-icon-
more
"
type=
"text"
type=
"text"
size=
"small"
size=
"small"
/>
/>
</span>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
icon=
"el-icon-edit"
:command=
"beforeClickMore('edit',data,node)"
>
<el-dropdown-item
icon=
"el-icon-edit"
:command=
"beforeClickMore('edit',data,node)"
>
编辑
重命名
</el-dropdown-item>
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-delete"
:command=
"beforeClickMore('delete',data,node)"
>
<el-dropdown-item
icon=
"el-icon-delete"
:command=
"beforeClickMore('delete',data,node)"
>
删除
删除
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论