perf: 优化导入失败提示
This commit is contained in:
parent
0aa3f68f6d
commit
e6b7a868a2
@ -33,15 +33,23 @@ export const useFile = () => {
|
|||||||
negativeButtonProps: { type: 'info', ghost: false },
|
negativeButtonProps: { type: 'info', ghost: false },
|
||||||
// 新增
|
// 新增
|
||||||
onPositiveCallback: async () => {
|
onPositiveCallback: async () => {
|
||||||
fileData = JSON.parse(fileData)
|
try {
|
||||||
await updateComponent(fileData, false, true)
|
fileData = JSON.parse(fileData)
|
||||||
window['$message'].success('导入成功!')
|
await updateComponent(fileData, false, true)
|
||||||
|
window['$message'].success('导入成功!')
|
||||||
|
} catch (error) {
|
||||||
|
window['$message'].error('组件导入失败,请检查文件完整性!')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 覆盖
|
// 覆盖
|
||||||
onNegativeCallback: async () => {
|
onNegativeCallback: async () => {
|
||||||
fileData = JSON.parse(fileData)
|
try {
|
||||||
await updateComponent(fileData, true, true)
|
fileData = JSON.parse(fileData)
|
||||||
window['$message'].success('导入成功!')
|
await updateComponent(fileData, true, true)
|
||||||
|
window['$message'].success('导入成功!')
|
||||||
|
} catch (error) {
|
||||||
|
window['$message'].error('组件导入失败,请检查文件完整性!')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user