Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
memberTag-web
Overview
Overview
Details
Activity
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
memberTag
memberTag-web
Commits
171b157a
Commit
171b157a
authored
May 23, 2019
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传表格时,添加文件格式限制
parent
2de1dac5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
manualTagEdit.vue
src/view/manualTag/manualTagEdit.vue
+11
-0
No files found.
src/view/manualTag/manualTagEdit.vue
View file @
171b157a
...
...
@@ -483,7 +483,17 @@ export default {
// 处理上传的表格
handleFileChange
(
e
)
{
const
files
=
e
.
target
.
files
[
0
];
// .xlsx, .xls, .csv
const
reg
=
/
(\.(
xlsx|xls|csv
))
$/
;
if
(
!
files
)
return
;
if
(
!
reg
.
test
(
files
.
name
))
{
this
.
$message
.
warning
({
duration
:
1000
,
message
:
'仅支持上传xlsx、xls、csv格式的文件'
});
e
.
target
.
value
=
''
;
return
;
}
this
.
importPop
.
excelName
=
files
.
name
;
const
reader
=
new
FileReader
();
reader
.
onload
=
e
=>
{
...
...
@@ -558,6 +568,7 @@ export default {
});
return
;
}
this
.
$refs
.
upload
.
value
=
''
;
const
para
=
{
tagItemId
:
this
.
importPop
.
tagItemId
,
data
:
JSON
.
stringify
(
this
.
importPop
.
excelData
)
...
...
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