forked from github/dataease
fix: 修复API 数据源状态不一致的问题
This commit is contained in:
parent
c47389e3f7
commit
da24571330
@ -139,6 +139,7 @@ const dsTableDetail = reactive({
|
||||
name: ''
|
||||
})
|
||||
const rootManage = ref(false)
|
||||
const nodeData = ref({})
|
||||
const nickName = ref('')
|
||||
const dsName = ref('')
|
||||
const userDrawer = ref(false)
|
||||
@ -271,7 +272,8 @@ const handleLoadExcel = data => {
|
||||
}
|
||||
|
||||
const validateDS = () => {
|
||||
validateById(nodeInfo.id as number).then(res => {
|
||||
validateById(nodeInfo.id as number)
|
||||
.then(res => {
|
||||
if (res.data.type === 'API') {
|
||||
let error = 0
|
||||
const status = JSON.parse(res.data.status)
|
||||
@ -286,14 +288,20 @@ const validateDS = () => {
|
||||
}
|
||||
}
|
||||
if (error === 0) {
|
||||
nodeData.value.extraFlag = Math.abs(nodeData.value.extraFlag)
|
||||
ElMessage.success(t('data_source.verification_successful'))
|
||||
} else {
|
||||
nodeData.value.extraFlag = -Math.abs(nodeData.value.extraFlag)
|
||||
ElMessage.error(t('data_source.verification_failed'))
|
||||
}
|
||||
} else {
|
||||
nodeData.value.extraFlag = Math.abs(nodeData.value.extraFlag)
|
||||
ElMessage.success(t('data_source.verification_successful'))
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
nodeData.value.extraFlag = -Math.abs(nodeData.value.extraFlag)
|
||||
})
|
||||
}
|
||||
|
||||
const dialogErrorInfo = ref(false)
|
||||
@ -522,6 +530,7 @@ const sortTypeTip = computed(() => {
|
||||
const tableData = shallowRef([])
|
||||
const tabData = shallowRef([])
|
||||
const handleNodeClick = data => {
|
||||
nodeData.value = data
|
||||
if (!data.leaf) {
|
||||
dsListTree.value.setCurrentKey(null)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user