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
f28e9536
Commit
f28e9536
authored
Sep 30, 2020
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加子表单功能。
parent
7a77a982
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
GenerateForm.vue
src/components/VueFormMaking/components/GenerateForm.vue
+6
-3
GenerateFormItem.vue
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,6 +335,14 @@ export default {
...
@@ -335,6 +335,14 @@ export default {
dataModel
:
{
dataModel
:
{
deep
:
true
,
deep
:
true
,
handler
(
val
)
{
handler
(
val
)
{
if
(
this
.
subformIndex
!==
undefined
)
{
this
.
models
[
this
.
subformModel
][
this
.
subformIndex
][
this
.
widget
.
model
]
=
val
this
.
$emit
(
'update:models'
,
{
...
this
.
models
[
this
.
subformModel
][
this
.
subformIndex
],
[
this
.
widget
.
model
]:
val
})
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
,
this
.
subformIndex
)
}
else
{
this
.
models
[
this
.
widget
.
model
]
=
val
this
.
models
[
this
.
widget
.
model
]
=
val
this
.
$emit
(
'update:models'
,
{
this
.
$emit
(
'update:models'
,
{
...
this
.
models
,
...
this
.
models
,
...
@@ -342,6 +350,7 @@ export default {
...
@@ -342,6 +350,7 @@ export default {
})
})
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
)
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
)
}
}
}
},
},
models
:
{
models
:
{
deep
:
true
,
deep
:
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