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/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) { 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')" > - {{ $t(`dataset.task.${scope.row.status.toLocaleLowerCase()}`) }} + {{ $t(`dataset.task.${scope.row.status.toLocaleLowerCase()}`) }} @@ -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 @@ - + - {{ $t("dataset.add_scope") }} + {{ $t("dataset.add_scope") }} - + {{ $t("dataset.last_update_time") }} + >{{ $t("dataset.last_update_time") }} {{ $t("dataset.current_update_time") }} + >{{ $t("dataset.current_update_time") }} @@ -102,7 +99,7 @@ }} - + + /> - + /> @@ -210,30 +206,30 @@ \ No newline at end of file +