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
ba7cfd53
Commit
ba7cfd53
authored
Sep 30, 2020
by
YuleiLan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增子表单功能。
parent
f28e9536
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
22 deletions
+26
-22
GenerateForm.vue
src/components/VueFormMaking/components/GenerateForm.vue
+3
-6
GenerateFormItem.vue
src/components/VueFormMaking/components/GenerateFormItem.vue
+23
-16
No files found.
src/components/VueFormMaking/components/GenerateForm.vue
View file @
ba7cfd53
...
...
@@ -58,8 +58,10 @@
:data=
"models[item.model]"
border
style=
"width: 100%"
:header-cell-style=
"
{padding: '5px 0'}"
>
<el-table-column
v-if=
"!preview"
fixed
width=
"50"
>
...
...
@@ -92,7 +94,6 @@
:is-label=
"false"
:subform-index=
"scope.$index"
:subform-model=
"item.model"
@
input-change=
"onSubformInputChange"
/>
</
template
>
</el-table-column>
...
...
@@ -224,12 +225,8 @@ export default {
reset
()
{
this
.
$refs
.
generateForm
.
resetFields
()
},
onSubformInputChange
(
value
,
field
,
index
)
{
console
.
log
(
value
,
field
,
index
)
// this.$emit('on-change', field, value, this.models)
},
onInputChange
(
value
,
field
)
{
this
.
$emit
(
'on-change'
,
field
,
value
,
this
.
models
)
//
this.$emit('on-change', field, value, this.models)
},
refresh
()
{
...
...
src/components/VueFormMaking/components/GenerateFormItem.vue
View file @
ba7cfd53
...
...
@@ -3,6 +3,7 @@
:label-width=
"isLabel===false||!widget.options.labelWidthStatus?'0px': widgetLabelWidth + 'px'"
:label=
"isLabel===false||widget.type==='divider' || !widget.options.labelWidthStatus?'':widget.name"
:prop=
"widget.model"
:style=
"subformIndex !== undefined?
{'margin-bottom': '0'}: {}"
>
<template
v-if=
"preview"
>
<template
v-if=
"widget.type === 'color'"
>
...
...
@@ -327,7 +328,7 @@ export default {
data
()
{
return
{
widgetLabelWidth
:
''
,
dataModel
:
this
.
models
[
this
.
widget
.
model
],
dataModel
:
this
.
subformIndex
===
undefined
?
this
.
models
[
this
.
widget
.
model
]:
this
.
models
[
this
.
subformModel
][
this
.
subformIndex
]
[
this
.
widget
.
model
],
tableData
:
[]
}
},
...
...
@@ -335,11 +336,12 @@ export default {
dataModel
:
{
deep
:
true
,
handler
(
val
)
{
if
(
val
!==
undefined
)
{
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
.
models
,
[
this
.
subformModel
]:
this
.
models
[
this
.
subformModel
]
})
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
,
this
.
subformIndex
)
}
else
{
...
...
@@ -351,11 +353,16 @@ export default {
this
.
$emit
(
'input-change'
,
val
,
this
.
widget
.
model
)
}
}
}
},
models
:
{
deep
:
true
,
handler
(
val
)
{
if
(
this
.
subformIndex
===
undefined
)
{
this
.
dataModel
=
val
[
this
.
widget
.
model
]
}
else
{
this
.
dataModel
=
val
[
this
.
subformModel
][
this
.
subformIndex
][
this
.
widget
.
model
]
}
}
}
},
...
...
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