mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 19:29:04 +08:00
perf: perf component
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
export { default as ImportExcel } from './src/ImportExcel.vue';
|
||||
export { default as ExportExcelModel } from './src/ExportExcelModel.vue';
|
||||
import ImportExcel from './src/ImportExcel.vue';
|
||||
import ExportExcelModel from './src/ExportExcelModel.vue';
|
||||
|
||||
import { withInstall } from '../util';
|
||||
|
||||
export * from './src/types';
|
||||
|
||||
export { jsonToSheetXlsx, aoaToSheetXlsx } from './src/Export2Excel';
|
||||
|
||||
export * from './src/types';
|
||||
export { ImportExcel, ExportExcelModel };
|
||||
|
||||
export default withInstall(ImportExcel, ExportExcelModel);
|
||||
|
@@ -1,14 +1,14 @@
|
||||
import xlsx from 'xlsx';
|
||||
import type { WorkBook } from 'xlsx';
|
||||
import type { JsonToSheet, AoAToSheet } from './types';
|
||||
// import { isObject } from '@/src/utils/is';
|
||||
|
||||
const { utils, writeFile } = xlsx;
|
||||
|
||||
const DEF_FILE_NAME = 'excel-list.xlsx';
|
||||
export function jsonToSheetXlsx<T = any>({
|
||||
data,
|
||||
header,
|
||||
filename = 'excel-list.xlsx',
|
||||
filename = DEF_FILE_NAME,
|
||||
json2sheetOpts = {},
|
||||
write2excelOpts = { bookType: 'xlsx' },
|
||||
}: JsonToSheet<T>) {
|
||||
@@ -34,7 +34,7 @@ export function jsonToSheetXlsx<T = any>({
|
||||
export function aoaToSheetXlsx<T = any>({
|
||||
data,
|
||||
header,
|
||||
filename = 'excel-list.xlsx',
|
||||
filename = DEF_FILE_NAME,
|
||||
write2excelOpts = { bookType: 'xlsx' },
|
||||
}: AoAToSheet<T>) {
|
||||
const arrData = [...data];
|
||||
|
@@ -72,7 +72,6 @@
|
||||
async function handleOk() {
|
||||
const res = (await validateFields()) as ExportModalResult;
|
||||
const { filename, bookType } = res;
|
||||
|
||||
emit('success', {
|
||||
filename: `${filename.split('.').shift()}.${bookType}`,
|
||||
bookType,
|
||||
|
Reference in New Issue
Block a user