diff --git a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java index 8b3f97c1e2..e7b0514e1b 100644 --- a/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java +++ b/backend/src/main/java/io/dataease/controller/dataset/DataSetTableFieldController.java @@ -13,6 +13,7 @@ import io.dataease.commons.exception.DEException; import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.controller.request.dataset.MultFieldValuesRequest; import io.dataease.controller.response.DatasetTableField4Type; +import io.dataease.dto.dataset.DatasetTableFieldDTO; import io.dataease.i18n.Translator; import io.dataease.plugins.common.base.domain.DatasetTable; import io.dataease.plugins.common.base.domain.DatasetTableField; @@ -106,9 +107,33 @@ public class DataSetTableFieldController { DatasetTableField datasetTableField = DatasetTableField.builder().build(); datasetTableField.setTableId(tableId); datasetTableField.setGroupType("d"); - List dimensionList = dataSetTableFieldsService.list(datasetTableField); + List dimensionList = new ArrayList<>(); + dataSetTableFieldsService.list(datasetTableField).forEach(o -> { + DatasetTableFieldDTO datasetTableFieldDTO = new DatasetTableFieldDTO(); + BeanUtils.copyProperties(o, datasetTableFieldDTO); + List deTypeCascader = new ArrayList<>(); + deTypeCascader.add(datasetTableFieldDTO.getDeType()); + if (datasetTableFieldDTO.getDeExtractType() == 0 && datasetTableFieldDTO.getDeType() == 1) { + deTypeCascader.add(datasetTableFieldDTO.getDateFormatType()); + } + datasetTableFieldDTO.setDeTypeCascader(deTypeCascader); + dimensionList.add(datasetTableFieldDTO); + }); + + datasetTableField.setGroupType("q"); - List quotaList = dataSetTableFieldsService.list(datasetTableField); + List quotaList = new ArrayList<>(); + dataSetTableFieldsService.list(datasetTableField).forEach(o -> { + DatasetTableFieldDTO datasetTableFieldDTO = new DatasetTableFieldDTO(); + BeanUtils.copyProperties(o, datasetTableFieldDTO); + List deTypeCascader = new ArrayList<>(); + deTypeCascader.add(datasetTableFieldDTO.getDeType()); + if (datasetTableFieldDTO.getDeExtractType() == 0 && datasetTableFieldDTO.getDeType() == 1) { + deTypeCascader.add(datasetTableFieldDTO.getDateFormatType()); + } + datasetTableFieldDTO.setDeTypeCascader(deTypeCascader); + quotaList.add(datasetTableFieldDTO); + }); DatasetTableField4Type datasetTableField4Type = new DatasetTableField4Type(); datasetTableField4Type.setDimensionList(dimensionList); diff --git a/backend/src/main/java/io/dataease/controller/response/DatasetTableField4Type.java b/backend/src/main/java/io/dataease/controller/response/DatasetTableField4Type.java index 5f1081716a..8dbc9421cf 100644 --- a/backend/src/main/java/io/dataease/controller/response/DatasetTableField4Type.java +++ b/backend/src/main/java/io/dataease/controller/response/DatasetTableField4Type.java @@ -1,6 +1,6 @@ package io.dataease.controller.response; -import io.dataease.plugins.common.base.domain.DatasetTableField; +import io.dataease.dto.dataset.DatasetTableFieldDTO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -9,7 +9,7 @@ import java.util.List; @Data public class DatasetTableField4Type { @ApiModelProperty("维度") - List dimensionList; + List dimensionList; @ApiModelProperty("指标") - List quotaList; + List quotaList; } diff --git a/backend/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java b/backend/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java index 83a65cb94d..f1455ae21d 100644 --- a/backend/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java +++ b/backend/src/main/java/io/dataease/dto/dataset/DatasetTableFieldDTO.java @@ -3,7 +3,10 @@ package io.dataease.dto.dataset; import io.dataease.plugins.common.base.domain.DatasetTableField; import lombok.Data; +import java.util.List; + @Data public class DatasetTableFieldDTO extends DatasetTableField { private String jsonPath; + private List deTypeCascader; } diff --git a/backend/src/main/resources/db/migration/V44__1.17.sql b/backend/src/main/resources/db/migration/V44__1.17.sql index 30b3206948..f1cfbc3ad7 100644 --- a/backend/src/main/resources/db/migration/V44__1.17.sql +++ b/backend/src/main/resources/db/migration/V44__1.17.sql @@ -39,3 +39,6 @@ WHERE (`component` = 'msg/setting'); ALTER TABLE `panel_group` ADD COLUMN `panel_sort` bigint(13) NULL COMMENT '排序' AFTER `watermark_open`; + +ALTER TABLE `dataset_table_field` + ADD COLUMN `date_format_type` VARCHAR(255) NULL COMMENT '时间格式类型' AFTER `date_format`; diff --git a/frontend/src/views/dataset/data/FieldEdit.vue b/frontend/src/views/dataset/data/FieldEdit.vue index dc35dffd72..90591d6124 100644 --- a/frontend/src/views/dataset/data/FieldEdit.vue +++ b/frontend/src/views/dataset/data/FieldEdit.vue @@ -136,24 +136,24 @@