Merge pull request #6990 from dataease/pr@dev-v2@fixDatasource

fix: API 数据源更新数据
This commit is contained in:
taojinlong 2023-12-04 02:23:18 -06:00 committed by GitHub
commit 7669f6c8c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 16 deletions

View File

@ -121,7 +121,7 @@ const initForm = type => {
updateType: 'all_scope',
syncRate: 'SIMPLE_CRON',
simpleCronValue: '1',
simpleCronType: 'hour',
simpleCronType: 'minute',
startTime: '',
endTime: '',
endLimit: '0',
@ -363,6 +363,7 @@ const onRateChange = () => {
}
if (form.value.syncSetting.syncRate === 'SIMPLE_CRON') {
form.value.syncSetting.cron = '0 0 0/1 * * ? *'
form.value.syncSetting.simpleCronType = 'minute'
}
if (form.value.syncSetting.syncRate === 'CRON') {
form.value.syncSetting.cron = '00 00 * ? * * *'

View File

@ -42,7 +42,7 @@ const { t } = useI18n()
const creatDsFolder = ref()
const router = useRouter()
const { wsCache } = useCache()
const dsLoading = ref(false)
const state = reactive({
datasourceTree: []
})
@ -394,21 +394,37 @@ const saveDS = () => {
if (res) {
ElMessageBox.confirm(t('datasource.has_same_ds'), options as ElMessageBoxOptions).then(
() => {
save(request).then(res => {
if (res !== undefined) {
handleShowFinishPage({ id: res.id, name: res.name })
ElMessage.success('保存数据源成功')
}
})
if (dsLoading.value === true) {
return
}
dsLoading.value = true
save(request)
.then(res => {
if (res !== undefined) {
handleShowFinishPage({ id: res.id, name: res.name })
ElMessage.success('保存数据源成功')
}
})
.finally(() => {
dsLoading.value = false
})
}
)
} else {
save(request).then(res => {
if (res !== undefined) {
handleShowFinishPage({ id: res.id, name: res.name })
ElMessage.success('保存数据源成功')
}
})
if (dsLoading.value === true) {
return
}
dsLoading.value = true
save(request)
.then(res => {
if (res !== undefined) {
handleShowFinishPage({ id: res.id, name: res.name })
ElMessage.success('保存数据源成功')
}
})
.finally(() => {
dsLoading.value = false
})
}
})
} else {
@ -609,7 +625,7 @@ defineExpose({
</template>
</el-tree>
</div>
<div class="ds-editor" :class="editDs && 'edit-ds'">
<div class="ds-editor" :class="editDs && 'edit-ds'" v-loading="dsLoading">
<div v-show="activeStep !== 0 && !editDs" class="ds-type-title">
{{ typeTitle }}
</div>
@ -633,7 +649,7 @@ defineExpose({
</template>
</div>
</div>
<div class="editor-footer">
<div class="editor-footer" v-loading="dsLoading">
<el-button secondary @click="visible = false"> {{ t('common.cancel') }}</el-button>
<el-button
v-show="!(activeStep === 0 || (editDs && activeApiStep <= 1))"