Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
7add22f6
提交
7add22f6
authored
2月 28, 2022
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 优化数据源删除提示信息
上级
c9b355c6
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
7 行删除
+15
-7
DatasourceController.java
.../dataease/controller/datasource/DatasourceController.java
+2
-2
DatasourceService.java
...ava/io/dataease/service/datasource/DatasourceService.java
+3
-2
DsTree.vue
frontend/src/views/system/datasource/DsTree.vue
+10
-3
没有找到文件。
backend/src/main/java/io/dataease/controller/datasource/DatasourceController.java
浏览文件 @
7add22f6
...
@@ -74,8 +74,8 @@ public class DatasourceController {
...
@@ -74,8 +74,8 @@ public class DatasourceController {
@DePermission
(
type
=
DePermissionType
.
DATASOURCE
,
level
=
ResourceAuthLevel
.
DATASOURCE_LEVEL_MANAGE
)
@DePermission
(
type
=
DePermissionType
.
DATASOURCE
,
level
=
ResourceAuthLevel
.
DATASOURCE_LEVEL_MANAGE
)
@ApiOperation
(
"删除数据源"
)
@ApiOperation
(
"删除数据源"
)
@PostMapping
(
"/delete/{datasourceID}"
)
@PostMapping
(
"/delete/{datasourceID}"
)
public
void
deleteDatasource
(
@PathVariable
(
value
=
"datasourceID"
)
String
datasourceID
)
throws
Exception
{
public
ResultHolder
deleteDatasource
(
@PathVariable
(
value
=
"datasourceID"
)
String
datasourceID
)
throws
Exception
{
datasourceService
.
deleteDatasource
(
datasourceID
);
return
datasourceService
.
deleteDatasource
(
datasourceID
);
}
}
@RequiresPermissions
(
"datasource:read"
)
@RequiresPermissions
(
"datasource:read"
)
...
...
backend/src/main/java/io/dataease/service/datasource/DatasourceService.java
浏览文件 @
7add22f6
...
@@ -163,16 +163,17 @@ public class DatasourceService {
...
@@ -163,16 +163,17 @@ public class DatasourceService {
}
}
@DeCleaner
(
DePermissionType
.
DATASOURCE
)
@DeCleaner
(
DePermissionType
.
DATASOURCE
)
public
void
deleteDatasource
(
String
datasourceId
)
throws
Exception
{
public
ResultHolder
deleteDatasource
(
String
datasourceId
)
throws
Exception
{
DatasetTableExample
example
=
new
DatasetTableExample
();
DatasetTableExample
example
=
new
DatasetTableExample
();
example
.
createCriteria
().
andDataSourceIdEqualTo
(
datasourceId
);
example
.
createCriteria
().
andDataSourceIdEqualTo
(
datasourceId
);
List
<
DatasetTable
>
datasetTables
=
datasetTableMapper
.
selectByExample
(
example
);
List
<
DatasetTable
>
datasetTables
=
datasetTableMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
datasetTables
)){
if
(
CollectionUtils
.
isNotEmpty
(
datasetTables
)){
DataEaseException
.
throwException
(
datasetTables
.
size
()
+
Translator
.
get
(
"i18n_datasource_not_allow_delete_msg"
));
return
ResultHolder
.
error
(
datasetTables
.
size
()
+
Translator
.
get
(
"i18n_datasource_not_allow_delete_msg"
));
}
}
Datasource
datasource
=
datasourceMapper
.
selectByPrimaryKey
(
datasourceId
);
Datasource
datasource
=
datasourceMapper
.
selectByPrimaryKey
(
datasourceId
);
datasourceMapper
.
deleteByPrimaryKey
(
datasourceId
);
datasourceMapper
.
deleteByPrimaryKey
(
datasourceId
);
handleConnectionPool
(
datasource
,
"delete"
);
handleConnectionPool
(
datasource
,
"delete"
);
return
ResultHolder
.
success
(
"success"
);
}
}
public
void
updateDatasource
(
Datasource
datasource
)
{
public
void
updateDatasource
(
Datasource
datasource
)
{
...
...
frontend/src/views/system/datasource/DsTree.vue
浏览文件 @
7add22f6
...
@@ -268,9 +268,16 @@ export default {
...
@@ -268,9 +268,16 @@ export default {
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
delDs
(
datasource
.
id
).
then
(
res
=>
{
delDs
(
datasource
.
id
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.delete_success'
))
if
(
res
.
success
){
this
.
switchMain
(
'DataHome'
,
{},
this
.
tData
)
this
.
$success
(
this
.
$t
(
'commons.delete_success'
))
this
.
refreshType
(
datasource
)
this
.
switchMain
(
'DataHome'
,
{},
this
.
tData
)
this
.
refreshType
(
datasource
)
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
message
})
}
})
})
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
$message
({
this
.
$message
({
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论