From ef36e739481cd77b90c66b5b62c947e49cb7e756 Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 12 May 2021 15:53:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E9=9B=86):=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E8=87=AA=E5=8A=A9=E6=95=B0=E6=8D=AE=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 2 +- frontend/src/views/dataset/add/AddCustom.vue | 2 +- .../dataset/common/DatasetGroupSelector.vue | 21 +++++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) 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 2753db3567..4c639c23d1 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,7 @@ public class DataSetTableService { int update = datasetTableMapper.updateByPrimaryKeySelective(datasetTable); // sql 更新 if (update == 1) { - if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql")) { + if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql") || StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) { // 删除所有字段,重新抽象 dataSetTableFieldsService.deleteByTableId(datasetTable.getId()); saveTableField(datasetTable); diff --git a/frontend/src/views/dataset/add/AddCustom.vue b/frontend/src/views/dataset/add/AddCustom.vue index ddc55358fb..2a8fc2a3d9 100644 --- a/frontend/src/views/dataset/add/AddCustom.vue +++ b/frontend/src/views/dataset/add/AddCustom.vue @@ -23,7 +23,7 @@ - + diff --git a/frontend/src/views/dataset/common/DatasetGroupSelector.vue b/frontend/src/views/dataset/common/DatasetGroupSelector.vue index 4e160b70c1..d3ce447410 100644 --- a/frontend/src/views/dataset/common/DatasetGroupSelector.vue +++ b/frontend/src/views/dataset/common/DatasetGroupSelector.vue @@ -122,6 +122,11 @@ export default { type: Array, required: false, default: null + }, + table: { + type: Object, + required: false, + default: null } }, data() { @@ -153,6 +158,18 @@ export default { 'unionData': function() { this.unionDataChange() }, + 'table': function() { + if (this.table && this.table.sceneId) { + post('dataset/group/getScene/' + this.table.sceneId, {}).then(response => { + this.currGroup = response.data + + this.$nextTick(function() { + this.sceneMode = true + this.tableTree() + }) + }) + } + }, search(val) { if (val && val !== '') { this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) }))) @@ -165,10 +182,6 @@ export default { this.tree(this.groupForm) this.tableTree() }, - activated() { - this.tree(this.groupForm) - this.tableTree() - }, created() { this.kettleState() },