Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
agcs2.0-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
liang
agcs2.0-web
Commits
3300a2a3
Commit
3300a2a3
authored
Feb 07, 2023
by
miaojiale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改上传组件的删除问题
2.修改上传组件
parent
98be2753
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
36 deletions
+63
-36
index.vue
src/components/FormComponents/CustomForm/index.vue
+1
-1
index.vue
src/components/Upload/index.vue
+45
-21
ConfigForms.vue
src/views/screening/components/ConfigForms.vue
+17
-14
No files found.
src/components/FormComponents/CustomForm/index.vue
View file @
3300a2a3
...
@@ -154,7 +154,7 @@ export default {
...
@@ -154,7 +154,7 @@ export default {
}
}
return
vwForm
return
vwForm
},
},
formId
:
""
,
//
formId: "",
}
}
},
},
data
()
{
data
()
{
...
...
src/components/Upload/index.vue
View file @
3300a2a3
<
template
>
<
template
>
<el-row
class=
"el-upload-self"
>
<el-row
class=
"el-upload-self"
>
<el-upload
<el-upload
ref=
"upload"
:multiple=
"multiple"
:multiple=
"multiple"
class=
"avatar-uploader"
class=
"avatar-uploader"
ref=
"upload"
:action=
"action"
:action=
"action"
:headers=
"headers"
:headers=
"headers"
:list-type=
"listType"
:list-type=
"listType"
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
:drag=
"drag"
:drag=
"drag"
:disabled=
"disabled"
:disabled=
"disabled"
>
>
<!-- :http-request="handleUpload" -->
<template
v-if=
"drag"
>
<template
v-if=
"drag"
>
<i
class=
"el-icon-upload"
></i>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
...
@@ -37,10 +38,10 @@
...
@@ -37,10 +38,10 @@
</el-upload>
</el-upload>
<el-image
<el-image
ref=
"image"
style=
"display: none"
style=
"display: none"
:src=
"imgUrl"
:src=
"imgUrl"
:preview-src-list=
"previewList"
:preview-src-list=
"previewList"
ref=
"image"
>
>
</el-image>
</el-image>
</el-row>
</el-row>
...
@@ -50,7 +51,7 @@
...
@@ -50,7 +51,7 @@
import
{
getAccessToken
}
from
"
@/utils/accessToken
"
import
{
getAccessToken
}
from
"
@/utils/accessToken
"
import
{
delFile
}
from
"
@/api/file
"
import
{
delFile
}
from
"
@/api/file
"
export
default
{
export
default
{
name
:
"
el-upload-s
elf
"
,
name
:
"
ElUploadS
elf
"
,
props
:
{
props
:
{
accept
:
{
type
:
String
,
default
:
"
image/*
"
},
accept
:
{
type
:
String
,
default
:
"
image/*
"
},
disabled
:
{
disabled
:
{
...
@@ -97,20 +98,6 @@ export default {
...
@@ -97,20 +98,6 @@ export default {
fileList
:
[],
fileList
:
[],
}
}
},
},
watch
:
{
value
:
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
===
oldValue
)
return
this
.
fileList
=
newValue
.
map
((
_
)
=>
{
return
{
name
:
_
.
file_name
,
url
:
`https://ds.cixincloud.com/geca-api/disease-data/file/info/
${
_
.
bucketName
}
/
${
_
.
uuidName
}
`
,
}
})
},
immediate
:
true
,
},
},
computed
:
{
computed
:
{
headers
()
{
headers
()
{
return
{
return
{
...
@@ -118,7 +105,10 @@ export default {
...
@@ -118,7 +105,10 @@ export default {
}
}
},
},
action
()
{
action
()
{
return
this
.
httpPrefix
+
`/cloud-upms/file/upload`
return
(
this
.
httpPrefix
+
`/disease-data/file/upload?formId=
${
this
.
uploadQuery
.
formId
}
&patientId=
${
this
.
uploadQuery
.
patientId
}
&prefix=
${
this
.
uploadQuery
.
prefix
}
`
)
},
},
// 预览list
// 预览list
previewList
()
{
previewList
()
{
...
@@ -131,7 +121,35 @@ export default {
...
@@ -131,7 +121,35 @@ export default {
})
})
},
},
},
},
watch
:
{
value
:
{
handler
(
newValue
,
oldValue
)
{
console
.
log
(
this
.
value
)
if
(
newValue
===
oldValue
)
return
this
.
fileList
=
newValue
.
map
((
_
)
=>
{
return
{
name
:
_
.
file_name
,
url
:
`https://ds.cixincloud.com/geca-api/disease-data/file/info/
${
_
.
bucketName
}
/
${
_
.
uuidName
}
`
,
}
})
},
immediate
:
true
,
},
},
methods
:
{
methods
:
{
// 自定义上传方法
// handleUpload(param) {
// let formData = new FormData()
// fd.append("file", param.file) //传文件
// fd.append("formld", this.formld) //传formld
// // ajax.axiosPost(
// // url, //接口地址
// // fd, //formdata对象参数
// // (res) => {
// // console.log(res)
// // }
// // )
// },
// 上传前回调
// 上传前回调
beforeUpload
(
file
)
{
beforeUpload
(
file
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
@@ -162,13 +180,19 @@ export default {
...
@@ -162,13 +180,19 @@ export default {
// 移除提醒
// 移除提醒
beforeRemove
(
file
,
fileList
)
{
beforeRemove
(
file
,
fileList
)
{
return
this
.
$confirm
(
`确定移除
${
file
.
file_name
||
file
.
name
}
?`
)
// console.log(file, fileList)
return
this
.
$confirm
(
`确定移除
${
file
.
file_name
||
file
.
name
||
"
该照片
"
}
?`
)
},
},
// 移除
// 移除
handleRemove
({
url
},
fileList
)
{
handleRemove
({
url
},
fileList
)
{
const
i
=
this
.
value
.
findIndex
((
_
)
=>
url
.
endsWith
(
_
.
uuid_name
))
let
arr
=
url
.
split
(
"
/
"
)
if
(
i
>
-
1
)
this
.
value
.
splice
(
i
,
1
)
// 静态移除
let
uuidName
=
arr
[
arr
.
length
-
1
]
const
i
=
this
.
value
.
findIndex
((
_
)
=>
uuidName
==
_
.
uuidName
)
if
(
i
>
-
1
)
this
.
value
.
splice
(
i
,
1
)
console
.
log
(
"
删了
"
,
this
.
value
)
},
},
// 查看
// 查看
...
...
src/views/screening/components/ConfigForms.vue
View file @
3300a2a3
...
@@ -157,7 +157,9 @@ export default {
...
@@ -157,7 +157,9 @@ export default {
if
(
val
==
"
index1
"
)
{
if
(
val
==
"
index1
"
)
{
// 第二步问卷调查
// 第二步问卷调查
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
let
{
birthday
}
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"
index1Data
"
))
let
index1Data
=
sessionStorage
.
getItem
(
"
index1Data
"
)
if
(
index1Data
)
{
let
{
birthday
}
=
JSON
.
parse
(
index1Data
)
let
date
=
new
Date
(
String
(
birthday
).
replace
(
/-/g
,
"
/
"
))
let
date
=
new
Date
(
String
(
birthday
).
replace
(
/-/g
,
"
/
"
))
let
d
=
new
Date
()
let
d
=
new
Date
()
let
age
=
let
age
=
...
@@ -172,6 +174,7 @@ export default {
...
@@ -172,6 +174,7 @@ export default {
birthday
,
birthday
,
age
,
age
,
}
}
}
})
})
}
else
{
}
else
{
this
.
formInitial
=
false
this
.
formInitial
=
false
...
...
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