Merge pull request #12038 from dataease/pr@dev-v2_st

fix(数据源): 创建SQLServer不输入连接字符串提示异常后持续加载,无法恢复
This commit is contained in:
dataeaseShu 2024-09-05 11:19:36 +08:00 committed by GitHub
commit 4604864816
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 26 deletions

View File

@ -459,7 +459,12 @@ defineExpose({
class="setting-input"
:class="curComponent.timeGranularity === 'datetime' && 'with-date'"
>
<el-input-number v-model="curComponent.timeNum" :min="0" controls-position="right" />
<el-input-number
step-strictly
v-model="curComponent.timeNum"
:min="0"
controls-position="right"
/>
<el-select @focus="handleDialogClick" v-model="curComponent.relativeToCurrentType">
<el-option
v-for="item in relativeToCurrentTypeList"

View File

@ -504,11 +504,14 @@ const getDsSchema = () => {
const request = JSON.parse(JSON.stringify(form.value))
request.configuration = Base64.encode(JSON.stringify(request.configuration))
loading.value = true
getSchema(request).then(res => {
loading.value = false
schemas.value = res.data
ElMessage.success(t('commons.success'))
})
getSchema(request)
.then(res => {
schemas.value = res.data
ElMessage.success(t('commons.success'))
})
.finally(() => {
loading.value = false
})
}
})
}

View File

@ -362,30 +362,33 @@ const validateDS = () => {
const doValidateDs = request => {
dsLoading.value = true
validate(request).then(res => {
dsLoading.value = false
if (res.data.type === 'API') {
let error = 0
const status = JSON.parse(res.data.status) as Array<{ status: string; name: string }>
for (let i = 0; i < status.length; i++) {
if (status[i].status === 'Error') {
error++
}
for (let j = 0; j < form.apiConfiguration.length; j++) {
if (status[i].name === form.apiConfiguration[j].name) {
form.apiConfiguration[j].status = status[i].status
validate(request)
.then(res => {
if (res.data.type === 'API') {
let error = 0
const status = JSON.parse(res.data.status) as Array<{ status: string; name: string }>
for (let i = 0; i < status.length; i++) {
if (status[i].status === 'Error') {
error++
}
for (let j = 0; j < form.apiConfiguration.length; j++) {
if (status[i].name === form.apiConfiguration[j].name) {
form.apiConfiguration[j].status = status[i].status
}
}
}
}
if (error === 0) {
ElMessage.success(t('datasource.validate_success'))
if (error === 0) {
ElMessage.success(t('datasource.validate_success'))
} else {
ElMessage.error('校验失败')
}
} else {
ElMessage.error('校验失败')
ElMessage.success(t('datasource.validate_success'))
}
} else {
ElMessage.success(t('datasource.validate_success'))
}
})
})
.finally(() => {
dsLoading.value = false
})
}
const typeTitle = computed(() => {