Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
9fc6cedc
提交
9fc6cedc
authored
2月 07, 2022
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: S2 Event
上级
de006285
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
130 行增加
和
47 行删除
+130
-47
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+1
-1
table-info.js
frontend/src/views/chart/chart/table/table-info.js
+93
-12
ChartComponentS2.vue
frontend/src/views/chart/components/ChartComponentS2.vue
+33
-8
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+3
-26
没有找到文件。
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
9fc6cedc
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
class=
"table-class"
class=
"table-class"
/>
/>
<label-normal
v-if=
"labelShowFlag"
:ref=
"element.propValue.id"
:chart=
"chart"
class=
"table-class"
/>
<label-normal
v-if=
"labelShowFlag"
:ref=
"element.propValue.id"
:chart=
"chart"
class=
"table-class"
/>
<div
style=
"position: absolute;left:
20px;bottom:14
px;"
>
<div
style=
"position: absolute;left:
8px;bottom:8
px;"
>
<drill-path
:drill-filters=
"drillFilters"
@
onDrillJump=
"drillJump"
/>
<drill-path
:drill-filters=
"drillFilters"
@
onDrillJump=
"drillJump"
/>
</div>
</div>
</div>
</div>
...
...
frontend/src/views/chart/chart/table/table-info.js
浏览文件 @
9fc6cedc
...
@@ -15,14 +15,56 @@ export function baseTableInfo(s2, container, chart, action, tableData) {
...
@@ -15,14 +15,56 @@ export function baseTableInfo(s2, container, chart, action, tableData) {
const
columns
=
[]
const
columns
=
[]
const
meta
=
[]
const
meta
=
[]
fields
.
forEach
(
ele
=>
{
columns
.
push
(
ele
.
dataeaseName
)
meta
.
push
({
// add drill list
field
:
ele
.
dataeaseName
,
if
(
chart
.
drill
)
{
name
:
ele
.
name
let
drillFields
=
[]
try
{
drillFields
=
JSON
.
parse
(
chart
.
drillFields
)
}
catch
(
err
)
{
drillFields
=
JSON
.
parse
(
JSON
.
stringify
(
chart
.
drillFields
))
}
const
drillField
=
drillFields
[
chart
.
drillFilters
.
length
]
const
drillFilters
=
JSON
.
parse
(
JSON
.
stringify
(
chart
.
drillFilters
))
const
drillExp
=
drillFilters
[
drillFilters
.
length
-
1
].
datasetTableField
// 移除所有下钻字段
const
removeField
=
[]
for
(
let
i
=
0
;
i
<
chart
.
drillFilters
.
length
;
i
++
)
{
const
ele
=
chart
.
drillFilters
[
i
].
datasetTableField
removeField
.
push
(
ele
.
dataeaseName
)
}
// build field
fields
.
forEach
(
ele
=>
{
if
(
removeField
.
indexOf
(
ele
.
dataeaseName
)
<
0
)
{
// 用下钻字段替换当前字段
if
(
drillExp
.
dataeaseName
===
ele
.
dataeaseName
)
{
columns
.
push
(
drillField
.
dataeaseName
)
meta
.
push
({
field
:
drillField
.
dataeaseName
,
name
:
drillField
.
name
})
}
else
{
columns
.
push
(
ele
.
dataeaseName
)
meta
.
push
({
field
:
ele
.
dataeaseName
,
name
:
ele
.
name
})
}
}
})
}
else
{
fields
.
forEach
(
ele
=>
{
columns
.
push
(
ele
.
dataeaseName
)
meta
.
push
({
field
:
ele
.
dataeaseName
,
name
:
ele
.
name
})
})
})
}
)
}
// data config
// data config
const
s2DataConfig
=
{
const
s2DataConfig
=
{
...
@@ -71,14 +113,50 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
...
@@ -71,14 +113,50 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
const
columns
=
[]
const
columns
=
[]
const
meta
=
[]
const
meta
=
[]
fields
.
forEach
(
ele
=>
{
columns
.
push
(
ele
.
dataeaseName
)
meta
.
push
({
// add drill list
field
:
ele
.
dataeaseName
,
if
(
chart
.
drill
)
{
name
:
ele
.
name
const
drillFields
=
JSON
.
parse
(
chart
.
drillFields
)
const
drillField
=
drillFields
[
chart
.
drillFilters
.
length
]
const
drillFilters
=
JSON
.
parse
(
JSON
.
stringify
(
chart
.
drillFilters
))
const
drillExp
=
drillFilters
[
drillFilters
.
length
-
1
].
datasetTableField
// 移除所有下钻字段
const
removeField
=
[]
for
(
let
i
=
0
;
i
<
chart
.
drillFilters
.
length
;
i
++
)
{
const
ele
=
chart
.
drillFilters
[
i
].
datasetTableField
removeField
.
push
(
ele
.
dataeaseName
)
}
// build field
fields
.
forEach
(
ele
=>
{
if
(
removeField
.
indexOf
(
ele
.
dataeaseName
)
<
0
)
{
// 用下钻字段替换当前字段
if
(
drillExp
.
dataeaseName
===
ele
.
dataeaseName
)
{
columns
.
push
(
drillField
.
dataeaseName
)
meta
.
push
({
field
:
drillField
.
dataeaseName
,
name
:
drillField
.
name
})
}
else
{
columns
.
push
(
ele
.
dataeaseName
)
meta
.
push
({
field
:
ele
.
dataeaseName
,
name
:
ele
.
name
})
}
}
})
}
else
{
fields
.
forEach
(
ele
=>
{
columns
.
push
(
ele
.
dataeaseName
)
meta
.
push
({
field
:
ele
.
dataeaseName
,
name
:
ele
.
name
})
})
})
}
)
}
// data config
// data config
const
s2DataConfig
=
{
const
s2DataConfig
=
{
...
@@ -103,6 +181,9 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
...
@@ -103,6 +181,9 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
}
}
s2
=
new
TableSheet
(
containerDom
,
s2DataConfig
,
s2Options
)
s2
=
new
TableSheet
(
containerDom
,
s2DataConfig
,
s2Options
)
// click
s2
.
on
(
S2Event
.
DATA_CELL_CLICK
,
action
)
// theme
// theme
const
customTheme
=
getCustomTheme
(
chart
)
const
customTheme
=
getCustomTheme
(
chart
)
s2
.
setThemeCfg
({
theme
:
customTheme
})
s2
.
setThemeCfg
({
theme
:
customTheme
})
...
...
frontend/src/views/chart/components/ChartComponentS2.vue
浏览文件 @
9fc6cedc
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
<p
style=
"padding:6px 10px 0 10px;margin: 0;overflow: hidden;white-space: pre;text-overflow: ellipsis;"
>
{{
chart
.
title
}}
</p>
<p
style=
"padding:6px 10px 0 10px;margin: 0;overflow: hidden;white-space: pre;text-overflow: ellipsis;"
>
{{
chart
.
title
}}
</p>
</span>
</span>
<div
style=
"width: 100%;overflow: hidden;padding: 8px;"
:style=
"
{height:chartHeight,background:container_bg_class.background}">
<div
style=
"width: 100%;overflow: hidden;padding: 8px;"
:style=
"
{height:chartHeight,background:container_bg_class.background}">
<div
v-if=
"chart.type === 'table-normal'"
:id=
"chartId"
style=
"width: 100%;overflow: hidden;"
class=
"table-dom-normal
"
/>
<div
v-if=
"chart.type === 'table-normal'"
:id=
"chartId"
style=
"width: 100%;overflow: hidden;"
:class=
"chart.drill ? 'table-dom-normal-drill' : 'table-dom-normal'
"
/>
<div
v-if=
"chart.type === 'table-info'"
:id=
"chartId"
style=
"width: 100%;overflow: hidden;"
class=
"table-dom-info
"
/>
<div
v-if=
"chart.type === 'table-info'"
:id=
"chartId"
style=
"width: 100%;overflow: hidden;"
:class=
"chart.drill ? 'table-dom-info-drill' : 'table-dom-info'
"
/>
<el-row
v-show=
"chart.type === 'table-info'"
class=
"table-page"
>
<el-row
v-show=
"chart.type === 'table-info'"
class=
"table-page"
>
<span
class=
"total-style"
>
<span
class=
"total-style"
>
{{
$t
(
'chart.total'
)
}}
{{
$t
(
'chart.total'
)
}}
...
@@ -207,18 +207,37 @@ export default {
...
@@ -207,18 +207,37 @@ export default {
},
},
antVAction
(
param
)
{
antVAction
(
param
)
{
console
.
log
(
param
,
'param'
)
const
cell
=
this
.
myChart
.
getCell
(
param
.
target
)
const
cell
=
this
.
myChart
.
getCell
(
param
.
target
)
const
meta
=
cell
.
getMeta
()
const
meta
=
cell
.
getMeta
()
console
.
log
(
meta
)
console
.
log
(
meta
,
'meta'
)
let
xAxis
=
[]
let
xAxis
=
[]
if
(
this
.
chart
.
xaxis
)
{
if
(
this
.
chart
.
xaxis
)
{
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
}
}
let
drillFields
=
[]
if
(
this
.
chart
.
drillFields
)
{
try
{
drillFields
=
JSON
.
parse
(
this
.
chart
.
drillFields
)
}
catch
(
err
)
{
drillFields
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
chart
.
drillFields
))
}
}
let
field
=
{}
let
field
=
{}
if
(
meta
.
colIndex
<
xAxis
.
length
)
{
if
(
this
.
chart
.
drill
)
{
field
=
xAxis
[
meta
.
colIndex
]
field
=
drillFields
[
this
.
chart
.
drillFilters
.
length
]
// check click field is drill?
if
(
field
.
dataeaseName
!==
meta
.
valueField
)
{
return
}
}
else
{
if
(
meta
.
colIndex
<
xAxis
.
length
)
{
field
=
xAxis
[
meta
.
colIndex
]
}
}
}
const
dimensionList
=
[]
const
dimensionList
=
[]
dimensionList
.
push
({
id
:
field
.
id
,
value
:
meta
.
fieldValue
})
dimensionList
.
push
({
id
:
field
.
id
,
value
:
meta
.
fieldValue
})
this
.
pointParam
=
{
this
.
pointParam
=
{
...
@@ -226,13 +245,13 @@ export default {
...
@@ -226,13 +245,13 @@ export default {
dimensionList
:
dimensionList
dimensionList
:
dimensionList
}
}
}
}
console
.
log
(
this
.
pointParam
)
console
.
log
(
this
.
pointParam
,
'pointParam'
)
if
(
this
.
trackMenu
.
length
<
2
)
{
// 只有一个事件直接调用
if
(
this
.
trackMenu
.
length
<
2
)
{
// 只有一个事件直接调用
this
.
trackClick
(
this
.
trackMenu
[
0
])
this
.
trackClick
(
this
.
trackMenu
[
0
])
}
else
{
// 视图关联多个事件
}
else
{
// 视图关联多个事件
this
.
trackBarStyle
.
left
=
50
+
'px'
this
.
trackBarStyle
.
left
=
param
.
x
+
'px'
this
.
trackBarStyle
.
top
=
(
50
+
10
)
+
'px'
this
.
trackBarStyle
.
top
=
(
param
.
y
+
10
)
+
'px'
this
.
$refs
.
viewTrack
.
trackButtonClick
()
this
.
$refs
.
viewTrack
.
trackButtonClick
()
}
}
},
},
...
@@ -360,6 +379,12 @@ export default {
...
@@ -360,6 +379,12 @@ export default {
.table-dom-normal
{
.table-dom-normal
{
height
:
100%
;
height
:
100%
;
}
}
.table-dom-info-drill
{
height
:calc
(
100
%
-
36px
-
12px
)
;
}
.table-dom-normal-drill
{
height
:calc
(
100
%
-
12px
)
;
}
.table-page
{
.table-page
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
9fc6cedc
...
@@ -483,7 +483,7 @@
...
@@ -483,7 +483,7 @@
</div>
</div>
</el-row>
</el-row>
<el-row
<el-row
v-if=
"view.type && !
view.type.includes('table
') && !view.type.includes('text') && !view.type.includes('gauge') && view.type !== 'liquid' && view.type !== 'word-cloud'"
v-if=
"view.type && !
(view.type.includes('table') && view.render === 'echarts
') && !view.type.includes('text') && !view.type.includes('gauge') && view.type !== 'liquid' && view.type !== 'word-cloud'"
class=
"padding-lr"
class=
"padding-lr"
style=
"margin-top: 6px;"
style=
"margin-top: 6px;"
>
>
...
@@ -798,7 +798,7 @@
...
@@ -798,7 +798,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
style=
"position: absolute;left:
20px;bottom:10
px;"
>
<div
style=
"position: absolute;left:
8px;bottom:8
px;"
>
<drill-path
:drill-filters=
"drillFilters"
@
onDrillJump=
"drillJump"
/>
<drill-path
:drill-filters=
"drillFilters"
@
onDrillJump=
"drillJump"
/>
</div>
</div>
</el-row>
</el-row>
...
@@ -1325,7 +1325,7 @@ export default {
...
@@ -1325,7 +1325,7 @@ export default {
view
.
customAttr
.
label
.
show
=
true
view
.
customAttr
.
label
.
show
=
true
}
}
if
(
view
.
type
===
'liquid'
||
if
(
view
.
type
===
'liquid'
||
view
.
type
.
includes
(
'table
'
)
||
(
view
.
type
.
includes
(
'table'
)
&&
view
.
render
===
'echarts
'
)
||
view
.
type
.
includes
(
'text'
)
||
view
.
type
.
includes
(
'text'
)
||
view
.
type
.
includes
(
'gauge'
))
{
view
.
type
.
includes
(
'gauge'
))
{
view
.
drillFields
=
[]
view
.
drillFields
=
[]
...
@@ -1347,22 +1347,6 @@ export default {
...
@@ -1347,22 +1347,6 @@ export default {
delete
view
.
data
delete
view
.
data
return
view
return
view
},
},
save
(
getData
,
trigger
,
needRefreshGroup
=
false
,
switchType
=
false
)
{
const
view
=
this
.
buildParam
(
getData
,
trigger
,
needRefreshGroup
,
switchType
)
if
(
!
view
)
return
post
(
'/chart/view/save'
,
view
).
then
(
response
=>
{
if
(
getData
)
{
this
.
resetDrill
()
this
.
getData
(
response
.
data
.
id
)
}
else
{
this
.
getChart
(
response
.
data
.
id
)
}
if
(
needRefreshGroup
)
{
this
.
refreshGroup
(
view
)
}
this
.
closeChangeChart
()
})
},
calcData
(
getData
,
trigger
,
needRefreshGroup
=
false
,
switchType
=
false
)
{
calcData
(
getData
,
trigger
,
needRefreshGroup
=
false
,
switchType
=
false
)
{
this
.
hasEdit
=
true
this
.
hasEdit
=
true
const
view
=
this
.
buildParam
(
getData
,
trigger
,
needRefreshGroup
,
switchType
)
const
view
=
this
.
buildParam
(
getData
,
trigger
,
needRefreshGroup
,
switchType
)
...
@@ -1501,14 +1485,7 @@ export default {
...
@@ -1501,14 +1485,7 @@ export default {
this
.
view
.
customAttr
=
this
.
view
.
customAttr
?
JSON
.
parse
(
this
.
view
.
customAttr
)
:
{}
this
.
view
.
customAttr
=
this
.
view
.
customAttr
?
JSON
.
parse
(
this
.
view
.
customAttr
)
:
{}
this
.
view
.
customStyle
=
this
.
view
.
customStyle
?
JSON
.
parse
(
this
.
view
.
customStyle
)
:
{}
this
.
view
.
customStyle
=
this
.
view
.
customStyle
?
JSON
.
parse
(
this
.
view
.
customStyle
)
:
{}
this
.
view
.
customFilter
=
this
.
view
.
customFilter
?
JSON
.
parse
(
this
.
view
.
customFilter
)
:
{}
this
.
view
.
customFilter
=
this
.
view
.
customFilter
?
JSON
.
parse
(
this
.
view
.
customFilter
)
:
{}
response
.
data
.
data
=
this
.
data
this
.
chart
=
response
.
data
this
.
chart
.
drill
=
this
.
drill
// this.httpRequest.status = true
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
// this.resetView()
this
.
httpRequest
.
status
=
err
.
response
.
data
.
success
this
.
httpRequest
.
status
=
err
.
response
.
data
.
success
this
.
httpRequest
.
msg
=
err
.
response
.
data
.
message
this
.
httpRequest
.
msg
=
err
.
response
.
data
.
message
return
true
return
true
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论