Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
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
周远喜
mes-ui
Commits
a51fe745
Commit
a51fe745
authored
Aug 27, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changeExcel
parent
51a0cf28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
119 deletions
+110
-119
detailExcel.vue
pages/import/detailExcel.vue
+35
-0
process.vue
pages/import/process.vue
+75
-119
No files found.
pages/import/detailExcel.vue
View file @
a51fe745
...
...
@@ -27,6 +27,8 @@ export default {
rows
:
10
,
placeholder
:
"请从Excel复制一段表格数据,粘贴在这里"
,
},
columnsImport
:
[],
excelData
:
[]
};
},
...
...
@@ -77,6 +79,39 @@ export default {
}
}
},
//粘贴excel成功
handleSuccess
(
tableData
)
{
//初始化数据
this
.
excelData
=
[];
this
.
excelDataBack
=
[];
this
.
columnsImport
=
[];
this
.
sheetNames
=
[];
this
.
pageType
=
undefined
;
//处理colum和data
let
tabColum
=
tableData
.
columns
let
tabData
=
tableData
.
data
let
arrData
=
[]
tabData
.
forEach
(
ele
=>
{
let
objData
=
{}
tabColum
.
forEach
(
el
=>
{
objData
[
el
.
title
]
=
ele
[
el
.
key
]
})
arrData
.
push
(
objData
)
})
//处理title和key一致
tabColum
.
forEach
(
el
=>
{
el
.
key
=
el
.
title
})
this
.
columnsImport
=
tabColum
;
this
.
excelData
=
arrData
;
this
.
excelDataBack
=
arrData
;
},
//粘贴excel失败
handleError
(
tableData
,
errorIndex
)
{
//console.log(tableData, errorIndex);
this
.
$Message
.
error
(
"表格数据有误"
);
},
//粘贴excel相关end
l
(
key
)
{
key
=
"import_center"
+
"."
+
key
;
return
this
.
$t
(
key
);
...
...
pages/import/process.vue
View file @
a51fe745
This diff is collapsed.
Click to expand it.
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