Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-web
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
中汽研标准应用数据库
car-database-web
Commits
21e2858a
Commit
21e2858a
authored
Oct 16, 2024
by
jiaxu.yan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 上传组件修改
parent
3d3b3fdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
32 deletions
+55
-32
checkInputUpload.vue
src/components/CheckCoiumns/checkInputUpload.vue
+55
-32
No files found.
src/components/CheckCoiumns/checkInputUpload.vue
View file @
21e2858a
...
...
@@ -23,37 +23,54 @@
@
input=
"input"
>
</el-input>
<div
style=
"width: 20rem; display: inline-block; vertical-align: middle"
>
{{
i
.
object
}}
</div>
<el-upload
class=
"upload-demo"
ref=
"fileUpload"
:action=
"uploadImgUrl"
:on-preview=
"handlePreview"
v-model=
"i.file"
:on-remove=
"handleRemove"
accept=
".pdf ,.doc ,.docx ,.xls, .xlsx"
:before-remove=
"beforeRemove"
:show-file-list=
"false"
:limit=
"1"
:on-success=
"
res =>
{
handleSuccess(res, i)
}
"
:on-exceed="handleExceed"
:headers="headers"
>、
<!--
<el-button
size=
"small"
v-if=
"i.path"
v-loading=
"loading"
:disabled=
"status"
type=
"primary"
>
{{
i
.
file_name
}}
</el-button
>
-->
<el-button
size=
"small"
v-loading=
"loading"
:disabled=
"status"
type=
"primary"
>
上传文件
</el-button
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
<div
v-if=
"i.path"
>
<el-link
:href=
"i.path"
>
{{
i
.
file_name
}}
</el-link>
</div>
</div>
</el-upload>
</div>
</div>
<el-upload
class=
"upload-demo"
ref=
"fileUpload"
:action=
"uploadImgUrl"
:on-preview=
"handlePreview"
v-model=
"model.file"
:on-remove=
"handleRemove"
accept=
".pdf"
:before-remove=
"beforeRemove"
:show-file-list=
"false"
:limit=
"1"
:on-success=
"handleSuccess"
:on-exceed=
"handleExceed"
:headers=
"headers"
>
<el-button
size=
"small"
:disabled=
"status"
type=
"primary"
>
上传文件
</el-button
>
<div
slot=
"tip"
class=
"el-upload__tip"
>
<div
v-if=
"model.path"
>
<el-link
:href=
"model.path"
>
{{
model
.
name
}}
</el-link>
</div>
</div>
</el-upload>
</div>
</
template
>
<
script
>
...
...
@@ -83,11 +100,9 @@ export default {
return
{
model
:
{
value
:
''
,
list
:
[],
file
:
''
,
path
:
''
,
name
:
''
list
:
[]
},
loading
:
false
,
headers
:
{
Authorization
:
'Bearer '
+
this
.
$store
.
getters
.
token
},
...
...
@@ -172,6 +187,9 @@ export default {
value
:
''
,
check
:
false
,
useCaseNo
:
i
.
useCaseNo
,
path
:
''
,
file
:
''
,
file_name
:
''
,
key
:
i
.
value
,
id
:
i
.
id
,
flag
:
i
.
flag
...
...
@@ -183,13 +201,18 @@ export default {
},
handlePreview
(
file
)
{
console
.
log
(
file
)
this
.
loading
=
true
},
handleSuccess
(
res
,
file
)
{
handleSuccess
(
res
,
item
)
{
console
.
log
(
res
,
item
)
if
(
res
.
code
===
200
)
{
this
.
model
.
path
=
process
.
env
.
VUE_APP_IMAGE_API
+
res
.
url
this
.
model
.
name
=
res
.
originalFilename
this
.
$refs
.
fileUpload
.
clearFiles
()
this
.
loading
=
false
// const item = this.model.list[k]
item
.
path
=
process
.
env
.
VUE_APP_IMAGE_API
+
res
.
url
item
.
file_name
=
res
.
originalFilename
this
.
$message
.
success
(
'上传成功'
)
this
.
$forceUpdate
()
}
else
{
this
.
$message
.
error
(
'error'
)
}
...
...
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