mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
Merge pull request #13635 from dataease/pr@dev-v2@fixds
Pr@dev v2@fixds
This commit is contained in:
commit
2e6a9e4f9c
@ -97,7 +97,6 @@ public class TableInfoHandler extends DefaultChartHandler {
|
|||||||
fieldDTO = allField;
|
fieldDTO = allField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert fieldDTO != null;
|
|
||||||
if (fieldDTO != null && fieldDTO.isAgg()) {
|
if (fieldDTO != null && fieldDTO.isAgg()) {
|
||||||
sqlMeta.getXFields().get(i).setFieldName("'-'");
|
sqlMeta.getXFields().get(i).setFieldName("'-'");
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package io.dataease.config;
|
|||||||
|
|
||||||
|
|
||||||
import io.dataease.commons.utils.MybatisInterceptorConfig;
|
import io.dataease.commons.utils.MybatisInterceptorConfig;
|
||||||
|
import io.dataease.datasource.dao.auto.entity.CoreDatasource;
|
||||||
import io.dataease.datasource.dao.auto.entity.CoreDeEngine;
|
import io.dataease.datasource.dao.auto.entity.CoreDeEngine;
|
||||||
import io.dataease.interceptor.MybatisInterceptor;
|
import io.dataease.interceptor.MybatisInterceptor;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
@ -22,6 +23,7 @@ public class MybatisConfig {
|
|||||||
MybatisInterceptor interceptor = new MybatisInterceptor();
|
MybatisInterceptor interceptor = new MybatisInterceptor();
|
||||||
List<MybatisInterceptorConfig> configList = new ArrayList<>();
|
List<MybatisInterceptorConfig> configList = new ArrayList<>();
|
||||||
configList.add(new MybatisInterceptorConfig(CoreDeEngine.class, "configuration"));
|
configList.add(new MybatisInterceptorConfig(CoreDeEngine.class, "configuration"));
|
||||||
|
configList.add(new MybatisInterceptorConfig(CoreDatasource.class, "configuration"));
|
||||||
interceptor.setInterceptorConfigList(configList);
|
interceptor.setInterceptorConfigList(configList);
|
||||||
return interceptor;
|
return interceptor;
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,13 @@ public class DataSourceManage {
|
|||||||
coreOptRecentManage.saveOpt(sourceData.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.UPDATE);
|
coreOptRecentManage.saveOpt(sourceData.getId(), OptConstants.OPT_RESOURCE_TYPE.DATASOURCE, OptConstants.OPT_TYPE.UPDATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void encryptDsConfig(){
|
||||||
|
coreDatasourceMapper.selectList(null).forEach(dataSource -> {
|
||||||
|
coreDatasourceMapper.updateById(dataSource);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public DatasourceDTO getDs(Long id) {
|
public DatasourceDTO getDs(Long id) {
|
||||||
CoreDatasource coreDatasource = coreDatasourceMapper.selectById(id);
|
CoreDatasource coreDatasource = coreDatasourceMapper.selectById(id);
|
||||||
DatasourceDTO dto = new DatasourceDTO();
|
DatasourceDTO dto = new DatasourceDTO();
|
||||||
|
@ -703,7 +703,7 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
String datasourceId = req.get("datasourceId");
|
String datasourceId = req.get("datasourceId");
|
||||||
DatasetTableDTO datasetTableDTO = new DatasetTableDTO();
|
DatasetTableDTO datasetTableDTO = new DatasetTableDTO();
|
||||||
datasetTableDTO.setDatasourceId(Long.valueOf(datasourceId));
|
datasetTableDTO.setDatasourceId(Long.valueOf(datasourceId));
|
||||||
if (!getTables(datasetTableDTO).stream().map(DatasetTableDTO::getTableName).collect(Collectors.toList()).contains("tableName")) {
|
if (!getTables(datasetTableDTO).stream().map(DatasetTableDTO::getTableName).collect(Collectors.toList()).contains(tableName)) {
|
||||||
DEException.throwException("无效的表名!");
|
DEException.throwException("无效的表名!");
|
||||||
}
|
}
|
||||||
CoreDatasource coreDatasource = datasourceMapper.selectById(datasourceId);
|
CoreDatasource coreDatasource = datasourceMapper.selectById(datasourceId);
|
||||||
@ -817,7 +817,7 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
sheet.setDeTableName(datasetTableDTO.getTableName());
|
sheet.setDeTableName(datasetTableDTO.getTableName());
|
||||||
datasourceRequest.setTable(datasetTableDTO.getTableName());
|
datasourceRequest.setTable(datasetTableDTO.getTableName());
|
||||||
List<TableField> oldTableFields = ExcelUtils.getTableFields(datasourceRequest);
|
List<TableField> oldTableFields = ExcelUtils.getTableFields(datasourceRequest);
|
||||||
mergeFields(sheet.getFields(), oldTableFields);
|
mergeFields(oldTableFields, sheet.getFields());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!find) {
|
if (!find) {
|
||||||
@ -866,7 +866,7 @@ public class DatasourceServer implements DatasourceApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void mergeFields(List<TableField> oldFields, List<TableField> newFields) {
|
private void mergeFields(List<TableField> oldFields, List<TableField> newFields) {
|
||||||
oldFields.forEach(tableField -> tableField.setChecked(false));
|
newFields.forEach(tableField -> tableField.setChecked(false));
|
||||||
for (TableField newField : newFields) {
|
for (TableField newField : newFields) {
|
||||||
for (TableField oldField : oldFields) {
|
for (TableField oldField : oldFields) {
|
||||||
if (oldField.getName().equals(newField.getName())) {
|
if (oldField.getName().equals(newField.getName())) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package io.dataease.listener;
|
package io.dataease.listener;
|
||||||
|
|
||||||
import io.dataease.datasource.dao.auto.entity.CoreDatasourceTask;
|
import io.dataease.datasource.dao.auto.entity.CoreDatasourceTask;
|
||||||
|
import io.dataease.datasource.manage.DataSourceManage;
|
||||||
import io.dataease.datasource.manage.DatasourceSyncManage;
|
import io.dataease.datasource.manage.DatasourceSyncManage;
|
||||||
import io.dataease.datasource.manage.EngineManage;
|
import io.dataease.datasource.manage.EngineManage;
|
||||||
import io.dataease.datasource.provider.CalciteProvider;
|
import io.dataease.datasource.provider.CalciteProvider;
|
||||||
@ -26,6 +27,8 @@ public class DataSourceInitStartListener implements ApplicationListener<Applicat
|
|||||||
@Resource
|
@Resource
|
||||||
private DatasourceServer datasourceServer;
|
private DatasourceServer datasourceServer;
|
||||||
@Resource
|
@Resource
|
||||||
|
private DataSourceManage dataSourceManage;
|
||||||
|
@Resource
|
||||||
private DatasourceTaskServer datasourceTaskServer;
|
private DatasourceTaskServer datasourceTaskServer;
|
||||||
@Resource
|
@Resource
|
||||||
private CalciteProvider calciteProvider;
|
private CalciteProvider calciteProvider;
|
||||||
@ -71,7 +74,7 @@ public class DataSourceInitStartListener implements ApplicationListener<Applicat
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
dataSourceManage.encryptDsConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,12 @@ const { curComponent } = storeToRefs(dvMainStore)
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-collapse-item :effect="themes" :title="t('visualization.position')" name="position" v-if="!dashboardActive">
|
<el-collapse-item
|
||||||
|
:effect="themes"
|
||||||
|
:title="t('visualization.position')"
|
||||||
|
name="position"
|
||||||
|
v-if="!dashboardActive"
|
||||||
|
>
|
||||||
<component-position :themes="themes" />
|
<component-position :themes="themes" />
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</template>
|
</template>
|
||||||
|
@ -653,14 +653,6 @@ defineExpose({
|
|||||||
{{ t('data_set.field_selection') }}
|
{{ t('data_set.field_selection') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-button @click="refreshData" secondary>
|
|
||||||
<template #icon>
|
|
||||||
<el-icon>
|
|
||||||
<Icon><icon_refresh_outlined class="svg-icon" /></Icon>
|
|
||||||
</el-icon>
|
|
||||||
</template>
|
|
||||||
{{ t('data_set.refresh_data') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="info-table" v-if="isResize">
|
<div class="info-table" v-if="isResize">
|
||||||
<el-auto-resizer v-if="currentMode === 'preview'">
|
<el-auto-resizer v-if="currentMode === 'preview'">
|
||||||
|
Loading…
Reference in New Issue
Block a user