feat: update Excel template management and export handling
This commit is contained in:
@@ -55,3 +55,23 @@ export async function openJsonFile() {
|
||||
if (!handles.length) return null
|
||||
return handles[0].getFile()
|
||||
}
|
||||
|
||||
export async function openExcelFile() {
|
||||
if (!isOpenPickerSupported()) return null
|
||||
|
||||
const handles = await window.showOpenFilePicker({
|
||||
multiple: false,
|
||||
types: [
|
||||
{
|
||||
description: 'Excel 工作簿',
|
||||
accept: {
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['.xlsx'],
|
||||
'application/vnd.ms-excel': ['.xls']
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
if (!handles.length) return null
|
||||
return handles[0].getFile()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user