fix: 数据源增加 loading 效果

This commit is contained in:
taojinlong 2024-09-02 16:43:34 +08:00
parent 3fcdd0cf7e
commit d571fa17c6
2 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,7 @@ const state = reactive({
})
const schemas = ref([])
const loading = ref(false)
const dsForm = ref<FormInstance>()
const cronEdit = ref(true)
@ -502,7 +503,9 @@ const getDsSchema = () => {
if (val) {
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'))
})
@ -722,6 +725,7 @@ defineExpose({
label-width="180px"
label-position="top"
require-asterisk-position="right"
v-loading="loading"
>
<el-form-item
:label="t('auth.datasource') + t('chart.name')"

View File

@ -361,7 +361,9 @@ 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 }>