From f279b673e13210d2cb767e99972ce6ec326e142f Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 30 Sep 2022 11:18:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20API=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/datasource/DsConfiguration.vue | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/frontend/src/views/system/datasource/DsConfiguration.vue b/frontend/src/views/system/datasource/DsConfiguration.vue index 079116b137..f746574444 100644 --- a/frontend/src/views/system/datasource/DsConfiguration.vue +++ b/frontend/src/views/system/datasource/DsConfiguration.vue @@ -246,7 +246,7 @@ " :label="$t('datasource.extra_params')" > - + - - - - - - - + + + + + + + @@ -728,7 +728,8 @@ export default { { required: true, validator: this.nameRepeat, - trigger: 'blur' + trigger: 'blur', + message: i18n.t('commons.input_name') } ], desc: [ @@ -971,20 +972,24 @@ export default { }) }, nameRepeat(rule, value, callback) { + if (!value) { + callback(new Error(i18n.t('commons.input_name'))) + return + } let hasRepeatName = false - this.form.apiConfiguration.forEach((item) => { - if ( - item.name === this.apiItem.name && + this.form.apiConfiguration.forEach((item) => { + if ( + item.name === this.apiItem.name && item.serialNumber !== this.apiItem.serialNumber - ) { - hasRepeatName = true - } - }) - if (hasRepeatName) { - callback(new Error(i18n.t('theme.name_repeat'))); - return + ) { + hasRepeatName = true } - callback(); + }) + if (hasRepeatName) { + callback(new Error(i18n.t('theme.name_repeat'))) + return + } + callback() }, next() { if (this.active === 1) { From fe84c366d4b85ff990d9137644a212b9841edf07 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 30 Sep 2022 12:09:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0):?= =?UTF-8?q?=20=E3=80=90=E6=95=B0=E6=8D=AE=E9=9B=86=E3=80=91=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=A2=9E=E9=87=8F=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=90=8E=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E5=B0=B1=E6=B2=A1=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/dataset/data/UpdateInfo.vue | 31 +- .../src/views/system/task/DatasetTaskList.vue | 18 +- frontend/src/views/system/task/form.vue | 381 +++++++++--------- 3 files changed, 217 insertions(+), 213 deletions(-) diff --git a/frontend/src/views/dataset/data/UpdateInfo.vue b/frontend/src/views/dataset/data/UpdateInfo.vue index 36ff3c3348..495a6d8354 100644 --- a/frontend/src/views/dataset/data/UpdateInfo.vue +++ b/frontend/src/views/dataset/data/UpdateInfo.vue @@ -596,6 +596,7 @@ export default { handler() { if (hasDataPermission('manage', this.param.privileges)) { this.listTask() + this.getIncrementalConfig() } this.listTaskLog() }, @@ -792,19 +793,6 @@ export default { return false // !hasDataPermission('manage',task.privileges) }, - deleteTask(task) { - const options = { - title: '确定删除该任务吗?', - type: 'primary', - cb: () => { - post('/dataset/task/delete/' + task.id, null).then((response) => { - this.openMessageSuccess('commons.delete_success') - this.initSearch() - }) - } - } - this.handlerConfirm(options) - }, selectDataset(row) { this.disableForm = this.disableEdit(row) this.addTask(row) @@ -869,6 +857,23 @@ export default { } }) }, + getIncrementalConfig() { + post('/dataset/table/incrementalConfig', { tableId: this.table.id }).then(response => { + this.incrementalConfig = response.data + if (this.incrementalConfig.incrementalAdd.length === 0 && this.incrementalConfig.incrementalDelete.length === 0) { + this.incrementalUpdateType = 'incrementalAdd' + this.sql = '' + return + } + if (this.incrementalConfig.incrementalAdd.length > 0) { + this.incrementalUpdateType = 'incrementalAdd' + this.sql = this.incrementalConfig.incrementalAdd + } else { + this.incrementalUpdateType = 'incrementalDelete' + this.sql = this.incrementalConfig.incrementalDelete + } + }) + }, deleteTask(task) { this.$confirm( this.$t('dataset.confirm_delete'), diff --git a/frontend/src/views/system/task/DatasetTaskList.vue b/frontend/src/views/system/task/DatasetTaskList.vue index 1d49e08350..8f06ec7d61 100644 --- a/frontend/src/views/system/task/DatasetTaskList.vue +++ b/frontend/src/views/system/task/DatasetTaskList.vue @@ -163,10 +163,10 @@ {{ - $t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`) - }} - + >{{ + $t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`) + }} + - @@ -202,8 +202,9 @@ :label="$t('dataset.task.task_status')" > @@ -589,12 +590,13 @@ export default { }, selectDataset(row) { if (row) { - const { datasetName, id } = row + const { datasetName, id, tableId } = row this.$router.push({ path: '/task-ds-form', query: { datasetName, - id + id, + tableId } }) } else { diff --git a/frontend/src/views/system/task/form.vue b/frontend/src/views/system/task/form.vue index 4b038d7e76..b04ea26ef1 100644 --- a/frontend/src/views/system/task/form.vue +++ b/frontend/src/views/system/task/form.vue @@ -1,5 +1,5 @@ \ No newline at end of file +