Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
6b510908
提交
6b510908
authored
3月 25, 2021
作者:
junjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(数据集): 1.删除分组,场景将同时删除dataset和chart;2.数据集SQL模式可以重新编辑SQL
上级
68df03d7
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
56 行增加
和
7 行删除
+56
-7
ChartGroupService.java
...ain/java/io/dataease/service/chart/ChartGroupService.java
+13
-0
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+6
-0
DataSetGroupService.java
...java/io/dataease/service/dataset/DataSetGroupService.java
+2
-4
zh.js
frontend/src/lang/zh.js
+2
-1
AddSQL.vue
frontend/src/views/dataset/add/AddSQL.vue
+26
-2
ViewTable.vue
frontend/src/views/dataset/data/ViewTable.vue
+7
-0
没有找到文件。
backend/src/main/java/io/dataease/service/chart/ChartGroupService.java
浏览文件 @
6b510908
...
...
@@ -2,9 +2,12 @@ package io.dataease.service.chart;
import
io.dataease.base.domain.ChartGroup
;
import
io.dataease.base.domain.ChartGroupExample
;
import
io.dataease.base.domain.DatasetGroup
;
import
io.dataease.base.domain.DatasetTable
;
import
io.dataease.base.mapper.ChartGroupMapper
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.controller.request.chart.ChartGroupRequest
;
import
io.dataease.controller.request.dataset.DataSetTableRequest
;
import
io.dataease.dto.chart.ChartGroupDTO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -21,6 +24,8 @@ import java.util.stream.Collectors;
public
class
ChartGroupService
{
@Resource
private
ChartGroupMapper
chartGroupMapper
;
@Resource
private
ChartViewService
chartViewService
;
public
ChartGroupDTO
save
(
ChartGroup
chartGroup
)
{
if
(
StringUtils
.
isEmpty
(
chartGroup
.
getId
()))
{
...
...
@@ -45,6 +50,14 @@ public class ChartGroupService {
ChartGroupExample
ChartGroupExample
=
new
ChartGroupExample
();
ChartGroupExample
.
createCriteria
().
andIdIn
(
ids
);
chartGroupMapper
.
deleteByExample
(
ChartGroupExample
);
// 删除所有chart
deleteChart
(
ids
);
}
public
void
deleteChart
(
List
<
String
>
sceneIds
)
{
for
(
String
sceneId
:
sceneIds
)
{
chartViewService
.
deleteBySceneId
(
sceneId
);
}
}
public
ChartGroup
getScene
(
String
id
)
{
...
...
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
6b510908
...
...
@@ -75,6 +75,12 @@ public class ChartViewService {
chartViewMapper
.
deleteByPrimaryKey
(
id
);
}
public
void
deleteBySceneId
(
String
sceneId
)
{
ChartViewExample
chartViewExample
=
new
ChartViewExample
();
chartViewExample
.
createCriteria
().
andSceneIdEqualTo
(
sceneId
);
chartViewMapper
.
deleteByExample
(
chartViewExample
);
}
public
ChartViewDTO
getData
(
String
id
)
throws
Exception
{
ChartViewWithBLOBs
view
=
chartViewMapper
.
selectByPrimaryKey
(
id
);
List
<
ChartViewFieldDTO
>
xAxis
=
new
Gson
().
fromJson
(
view
.
getXAxis
(),
new
TypeToken
<
List
<
ChartViewFieldDTO
>>()
{
...
...
backend/src/main/java/io/dataease/service/dataset/DataSetGroupService.java
浏览文件 @
6b510908
...
...
@@ -52,10 +52,8 @@ public class DataSetGroupService {
DatasetGroupExample
datasetGroupExample
=
new
DatasetGroupExample
();
datasetGroupExample
.
createCriteria
().
andIdIn
(
ids
);
datasetGroupMapper
.
deleteByExample
(
datasetGroupExample
);
// 获取type为scene的id,删除场景下的表和字段
deleteTableAndField
(
tree
.
stream
().
filter
(
ele
->
{
return
StringUtils
.
equalsIgnoreCase
(
ele
.
getType
(),
"scene"
);
}).
map
(
DatasetGroup:
:
getId
).
collect
(
Collectors
.
toList
()));
// 删除场景下的表和字段
deleteTableAndField
(
ids
);
}
public
DatasetGroup
getScene
(
String
id
)
{
...
...
frontend/src/lang/zh.js
浏览文件 @
6b510908
...
...
@@ -768,7 +768,8 @@ export default {
incremental_delete
:
'增量删除'
,
last_update_time
:
'上次更新时间'
,
current_update_time
:
'当前更新时间'
,
param
:
'参数'
param
:
'参数'
,
edit_sql
:
'编辑SQL'
},
datasource
:
{
create
:
'新建数据连接'
,
...
...
frontend/src/views/dataset/add/AddSQL.vue
浏览文件 @
6b510908
...
...
@@ -3,7 +3,7 @@
<el-row>
<el-row
style=
"height: 26px;"
>
<span
style=
"line-height: 26px;"
>
{{
$t
(
'dataset.add_sql_table'
)
}}
{{
param
.
tableId
?
$t
(
'dataset.edit_sql'
):
$t
(
'dataset.add_sql_table'
)
}}
</span>
<el-row
style=
"float: right"
>
<el-button
size=
"mini"
@
click=
"cancel"
>
...
...
@@ -85,6 +85,7 @@
<
script
>
import
{
post
,
listDatasource
}
from
'@/api/dataset/dataset'
import
{
codemirror
}
from
'vue-codemirror'
import
{
getTable
}
from
'@/api/dataset/dataset'
// 核心样式
import
'codemirror/lib/codemirror.css'
// 引入主题后还需要在 options 中指定主题才会生效
...
...
@@ -145,7 +146,13 @@ export default {
return
this
.
$refs
.
myCm
.
codemirror
}
},
watch
:
{},
watch
:
{
'param.tableId'
:
{
handler
:
function
()
{
this
.
initTableInfo
()
}
}
},
mounted
()
{
window
.
onresize
=
()
=>
{
return
(()
=>
{
...
...
@@ -157,6 +164,8 @@ export default {
this
.
$refs
.
myCm
.
codemirror
.
on
(
'keypress'
,
()
=>
{
this
.
$refs
.
myCm
.
codemirror
.
showHint
()
})
this
.
initTableInfo
()
},
methods
:
{
initDataSource
()
{
...
...
@@ -165,6 +174,20 @@ export default {
})
},
initTableInfo
()
{
if
(
this
.
param
.
tableId
)
{
getTable
(
this
.
param
.
tableId
).
then
(
response
=>
{
const
table
=
response
.
data
this
.
name
=
table
.
name
this
.
dataSource
=
table
.
dataSourceId
this
.
mode
=
table
.
mode
+
''
this
.
sql
=
JSON
.
parse
(
table
.
info
.
replace
(
/
\n
/g
,
'
\\
n'
).
replace
(
/
\r
/g
,
'
\\
r'
)).
sql
this
.
getSQLPreview
()
})
}
},
getSQLPreview
()
{
if
(
!
this
.
dataSource
||
this
.
datasource
===
''
)
{
this
.
$message
({
...
...
@@ -204,6 +227,7 @@ export default {
return
}
const
table
=
{
id
:
this
.
param
.
tableId
,
name
:
this
.
name
,
sceneId
:
this
.
param
.
id
,
dataSourceId
:
this
.
dataSource
,
...
...
frontend/src/views/dataset/data/ViewTable.vue
浏览文件 @
6b510908
...
...
@@ -7,6 +7,9 @@
{{
table
.
name
}}
</span>
<el-row
style=
"float: right"
>
<el-button
v-if=
"table.type ==='sql'"
size=
"mini"
@
click=
"editSql"
>
{{
$t
(
'dataset.edit_sql'
)
}}
</el-button>
<el-button
size=
"mini"
@
click=
"edit"
>
{{
$t
(
'dataset.edit'
)
}}
</el-button>
...
...
@@ -146,6 +149,10 @@ export default {
closeEdit
()
{
this
.
editField
=
false
this
.
tableFields
=
[]
},
editSql
()
{
this
.
$emit
(
'switchComponent'
,
{
name
:
'AddSQL'
,
param
:
{
id
:
this
.
table
.
sceneId
,
tableId
:
this
.
table
.
id
}})
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论