Merge remote-tracking branch 'origin/v1.8' into v1.8

This commit is contained in:
wangjiahao 2022-02-28 18:01:29 +08:00
commit 357e3ec285
6 changed files with 20 additions and 13 deletions

View File

@ -36,7 +36,7 @@
panel_link_jump_info.jump_type, panel_link_jump_info.jump_type,
panel_link_jump_info.target_panel_id, panel_link_jump_info.target_panel_id,
panel_link_jump_info.content, 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, 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_view_id,
panel_link_jump_target_view_info.target_field_id panel_link_jump_target_view_info.target_field_id

View File

@ -54,7 +54,6 @@ public class DatasourceController {
return datasourceService.validate(datasourceId); return datasourceService.validate(datasourceId);
} }
@RequiresPermissions("datasource:read")
@ApiOperation("查询当前用户数据源") @ApiOperation("查询当前用户数据源")
@GetMapping("/list") @GetMapping("/list")
public List<DatasourceDTO> getDatasourceList() throws Exception { public List<DatasourceDTO> getDatasourceList() throws Exception {
@ -63,7 +62,6 @@ public class DatasourceController {
return datasourceService.getDatasourceList(request); return datasourceService.getDatasourceList(request);
} }
@RequiresPermissions("datasource:read")
@ApiOperation("查询当前用户数据源") @ApiOperation("查询当前用户数据源")
@GetMapping("/list/{type}") @GetMapping("/list/{type}")
public List<DatasourceDTO> getDatasourceListByType(@PathVariable String type) throws Exception { 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) @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")

View File

@ -6,4 +6,5 @@ import lombok.Data;
public class Requst { public class Requst {
private String query; private String query;
private Integer fetch_size = 10000; private Integer fetch_size = 10000;
private boolean field_multi_value_leniency = true;
} }

View File

@ -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) {

View File

@ -1,7 +1,7 @@
<template> <template>
<de-container> <de-container>
<de-aside-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-aside-container>
<de-main-container> <de-main-container>
<dataset-table-data :table="table" /> <dataset-table-data :table="table" />
@ -54,7 +54,7 @@ export default {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
}, }
}, },
data() { data() {
return { return {
@ -69,7 +69,7 @@ export default {
methods: { methods: {
getTable(table) { getTable(table) {
// this.table = table // this.table = table
getTable(table.id).then(response => { table && table.id && getTable(table.id).then(response => {
this.table = response.data this.table = response.data
this.$emit('getTable', this.table) this.$emit('getTable', this.table)
}).catch(res => { }).catch(res => {

View File

@ -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({