Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
807aa548
Commit
807aa548
authored
7 years ago
by
Pan
Browse files
Options
Downloads
Patches
Plain Diff
refine:rm duplicate code && split xlsx
parent
db61251d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build/webpack.prod.conf.js
+8
-0
8 additions, 0 deletions
build/webpack.prod.conf.js
src/vendor/Export2Excel.js
+2
-5
2 additions, 5 deletions
src/vendor/Export2Excel.js
with
10 additions
and
5 deletions
build/webpack.prod.conf.js
+
8
−
0
View file @
807aa548
...
...
@@ -95,6 +95,14 @@ var webpackConfig = merge(baseWebpackConfig, {
return
context
&&
(
context
.
indexOf
(
'
echarts
'
)
>=
0
||
context
.
indexOf
(
'
zrender
'
)
>=
0
);
}
}),
// split xlsx into its own file
new
webpack
.
optimize
.
CommonsChunkPlugin
({
async
:
'
xlsx
'
,
minChunks
(
module
)
{
var
context
=
module
.
context
;
return
context
&&
(
context
.
indexOf
(
'
xlsx
'
)
>=
0
);
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new
webpack
.
optimize
.
CommonsChunkPlugin
({
...
...
This diff is collapsed.
Click to expand it.
src/vendor/Export2Excel.js
+
2
−
5
View file @
807aa548
/* eslint-disable */
require
(
'
script-loader!file-saver
'
);
require
(
'
script-loader!vendor/Blob
'
);
require
(
'
script-loader!xlsx/dist/xlsx.core.min
'
);
import
XLSX
from
'
xlsx
'
function
generateArray
(
table
)
{
var
out
=
[];
var
rows
=
table
.
querySelectorAll
(
'
tr
'
);
...
...
@@ -93,7 +94,6 @@ function s2ab(s) {
export
function
export_table_to_excel
(
id
)
{
var
theTable
=
document
.
getElementById
(
id
);
console
.
log
(
'
a
'
)
var
oo
=
generateArray
(
theTable
);
var
ranges
=
oo
[
1
];
...
...
@@ -117,9 +117,6 @@ export function export_table_to_excel(id) {
saveAs
(
new
Blob
([
s2ab
(
wbout
)],
{
type
:
"
application/octet-stream
"
}),
"
test.xlsx
"
)
}
function
formatJson
(
jsonData
)
{
console
.
log
(
jsonData
)
}
export
function
export_json_to_excel
(
th
,
jsonData
,
defaultTitle
)
{
/* original data */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment