Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
2160d748
authored
2023-07-28 15:00:53 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:文件上传功能的完善
1 parent
2239205b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
src/api/clxx.js
src/views/components/imagePreview.vue
src/api/clxx.js
View file @
2160d74
/*
* @Description: 材料信息
* @Autor: renchao
* @LastEditTime: 2023-0
5-16 14:04:42
* @LastEditTime: 2023-0
7-28 14:31:00
*/
import
request
from
'@/utils/request'
let
SERVER
=
window
.
config
?
window
.
config
:
JSON
.
parse
(
localStorage
.
getItem
(
'ApiUrl'
))
...
...
@@ -75,6 +75,22 @@ export function uploadSjClmx (data) {
}
/**
* @description: 上传duo个文件
* @param {*} data
* @author: renchao
*/
export
function
uploadBatch
(
data
)
{
return
request
({
url
:
SERVER
.
SERVERAPI
+
'/rest/ywbl/clxx/uploadBatch'
,
method
:
'post'
,
headers
:
{
'Content-Type'
:
'multipart/form-data'
},
data
})
}
/**
* @description: 删除上传文件
* @param {*} bsmClmx
* @author: renchao
...
...
src/views/components/imagePreview.vue
View file @
2160d74
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-28 14:
20:07
* @LastEditTime: 2023-07-28 14:
59:55
-->
<
template
>
<div
class=
"rlPopup"
>
...
...
@@ -50,7 +50,7 @@
<
script
>
import
PhotoZoom
from
'@/components/PhotoZoom'
import
{
getAltimeterInfo
,
getUuid
}
from
'@/utils/operation.js'
import
{
upload
SjClmx
,
deleteClmx
}
from
"@/api/clxx.js"
;
import
{
upload
Batch
,
deleteClmx
}
from
"@/api/clxx.js"
;
import
publicPicture
from
'@/components/publicPicture/index.vue'
export
default
{
name
:
'PreviewImage'
,
...
...
@@ -255,8 +255,9 @@
async
handleChange
(
file
,
fileList
)
{
let
length
=
fileList
.
length
;
this
.
maxFileLength
=
Math
.
max
(
length
,
this
.
maxFileLength
)
setTimeout
(()
=>
{
console
.
log
(
fileList
,
this
.
maxFileLength
,
'this.maxFileLength'
);
var
formData
=
new
FormData
();
setTimeout
(()
=>
{
if
(
this
.
maxFileLength
!==
length
)
{
return
}
...
...
@@ -265,13 +266,15 @@
})
formData
.
append
(
"bsmSj"
,
this
.
previewImg
.
bsmSj
);
formData
.
append
(
"bsmSlsq"
,
this
.
previewImg
.
bsmSlsq
);
upload
SjClmx
(
formData
).
then
((
res
)
=>
{
upload
Batch
(
formData
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
$emit
(
'updateList'
,
res
.
result
)
this
.
$message
({
message
:
'上传成功!'
,
type
:
'success'
})
this
.
$refs
.
upload
.
clearFiles
();
this
.
maxFileLength
=
0
}
})
},
0
)
...
...
Please
register
or
sign in
to post a comment