Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sgaqgl-vue
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
李苏
sgaqgl-vue
Commits
8bb09a77
Commit
8bb09a77
authored
Jan 12, 2023
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
反馈上传文件
parent
9bff3ea6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
3 deletions
+61
-3
sbbymx.js
src/api/equipment/sbbymx.js
+9
-0
ckxmEdit.vue
src/views/equipment/sbbymx/ckxmEdit.vue
+52
-3
No files found.
src/api/equipment/sbbymx.js
View file @
8bb09a77
...
...
@@ -45,4 +45,13 @@ data: query||{}
})
}
/* 附件list */
export
function
attachmentList
(
query
)
{
return
request
({
url
:
'/aqgl/sbgl/sbbyjl/attachment/list'
,
method
:
'post'
,
data
:
query
||
{}
})
}
src/views/equipment/sbbymx/ckxmEdit.vue
View file @
8bb09a77
...
...
@@ -30,6 +30,29 @@
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
style=
'padding-left: 120px;padding-bottom: 20px;'
>
<!-- 附件-->
<el-upload
:on-success=
"success"
:data=
"
{groupid:null}"
:headers='headers'
class="upload-demo"
:action="action"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
multiple
:limit="6"
:on-exceed="handleExceed"
:file-list="fileList">
<el-button
size=
"mini"
type=
"primary"
>
点击上传
</el-button>
</el-upload>
</el-col>
</el-row>
<!--
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"上次保养记录ID"
ref=
"scbyjlid"
prop=
"scbyjlid"
>
...
...
@@ -45,8 +68,8 @@
</div>
</DefaultDialog>
</
template
>
<
script
>
const
baseurl
=
process
.
env
.
VUE_APP_BASE_API
/* 引入需要的接口*/
import
{
doQuery
,
...
...
@@ -55,7 +78,8 @@
// doDelete
}
from
'@/api/equipment/sbbyjl.js'
;
import
{
doSave
doSave
,
attachmentList
}
from
"@/api/equipment/sbbymx.js"
/* edit页面*/
import
{
...
...
@@ -72,7 +96,12 @@ props:['app'],
},
data
()
{
return
{
readonly
:
false
,
fileList
:[],
headers
:{
Gtoken
:
sessionStorage
.
getItem
(
'Gtoken'
)},
action
:
baseurl
+
'/aqgl/sbgl/sbbyjl/attachment/upload'
,
form
:
{
//ID
id
:
''
,
//设备ID
...
...
@@ -91,7 +120,26 @@ props:['app'],
}
},
methods
:
{
success
(
res
,
file
){
this
.
fileList
.
push
({
name
:
file
.
name
,
url
:
res
.
data
.
viewUrl
,
id
:
res
.
data
.
id
})
},
handleRemove
(
file
,
fileList
)
{
console
.
log
(
file
,
fileList
);
},
handlePreview
(
file
)
{
console
.
log
(
'点击上传列表'
,
file
,
this
.
fileList
);
},
handleExceed
(
files
,
fileList
)
{
this
.
$message
.
warning
(
`当前限制选择6个文件,本次选择了
${
files
.
length
}
个文件,共选择了
${
files
.
length
+
fileList
.
length
}
个文件`
);
},
beforeRemove
(
file
,
fileList
)
{
return
this
.
$confirm
(
`确定移除
${
file
.
name
}
?`
);
},
/* 基础查询*/
query
:
doQuery
,
/* treeQuery */
...
...
@@ -104,6 +152,7 @@ props:['app'],
},
save
(){
let
params
=
{
attachments
:
this
.
fileList
,
details
:[{
id
:
''
,
records
:[]}],
master
:{...
this
.
form
}
}
...
...
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