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

Merge branch 'feat/v1.8' into 'master'

Feat/v1.8

See merge request !93
parents b60f711b 57c4b0c2
......@@ -105,4 +105,9 @@ export default {
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';
import ContextMenuMixin from '@editor/mixins/contextMenu.mixin';
import Upload from '../DynamicForm/component/Upload/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 Textarea from '../DynamicForm/component/Textarea/index.vue';
import Number from '../DynamicForm/component/Number/index.vue';
......@@ -12,7 +13,7 @@ import BackTopPicker from '../DynamicForm/component/BackTopPicker/index.vue';
import SwitchBtn from '../DynamicForm/component/SwitchBtn/index.vue';
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) {
@Getter('pageData') pageData;
@State(state => state.tenant.cartAndShareBtn) cartAndShareBtn;
......@@ -32,6 +33,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
type: 'ColorSelector'
}
];
baseConfigSchema: object[] = [
{
key: 'pageNeedLogin',
name: '是否登录',
type: 'SwitchBtn'
},
]; ,
titleSchema: object[] = [
{
key: 'titleBgColor',
......@@ -158,6 +166,13 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
formDefault: {}
}
];
floatModal: object[] = [
{
key: 'couponModal',
name: '优惠券弹窗',
type: 'CouponModalSelector'
},
];
// 这块用于让被污染的pageInfo的page.props返回shareOpenMethod
otherProps: object[] = [
{
......@@ -171,7 +186,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
},
];
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 })
......@@ -189,6 +204,7 @@ export default class DynamicPageForm extends Mixins(ContextMenuMixin) {
this.propsSchema.forEach(schame => {
this.$set(this.propsForm, schame.key, this.pageData?.props?.[schame.key]);
});
// console.log(this.propsForm);
}
@Watch('commonStyleForm', { immediate: true, deep: true })
......
......@@ -3,6 +3,12 @@
<h2>{{title}}</h2>
<Form class="dynamic-form-component" :label-width="80" :model="propsForm" @submit.native.prevent>
<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>
<template v-for="(item, index) in titleSchema">
<FormItem class="Df-component-formitem" :label="item.name" :key="'titleSchema_' + index">
......@@ -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" />
</FormItem>
</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 class="dynamic-form-component" :label-width="80" :model="commonStyleForm" @submit.native.prevent>
<h3>基础样式</h3>
......@@ -57,7 +69,7 @@
}
}
/deep/ .ivu-form-item-label {
font-size: 14px;
font-size: 12px;
}
/deep/ .ivu-input-number {
......
......@@ -114,6 +114,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
return;
}
}
// console.log({ pageInfo, pageData: this.pageData }, 0);
// return;
await this.savePageData({ pageInfo, pageData: this.pageData });
if (this.uuid) { await this.getPageDate({ pageId: this.uuid }); }
this.showSubmitPopup = false;
......
......@@ -95,11 +95,13 @@ export const defaultState = {
backgroundImage: '',
},
props: {
pageNeedLogin: false,
titleBgColor: '#fff',
titleUseUrl: false,
showPageBottomTip: true,
pageBottomTxt: '没有更多啦~',
pageBottomColor: '#333',
couponModal: [],
showBackTop: true,
btAttachVal: [
{
......
......@@ -18,7 +18,8 @@
"only-arrow-functions": false,
"interface-over-type-literal": false,
"ter-indent": [ true, 2],
"no-var-requires": false
"no-var-requires": false,
"triple-equals": false
},
"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