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

fix(componentSelect): 修改商品选择

parent 6d4b3b9b
...@@ -8,6 +8,7 @@ export default class DynamicForm extends Vue { ...@@ -8,6 +8,7 @@ export default class DynamicForm extends Vue {
@Getter('pageData') pageData; @Getter('pageData') pageData;
@Prop([String, Number]) value; @Prop([String, Number]) value;
@Prop(String) limitName;
selected: string = this.value; selected: string = this.value;
list: object[] = []; list: object[] = [];
...@@ -31,7 +32,14 @@ export default class DynamicForm extends Vue { ...@@ -31,7 +32,14 @@ export default class DynamicForm extends Vue {
updateOptions(val = this.curEleIndex) { updateOptions(val = this.curEleIndex) {
if (val || val === 0) { if (val || val === 0) {
const pointY = this.pageData?.elements[val]?.point?.y; 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); console.log('curEleIndex', pointY, this.pageData?.elements?.filter(v => pointY < v?.point?.y), this.list);
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<Form @submit.native.prevent :model="item" :label-width="50"> <Form @submit.native.prevent :model="item" :label-width="50">
<FormItem :prop="`${keywords.key}`" :label="keywords.name" :key="idx" v-for="(keywords, idx) in formControl"> <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> </FormItem>
</Form> </Form>
</Card> </Card>
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
ColorSelector ColorSelector
}, },
props: { props: {
limitName: String,
value: { value: {
type: Array, type: Array,
default: () => [] default: () => []
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<div v-if="item.title"> <div v-if="item.title">
<h3>{{ item.title }}</h3> <h3>{{ item.title }}</h3>
<FormItem :label="child.name" :key="curElement.id + child.key" v-for="child in item.children"> <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> </FormItem>
</div> </div>
<FormItem class="Df-component-formitem" v-else :label="item.name" > <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> </FormItem>
</template> </template>
</Form> </Form>
......
...@@ -1491,9 +1491,9 @@ ...@@ -1491,9 +1491,9 @@
"integrity": "sha512-uOCUKu5mvX3PWee+7ZFXQSNIR1V5SN2JVE2yANmW9/wQOgpEct291gXGok8VMw0009HlTWB4JATURPwyOP2DFg==" "integrity": "sha512-uOCUKu5mvX3PWee+7ZFXQSNIR1V5SN2JVE2yANmW9/wQOgpEct291gXGok8VMw0009HlTWB4JATURPwyOP2DFg=="
}, },
"@qg/cherry-ui": { "@qg/cherry-ui": {
"version": "2.23.6", "version": "2.23.7",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-2.23.6.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcherry-ui/-/cherry-ui-2.23.7.tgz",
"integrity": "sha512-jKv/DMHaaQyba/yR3LUdY1lVhkLjcv9hb5o5ri/jb3Xhi7mglhdAeCEFmYyyKu1QXLbGZQdGKuYsfz5o87SJcQ==", "integrity": "sha512-ZQ5valaspUkQfyUzoj7nzGqGW287NkK5WH7BB1q5LIb3kAaL/1YSF5J1j8Azn8aqtHq/xNqYMFIfb8YBsq00nw==",
"requires": { "requires": {
"@popperjs/core": "^2.5.4", "@popperjs/core": "^2.5.4",
"vue-lazyload": "^1.3.3", "vue-lazyload": "^1.3.3",
...@@ -1501,12 +1501,12 @@ ...@@ -1501,12 +1501,12 @@
} }
}, },
"@qg/citrus-ui": { "@qg/citrus-ui": {
"version": "0.2.28", "version": "0.2.29",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.2.28.tgz", "resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.2.29.tgz",
"integrity": "sha512-uW9D2e7bs2Otkvum6ph0c11CkY2kZMzJTHLIBK8Jq1VmGBhCjjWOsy+wVYLHfc82sy/WtJ93Jyt/y4MUAfHrQg==", "integrity": "sha512-inMPAWHzFvNZSCqotDVlKnONmeYps98yGRck5V3cV/1dAiScBhWovyvxXGAnfCk0dfmjcm/5Tpw4pmjt04Xjnw==",
"requires": { "requires": {
"@better-scroll/core": "^2.1.1", "@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.6", "@qg/cherry-ui": "^2.23.7",
"@qg/js-bridge": "^1.1.11", "@qg/js-bridge": "^1.1.11",
"axios": "^0.21.1", "axios": "^0.21.1",
"intersection-observer": "^0.12.0", "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