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
83e8dfc4
Commit
83e8dfc4
authored
Jul 27, 2017
by
spiritree
Committed by
花裤衩
Jul 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix selectExcel bug
parent
77ff8230
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
selectExcel.vue
src/views/excel/selectExcel.vue
+16
-9
No files found.
src/views/excel/selectExcel.vue
View file @
83e8dfc4
...
@@ -66,15 +66,22 @@
...
@@ -66,15 +66,22 @@
this
.
multipleSelection
=
val
;
this
.
multipleSelection
=
val
;
},
},
handleDownload
()
{
handleDownload
()
{
require
.
ensure
([],
()
=>
{
if
(
this
.
multipleSelection
.
length
)
{
const
{
export_json_to_excel
}
=
require
(
'vendor/Export2Excel'
);
require
.
ensure
([],
()
=>
{
const
tHeader
=
[
'序号'
,
'文章标题'
,
'作者'
,
'阅读数'
,
'发布时间'
];
const
{
export_json_to_excel
}
=
require
(
'vendor/Export2Excel'
);
const
filterVal
=
[
'id'
,
'title'
,
'author'
,
'pageviews'
,
'display_time'
];
const
tHeader
=
[
'序号'
,
'文章标题'
,
'作者'
,
'阅读数'
,
'发布时间'
];
const
list
=
this
.
multipleSelection
;
const
filterVal
=
[
'id'
,
'title'
,
'author'
,
'pageviews'
,
'display_time'
];
const
data
=
this
.
formatJson
(
filterVal
,
list
);
const
list
=
this
.
multipleSelection
;
export_json_to_excel
(
tHeader
,
data
,
'列表excel'
);
const
data
=
this
.
formatJson
(
filterVal
,
list
);
this
.
$refs
.
multipleTable
.
clearSelection
();
export_json_to_excel
(
tHeader
,
data
,
'列表excel'
);
})
this
.
$refs
.
multipleTable
.
clearSelection
();
})
}
else
{
this
.
$message
({
message
:
'请选择一条或多条记录导出'
,
type
:
'warning'
});
}
},
},
formatJson
(
filterVal
,
jsonData
)
{
formatJson
(
filterVal
,
jsonData
)
{
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
v
[
j
]))
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
v
[
j
]))
...
...
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