Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
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
ximai
mes-ui
Commits
65619364
Commit
65619364
authored
Aug 30, 2024
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产版本上传文件对接接口
parent
c90a2aa3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
25 deletions
+60
-25
ProogingProcess.vue
...mes/pro/productionSolution/components/ProogingProcess.vue
+3
-2
uploadTuzhi.vue
...ews/mes/pro/productionSolution/components/uploadTuzhi.vue
+57
-23
No files found.
src/views/mes/pro/productionSolution/components/ProogingProcess.vue
View file @
65619364
...
@@ -187,7 +187,8 @@
...
@@ -187,7 +187,8 @@
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
<el-button
size=
"mini"
size=
"mini"
icon=
"el-icon-upload"
:icon=
"scope.row.drawingList && scope.row.drawingList.length > 0 ? 'el-icon-reading' : 'el-icon-upload'"
:title=
"scope.row.drawingList && scope.row.drawingList.length > 0 ? '查看文件' : '文件上传'"
@
click=
"openUploadDialog(scope.row, scope.$index)"
@
click=
"openUploadDialog(scope.row, scope.$index)"
>
>
</el-button>
</el-button>
...
@@ -628,7 +629,7 @@ export default {
...
@@ -628,7 +629,7 @@ export default {
this
.
tableData
[
this
.
currentRowIndex
].
processItemList
=
items
;
this
.
tableData
[
this
.
currentRowIndex
].
processItemList
=
items
;
},
},
updateItemUpload
(
items
)
{
updateItemUpload
(
items
)
{
// this.tableData[this.currentRowIndex].processItem
List = items;
this
.
tableData
[
this
.
currentRowIndex
].
drawing
List
=
items
;
},
},
openSetProd
(
row
,
idx
)
{
openSetProd
(
row
,
idx
)
{
this
.
currentRow
=
row
;
this
.
currentRow
=
row
;
...
...
src/views/mes/pro/productionSolution/components/uploadTuzhi.vue
View file @
65619364
...
@@ -11,29 +11,33 @@
...
@@ -11,29 +11,33 @@
<el-row>
<el-row>
<el-col
:span=
"3"
>
<el-col
:span=
"3"
>
<el-upload
<el-upload
class=
"
upload-demo
"
class=
"
tuzhi-upload
"
ref=
"upload"
ref=
"upload"
:action=
"baseURL + '/common/upload
Minio
'"
:action=
"baseURL + '/common/upload'"
:before-upload=
"handleBeforeUpload"
:before-upload=
"handleBeforeUpload"
:on-success=
"handleUploadSuccess"
:on-success=
"handleUploadSuccess"
:on-error=
"handleUploadError"
:on-error=
"handleUploadError"
name=
"file"
name=
"file"
:headers=
"headers"
multiple
:show-file-list=
"false"
>
:file-list=
"fileList"
:headers=
"headers"
>
<el-button
size=
"small"
type=
"primary"
:loading=
"loading"
>
选择文件上传
</el-button>
<el-button
size=
"small"
type=
"primary"
:loading=
"loading"
>
选择文件上传
</el-button>
</el-upload>
</el-upload>
</el-col>
</el-col>
</el-row>
</el-row>
<div
class=
"upload-list"
>
<div
class=
"upload-list"
>
<el-table
:data=
"
uploadl
ist"
>
<el-table
:data=
"
drawingL
ist"
>
<el-table-column
align=
"left"
label=
"名称"
width=
"
215"
prop=
"n
ame"
>
<el-table-column
align=
"left"
label=
"名称"
width=
"
315"
prop=
"fileOriginalN
ame"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<i
class=
"el-icon-document"
></i>
<div
@
click=
"openFilename"
>
{{
scope
.
row
.
name
}}
<i
class=
"el-icon-document"
></i>
{{
scope
.
row
.
fileOriginalName
}}
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
label=
"大小"
prop=
"size"
/>
<el-table-column
align=
"left"
label=
"大小"
prop=
"fileSize"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
>
<el-table-column
align=
"center"
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"delItem(scope.row, scope.$index)"
>
删除
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"delItem(scope.row, scope.$index)"
>
删除
</el-button>
...
@@ -56,7 +60,8 @@ export default {
...
@@ -56,7 +60,8 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
uploadlist
:
[{
name
:
'sadas'
,
url
:
'ads'
}],
drawingList
:
[],
fileList
:
[],
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
headers
:
{
headers
:
{
Authorization
:
"Bearer "
+
getToken
()
Authorization
:
"Bearer "
+
getToken
()
...
@@ -65,13 +70,22 @@ export default {
...
@@ -65,13 +70,22 @@ export default {
loading
:
false
loading
:
false
}
}
},
},
watch
:
{
process
(
val
)
{
if
(
val
&&
val
.
drawingList
&&
val
.
drawingList
.
length
>
0
)
{
this
.
drawingList
=
val
.
drawingList
}
else
{
this
.
drawingList
=
[]
}
}
},
created
(){
created
(){
},
},
methods
:
{
methods
:
{
openFilename
()
{},
beforeClose
(
done
)
{
beforeClose
(
done
)
{
// 更新父组件的processItemList
// 更新父组件的processItemList
this
.
$emit
(
"updateItem"
,
this
.
uploadl
ist
);
this
.
$emit
(
"updateItem"
,
this
.
drawingL
ist
);
done
();
done
();
},
},
handleBeforeUpload
(
file
)
{
handleBeforeUpload
(
file
)
{
...
@@ -86,18 +100,35 @@ export default {
...
@@ -86,18 +100,35 @@ export default {
// }
// }
},
},
delItem
(
item
,
index
)
{
delItem
(
item
,
index
)
{
this
.
uploadl
ist
.
splice
(
index
,
1
)
this
.
drawingL
ist
.
splice
(
index
,
1
)
},
},
handleUploadSuccess
(
res
,
file
)
{
handleUploadSuccess
(
res
,
file
,
fileList
)
{
this
.
loading
=
false
if
(
fileList
.
every
(
item
=>
item
.
status
==
'success'
))
{
// 如果上传成功
fileList
.
map
((
item
,
index
)
=>
{
if
(
res
.
code
==
200
)
{
/** 这时只需要push进带有response的数据就好 */
this
.
uploadlist
.
push
({
url
:
url
,
name
:
file
.
name
,
size
:
file
.
size
})
console
.
log
(
'item'
,
item
)
this
.
$message
.
success
(
"文件上传成功"
);
if
(
item
.
response
)
{
}
else
{
this
.
fileList
.
push
({
this
.
$message
.
error
(
"文件上传失败"
);
name
:
item
.
response
.
data
.
originalFilename
,
url
:
item
.
response
.
data
.
filePath
})
this
.
drawingList
.
push
({
filePath
:
item
.
response
.
data
.
filePath
,
fileOriginalName
:
item
.
response
.
data
.
originalFilename
,
fileSize
:
item
.
response
.
data
.
size
})
}
if
(
index
===
fileList
.
length
-
1
)
{
console
.
log
(
'清除'
)
this
.
$refs
.
upload
.
clearFiles
();
}
})
}
}
this
.
$refs
.
upload
.
clearFiles
();
// console.log('resresres', res, fileList)
this
.
loading
=
false
// // 如果上传成功
// if (res.code == 200) {
// this.$message.success("文件上传成功");
// } else {
// this.$message.error("文件上传失败");
// }
// this.$refs.upload.clearFiles();
},
},
handleUploadError
()
{
handleUploadError
()
{
this
.
loading
=
false
this
.
loading
=
false
...
@@ -106,8 +137,11 @@ export default {
...
@@ -106,8 +137,11 @@ export default {
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
>
.el-icon-document
{
.el-icon-document
{
color
:
#3578ff
;
color
:
#3578ff
;
}
}
.tuzhi-upload
.el-upload-list
{
display
:
none
!
important
;
}
</
style
>
</
style
>
\ No newline at end of file
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