Commit 216b9593 authored by 郭志伟's avatar 郭志伟

fix(componentSelect): 修改商品选择

parent 6d4b3b9b
......@@ -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,14 @@ 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);
}
}
......
......@@ -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)" :options="item.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>
......@@ -27,6 +27,7 @@
ColorSelector
},
props: {
limitName: String,
value: {
type: Array,
default: () => []
......
......@@ -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>
......
......@@ -1491,9 +1491,9 @@
"integrity": "sha512-uOCUKu5mvX3PWee+7ZFXQSNIR1V5SN2JVE2yANmW9/wQOgpEct291gXGok8VMw0009HlTWB4JATURPwyOP2DFg=="
},
"@qg/cherry-ui": {
"version": "2.23.6",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-2.23.6.tgz",
"integrity": "sha512-jKv/DMHaaQyba/yR3LUdY1lVhkLjcv9hb5o5ri/jb3Xhi7mglhdAeCEFmYyyKu1QXLbGZQdGKuYsfz5o87SJcQ==",
"version": "2.23.7",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-2.23.7.tgz",
"integrity": "sha512-ZQ5valaspUkQfyUzoj7nzGqGW287NkK5WH7BB1q5LIb3kAaL/1YSF5J1j8Azn8aqtHq/xNqYMFIfb8YBsq00nw==",
"requires": {
"@popperjs/core": "^2.5.4",
"vue-lazyload": "^1.3.3",
......@@ -1501,12 +1501,12 @@
}
},
"@qg/citrus-ui": {
"version": "0.2.28",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.2.28.tgz",
"integrity": "sha512-uW9D2e7bs2Otkvum6ph0c11CkY2kZMzJTHLIBK8Jq1VmGBhCjjWOsy+wVYLHfc82sy/WtJ93Jyt/y4MUAfHrQg==",
"version": "0.2.29",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.2.29.tgz",
"integrity": "sha512-inMPAWHzFvNZSCqotDVlKnONmeYps98yGRck5V3cV/1dAiScBhWovyvxXGAnfCk0dfmjcm/5Tpw4pmjt04Xjnw==",
"requires": {
"@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.6",
"@qg/cherry-ui": "^2.23.7",
"@qg/js-bridge": "^1.1.11",
"axios": "^0.21.1",
"intersection-observer": "^0.12.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment