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
f28e9536
Commit
f28e9536
authored
Sep 30, 2020
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加子表单功能。
parent
7a77a982
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
src/components/VueFormMaking/components/GenerateForm.vue
+6
-3
src/components/VueFormMaking/components/GenerateFormItem.vue
+16
-7
No files found.
src/components/VueFormMaking/components/GenerateForm.vue
View file @
f28e9536
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
:label=
"v.name"
:label=
"v.name"
min-width=
"250"
min-width=
"250"
>
>
<template>
<template
slot-scope=
"scope"
>
<genetate-form-item
<genetate-form-item
:preview=
"preview"
:preview=
"preview"
:models
.
sync=
"models"
:models
.
sync=
"models"
...
@@ -90,6 +90,8 @@
...
@@ -90,6 +90,8 @@
:data=
"data"
:data=
"data"
:disabled=
"disabled"
:disabled=
"disabled"
:is-label=
"false"
:is-label=
"false"
:subform-index=
"scope.$index"
:subform-model=
"item.model"
@
input-change=
"onSubformInputChange"
@
input-change=
"onSubformInputChange"
/>
/>
</
template
>
</
template
>
...
@@ -222,8 +224,9 @@ export default {
...
@@ -222,8 +224,9 @@ export default {
reset
()
{
reset
()
{
this
.
$refs
.
generateForm
.
resetFields
()
this
.
$refs
.
generateForm
.
resetFields
()
},
},
onSubformInputChange
(
value
,
field
)
{
onSubformInputChange
(
value
,
field
,
index
)
{
this
.
$emit
(
'on-change'
,
field
,
value
,
this
.
models
)
console
.
log
(
value
,
field
,
index
)
// this.$emit('on-change', field, value, this.models)
},
},
onInputChange
(
value
,
field
)
{
onInputChange
(
value
,
field
)
{
this
.
$emit
(
'on-change'
,
field
,
value
,
this
.
models
)
this
.
$emit
(
'on-change'
,
field
,
value
,
this
.
models
)
...
...
src/components/VueFormMaking/components/GenerateFormItem.vue
View file @
f28e9536
...
@@ -323,7 +323,7 @@ export default {
...
@@ -323,7 +323,7 @@ export default {
FileUpload
FileUpload
},
},
/* eslint-disable */
/* eslint-disable */
props
:
[
'widget'
,
'models'
,
'rules'
,
'remote'
,
'data'
,
'disabled'
,
'preview'
,
'isLabel'
],
props
:
[
'widget'
,
'models'
,
'rules'
,
'remote'
,
'data'
,
'disabled'
,
'preview'
,
'isLabel'
,
'subformIndex'
,
'subformModel'
],
data
()
{
data
()
{
return
{
return
{
widgetLabelWidth
:
''
,
widgetLabelWidth
:
''
,
...
@@ -335,12 +335,21 @@ export default {
...
@@ -335,12 +335,21 @@ export default {
dataModel
:
{
dataModel
:
{
deep
:
true
,
deep
:
true
,
handler
(
val
)
{
handler
(
val
)
{
this
.
models
[
this
.
widget
.
model
]
=
val
if
(
this
.
subformIndex
!==
undefined
)
{
this
.
$emit
(
'update:models'
,
{
this
.
models
[
this
.
subformModel
][
this
.
subformIndex
][
this
.
widget
.
model
]
=
val
...
this
.
models
,
this
.
$emit
(
'update:models'
,
{
[
this
.
widget
.
model
]:
val
...
this
.
models
[
this
.
subformModel
][
this
.
subformIndex
],
})
[
this
.
widget
.
model
]:
val
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
)
})
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
,
this
.
subformIndex
)
}
else
{
this
.
models
[
this
.
widget
.
model
]
=
val
this
.
$emit
(
'update:models'
,
{
...
this
.
models
,
[
this
.
widget
.
model
]:
val
})
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
)
}
}
}
},
},
models
:
{
models
:
{
...
...
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