Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
4940dd40
Commit
4940dd40
authored
Oct 12, 2017
by
spiritree
Committed by
花裤衩
Oct 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:fix `undefined` bug in export excel
parent
91bd31e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Export2Excel.js
src/vendor/Export2Excel.js
+6
-2
No files found.
src/vendor/Export2Excel.js
View file @
4940dd40
...
@@ -128,8 +128,12 @@ export function export_json_to_excel(th, jsonData, defaultTitle) {
...
@@ -128,8 +128,12 @@ export function export_json_to_excel(th, jsonData, defaultTitle) {
/*设置worksheet每列的最大宽度*/
/*设置worksheet每列的最大宽度*/
const
colWidth
=
data
.
map
(
row
=>
row
.
map
(
val
=>
{
const
colWidth
=
data
.
map
(
row
=>
row
.
map
(
val
=>
{
/*判断是否为中文*/
/*先判断是否为null/undefined*/
if
(
val
.
toString
().
charCodeAt
(
0
)
>
255
)
{
if
(
val
==
null
)
{
return
{
'wch'
:
10
};
}
/*再判断是否为中文*/
else
if
(
val
.
toString
().
charCodeAt
(
0
)
>
255
)
{
return
{
'wch'
:
val
.
toString
().
length
*
2
};
return
{
'wch'
:
val
.
toString
().
length
*
2
};
}
else
{
}
else
{
return
{
'wch'
:
val
.
toString
().
length
};
return
{
'wch'
:
val
.
toString
().
length
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment