1
0
mirror of synced 2025-12-08 06:26:45 +08:00

update ts

This commit is contained in:
xuliangzhan
2020-11-16 10:00:29 +08:00
parent 91b3dc45c4
commit d02d5054f5
4 changed files with 32 additions and 43 deletions

View File

@@ -7,19 +7,14 @@ const replace = require('gulp-replace')
const sourcemaps = require('gulp-sourcemaps')
const ts = require('gulp-typescript')
const pack = require('./package.json')
const tsconfig = require('./tsconfig.json')
const exportModuleName = 'VXETablePluginExportXLSX'
gulp.task('build_commonjs', function () {
return gulp.src(['index.d.ts', 'depend.ts', 'index.ts'])
.pipe(sourcemaps.init())
.pipe(ts({
strict: true,
moduleResolution: 'node',
noImplicitAny: true,
target: 'es6',
lib: ['dom', 'es6']
}))
.pipe(ts(tsconfig.compilerOptions))
.pipe(babel({
presets: ['@babel/env']
}))
@@ -33,13 +28,7 @@ gulp.task('build_commonjs', function () {
gulp.task('build_umd', function () {
return gulp.src(['index.d.ts', 'depend.ts', 'index.ts'])
.pipe(ts({
strict: true,
moduleResolution: 'node',
noImplicitAny: true,
target: 'es6',
lib: ['dom', 'es6']
}))
.pipe(ts(tsconfig.compilerOptions))
.pipe(replace(`import XEUtils from 'xe-utils/ctor';`, `import XEUtils from 'xe-utils';`))
.pipe(babel({
moduleId: pack.name,

View File

@@ -6,17 +6,17 @@ import {
InterceptorExportParams,
InterceptorImportParams,
ColumnConfig,
ExportOptons
TableExportConfig
} from 'vxe-table/lib/vxe-table'
import XLSX from 'xlsx'
/* eslint-enable no-unused-vars */
function getFooterCellValue ($table: Table, opts: ExportOptons, rows: any[], column: ColumnConfig) {
function getFooterCellValue ($table: Table, opts: TableExportConfig, rows: any[], column: ColumnConfig) {
const cellValue = rows[$table.$getColumnIndex(column)]
return cellValue
}
function getFooterData (opts: ExportOptons, footerData: any[][]) {
function getFooterData (opts: TableExportConfig, footerData: any[][]) {
const { footerFilterMethod } = opts
return footerFilterMethod ? footerData.filter((items, index) => footerFilterMethod({ items, $rowIndex: index })) : footerData
}
@@ -174,7 +174,7 @@ function exportXLSX (params: InterceptorExportParams) {
}
}
function downloadFile (params: InterceptorExportParams, blob: Blob, options: ExportOptons) {
function downloadFile (params: InterceptorExportParams, blob: Blob, options: TableExportConfig) {
const { $table } = params
const { $vxe } = $table
const { modal, t } = $vxe

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table-plugin-export-xlsx",
"version": "2.0.5",
"version": "2.0.6",
"description": "基于 vxe-table 的表格插件,支持导出 xlsx 格式",
"scripts": {
"lib": "gulp build"
@@ -16,22 +16,22 @@
"style": "dist/style.css",
"typings": "index.ts",
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"@babel/runtime": "^7.4.4",
"@typescript-eslint/eslint-plugin": "^2.3.1",
"@typescript-eslint/parser": "^2.3.1",
"del": "^5.1.0",
"eslint": "^5.15.1",
"eslint-config-prettier": "^6.3.0",
"eslint-config-standard": "^12.0.0",
"@babel/core": "^7.12.3",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/runtime": "^7.12.5",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"del": "^6.0.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-standard": "^16.0.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.2",
"eslint-plugin-typescript": "^0.14.0",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
@@ -44,17 +44,16 @@
"gulp-sourcemaps": "^2.6.5",
"gulp-typescript": "^5.0.1",
"gulp-uglify": "^3.0.2",
"markdown-doctest": "^0.9.1",
"prettier": "^1.18.2",
"typescript": "^3.9.3",
"markdown-doctest": "^1.1.0",
"prettier": "^2.1.2",
"typescript": "^4.0.5",
"vue": "^2.6.12",
"vxe-table": "^2.9.25",
"xe-utils": "^2.7.13",
"vxe-table": "^2.10.0",
"xe-utils": "^3.0.1",
"xlsx": "^0.16.7"
},
"peerDependencies": {
"vxe-table": ">= 2.9.25",
"xlsx": ">= 0.16.0"
"vxe-table": ">= 2.9"
},
"repository": {
"type": "git",

View File

@@ -8,10 +8,11 @@
"strict": true,
"moduleResolution": "node",
"noImplicitAny": true,
"target": "es6",
"target": "esnext",
"lib": [
"esnext",
"dom",
"es6"
"dom.iterable"
]
}
}