x-extends / vxe-table-plugin-export-xlsx Goto Github PK
View Code? Open in Web Editor NEW🔨 基于 vxe-table 的表格插件,支持导出 xlsx 格式
License: MIT License
🔨 基于 vxe-table 的表格插件,支持导出 xlsx 格式
License: MIT License
目前导出的excel只有默认的边框,很不明显,最好能支持配置,就不需要后期处理了
No response
No response
空格 字符 ‘ ’ 导出的时候部分数据改成0(200多条数据出现的问题)
(必填)这个需求解决了什么问题:
?
截图或在线链接:
?
建议的 API 是什么样的:
?
是否已有其他不错的替代方案:
?
https://codesandbox.io/s/vxe-table-3-x-vue-2-6-wen-ti-yan-shi-forked-8gf5lk
点击导出按钮,下载下来的 xlxs ,表尾数据不完整
使用了这个插件,
"vxe-table-plugin-export-xlsx": "2.2.6",
gridOptions: {
border: true,
toolbarConfig: {
export: true,
},
exportConfig: {
filename: "demo",
// 默认选中类型
type: "xlsx",
// 自定义类型
types: ["xlsx", "csv", "html", "xml", "txt"],
// mode: 'all',
useStyle: true,
isFooter: true,
isColgroup: true,
},
},
vxe-table v4 版本测试过了,没有这个问题,具体代码
我试着解决:
我修改了 vxe-table-plugin-export-xlsx 的 index.es6.js
发现
function getFooterCellValue($table, opts, rows, column) {
const cellValue = getCellLabel(column, rows[$table.getVMColumnIndex(column)]);
return cellValue;
}
将 getFooterCellValue 函数中的 getVMColumnIndex 换成 getVTColumnIndex 就解决了
表尾数据可以导出完整
window10
114.0.5735.91
2.7.0
3.6.17
比如某列是日期格式,导出模板,编辑后导入。
后端解析日期格式错误。将日期那列手动设置单元格式为日期,导入正常。
No response
No response
https://vxetable.cn/other4/#/table/plugin/exportXLSX
No response
mac
chrome
3.2.41
4.3.9
(必填)请填在线链接:
https://codesandbox.io/s/delicate-smoke-er6mh
(必填)请填写期望的结果:
编译不报错
(必填)请填写以下信息:
this.$refs.xTable.exportData这个方法的参数支持那些配置呢?有清晰点的文档吗
(必填)请填在线链接:
https://codesandbox.io/s/delicate-smoke-er6mh
(必填)请填写期望的结果:
编译不报错
(必填)请填写以下信息:
Is it possible to change font family and size ?
No response
No response
(必填)请填写问题描述或截图:
initSeqConfig(startIndex = 0) {
// 初始化序号配置项
let self = this
this.seqConfig = {
startIndex: 1, // 设置序号的起始值 number0
seqMethod({ row, $rowIndex, rowIndex, column, columnIndex, seq, $seq }) {
if (self.pagerConfigIn) {
return self.pagerConfig.pageSize * (self.pagerConfig.currentPage - 1) + seq
} else {
return $seq === '' || $seq === undefined ? seq : $seq + '.' + seq
}
}
}
}
导出时序号为NAN
(必填)请填在线链接:
无
(必填)请填写期望的结果:
测试修正bug
(必填)请填写以下信息:
导出表格的单元格合并、字体、颜色、背景、对齐、边框等,可以设置吗
No response
No response
(必填)请填写问题描述或截图:
?
utils.js?5ef4:38 [vxe-table] 不支持的参数 "export-config.types=xlsx,csv,html,xml,txt",可能为 "csv,html,xml,txt"
(必填)请填在线链接:
?
(必填)请填写期望的结果:
支持xlsx导出
(必填)请填写以下信息:
打包的时候报错...
error in /node_modules/vxe-table-plugin-export-xlsx/index.ts
ERROR in /node_modules/vxe-table-plugin-export-xlsx/index.ts
54:34 Argument of type '{ bookType: string | undefined; bookSST: false; type: "binary"; }' is not assignable to parameter of type 'WritingOptions'.
Types of property 'bookType' are incompatible.
Type 'string | undefined' is not assignable to type '"html" | "xlsx" | "xlsm" | "xlsb" | "xls" | "xla" | "biff8" | "biff5" | "biff2" | "xlml" | "ods" | "fods" | "csv" | "txt" | "sylk" | "dif" | "rtf" | "prn" | "eth" | undefined'.
Type 'string' is not assignable to type '"html" | "xlsx" | "xlsm" | "xlsb" | "xls" | "xla" | "biff8" | "biff5" | "biff2" | "xlml" | "ods" | "fods" | "csv" | "txt" | "sylk" | "dif" | "rtf" | "prn" | "eth" | undefined'.
52 | // 转换数据
53 | XLSX.utils.book_append_sheet(book, sheet, sheetName)
> 54 | const wbout = XLSX.write(book, { bookType: type, bookSST: false, type: 'binary' })
| ^
55 | const blob = new Blob([toBuffer(wbout)], { type: 'application/octet-stream' })
56 | // 保存导出
57 | downloadFile(blob, options)
ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
tsconfig.json
...
"exclude": [
"node_modules"
]
"vxe-table": "^2.8.30",
"vxe-table-plugin-export-xlsx": "^1.2.2",
"xe-utils": "^2.4.2",
"xlsx": "^0.15.6"
无
如果开启了虚拟滚动下使用导出,那么页面上虚拟滚动渲染出来的部分,导出到excel上是包含了<template #default>插槽效果的,但是如果没有渲染出来的部分,导出出来的内容不会携带<template #default>甚至会错位
No response
windows/macos
chromr 116.0.5845.187
2.6.11
3.7.5
(必填)请填写问题描述或截图:
?
(必填)请填在线链接:
?https://jsrun.net/PIWKp/edit
(必填)请填写期望的结果:
?希望在线运行的可以正常,目前项目需要参考 感谢
(必填)请填写以下信息:
table存在多级表头,但是导出excel的时候,只有一级表头,是怎么回事?
(必填)这个需求解决了什么问题:
this.$refs.xTable.exportData这个方法的参数支持哪些配置呢?有清晰的文档吗
截图或在线链接:
?
建议的 API 是什么样的:
?
是否已有其他不错的替代方案:
?
支持多个table导出到一个execl中,通过sheet表名区分每个table
No response
No response
无
数据中有以0开头的字符串,长度在6位,导出文件时,会默认存储为数字格式,导致数据丢失
No response
window 11
edge 103.0.1264.62 (正式版本) (64 位)
3.2.37
4.2.8
(必填)请填写问题描述或截图:
?因为没有设置导出数据保留两位小数的功能,所以我将数值设置cell-type="string",字符串形式导出。数据量少的时候,达到了保留两位小数效果,但是当数据量大的时候,依然无法保留两位小数。
(必填)请填在线链接:
?无
(必填)请填写期望的结果:
?支持支持数据类型的导出,能设置xlsx单元格格式,保留两位小数。
(必填)请填写以下信息:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.