Merge pull request #7465 from dataease/pr@dev-v2_dzz

fix: 建议通过创建完上一个数据源后的继续创建操作的默认文件夹仍然保持为同一个
This commit is contained in:
dataeaseShu 2023-12-29 11:27:07 +08:00 committed by GitHub
commit 10f2eabc2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 16 deletions

View File

@ -107,7 +107,10 @@ const showAll = ref(true)
const datasource = ref()
const loading = ref(false)
const createDataset = ref(false)
const filterMethod = (value, data) => data.name.includes(value)
const filterMethod = (value, data) => {
if (!data) return false
data.name.includes(value)
}
const resetForm = () => {
createDataset.value = false
}
@ -277,7 +280,7 @@ const saveDataset = () => {
.then(res => {
if (res !== undefined) {
wsCache.set('ds-new-success', true)
emits('handleShowFinishPage', res)
emits('handleShowFinishPage', { ...res, pid: params.pid })
ElMessage.success('保存数据源成功')
successCb()
}
@ -292,7 +295,7 @@ const saveDataset = () => {
.then(res => {
if (res !== undefined) {
wsCache.set('ds-new-success', true)
emits('handleShowFinishPage', res)
emits('handleShowFinishPage', { ...res, pid: params.pid })
ElMessage.success('保存数据源成功')
successCb()
}

View File

@ -211,7 +211,14 @@ const next = () => {
}
const complete = (params, successCb, finallyCb) => {
excel.value.saveExcelDs(params, successCb, finallyCb)
excel.value.saveExcelDs(
params,
() => {
pid.value = params.pid
successCb()
},
finallyCb
)
return
}
@ -239,24 +246,29 @@ const continueCreating = () => {
init(null, pid.value)
}
const handleShowFinishPage = ({ id, name }) => {
isShowFinishPage().then(res => {
if (editDs.value || !res.data) {
emits('refresh')
visible.value = false
return
} else {
showFinishPage.value = true
Object.assign(dsInfo, { id, name })
}
})
const handleShowFinishPage = ({ id, name, pid }) => {
isShowFinishPage()
.then(res => {
if (editDs.value || !res.data) {
emits('refresh')
visible.value = false
return
} else {
showFinishPage.value = true
Object.assign(dsInfo, { id, name })
}
})
.finally(() => {
pid.value = pid
})
}
emitter.on('showFinishPage', handleShowFinishPage)
const prev = () => {
if (currentDsType.value === 'API' && activeApiStep.value === 2) {
activeApiStep.value = activeStep.value = 1
activeApiStep.value = 1
activeStep.value = 1
return
}