提交 21a4073d authored 作者: wangjiahao's avatar wangjiahao

Merge remote-tracking branch 'origin/main' into main

...@@ -100,7 +100,8 @@ public class ChartViewService { ...@@ -100,7 +100,8 @@ public class ChartViewService {
customFilter.forEach(ele -> ele.setField(dataSetTableFieldsService.get(ele.getFieldId()))); customFilter.forEach(ele -> ele.setField(dataSetTableFieldsService.get(ele.getFieldId())));
if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) { if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) {
if (CollectionUtils.isEmpty(xAxis) && CollectionUtils.isEmpty(yAxis)) { xAxis = new ArrayList<>();
if (CollectionUtils.isEmpty(yAxis)) {
ChartViewDTO dto = new ChartViewDTO(); ChartViewDTO dto = new ChartViewDTO();
BeanUtils.copyBean(dto, view); BeanUtils.copyBean(dto, view);
return dto; return dto;
......
...@@ -3,11 +3,13 @@ package io.dataease.service.dataset; ...@@ -3,11 +3,13 @@ package io.dataease.service.dataset;
import io.dataease.base.domain.DatasetTableField; import io.dataease.base.domain.DatasetTableField;
import io.dataease.base.domain.DatasetTableFieldExample; import io.dataease.base.domain.DatasetTableFieldExample;
import io.dataease.base.mapper.DatasetTableFieldMapper; import io.dataease.base.mapper.DatasetTableFieldMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
...@@ -61,6 +63,16 @@ public class DataSetTableFieldsService { ...@@ -61,6 +63,16 @@ public class DataSetTableFieldsService {
return datasetTableFieldMapper.selectByExample(datasetTableFieldExample); return datasetTableFieldMapper.selectByExample(datasetTableFieldExample);
} }
public List<DatasetTableField> getListByIdsEach(List<String> ids) {
List<DatasetTableField> list = new ArrayList<>();
if (CollectionUtils.isNotEmpty(ids)) {
ids.forEach(id -> {
list.add(datasetTableFieldMapper.selectByPrimaryKey(id));
});
}
return list;
}
public List<DatasetTableField> getFieldsByTableId(String id) { public List<DatasetTableField> getFieldsByTableId(String id) {
DatasetTableFieldExample datasetTableFieldExample = new DatasetTableFieldExample(); DatasetTableFieldExample datasetTableFieldExample = new DatasetTableFieldExample();
datasetTableFieldExample.createCriteria().andTableIdEqualTo(id); datasetTableFieldExample.createCriteria().andTableIdEqualTo(id);
......
...@@ -427,6 +427,9 @@ public class DataSetTableService { ...@@ -427,6 +427,9 @@ public class DataSetTableService {
String sql = getCustomSQL(dataTableInfoDTO, list); String sql = getCustomSQL(dataTableInfoDTO, list);
// 使用输入的sql先预执行一次,并拿到所有字段 // 使用输入的sql先预执行一次,并拿到所有字段
datasourceRequest.setQuery(sql); datasourceRequest.setQuery(sql);
Map<String, Object> res = new HashMap<>();
try {
List<TableFiled> previewFields = jdbcProvider.fetchResultField(datasourceRequest); List<TableFiled> previewFields = jdbcProvider.fetchResultField(datasourceRequest);
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType()); QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
...@@ -461,11 +464,12 @@ public class DataSetTableService { ...@@ -461,11 +464,12 @@ public class DataSetTableService {
} }
} }
Map<String, Object> map = new HashMap<>(); res.put("fields", fields);
map.put("fields", fields); res.put("data", jsonArray);
map.put("data", jsonArray); return res;
} catch (Exception e) {
return map; return res;
}
} }
// 自助数据集从doris里预览数据 // 自助数据集从doris里预览数据
...@@ -473,7 +477,7 @@ public class DataSetTableService { ...@@ -473,7 +477,7 @@ public class DataSetTableService {
Map<String, String[]> customInfo = new TreeMap<>(); Map<String, String[]> customInfo = new TreeMap<>();
dataTableInfoDTO.getList().forEach(ele -> { dataTableInfoDTO.getList().forEach(ele -> {
String table = DorisTableUtils.dorisName(ele.getTableId()); String table = DorisTableUtils.dorisName(ele.getTableId());
List<DatasetTableField> fields = dataSetTableFieldsService.getListByIds(ele.getCheckedFields()); List<DatasetTableField> fields = dataSetTableFieldsService.getListByIdsEach(ele.getCheckedFields());
String[] array = fields.stream().map(f -> table + "." + f.getDataeaseName() + " AS " + DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName())).toArray(String[]::new); String[] array = fields.stream().map(f -> table + "." + f.getDataeaseName() + " AS " + DorisTableUtils.dorisFieldName(ele.getTableId() + "_" + f.getDataeaseName())).toArray(String[]::new);
customInfo.put(table, array); customInfo.put(table, array);
}); });
...@@ -503,8 +507,14 @@ public class DataSetTableService { ...@@ -503,8 +507,14 @@ public class DataSetTableService {
} }
} }
} }
if (StringUtils.isEmpty(f)) {
throw new RuntimeException(Translator.get("i18n_custom_ds_delete"));
}
return MessageFormat.format("SELECT {0} FROM {1}", f, DorisTableUtils.dorisName(first.getTableId())) + join.toString(); return MessageFormat.format("SELECT {0} FROM {1}", f, DorisTableUtils.dorisName(first.getTableId())) + join.toString();
} else { } else {
if (StringUtils.isEmpty(StringUtils.join(customInfo.get(DorisTableUtils.dorisName(first.getTableId())), ","))) {
throw new RuntimeException(Translator.get("i18n_custom_ds_delete"));
}
return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(customInfo.get(DorisTableUtils.dorisName(first.getTableId())), ","), DorisTableUtils.dorisName(first.getTableId())); return MessageFormat.format("SELECT {0} FROM {1}", StringUtils.join(customInfo.get(DorisTableUtils.dorisName(first.getTableId())), ","), DorisTableUtils.dorisName(first.getTableId()));
} }
} }
......
...@@ -226,6 +226,7 @@ public class ExtractDataService { ...@@ -226,6 +226,7 @@ public class ExtractDataService {
}else { }else {
DatasetTableIncrementalConfig datasetTableIncrementalConfig = dataSetTableService.incrementalConfig(datasetTableId); DatasetTableIncrementalConfig datasetTableIncrementalConfig = dataSetTableService.incrementalConfig(datasetTableId);
if (datasetTableIncrementalConfig == null || StringUtils.isEmpty(datasetTableIncrementalConfig.getTableId())) { if (datasetTableIncrementalConfig == null || StringUtils.isEmpty(datasetTableIncrementalConfig.getTableId())) {
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed);
return; return;
} }
DatasetTableTaskLog request = new DatasetTableTaskLog(); DatasetTableTaskLog request = new DatasetTableTaskLog();
...@@ -233,6 +234,7 @@ public class ExtractDataService { ...@@ -233,6 +234,7 @@ public class ExtractDataService {
request.setStatus(JobStatus.Completed.name()); request.setStatus(JobStatus.Completed.name());
List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(request); List<DatasetTableTaskLog> datasetTableTaskLogs = dataSetTableTaskLogService.select(request);
if (CollectionUtils.isEmpty(datasetTableTaskLogs)) { if (CollectionUtils.isEmpty(datasetTableTaskLogs)) {
updateTableStatus(datasetTableId, datasetTable, JobStatus.Completed);
return; return;
} }
......
...@@ -254,3 +254,4 @@ i18n_dataset_delete=Data set is delete ...@@ -254,3 +254,4 @@ i18n_dataset_delete=Data set is delete
i18n_chart_delete=Chart is delete i18n_chart_delete=Chart is delete
i18n_not_exec_add_sync=There is no completed synchronization task. Incremental synchronization cannot be performed i18n_not_exec_add_sync=There is no completed synchronization task. Incremental synchronization cannot be performed
i18n_excel_header_empty=Excel first row can not empty i18n_excel_header_empty=Excel first row can not empty
i18n_custom_ds_delete=Custom dataset union data is deleted,can not display
\ No newline at end of file
...@@ -254,3 +254,4 @@ i18n_dataset_delete=当前用到的数据集已被删除 ...@@ -254,3 +254,4 @@ i18n_dataset_delete=当前用到的数据集已被删除
i18n_chart_delete=当前用到的视图已被删除 i18n_chart_delete=当前用到的视图已被删除
i18n_not_exec_add_sync=没有已完成的同步任务,无法进行增量同步 i18n_not_exec_add_sync=没有已完成的同步任务,无法进行增量同步
i18n_excel_header_empty=Excel第一行为空 i18n_excel_header_empty=Excel第一行为空
i18n_custom_ds_delete=自定义数据集所关联数据被删除,无法正常显示
...@@ -256,3 +256,4 @@ i18n_dataset_delete=當前用到的數據集已被刪除 ...@@ -256,3 +256,4 @@ i18n_dataset_delete=當前用到的數據集已被刪除
i18n_chart_delete=當前用到的視圖已被刪除 i18n_chart_delete=當前用到的視圖已被刪除
i18n_not_exec_add_sync=沒有已經完成的同步任務,無法進行增量同步 i18n_not_exec_add_sync=沒有已經完成的同步任務,無法進行增量同步
i18n_excel_header_empty=Excel第一行為空 i18n_excel_header_empty=Excel第一行為空
i18n_custom_ds_delete=自定義數據集所關聯數據被刪除,無法正常顯示
\ No newline at end of file
...@@ -529,9 +529,6 @@ export default { ...@@ -529,9 +529,6 @@ export default {
view.yaxis.splice(1, view.yaxis.length) view.yaxis.splice(1, view.yaxis.length)
} }
} }
if (view.type.startsWith('text') || view.type.startsWith('gauge')) {
view.xaxis = []
}
if (view.type === 'line' && trigger === 'chart') { if (view.type === 'line' && trigger === 'chart') {
view.customAttr.size.lineArea = false view.customAttr.size.lineArea = false
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<el-col ref="container" v-loading="dataLoading" style="width: 100%;height:100%"> <el-col ref="container" v-loading="dataLoading" style="width: 100%;height:100%">
<span>{{ table.name }}</span> <span>{{ table.name }}</span>
<ux-grid <ux-grid
id="dsData"
ref="plxTable" ref="plxTable"
size="mini" size="mini"
style="width: 100%;" style="width: 100%;"
...@@ -59,6 +60,7 @@ export default { ...@@ -59,6 +60,7 @@ export default {
// })() // })()
// } // }
// this.height = window.innerHeight / 3 // this.height = window.innerHeight / 3
this.height = document.getElementById('dsData').parentNode.offsetHeight - 16 - 14 - 5
this.initData() this.initData()
}, },
methods: { methods: {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
> >
<el-row style="display: flex;align-items: center;justify-content: center;"> <el-row style="display: flex;align-items: center;justify-content: center;">
<el-col :span="6"> <el-col :span="6">
<p class="table-name-css">{{ table.name }}</p> <p class="table-name-css" :title="table.name">{{ table.name }}</p>
<el-select v-model="union.sourceTableFieldId" :placeholder="$t('dataset.pls_slc_union_field')" filterable clearable size="mini"> <el-select v-model="union.sourceTableFieldId" :placeholder="$t('dataset.pls_slc_union_field')" filterable clearable size="mini">
<el-option <el-option
v-for="item in sourceFieldOption" v-for="item in sourceFieldOption"
...@@ -93,7 +93,9 @@ ...@@ -93,7 +93,9 @@
trigger="click" trigger="click"
> >
<dataset-group-selector :mode="1" @getTable="getTable" /> <dataset-group-selector :mode="1" @getTable="getTable" />
<el-button slot="reference" size="mini">{{ targetTable.name || $t('dataset.pls_slc_union_table') }}</el-button> <el-button slot="reference" size="mini" style="width: 100%;">
<p class="table-name-css" :title="targetTable.name || $t('dataset.pls_slc_union_table')">{{ targetTable.name || $t('dataset.pls_slc_union_table') }}</p>
</el-button>
</el-popover> </el-popover>
<el-select v-model="union.targetTableFieldId" :placeholder="$t('dataset.pls_slc_union_field')" filterable clearable size="mini"> <el-select v-model="union.targetTableFieldId" :placeholder="$t('dataset.pls_slc_union_field')" filterable clearable size="mini">
...@@ -282,6 +284,9 @@ export default { ...@@ -282,6 +284,9 @@ export default {
<style scoped> <style scoped>
.table-name-css{ .table-name-css{
margin: 4px 2px; margin: 4px 2px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
} }
.union-relation-css{ .union-relation-css{
display: block; display: block;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论