forked from github/dataease
Merge remote-tracking branch 'origin/v1.8' into v1.8
This commit is contained in:
commit
357e3ec285
@ -36,7 +36,7 @@
|
||||
panel_link_jump_info.jump_type,
|
||||
panel_link_jump_info.target_panel_id,
|
||||
panel_link_jump_info.content,
|
||||
panel_link_mapping.id as publicJumpId,
|
||||
ifnull( panel_link_mapping.uuid, panel_link_mapping.id ) AS publicJumpId,
|
||||
ifnull( panel_link_jump_info.checked, 0 ) AS checked,
|
||||
panel_link_jump_target_view_info.target_view_id,
|
||||
panel_link_jump_target_view_info.target_field_id
|
||||
|
@ -54,7 +54,6 @@ public class DatasourceController {
|
||||
return datasourceService.validate(datasourceId);
|
||||
}
|
||||
|
||||
@RequiresPermissions("datasource:read")
|
||||
@ApiOperation("查询当前用户数据源")
|
||||
@GetMapping("/list")
|
||||
public List<DatasourceDTO> getDatasourceList() throws Exception {
|
||||
@ -63,7 +62,6 @@ public class DatasourceController {
|
||||
return datasourceService.getDatasourceList(request);
|
||||
}
|
||||
|
||||
@RequiresPermissions("datasource:read")
|
||||
@ApiOperation("查询当前用户数据源")
|
||||
@GetMapping("/list/{type}")
|
||||
public List<DatasourceDTO> getDatasourceListByType(@PathVariable String type) throws Exception {
|
||||
@ -74,8 +72,8 @@ public class DatasourceController {
|
||||
@DePermission(type = DePermissionType.DATASOURCE, level = ResourceAuthLevel.DATASOURCE_LEVEL_MANAGE)
|
||||
@ApiOperation("删除数据源")
|
||||
@PostMapping("/delete/{datasourceID}")
|
||||
public void deleteDatasource(@PathVariable(value = "datasourceID") String datasourceID) throws Exception {
|
||||
datasourceService.deleteDatasource(datasourceID);
|
||||
public ResultHolder deleteDatasource(@PathVariable(value = "datasourceID") String datasourceID) throws Exception {
|
||||
return datasourceService.deleteDatasource(datasourceID);
|
||||
}
|
||||
|
||||
@RequiresPermissions("datasource:read")
|
||||
|
@ -6,4 +6,5 @@ import lombok.Data;
|
||||
public class Requst {
|
||||
private String query;
|
||||
private Integer fetch_size = 10000;
|
||||
private boolean field_multi_value_leniency = true;
|
||||
}
|
||||
|
@ -163,16 +163,17 @@ public class DatasourceService {
|
||||
}
|
||||
|
||||
@DeCleaner(DePermissionType.DATASOURCE)
|
||||
public void deleteDatasource(String datasourceId) throws Exception {
|
||||
public ResultHolder deleteDatasource(String datasourceId) throws Exception {
|
||||
DatasetTableExample example = new DatasetTableExample();
|
||||
example.createCriteria().andDataSourceIdEqualTo(datasourceId);
|
||||
List<DatasetTable> datasetTables = datasetTableMapper.selectByExample(example);
|
||||
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);
|
||||
datasourceMapper.deleteByPrimaryKey(datasourceId);
|
||||
handleConnectionPool(datasource, "delete");
|
||||
return ResultHolder.success("success");
|
||||
}
|
||||
|
||||
public void updateDatasource(Datasource datasource) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<de-container>
|
||||
<de-aside-container>
|
||||
<dataset-group-selector-tree :privileges="privileges" :mode="mode" :clearEmptyDir="clearEmptyDir" :type="type" :custom-type="customType" :show-mode="showMode" @getTable="getTable" />
|
||||
<dataset-group-selector-tree :privileges="privileges" :mode="mode" :clear-empty-dir="clearEmptyDir" :type="type" :custom-type="customType" :show-mode="showMode" @getTable="getTable" />
|
||||
</de-aside-container>
|
||||
<de-main-container>
|
||||
<dataset-table-data :table="table" />
|
||||
@ -54,7 +54,7 @@ export default {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -69,7 +69,7 @@ export default {
|
||||
methods: {
|
||||
getTable(table) {
|
||||
// this.table = table
|
||||
getTable(table.id).then(response => {
|
||||
table && table.id && getTable(table.id).then(response => {
|
||||
this.table = response.data
|
||||
this.$emit('getTable', this.table)
|
||||
}).catch(res => {
|
||||
|
@ -268,9 +268,16 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delDs(datasource.id).then(res => {
|
||||
this.$success(this.$t('commons.delete_success'))
|
||||
this.switchMain('DataHome', {}, this.tData)
|
||||
this.refreshType(datasource)
|
||||
if(res.success){
|
||||
this.$success(this.$t('commons.delete_success'))
|
||||
this.switchMain('DataHome', {}, this.tData)
|
||||
this.refreshType(datasource)
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
|
Loading…
Reference in New Issue
Block a user