mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
perf: 优化导入失败提示
This commit is contained in:
parent
7e3efa46ee
commit
a5bf0e9f6a
@ -33,15 +33,23 @@ export const useFile = () => {
|
||||
negativeButtonProps: { type: 'info', ghost: false },
|
||||
// 新增
|
||||
onPositiveCallback: async () => {
|
||||
fileData = JSON.parse(fileData)
|
||||
await updateComponent(fileData, false, true)
|
||||
window['$message'].success('导入成功!')
|
||||
try {
|
||||
fileData = JSON.parse(fileData)
|
||||
await updateComponent(fileData, false, true)
|
||||
window['$message'].success('导入成功!')
|
||||
} catch (error) {
|
||||
window['$message'].error('组件导入失败,请检查文件完整性!')
|
||||
}
|
||||
},
|
||||
// 覆盖
|
||||
onNegativeCallback: async () => {
|
||||
fileData = JSON.parse(fileData)
|
||||
await updateComponent(fileData, true, true)
|
||||
window['$message'].success('导入成功!')
|
||||
try {
|
||||
fileData = JSON.parse(fileData)
|
||||
await updateComponent(fileData, true, true)
|
||||
window['$message'].success('导入成功!')
|
||||
} catch (error) {
|
||||
window['$message'].error('组件导入失败,请检查文件完整性!')
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user