Commit dfb82ffa authored by 徐光星's avatar 徐光星

Merge branch 'master' of git.quantgroup.cn:ui/quantum-blocks into feat/history

parents b54ea60a d65e988f
...@@ -105,4 +105,9 @@ export default { ...@@ -105,4 +105,9 @@ export default {
accessToken: true accessToken: true
}); });
}, },
getCouponModalList(params) {
return http.post(`${config.opapiHost}/kdspOp/api/kdsp/app/app-config-push/listAll`, params, {
accessToken: true
});
}
}; };
\ No newline at end of file
<template>
<div class="couponModalSeletor">
<Select v-model="modalId" filterable clearable multiple>
<Option v-for="item in list" :value="item.appConfigPushNo" :key="item.appConfigPushNo">{{ `id ${item.id} - ${item.name}` }}</Option>
</Select>
<!-- <Button type="primary" @click="save">保存</Button> -->
</div>
</template>
<script>
import operationApi from '@api/operation.api';
export default {
props: {
value: {
type: Array,
default: []
}
},
watch: {
value(val) {
this.modalId = val;
},
modalId(val) {
this.$emit('input', val);
}
},
components: {
},
data() {
return {
list: [],
modalId: []
}
},
created() {
this.modalId = this.value;
this.getCouponModalList();
},
methods: {
async getCouponModalList() {
const res = await operationApi.getCouponModalList({
elementType: 4, // 4为优惠券弹窗类型
enable: 'VALID'
});
const list = res.list.map(item => {
let obj = {};
obj.id = item.id.toString();
obj.appConfigPushNo = item.appConfigPushNo.toString();
obj.name = item.componentName;
return obj;
})
// console.log(list)
this.list = list;
}
}
}
</script>
<style scoped lang="less">
</style>
...@@ -4,6 +4,7 @@ import { reduce, ceil, subtract, divide, cloneDeep, assign } from 'lodash'; ...@@ -4,6 +4,7 @@ import { reduce, ceil, subtract, divide, cloneDeep, assign } from 'lodash';
import ContextMenuMixin from '@editor/mixins/contextMenu.mixin'; import ContextMenuMixin from '@editor/mixins/contextMenu.mixin';
import Upload from '../DynamicForm/component/Upload/index.vue'; import Upload from '../DynamicForm/component/Upload/index.vue';
import ColorSelector from '../DynamicForm/component/ColorSelector/index.vue'; import ColorSelector from '../DynamicForm/component/ColorSelector/index.vue';
import CouponModalSelector from '../DynamicForm/component/CouponModalSelector/index.vue'; // 用于选择优惠券弹窗
import BaseSelect from '../DynamicForm/component/BaseSelect/index.vue'; import BaseSelect from '../DynamicForm/component/BaseSelect/index.vue';
import Textarea from '../DynamicForm/component/Textarea/index.vue'; import Textarea from '../DynamicForm/component/Textarea/index.vue';
import Number from '../DynamicForm/component/Number/index.vue'; import Number from '../DynamicForm/component/Number/index.vue';
...@@ -12,7 +13,7 @@ import BackTopPicker from '../DynamicForm/component/BackTopPicker/index.vue'; ...@@ -12,7 +13,7 @@ import BackTopPicker from '../DynamicForm/component/BackTopPicker/index.vue';
import SwitchBtn from '../DynamicForm/component/SwitchBtn/index.vue'; import SwitchBtn from '../DynamicForm/component/SwitchBtn/index.vue';
import { SHOP_CART_CONFIG, DEFAULT_CONFIG } from '@service/staticData.service'; import { SHOP_CART_CONFIG, DEFAULT_CONFIG } from '@service/staticData.service';
@Component({ components: { Upload, ColorSelector, BaseSelect, Textarea, Number, FormList, BackTopPicker, SwitchBtn }, name: 'DynamicPageForm' }) @Component({ components: { Upload, ColorSelector, BaseSelect, Textarea, Number, FormList, BackTopPicker, SwitchBtn, CouponModalSelector }, name: 'DynamicPageForm' })
export default class DynamicPageForm extends Mixins(ContextMenuMixin) { export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
@Getter('pageData') pageData; @Getter('pageData') pageData;
@State(state => state.tenant.cartAndShareBtn) cartAndShareBtn; @State(state => state.tenant.cartAndShareBtn) cartAndShareBtn;
...@@ -32,6 +33,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) { ...@@ -32,6 +33,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
type: 'ColorSelector' type: 'ColorSelector'
} }
]; ];
baseConfigSchema: object[] = [
{
key: 'pageNeedLogin',
name: '是否登录',
type: 'SwitchBtn'
},
]; ,
titleSchema: object[] = [ titleSchema: object[] = [
{ {
key: 'titleBgColor', key: 'titleBgColor',
...@@ -158,6 +166,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) { ...@@ -158,6 +166,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
formDefault: {} formDefault: {}
} }
]; ];
floatModal: object[] = [
{
key: 'couponModal',
name: '优惠券弹窗',
type: 'CouponModalSelector'
},
];
// 这块用于让被污染的pageInfo的page.props返回shareOpenMethod // 这块用于让被污染的pageInfo的page.props返回shareOpenMethod
otherProps: object[] = [ otherProps: object[] = [
{ {
...@@ -171,7 +186,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) { ...@@ -171,7 +186,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
}, },
]; ];
get propsSchema() { get propsSchema() {
return [...this.titleSchema, ...this.bottomSchema, ...this.floatSchema, ...this.otherProps]; return [...this.titleSchema, ...this.bottomSchema, ...this.floatSchema, ...this.otherProps, ...this.floatModal, ...this.baseConfigSchema];
} }
@Watch('cartAndShareBtn', { immediate: true }) @Watch('cartAndShareBtn', { immediate: true })
...@@ -189,6 +204,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) { ...@@ -189,6 +204,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
this.propsSchema.forEach(schame => { this.propsSchema.forEach(schame => {
this.$set(this.propsForm, schame.key, this.pageData?.props?.[schame.key]); this.$set(this.propsForm, schame.key, this.pageData?.props?.[schame.key]);
}); });
// console.log(this.propsForm);
} }
@Watch('commonStyleForm', { immediate: true, deep: true }) @Watch('commonStyleForm', { immediate: true, deep: true })
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
<h2>{{title}}</h2> <h2>{{title}}</h2>
<Form class="dynamic-form-component" :label-width="80" :model="propsForm" @submit.native.prevent> <Form class="dynamic-form-component" :label-width="80" :model="propsForm" @submit.native.prevent>
<h3>基础属性</h3> <h3>基础属性</h3>
<h4>基础配置</h4>
<template v-for="(item, index) in baseConfigSchema">
<FormItem class="Df-component-formitem" :label="item.name" :key="'baseConfigSchema_' + index">
<component :is="item.type" :options="item.options" v-bind="item.props" v-model="propsForm[item.key]" :formControl="item.formControl" />
</FormItem>
</template>
<h4>标题栏</h4> <h4>标题栏</h4>
<template v-for="(item, index) in titleSchema"> <template v-for="(item, index) in titleSchema">
<FormItem class="Df-component-formitem" :label="item.name" :key="'titleSchema_' + index"> <FormItem class="Df-component-formitem" :label="item.name" :key="'titleSchema_' + index">
...@@ -21,6 +27,12 @@ ...@@ -21,6 +27,12 @@
<component :is="item.type" :options="item.options" v-bind="item.props" v-model="propsForm[item.key]" :formDefault="item.formDefault" :formControl="item.formControl" /> <component :is="item.type" :options="item.options" v-bind="item.props" v-model="propsForm[item.key]" :formDefault="item.formDefault" :formControl="item.formControl" />
</FormItem> </FormItem>
</template> </template>
<h4>弹窗</h4>
<template v-for="(item, index) in floatModal">
<FormItem class="Df-component-formitem" :label="item.name" :key="'floatModal_' + index">
<component :is="item.type" :options="item.options" v-bind="item.props" v-model="propsForm[item.key]" :formDefault="item.formDefault" :formControl="item.formControl" />
</FormItem>
</template>
</Form> </Form>
<Form class="dynamic-form-component" :label-width="80" :model="commonStyleForm" @submit.native.prevent> <Form class="dynamic-form-component" :label-width="80" :model="commonStyleForm" @submit.native.prevent>
<h3>基础样式</h3> <h3>基础样式</h3>
...@@ -57,7 +69,7 @@ ...@@ -57,7 +69,7 @@
} }
} }
/deep/ .ivu-form-item-label { /deep/ .ivu-form-item-label {
font-size: 14px; font-size: 12px;
} }
/deep/ .ivu-input-number { /deep/ .ivu-input-number {
......
...@@ -114,6 +114,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin, ...@@ -114,6 +114,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
return; return;
} }
} }
// console.log({ pageInfo, pageData: this.pageData }, 0);
// return;
await this.savePageData({ pageInfo, pageData: this.pageData }); await this.savePageData({ pageInfo, pageData: this.pageData });
if (this.uuid) { await this.getPageDate({ pageId: this.uuid }); } if (this.uuid) { await this.getPageDate({ pageId: this.uuid }); }
this.showSubmitPopup = false; this.showSubmitPopup = false;
......
...@@ -116,11 +116,13 @@ export const defaultState = { ...@@ -116,11 +116,13 @@ export const defaultState = {
backgroundImage: '', backgroundImage: '',
}, },
props: { props: {
pageNeedLogin: false,
titleBgColor: '#fff', titleBgColor: '#fff',
titleUseUrl: false, titleUseUrl: false,
showPageBottomTip: true, showPageBottomTip: true,
pageBottomTxt: '没有更多啦~', pageBottomTxt: '没有更多啦~',
pageBottomColor: '#333', pageBottomColor: '#333',
couponModal: [],
showBackTop: true, showBackTop: true,
btAttachVal: [ btAttachVal: [
{ {
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
"only-arrow-functions": false, "only-arrow-functions": false,
"interface-over-type-literal": false, "interface-over-type-literal": false,
"ter-indent": [ true, 2], "ter-indent": [ true, 2],
"no-var-requires": false "no-var-requires": false,
"triple-equals": false
}, },
"rulesDirectory": ["app"] "rulesDirectory": ["app"]
} }
\ No newline at end of file
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