Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
ferry_web
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jianan
ferry_web
Commits
d3891df8
Commit
d3891df8
authored
Nov 03, 2020
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix bug.
parent
d6ad63cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
6 deletions
+42
-6
src/components/VueFormMaking/components/GenerateFormItem.vue
+41
-5
src/components/VueFormMaking/components/componentsConfig.js
+1
-1
No files found.
src/components/VueFormMaking/components/GenerateFormItem.vue
View file @
d3891df8
...
...
@@ -265,7 +265,25 @@
</
template
>
<
template
v-if=
"widget.type=='file'"
>
<FileUpload
:element=
"widget"
/>
<el-upload
:action=
"widget.options.action"
:on-success=
"handleSuccess"
:on-preview=
"handlePreview"
:on-remove=
"handleRemove"
:before-remove=
"beforeRemove"
multiple
:limit=
"widget.options.length"
:headers=
"widget.options.headers"
:on-exceed=
"handleExceed"
:file-list=
"widget.options.defaultValue"
:disabled=
"widget.options.disabled"
:style=
"
{'width': widget.options.width}"
>
<div
v-if=
"!preview"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
{{
widget
.
options
.
tip
}}
</div>
</div>
</el-upload>
</
template
>
<
template
v-if=
"widget.type === 'editor'"
>
...
...
@@ -325,18 +343,17 @@
<
script
>
import
FmUpload
from
'./Upload'
import
FileUpload
from
'./Upload/file'
export
default
{
name
:
'GenetateFormItem'
,
components
:
{
FmUpload
,
FileUpload
FmUpload
},
/* eslint-disable */
props
:
[
'widget'
,
'models'
,
'rules'
,
'remote'
,
'data'
,
'disabled'
,
'preview'
,
'isLabel'
,
'subformIndex'
,
'subformModel'
],
data
()
{
return
{
currentRemoveUid
:
''
,
widgetLabelWidth
:
''
,
dataModel
:
this
.
subformIndex
===
undefined
?
this
.
models
[
this
.
widget
.
model
]:
...
...
@@ -370,7 +387,7 @@ export default {
models
:
{
deep
:
true
,
handler
(
val
)
{
if
(
val
.
status
===
undefined
&&
val
.
status
===
null
)
{
if
(
val
.
status
===
undefined
||
val
.
status
===
null
)
{
if
(
this
.
subformIndex
===
undefined
)
{
this
.
dataModel
=
val
[
this
.
widget
.
model
]
}
else
{
...
...
@@ -414,6 +431,25 @@ export default {
}
},
methods
:
{
handleRemove
(
file
,
fileList
)
{
this
.
widget
.
options
.
defaultValue
=
fileList
},
handlePreview
(
file
)
{
window
.
open
(
file
.
url
,
'_blank'
)
},
handleExceed
(
files
,
fileList
)
{
this
.
$message
.
warning
(
`最多允许上传
${
this
.
widget
.
options
.
length
}
个文件。`
)
},
beforeRemove
(
file
,
fileList
)
{
this
.
currentRemoveUid
=
file
.
uid
return
this
.
$confirm
(
`确定要移除
${
file
.
name
}
?`
)
},
handleSuccess
(
response
,
file
,
fileList
)
{
// this.widget.options.defaultValue.push({
// name: file.name,
// url: response.data
// })
}
}
}
</
script
>
...
...
src/components/VueFormMaking/components/componentsConfig.js
View file @
d3891df8
...
...
@@ -321,7 +321,7 @@ export const advanceComponents = [
headers
:
{},
// isQiniu: false,
tip
:
''
,
// 提示说明
action
:
'http
s://jsonplaceholder.typicode.com/photos/
'
,
action
:
'http
://ipaddress:port/api/v1/public/uploadFile
'
,
labelWidth
:
100
,
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
...
...
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