From 9085de668fa91d1af7fb4e3eec2ef29f2057a7b2 Mon Sep 17 00:00:00 2001 From: junjie Date: Thu, 25 Feb 2021 10:42:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=A3=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 9 +++- .../business/components/dataset/DataSet.vue | 44 +++++++++---------- .../dataset/{data => add}/AddDB.vue | 0 .../components/dataset/data/ViewTable.vue | 5 ++- .../src/business/components/dataset/router.js | 3 +- frontend/src/i18n/en-US.js | 3 +- frontend/src/i18n/zh-CN.js | 13 +++--- frontend/src/i18n/zh-TW.js | 3 +- 8 files changed, 47 insertions(+), 33 deletions(-) rename frontend/src/business/components/dataset/{data => add}/AddDB.vue (100%) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index e36ce10a5b..7ddd18503b 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -102,7 +102,14 @@ public class DataSetTableService { DatasourceRequest datasourceRequest = new DatasourceRequest(); datasourceRequest.setDatasource(ds); String table = new Gson().fromJson(dataSetTableRequest.getInfo(), DataTableInfoDTO.class).getTable(); - datasourceRequest.setQuery(createQuerySQL(ds.getType(), table, new String[]{"*"})); + + DatasetTableField datasetTableField = new DatasetTableField(); + datasetTableField.setTableId(dataSetTableRequest.getId()); + datasetTableField.setChecked(Boolean.TRUE); + List fields = dataSetTableFieldsService.list(datasetTableField); + String[] fieldArray = fields.stream().map(DatasetTableField::getOriginName).toArray(String[]::new); + datasourceRequest.setQuery(createQuerySQL(ds.getType(), table, fieldArray)); + return datasourceProvider.getData(datasourceRequest); } diff --git a/frontend/src/business/components/dataset/DataSet.vue b/frontend/src/business/components/dataset/DataSet.vue index e0c29585ef..337fa954d5 100644 --- a/frontend/src/business/components/dataset/DataSet.vue +++ b/frontend/src/business/components/dataset/DataSet.vue @@ -1,33 +1,33 @@