Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
d3891df8
Commit
d3891df8
authored
Nov 02, 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
GenerateFormItem.vue
src/components/VueFormMaking/components/GenerateFormItem.vue
+41
-5
componentsConfig.js
src/components/VueFormMaking/components/componentsConfig.js
+1
-1
No files found.
src/components/VueFormMaking/components/GenerateFormItem.vue
View file @
d3891df8
...
@@ -265,7 +265,25 @@
...
@@ -265,7 +265,25 @@
</
template
>
</
template
>
<
template
v-if=
"widget.type=='file'"
>
<
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
>
<
template
v-if=
"widget.type === 'editor'"
>
<
template
v-if=
"widget.type === 'editor'"
>
...
@@ -325,18 +343,17 @@
...
@@ -325,18 +343,17 @@
<
script
>
<
script
>
import
FmUpload
from
'./Upload'
import
FmUpload
from
'./Upload'
import
FileUpload
from
'./Upload/file'
export
default
{
export
default
{
name
:
'GenetateFormItem'
,
name
:
'GenetateFormItem'
,
components
:
{
components
:
{
FmUpload
,
FmUpload
FileUpload
},
},
/* eslint-disable */
/* eslint-disable */
props
:
[
'widget'
,
'models'
,
'rules'
,
'remote'
,
'data'
,
'disabled'
,
'preview'
,
'isLabel'
,
'subformIndex'
,
'subformModel'
],
props
:
[
'widget'
,
'models'
,
'rules'
,
'remote'
,
'data'
,
'disabled'
,
'preview'
,
'isLabel'
,
'subformIndex'
,
'subformModel'
],
data
()
{
data
()
{
return
{
return
{
currentRemoveUid
:
''
,
widgetLabelWidth
:
''
,
widgetLabelWidth
:
''
,
dataModel
:
this
.
subformIndex
===
undefined
?
dataModel
:
this
.
subformIndex
===
undefined
?
this
.
models
[
this
.
widget
.
model
]:
this
.
models
[
this
.
widget
.
model
]:
...
@@ -370,7 +387,7 @@ export default {
...
@@ -370,7 +387,7 @@ export default {
models
:
{
models
:
{
deep
:
true
,
deep
:
true
,
handler
(
val
)
{
handler
(
val
)
{
if
(
val
.
status
===
undefined
&&
val
.
status
===
null
)
{
if
(
val
.
status
===
undefined
||
val
.
status
===
null
)
{
if
(
this
.
subformIndex
===
undefined
)
{
if
(
this
.
subformIndex
===
undefined
)
{
this
.
dataModel
=
val
[
this
.
widget
.
model
]
this
.
dataModel
=
val
[
this
.
widget
.
model
]
}
else
{
}
else
{
...
@@ -414,6 +431,25 @@ export default {
...
@@ -414,6 +431,25 @@ export default {
}
}
},
},
methods
:
{
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
>
</
script
>
...
...
src/components/VueFormMaking/components/componentsConfig.js
View file @
d3891df8
...
@@ -321,7 +321,7 @@ export const advanceComponents = [
...
@@ -321,7 +321,7 @@ export const advanceComponents = [
headers
:
{},
headers
:
{},
// isQiniu: false,
// isQiniu: false,
tip
:
''
,
// 提示说明
tip
:
''
,
// 提示说明
action
:
'http
s://jsonplaceholder.typicode.com/photos/
'
,
action
:
'http
://ipaddress:port/api/v1/public/uploadFile
'
,
labelWidth
:
100
,
labelWidth
:
100
,
labelWidthDisabled
:
false
,
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
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