Merge pull request #1380 from dataease/pr@dev@feat_union_ds

feat(数据集): 关联数据集
This commit is contained in:
XiaJunjie2020 2021-12-02 18:35:42 +08:00 committed by GitHub
commit 7747d9ed55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 1 deletions

View File

@ -41,7 +41,7 @@ public class VAuthModelService {
private List<VAuthModelDTO> filterData(VAuthModelRequest request, List<VAuthModelDTO> result) {
if (request.getDatasetMode() != null && request.getDatasetMode() == 1) {
result = result.stream().filter(vAuthModelDTO -> {
if (vAuthModelDTO.getNodeType().equalsIgnoreCase("spine") || (vAuthModelDTO.getNodeType().equalsIgnoreCase("leaf") && vAuthModelDTO.getMode().equals(1L)) && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("excel") && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("custom")) {
if (vAuthModelDTO.getNodeType().equalsIgnoreCase("spine") || (vAuthModelDTO.getNodeType().equalsIgnoreCase("leaf") && vAuthModelDTO.getMode().equals(1L)) && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("excel") && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("custom") && !vAuthModelDTO.getModelInnerType().equalsIgnoreCase("union")) {
return true;
} else {
return false;

View File

@ -75,6 +75,10 @@ public class DirectFieldService implements DataSetFieldService {
List<DataSetTableUnionDTO> listUnion = dataSetTableUnionService.listByTableId(dt.getList().get(0).getTableId());
String sql = dataSetTableService.getCustomSQLDatasource(dt, listUnion, ds);
datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, Collections.singletonList(field), true));
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "union")) {
DataTableInfoDTO dt = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
String sql = (String) dataSetTableService.getUnionSQLDatasource(dt, ds).get("sql");
datasourceRequest.setQuery(qp.createQuerySQLAsTmp(sql, Collections.singletonList(field), true));
}
} else if (datasetTable.getMode() == 1) {// 抽取
// 连接doris构建doris数据源查询

View File

@ -96,6 +96,7 @@
<svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" />
<svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" />
<svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" />
<svg-icon v-if="data.type === 'union'" icon-class="ds-union" class="ds-icon-union" />
</span>
<span v-if="data.type === 'db' || data.type === 'sql'">
<span v-if="data.mode === 0" style="margin-left: 6px"><i class="el-icon-s-operation" /></span>

View File

@ -46,6 +46,7 @@
<svg-icon v-if="data.type === 'sql'" icon-class="ds-sql" class="ds-icon-sql" />
<svg-icon v-if="data.type === 'excel'" icon-class="ds-excel" class="ds-icon-excel" />
<svg-icon v-if="data.type === 'custom'" icon-class="ds-custom" class="ds-icon-custom" />
<svg-icon v-if="data.type === 'union'" icon-class="ds-union" class="ds-icon-union" />
</span>
<el-tooltip class="item" effect="dark" placement="top">
<div slot="content">{{ node.label }}</div>