Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
4be52b99
提交
4be52b99
authored
2月 05, 2022
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: S2 Event
上级
85a6f1ae
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
76 行增加
和
14 行删除
+76
-14
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+36
-4
table-info.js
frontend/src/views/chart/chart/table/table-info.js
+4
-1
ChartComponentS2.vue
frontend/src/views/chart/components/ChartComponentS2.vue
+34
-7
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+2
-2
没有找到文件。
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
4be52b99
...
...
@@ -305,10 +305,10 @@ public class ChartViewService {
filterRequest
.
setFieldId
(
fId
);
DatasetTableField
datasetTableField
=
dataSetTableFieldsService
.
get
(
fId
);
if
(
datasetTableField
==
null
)
{
if
(
datasetTableField
==
null
)
{
continue
;
}
if
(!
desensitizationList
.
contains
(
datasetTableField
.
getDataeaseName
())
&&
dataeaseNames
.
contains
(
datasetTableField
.
getDataeaseName
()))
{
if
(!
desensitizationList
.
contains
(
datasetTableField
.
getDataeaseName
())
&&
dataeaseNames
.
contains
(
datasetTableField
.
getDataeaseName
()))
{
filterRequest
.
setDatasetTableField
(
datasetTableField
);
if
(
StringUtils
.
equalsIgnoreCase
(
datasetTableField
.
getTableId
(),
view
.
getTableId
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
filterRequest
.
getViewIds
()))
{
...
...
@@ -329,7 +329,7 @@ public class ChartViewService {
if
(
ObjectUtils
.
isNotEmpty
(
requestList
.
getLinkageFilters
()))
{
for
(
ChartExtFilterRequest
request
:
requestList
.
getLinkageFilters
())
{
DatasetTableField
datasetTableField
=
dataSetTableFieldsService
.
get
(
request
.
getFieldId
());
if
(!
desensitizationList
.
contains
(
datasetTableField
.
getDataeaseName
())
&&
dataeaseNames
.
contains
(
datasetTableField
.
getDataeaseName
()))
{
if
(!
desensitizationList
.
contains
(
datasetTableField
.
getDataeaseName
())
&&
dataeaseNames
.
contains
(
datasetTableField
.
getDataeaseName
()))
{
request
.
setDatasetTableField
(
datasetTableField
);
if
(
StringUtils
.
equalsIgnoreCase
(
datasetTableField
.
getTableId
(),
view
.
getTableId
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
request
.
getViewIds
()))
{
...
...
@@ -814,6 +814,38 @@ public class ChartViewService {
}
}
if
(
StringUtils
.
containsIgnoreCase
(
view
.
getType
(),
"table"
))
{
for
(
int
i
=
0
;
i
<
xAxis
.
size
()
+
yAxis
.
size
();
i
++)
{
AxisChartDataAntVDTO
axisChartDataDTO
=
new
AxisChartDataAntVDTO
();
axisChartDataDTO
.
setField
(
a
.
toString
());
axisChartDataDTO
.
setName
(
a
.
toString
());
List
<
ChartDimensionDTO
>
dimensionList
=
new
ArrayList
<>();
List
<
ChartQuotaDTO
>
quotaList
=
new
ArrayList
<>();
for
(
int
j
=
0
;
j
<
xAxis
.
size
();
j
++)
{
ChartDimensionDTO
chartDimensionDTO
=
new
ChartDimensionDTO
();
chartDimensionDTO
.
setId
(
xAxis
.
get
(
j
).
getId
());
chartDimensionDTO
.
setValue
(
row
[
j
]);
dimensionList
.
add
(
chartDimensionDTO
);
}
axisChartDataDTO
.
setDimensionList
(
dimensionList
);
int
j
=
i
-
xAxis
.
size
();
if
(
j
>
-
1
)
{
ChartQuotaDTO
chartQuotaDTO
=
new
ChartQuotaDTO
();
chartQuotaDTO
.
setId
(
yAxis
.
get
(
j
).
getId
());
quotaList
.
add
(
chartQuotaDTO
);
axisChartDataDTO
.
setQuotaList
(
quotaList
);
try
{
axisChartDataDTO
.
setValue
(
StringUtils
.
isEmpty
(
row
[
i
])
?
null
:
new
BigDecimal
(
row
[
i
]));
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
}
datas
.
add
(
axisChartDataDTO
);
}
}
else
{
for
(
int
i
=
xAxis
.
size
();
i
<
xAxis
.
size
()
+
yAxis
.
size
();
i
++)
{
AxisChartDataAntVDTO
axisChartDataDTO
=
new
AxisChartDataAntVDTO
();
axisChartDataDTO
.
setField
(
a
.
toString
());
...
...
@@ -840,10 +872,10 @@ public class ChartViewService {
}
catch
(
Exception
e
)
{
axisChartDataDTO
.
setValue
(
new
BigDecimal
(
0
));
}
axisChartDataDTO
.
setCategory
(
yAxis
.
get
(
j
).
getName
());
datas
.
add
(
axisChartDataDTO
);
}
}
}
map
.
put
(
"datas"
,
datas
);
return
map
;
}
...
...
frontend/src/views/chart/chart/table/table-info.js
浏览文件 @
4be52b99
import
{
TableSheet
}
from
'@antv/s2'
import
{
TableSheet
,
S2Event
}
from
'@antv/s2'
import
{
getCustomTheme
,
getSize
}
from
'@/views/chart/chart/common/common_table'
export
function
baseTableInfo
(
s2
,
container
,
chart
,
action
,
tableData
)
{
...
...
@@ -47,6 +47,9 @@ export function baseTableInfo(s2, container, chart, action, tableData) {
}
s2
=
new
TableSheet
(
containerDom
,
s2DataConfig
,
s2Options
)
// click
s2
.
on
(
S2Event
.
DATA_CELL_CLICK
,
action
)
// theme
const
customTheme
=
getCustomTheme
(
chart
)
s2
.
setThemeCfg
({
theme
:
customTheme
})
...
...
frontend/src/views/chart/components/ChartComponentS2.vue
浏览文件 @
4be52b99
...
...
@@ -207,17 +207,44 @@ export default {
},
antVAction
(
param
)
{
console
.
log
(
param
)
if
(
this
.
chart
.
type
===
'treemap'
)
{
this
.
pointParam
=
param
.
data
.
data
}
else
{
this
.
pointParam
=
param
.
data
const
cell
=
this
.
myChart
.
getCell
(
param
.
target
)
const
meta
=
cell
.
getMeta
()
console
.
log
(
meta
)
// if (this.chart.type === 'treemap') {
// this.pointParam = param.data.data
// } else {
// this.pointParam = param.data
// }
// if (this.trackMenu.length
<
2
)
{
// 只有一个事件直接调用
// this.trackClick(this.trackMenu[0])
// } else { // 视图关联多个事件
// this.trackBarStyle.left = param.x + 'px'
// this.trackBarStyle.top = (param.y + 10) + 'px'
// this.$refs.viewTrack.trackButtonClick()
// }
let
xAxis
=
[]
if
(
this
.
chart
.
xaxis
)
{
xAxis
=
JSON
.
parse
(
this
.
chart
.
xaxis
)
}
let
field
=
{}
if
(
meta
.
colIndex
<
xAxis
.
length
)
{
field
=
xAxis
[
meta
.
colIndex
]
}
const
dimensionList
=
[]
dimensionList
.
push
({
id
:
field
.
id
,
value
:
meta
.
fieldValue
})
this
.
pointParam
=
{
data
:
{
dimensionList
:
dimensionList
}
}
console
.
log
(
this
.
pointParam
)
if
(
this
.
trackMenu
.
length
<
2
)
{
// 只有一个事件直接调用
this
.
trackClick
(
this
.
trackMenu
[
0
])
}
else
{
// 视图关联多个事件
this
.
trackBarStyle
.
left
=
param
.
x
+
'px'
this
.
trackBarStyle
.
top
=
(
param
.
y
+
10
)
+
'px'
this
.
trackBarStyle
.
left
=
50
+
'px'
this
.
trackBarStyle
.
top
=
(
50
+
10
)
+
'px'
this
.
$refs
.
viewTrack
.
trackButtonClick
()
}
},
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
4be52b99
...
...
@@ -483,7 +483,7 @@
</div>
</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"
style=
"margin-top: 6px;"
>
...
...
@@ -1325,7 +1325,7 @@ export default {
view
.
customAttr
.
label
.
show
=
true
}
if
(
view
.
type
===
'liquid'
||
view
.
type
.
includes
(
'table
'
)
||
(
view
.
type
.
includes
(
'table'
)
&&
view
.
render
===
'echarts
'
)
||
view
.
type
.
includes
(
'text'
)
||
view
.
type
.
includes
(
'gauge'
))
{
view
.
drillFields
=
[]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论