fix: 新建同步任务时数据集无数据无需提示“请先完成数据同步”

This commit is contained in:
taojinlong 2022-05-25 20:24:29 +08:00
parent 8d517f450d
commit 8f33d3779e
4 changed files with 14 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import io.dataease.plugins.common.dto.datasource.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ -38,4 +39,5 @@ public class DataSetTableRequest extends DatasetTable {
private List<ExcelSheetData> sheets;
@ApiModelProperty("是否合并sheet")
private boolean mergeSheet = false;
private boolean previewForTask = false;
}

View File

@ -581,7 +581,11 @@ public class DataSetTableService {
} else {
// check doris table
if (!checkEngineTableIsExists(dataSetTableRequest.getId())) {
throw new RuntimeException(Translator.get("i18n_data_not_sync"));
if(dataSetTableRequest.isPreviewForTask()){
return map;
}else {
throw new RuntimeException(Translator.get("i18n_data_not_sync"));
}
}
Datasource ds = engineService.getDeEngine();
JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class);

View File

@ -50,6 +50,11 @@ export default {
required: false,
default: null
},
previewForTask: {
type: Boolean,
required: false,
default: false
},
clearEmptyDir: {
type: Boolean,
required: false,
@ -77,6 +82,7 @@ export default {
// this.table = table
table && table.id && getTable(table.id).then(response => {
this.table = response.data
this.table.previewForTask = this.previewForTask
this.$emit('getTable', this.table)
}).catch(res => {
this.table = {}

View File

@ -168,7 +168,7 @@
<!--添加任务-选择数据集-->
<el-dialog v-dialogDrag :title="$t('dataset.task.create')" :visible="selectDatasetFlag" :show-close="false" width="70%" class="dialog-css" :destroy-on-close="true">
<table-selector privileges="manage" :mode="1" :clear-empty-dir="true" :custom-type="customType" show-mode="datasetTask" @getTable="getTable" />
<table-selector previewForTask="true" privileges="manage" :mode="1" :clear-empty-dir="true" :custom-type="customType" show-mode="datasetTask" @getTable="getTable" />
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="closeCreateTask">{{ $t('chart.cancel') }}</el-button>
<el-button type="primary" size="small" :disabled="!table.id" @click="create(undefined)">{{ $t('chart.confirm') }}</el-button>