Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
quantum-blocks
Commits
854ca5f2
Commit
854ca5f2
authored
Sep 17, 2021
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(componentSelect): 修改商品选择
parent
ade6bde9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
index.ts
.../component/DynamicForm/component/ComponentSelect/index.ts
+8
-1
index.vue
...editor/component/DynamicForm/component/FormList/index.vue
+6
-2
index.vue
app/web/page/editor/component/DynamicForm/index.vue
+2
-2
No files found.
app/web/page/editor/component/DynamicForm/component/ComponentSelect/index.ts
View file @
854ca5f2
...
...
@@ -8,6 +8,7 @@ export default class DynamicForm extends Vue {
@
Getter
(
'
pageData
'
)
pageData
;
@
Prop
([
String
,
Number
])
value
;
@
Prop
(
String
)
limitName
;
selected
:
string
=
this
.
value
;
list
:
object
[]
=
[];
...
...
@@ -31,7 +32,13 @@ export default class DynamicForm extends Vue {
updateOptions
(
val
=
this
.
curEleIndex
)
{
if
(
val
||
val
===
0
)
{
const
pointY
=
this
.
pageData
?.
elements
[
val
]?.
point
?.
y
;
this
.
list
=
this
.
pageData
?.
elements
?.
filter
(
v
=>
pointY
<
v
?.
point
?.
y
)?.
map
((
element
,
index
)
=>
({
id
:
element
.
id
,
label
:
element
.
title
+
'
-
'
+
element
.
id
}));
let
list
=
[];
if
(
this
.
limitName
)
{
list
=
this
.
pageData
?.
elements
?.
filter
(
v
=>
pointY
<
v
?.
point
?.
y
&&
v
?.
name
===
this
.
limitName
);
}
else
{
list
=
this
.
pageData
?.
elements
?.
filter
(
v
=>
pointY
<
v
?.
point
?.
y
);
}
this
.
list
=
list
.
map
((
element
,
index
)
=>
({
id
:
element
.
id
,
label
:
element
.
title
+
'
-
'
+
element
.
id
}));
console
.
log
(
'
curEleIndex
'
,
pointY
,
this
.
pageData
?.
elements
?.
filter
(
v
=>
pointY
<
v
?.
point
?.
y
),
this
.
list
);
}
}
...
...
app/web/page/editor/component/DynamicForm/component/FormList/index.vue
View file @
854ca5f2
...
...
@@ -7,7 +7,7 @@
</div>
<Form
@
submit
.
native
.
prevent
:model=
"item"
:label-width=
"50"
>
<FormItem
:prop=
"`$
{keywords.key}`" :label="keywords.name" :key="idx" v-for="(keywords, idx) in formControl">
<component
:is=
"getComponent(keywords.type)"
v-bind=
"keywords.props"
:options=
"keywords.options"
v-model=
"item[keywords.key]"
/>
<component
:is=
"getComponent(keywords.type)"
v-bind=
"keywords.props"
:
limit-name=
"limitName"
:
options=
"keywords.options"
v-model=
"item[keywords.key]"
/>
</FormItem>
</Form>
</Card>
...
...
@@ -19,7 +19,11 @@
<
script
>
import
FormList
from
'
../mixins/formList.mixin.ts
'
;
export
default
{
mixins
:
[
FormList
]
mixins
:
[
FormList
],
props
:
{
limitName
:
String
},
}
</
script
>
<
style
lang=
"less"
scoped
>
...
...
app/web/page/editor/component/DynamicForm/index.vue
View file @
854ca5f2
...
...
@@ -10,11 +10,11 @@
<
div
v
-
if
=
"
item.title
"
>
<
h3
>
{{
item
.
title
}}
<
/h3
>
<
FormItem
:
label
=
"
child.name
"
:
key
=
"
curElement.id + child.key
"
v
-
for
=
"
child in item.children
"
>
<
component
:
is
=
"
getComponent(child.type)
"
:
options
=
"
child.options
"
:
formControl
=
"
child.formControl
"
v
-
model
=
"
form[child.key]
"
/>
<
component
:
is
=
"
getComponent(child.type)
"
:
options
=
"
child.options
"
:
formControl
=
"
child.formControl
"
:
limit
-
name
=
"
child.type === 'FormList' && curElement.name === 'cs-goods-tabs' ? 'cs-goods' : ''
"
v
-
model
=
"
form[child.key]
"
/>
<
/FormItem
>
<
/div
>
<
FormItem
class
=
"
Df-component-formitem
"
v
-
else
:
label
=
"
item.name
"
>
<
component
:
is
=
"
getComponent(item.type)
"
:
options
=
"
item.options
"
:
formControl
=
"
item.formControl
"
v
-
model
=
"
form[item.key]
"
/>
<
component
:
is
=
"
getComponent(item.type)
"
:
options
=
"
item.options
"
:
formControl
=
"
item.formControl
"
:
limit
-
name
=
"
item.type === 'ComponentSelect' && curElement.name === 'cs-goods-tabs' ? 'cs-goods' : ''
"
v
-
model
=
"
form[item.key]
"
/>
<
/FormItem
>
<
/template
>
<
/Form
>
...
...
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