Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
5c0f8485
Unverified
提交
5c0f8485
authored
8月 11, 2021
作者:
王嘉豪
提交者:
GitHub
8月 11, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #591 from dataease/pr@dev@feat_panel-drill
feat:仪表板视图钻取和联动同时存在时,弹框由用户选择
上级
c877ed4a
e11d6ff7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
264 行增加
和
111 行删除
+264
-111
ComponentWrapper.vue
.../components/canvas/components/Editor/ComponentWrapper.vue
+1
-3
SettingMenuTest.vue
...c/components/canvas/components/Editor/SettingMenuTest.vue
+181
-0
ViewTrackBar.vue
.../src/components/canvas/components/Editor/ViewTrackBar.vue
+25
-94
en.js
frontend/src/lang/en.js
+3
-1
tw.js
frontend/src/lang/tw.js
+3
-1
zh.js
frontend/src/lang/zh.js
+3
-1
ChartComponent.vue
frontend/src/views/chart/components/ChartComponent.vue
+48
-11
没有找到文件。
frontend/src/components/canvas/components/Editor/ComponentWrapper.vue
浏览文件 @
5c0f8485
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
@mousedown="elementMouseDown"
@mousedown="elementMouseDown"
>
>
<edit-bar
v-if=
"config === curComponent"
:element=
"config"
@
showViewDetails=
"showViewDetails"
/>
<edit-bar
v-if=
"config === curComponent"
:element=
"config"
@
showViewDetails=
"showViewDetails"
/>
<!--
<view-track-bar
v-if=
"config === curComponent"
:element=
"config"
/>
-->
<de-out-widget
<de-out-widget
v-if=
"config.type==='custom'"
v-if=
"config.type==='custom'"
:id=
"'component' + config.id"
:id=
"'component' + config.id"
...
@@ -38,10 +37,9 @@ import { mixins } from '@/components/canvas/utils/events'
...
@@ -38,10 +37,9 @@ import { mixins } from '@/components/canvas/utils/events'
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
import
DeOutWidget
from
'@/components/dataease/DeOutWidget'
import
DeOutWidget
from
'@/components/dataease/DeOutWidget'
import
EditBar
from
'@/components/canvas/components/Editor/EditBar'
import
EditBar
from
'@/components/canvas/components/Editor/EditBar'
import
ViewTrackBar
from
'@/components/canvas/components/Editor/ViewTrackBar'
export
default
{
export
default
{
components
:
{
DeOutWidget
,
EditBar
,
ViewTrackBar
},
components
:
{
DeOutWidget
,
EditBar
},
mixins
:
[
mixins
],
mixins
:
[
mixins
],
props
:
{
props
:
{
config
:
{
config
:
{
...
...
frontend/src/components/canvas/components/Editor/SettingMenuTest.vue
0 → 100644
浏览文件 @
5c0f8485
<
template
>
<div>
<div
style=
"width: 100%;"
>
<el-dropdown
trigger=
"click"
@
mouseup=
"handleMouseUp"
>
<el-button
ref=
"trackButton"
class=
"icon iconfont icon-shezhi"
>
TEST
</el-button>
<el-dropdown-menu>
<el-dropdown-item
icon=
"el-icon-document-copy"
@
click
.
native=
"copy"
>
{{
$t
(
'panel.copy'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-delete"
@
click
.
native=
"deleteComponent"
>
{{
$t
(
'panel.delete'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-upload2"
@
click
.
native=
"topComponent"
>
{{
$t
(
'panel.topComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-download"
@
click
.
native=
"bottomComponent"
>
{{
$t
(
'panel.bottomComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-arrow-up"
@
click
.
native=
"upComponent"
>
{{
$t
(
'panel.upComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-arrow-down"
@
click
.
native=
"downComponent"
>
{{
$t
(
'panel.downComponent'
)
}}
</el-dropdown-item>
<el-dropdown-item
icon=
"el-icon-link"
@
click
.
native=
"linkageSetting"
>
联动设置
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</
template
>
<
script
>
import
{
mapState
}
from
'vuex'
import
bus
from
'@/utils/bus'
import
{
getViewLinkageGather
}
from
'@/api/panel/linkage'
export
default
{
data
()
{
return
{
copyData
:
null
,
editFilter
:
[
'view'
,
'custom'
]
}
},
computed
:
mapState
([
'menuTop'
,
'menuLeft'
,
'menuShow'
,
'curComponent'
,
'componentData'
,
'canvasStyleData'
]),
methods
:
{
trackButtonClick
()
{
this
.
$refs
.
trackButton
.
click
()
this
.
$refs
.
trackButton
.
$el
.
click
()
},
edit
()
{
// 编辑时临时保存 当前修改的画布
this
.
$store
.
dispatch
(
'panel/setComponentDataTemp'
,
JSON
.
stringify
(
this
.
componentData
))
this
.
$store
.
dispatch
(
'panel/setCanvasStyleDataTemp'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
if
(
this
.
curComponent
.
type
===
'view'
)
{
this
.
$store
.
dispatch
(
'chart/setViewId'
,
null
)
this
.
$store
.
dispatch
(
'chart/setViewId'
,
this
.
curComponent
.
propValue
.
viewId
)
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'ChartEdit'
,
param
:
{
'id'
:
this
.
curComponent
.
propValue
.
viewId
,
'optType'
:
'edit'
}})
}
if
(
this
.
curComponent
.
type
===
'custom'
)
{
bus
.
$emit
(
'component-dialog-edit'
)
}
// 编辑样式组件
if
(
this
.
curComponent
.
type
===
'v-text'
||
this
.
curComponent
.
type
===
'rect-shape'
)
{
bus
.
$emit
(
'component-dialog-style'
)
}
},
lock
()
{
this
.
$store
.
commit
(
'lock'
)
},
unlock
()
{
this
.
$store
.
commit
(
'unlock'
)
},
// 点击菜单时不取消当前组件的选中状态
handleMouseUp
()
{
this
.
$store
.
commit
(
'setClickComponentStatus'
,
true
)
},
cut
()
{
this
.
deleteCurCondition
()
this
.
$store
.
commit
(
'cut'
)
},
copy
()
{
this
.
$store
.
commit
(
'copy'
)
this
.
paste
()
},
paste
()
{
this
.
$store
.
commit
(
'paste'
,
true
)
this
.
$store
.
commit
(
'recordSnapshot'
)
},
deleteComponent
()
{
this
.
deleteCurCondition
()
this
.
$store
.
commit
(
'deleteComponent'
)
this
.
$store
.
commit
(
'recordSnapshot'
)
this
.
$store
.
commit
(
'setCurComponent'
,
{
component
:
null
,
index
:
null
})
},
deleteCurCondition
()
{
if
(
this
.
curComponent
.
type
===
'custom'
)
{
this
.
$store
.
commit
(
'removeViewFilter'
,
this
.
curComponent
.
id
)
bus
.
$emit
(
'delete-condition'
,
{
componentId
:
this
.
curComponent
.
id
})
}
},
upComponent
()
{
this
.
$store
.
commit
(
'upComponent'
)
this
.
$store
.
commit
(
'recordSnapshot'
)
},
downComponent
()
{
this
.
$store
.
commit
(
'downComponent'
)
this
.
$store
.
commit
(
'recordSnapshot'
)
},
topComponent
()
{
this
.
$store
.
commit
(
'topComponent'
)
this
.
$store
.
commit
(
'recordSnapshot'
)
},
bottomComponent
()
{
this
.
$store
.
commit
(
'bottomComponent'
)
this
.
$store
.
commit
(
'recordSnapshot'
)
},
linkageSetting
()
{
debugger
// sourceViewId 也加入查询
const
targetViewIds
=
this
.
componentData
.
filter
(
item
=>
item
.
type
===
'view'
&&
item
.
propValue
&&
item
.
propValue
.
viewId
)
.
map
(
item
=>
item
.
propValue
.
viewId
)
// 获取当前仪表板当前视图联动信息
const
requestInfo
=
{
'panelId'
:
this
.
$store
.
state
.
panel
.
panelInfo
.
id
,
'sourceViewId'
:
this
.
curComponent
.
propValue
.
viewId
,
'targetViewIds'
:
targetViewIds
}
getViewLinkageGather
(
requestInfo
).
then
(
rsp
=>
{
this
.
$store
.
commit
(
'setLinkageInfo'
,
rsp
.
data
)
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.contextmenu
{
position
:
absolute
;
z-index
:
1000
;
ul
{
border
:
1px
solid
#e4e7ed
;
border-radius
:
4px
;
background-color
:
#fff
;
box-shadow
:
0
2px
12px
0
rgba
(
0
,
0
,
0
,.
1
);
box-sizing
:
border-box
;
margin
:
5px
0
;
padding
:
6px
0
;
li
{
font-size
:
14px
;
padding
:
0
20px
;
position
:
relative
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
color
:
#606266
;
height
:
34px
;
line-height
:
34px
;
box-sizing
:
border-box
;
cursor
:
pointer
;
&
:hover
{
background-color
:
#f5f7fa
;
}
}
}
}
</
style
>
frontend/src/components/canvas/components/Editor/ViewTrackBar.vue
浏览文件 @
5c0f8485
<
template
>
<
template
>
<div
class=
"bar-main-left"
>
<div>
<div>
<el-dropdown
trigger=
"click"
>
<!--上钻-->
<input
id=
"input"
ref=
"trackButton"
type=
"button"
hidden
>
<i
<el-dropdown-menu
class=
"track-menu"
:append-to-body=
"false"
>
class=
"icon iconfont "
<el-dropdown-item
v-for=
"(item, key) in trackMenu"
:key=
"key"
@
click
.
native=
"trackMenuClick(item)"
><span
class=
"menu-item"
>
{{
i18n_map
[
item
]
}}
</span></el-dropdown-item>
:class=
"[
</el-dropdown-menu>
{
</el-dropdown>
['icon-shangzuan i-active']: drillUpStatus ,
['icon-quxiaoshangzuan i-on-active']: !drillUpStatus
}
]"
@click.stop="drillUpChange"
/>
<!--下钻-->
<i
class=
"icon iconfont "
:class=
"[
{
['icon-xiazuan i-active']: drillDownStatus ,
['icon-quxiaoxiazuan i-on-active']: !drillDownStatus
}
]"
@click.stop="drillDownChange"
/>
<!--上卷-->
<i
class=
"icon iconfont "
:class=
"[
{
['icon-linkage i-active']: linkageStatus ,
['icon-quxiaoliandong i-on-active']: !linkageStatus
}
]"
@click.stop="linkageChange"
/>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapState
}
from
'vuex'
export
default
{
export
default
{
props
:
{
props
:
{
element
:
{
trackMenu
:
{
type
:
Object
,
type
:
Array
,
required
:
true
required
:
true
},
active
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
},
// 当前模式 preview 预览 edit 编辑,
activeModel
:
{
type
:
String
,
required
:
false
,
default
:
'preview'
}
}
},
},
data
()
{
data
()
{
return
{
return
{
drillUpStatus
:
false
,
i18n_map
:
{
drillDownStatus
:
false
,
drill
:
this
.
$t
(
'panel.drill'
),
linkageStatus
:
false
linkage
:
this
.
$t
(
'panel.linkage'
)
}
}
}
},
},
computed
:
{
computed
:
{
linkageInfo
()
{
return
this
.
targetLinkageInfo
[
this
.
element
.
propValue
.
viewId
]
},
...
mapState
([
'menuTop'
,
'menuLeft'
,
'menuShow'
,
'curComponent'
,
'componentData'
,
'canvasStyleData'
,
'linkageSettingStatus'
,
'targetLinkageInfo'
,
'curLinkageView'
])
},
},
methods
:
{
methods
:
{
drillUpChange
()
{
trackButtonClick
()
{
this
.
drillUpStatus
=
!
this
.
drillUpStatus
this
.
$refs
.
trackButton
.
click
()
},
drillDownChange
()
{
this
.
drillDownStatus
=
!
this
.
drillDownStatus
},
},
linkageChange
(
)
{
trackMenuClick
(
menu
)
{
this
.
linkageStatus
=
!
this
.
linkageStatus
this
.
$emit
(
'trackClick'
,
menu
)
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.bar-main-left
{
.menu-item
{
position
:
absolute
;
font-size
:
12px
;
left
:
0px
;
float
:right
;
z-index
:
2
;
border-radius
:
2px
;
padding-left
:
5px
;
padding-right
:
2px
;
cursor
:pointer
!
important
;
background-color
:
#0a7be0
;
}
}
.i-on-active
{
color
:
whitesmoke
;
::v-deep
ul
{
float
:
right
;
width
:
80px
;
margin-right
:
3px
;
}
}
.i-active
{
.track-menu
{
color
:
yellow
;
border
:
#3a8ee6
1px
solid
;
float
:
right
;
margin-right
:
3px
;
}
}
</
style
>
</
style
>
frontend/src/lang/en.js
浏览文件 @
5c0f8485
...
@@ -1179,7 +1179,9 @@ export default {
...
@@ -1179,7 +1179,9 @@ export default {
panel_save_tips
:
'Do you want to save the changes you made to.'
,
panel_save_tips
:
'Do you want to save the changes you made to.'
,
panel_save_warn_tips
:
"Your changes will be lost if you don't save them!"
,
panel_save_warn_tips
:
"Your changes will be lost if you don't save them!"
,
do_not_save
:
"Don't Save"
,
do_not_save
:
"Don't Save"
,
save_and_close
:
'Save'
save_and_close
:
'Save'
,
drill
:
'drill'
,
linkage
:
'linkage'
},
},
plugin
:
{
plugin
:
{
local_install
:
'Local installation'
,
local_install
:
'Local installation'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
5c0f8485
...
@@ -1179,7 +1179,9 @@ export default {
...
@@ -1179,7 +1179,9 @@ export default {
panel_save_tips
:
'仪表板已变动,是否保存?'
,
panel_save_tips
:
'仪表板已变动,是否保存?'
,
panel_save_warn_tips
:
'如果未保存,你对仪表板做的变更将会丢失!'
,
panel_save_warn_tips
:
'如果未保存,你对仪表板做的变更将会丢失!'
,
do_not_save
:
'不保存'
,
do_not_save
:
'不保存'
,
save
:
'保存'
save
:
'保存'
,
drill
:
'下钻'
,
linkage
:
'联动'
},
},
plugin
:
{
plugin
:
{
local_install
:
'本地安裝'
,
local_install
:
'本地安裝'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
5c0f8485
...
@@ -1181,7 +1181,9 @@ export default {
...
@@ -1181,7 +1181,9 @@ export default {
panel_save_tips
:
'仪表板已变动,是否保存?'
,
panel_save_tips
:
'仪表板已变动,是否保存?'
,
panel_save_warn_tips
:
'如果未保存,你对仪表板做的变更将会丢失!'
,
panel_save_warn_tips
:
'如果未保存,你对仪表板做的变更将会丢失!'
,
do_not_save
:
'不保存'
,
do_not_save
:
'不保存'
,
save
:
'保存'
save
:
'保存'
,
drill
:
'下钻'
,
linkage
:
'联动'
},
},
plugin
:
{
plugin
:
{
local_install
:
'本地安装'
,
local_install
:
'本地安装'
,
...
...
frontend/src/views/chart/components/ChartComponent.vue
浏览文件 @
5c0f8485
<
template
>
<
template
>
<div
style=
"display: flex;"
>
<div
style=
"display: flex;"
>
<view-track-bar
ref=
"viewTrack"
:track-menu=
"trackMenu"
class=
"track-bar"
:style=
"trackBarStyleTime"
@
trackClick=
"trackClick"
/>
<div
:id=
"chartId"
style=
"width: 100%;height: 100%;"
/>
<div
:id=
"chartId"
style=
"width: 100%;height: 100%;"
/>
</div>
</div>
</
template
>
</
template
>
...
@@ -18,9 +19,11 @@ import { baseTreemapOption } from '../chart/treemap/treemap'
...
@@ -18,9 +19,11 @@ import { baseTreemapOption } from '../chart/treemap/treemap'
// import eventBus from '@/components/canvas/utils/eventBus'
// import eventBus from '@/components/canvas/utils/eventBus'
import
{
uuid
}
from
'vue-uuid'
import
{
uuid
}
from
'vue-uuid'
import
{
geoJson
}
from
'@/api/map/map'
import
{
geoJson
}
from
'@/api/map/map'
import
ViewTrackBar
from
'@/components/canvas/components/Editor/ViewTrackBar'
export
default
{
export
default
{
name
:
'ChartComponent'
,
name
:
'ChartComponent'
,
components
:
{
ViewTrackBar
},
props
:
{
props
:
{
chart
:
{
chart
:
{
type
:
Object
,
type
:
Object
,
...
@@ -32,13 +35,33 @@ export default {
...
@@ -32,13 +35,33 @@ export default {
default
:
function
()
{
default
:
function
()
{
return
{}
return
{}
}
}
},
trackMenu
:
{
type
:
Array
,
required
:
false
,
default
:
function
()
{
return
[
'drill'
,
'linkage'
]
}
}
}
},
},
data
()
{
data
()
{
return
{
return
{
myChart
:
{},
myChart
:
{},
chartId
:
uuid
.
v1
(),
chartId
:
uuid
.
v1
(),
currentGeoJson
:
null
currentGeoJson
:
null
,
showTrackBar
:
true
,
trackBarStyle
:
{
position
:
'absolute'
,
left
:
'0px'
,
top
:
'0px'
},
pointParam
:
null
}
},
computed
:
{
trackBarStyleTime
()
{
return
this
.
trackBarStyle
}
}
},
},
watch
:
{
watch
:
{
...
@@ -60,8 +83,6 @@ export default {
...
@@ -60,8 +83,6 @@ export default {
},
},
methods
:
{
methods
:
{
preDraw
()
{
preDraw
()
{
const
viewId
=
this
.
chart
.
id
const
_store
=
this
.
$store
// 基于准备好的dom,初始化echarts实例
// 基于准备好的dom,初始化echarts实例
// 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表板有重复id情况
// 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表板有重复id情况
const
that
=
this
const
that
=
this
...
@@ -75,15 +96,14 @@ export default {
...
@@ -75,15 +96,14 @@ export default {
this
.
myChart
.
off
(
'click'
)
this
.
myChart
.
off
(
'click'
)
this
.
myChart
.
on
(
'click'
,
function
(
param
)
{
this
.
myChart
.
on
(
'click'
,
function
(
param
)
{
console
.
log
(
JSON
.
stringify
(
param
.
data
))
that
.
pointParam
=
param
const
trackFilter
=
{
if
(
that
.
trackMenu
.
length
===
1
)
{
// 只有一个事件直接调用
viewId
:
viewId
,
that
.
trackClick
(
that
.
trackMenu
[
0
])
dimensionList
:
param
.
data
.
dimensionList
,
}
else
{
// 视图关联多个事件
quotaList
:
param
.
data
.
quotaList
that
.
trackBarStyle
.
left
=
param
.
event
.
offsetX
+
'px'
that
.
trackBarStyle
.
top
=
(
param
.
event
.
offsetY
-
15
)
+
'px'
that
.
$refs
.
viewTrack
.
trackButtonClick
()
}
}
_store
.
commit
(
'addViewTrackFilter'
,
trackFilter
)
that
.
$emit
(
'onChartClick'
,
param
)
})
})
})
})
},
},
...
@@ -169,6 +189,23 @@ export default {
...
@@ -169,6 +189,23 @@ export default {
// 指定图表的配置项和数据
// 指定图表的配置项和数据
const
chart
=
this
.
myChart
const
chart
=
this
.
myChart
chart
.
resize
()
chart
.
resize
()
},
trackClick
(
trackAction
)
{
const
linkageParam
=
{
viewId
:
this
.
chart
.
id
,
dimensionList
:
this
.
pointParam
.
data
.
dimensionList
,
quotaList
:
this
.
pointParam
.
data
.
quotaList
}
switch
(
trackAction
)
{
case
'drill'
:
this
.
$emit
(
'onChartClick'
,
this
.
pointParam
)
break
case
'linkage'
:
this
.
$store
.
commit
(
'addViewTrackFilter'
,
linkageParam
)
break
default
:
break
}
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论