From 5f402b35df44965f28f35a1e64bf75534338d30a Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 20 Apr 2021 11:48:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E9=9B=86):flyway=20fix?= =?UTF-8?q?=EF=BC=9Bexcel=E6=95=B0=E6=8D=AE=E9=9B=86=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V9__dataset_tables.sql | 2 +- frontend/src/views/dataset/add/AddExcel.vue | 42 ++++++++----------- .../dataset/common/DatasetGroupSelector.vue | 2 +- frontend/src/views/dataset/data/ViewTable.vue | 2 +- frontend/src/views/dataset/group/Group.vue | 2 +- 5 files changed, 22 insertions(+), 28 deletions(-) diff --git a/backend/src/main/resources/db/migration/V9__dataset_tables.sql b/backend/src/main/resources/db/migration/V9__dataset_tables.sql index ef38fd1fab..a16f747625 100644 --- a/backend/src/main/resources/db/migration/V9__dataset_tables.sql +++ b/backend/src/main/resources/db/migration/V9__dataset_tables.sql @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS `dataset_table` `id` varchar(50) NOT NULL COMMENT 'ID', `name` varchar(64) NOT NULL COMMENT '表名称', `scene_id` varchar(50) NOT NULL COMMENT '场景ID', - `data_source_id` varchar(50) NOT NULL COMMENT '数据源ID', + `data_source_id` varchar(50) COMMENT '数据源ID', `type` varchar(50) COMMENT 'db,sql,excel,custom', `mode` int(10) DEFAULT 0 COMMENT '连接模式:0-直连,1-定时同步', `info` longtext COMMENT '表原始信息', diff --git a/frontend/src/views/dataset/add/AddExcel.vue b/frontend/src/views/dataset/add/AddExcel.vue index f901d24396..625267daa2 100644 --- a/frontend/src/views/dataset/add/AddExcel.vue +++ b/frontend/src/views/dataset/add/AddExcel.vue @@ -9,7 +9,7 @@ {{ $t('dataset.cancel') }} - + {{ $t('dataset.confirm') }} @@ -18,9 +18,9 @@ - + - + 0) { - this.form.name = file.name.substring(0, file.name.lastIndexOf('.')) + this.name = file.name.substring(0, file.name.lastIndexOf('.')) } this.fileList = fileList }, @@ -148,20 +146,16 @@ export default { save() { // console.log(this.checkTableList); // console.log(this.scene); - const sceneId = this.param.id - const dataSourceId = this.dataSource - const tables = [] - const mode = this.mode - this.checkTableList.forEach(function(name) { - tables.push({ - name: name, - sceneId: sceneId, - dataSourceId: dataSourceId, - type: 'excel', - mode: parseInt(mode) - }) - }) - post('/dataset/table/batchAdd', tables).then(response => { + const table = { + id: this.param.tableId, + name: this.name, + sceneId: this.param.id, + dataSourceId: null, + type: 'excel', + mode: parseInt(this.mode), + info: '{"data":"' + '123' + '"}' + } + post('/dataset/table/update', table).then(response => { this.$store.dispatch('dataset/setSceneData', new Date().getTime()) this.cancel() }) diff --git a/frontend/src/views/dataset/common/DatasetGroupSelector.vue b/frontend/src/views/dataset/common/DatasetGroupSelector.vue index 25f2acf184..9eacdf3f6c 100644 --- a/frontend/src/views/dataset/common/DatasetGroupSelector.vue +++ b/frontend/src/views/dataset/common/DatasetGroupSelector.vue @@ -89,7 +89,7 @@ - + diff --git a/frontend/src/views/dataset/data/ViewTable.vue b/frontend/src/views/dataset/data/ViewTable.vue index d811a826a8..de610cf5a8 100644 --- a/frontend/src/views/dataset/data/ViewTable.vue +++ b/frontend/src/views/dataset/data/ViewTable.vue @@ -36,7 +36,7 @@ 关联视图 TODO - + diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index 2c9ba69c29..a488bf1e42 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -186,7 +186,7 @@ - +