We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问 MaProTable 工具栏插件(ToolbarPlugin)有没有内置导出表格数据功能?比如导出为 .csv, .xlsx 等格式。🙏
The text was updated successfully, but these errors were encountered:
目前没有,可以自己添加,或者等后面官方开发插件
Sorry, something went wrong.
用到了导出xlsx,简单实现了一下,使用xlswriter
<template #toolbarLeft> <el-button v-auth="['trademark:order:delete']" type="danger" plain :disabled="selections.length < 1" @click="handleDelete" > {{ t('crud.delete') }} </el-button> <el-button v-auth="['trademark:order:export']" type="primary" plain @click="handleExport" > {{ t('biz.field.export') }} </el-button> </template>
// 搜索参数 const searchFormValues = ref({}) // 给MaProTable加一个search-submit <MaProTable ref="proTableRef" :options="options" :schema="schema" @search-submit="handleSearchSubmit"> // 搜索参数赋值 function handleSearchSubmit(form: Record<string, any>): void { searchFormValues.value = form }
function handleExport() { const response = exportFile(searchFormValues.value) response.then((res) => { if (!res || !(res instanceof Blob)) { msg.alertError('Export response invalid') return } const url = window.URL.createObjectURL(new Blob([res])) const link = document.createElement('a') link.href = url link.setAttribute('download', 'order.xlsx') document.body.appendChild(link) link.click() document.body.removeChild(link) }, err => msg.alertError(err), ).catch((err) => { msg.alertError(err) }) }
export function exportFile(data: TrademarkOrderSearchVo) { return useHttp().post('/admin/trademark-order/export', data, { responseType: 'blob', timeout: 3600, }) }
#[Post( path: '/admin/trademark-order/export', operationId: 'trademarkOrderExport', summary: 'Export Trademark Order', security: [['Bearer' => [], 'ApiKey' => []]], tags: ['Trademark Manage'] )] #[Permission(code: 'trademark:order:export')] public function export(Request $request, Response $response): ResponseInterface { [$filePath, $fileName] = $this->trademarkOrderService->export($request->all()); return $response->download($filePath, $fileName); }
No branches or pull requests
请问 MaProTable 工具栏插件(ToolbarPlugin)有没有内置导出表格数据功能?比如导出为 .csv, .xlsx 等格式。🙏
The text was updated successfully, but these errors were encountered: