优化页面显示逻辑
parent
9120676301
commit
a646b06e1f
|
|
@ -271,7 +271,7 @@ watch(() => new_style.value.common_style, () => {
|
|||
}, {deep: true});
|
||||
|
||||
const swiper_bg_style = computed(() => {
|
||||
if (props.isNest) {
|
||||
if (!props.isCommonStyle) {
|
||||
return '';
|
||||
}
|
||||
const style = form.value?.carousel_list?.[actived_index.value]?.style;
|
||||
|
|
@ -292,7 +292,7 @@ const swiper_bg_style = computed(() => {
|
|||
});
|
||||
|
||||
const swiper_bg_img_style = computed(() => {
|
||||
if (props.isNest) {
|
||||
if (!props.isCommonStyle) {
|
||||
return '';
|
||||
}
|
||||
const { carousel_img, style = {} } = form.value?.carousel_list[actived_index.value] || {};
|
||||
|
|
@ -321,7 +321,7 @@ const slideChange = (swiper: { realIndex: number }) => {
|
|||
} else {
|
||||
actived_index.value = swiper.realIndex;
|
||||
}
|
||||
if (props.isNest) {
|
||||
if (!props.isCommonStyle) {
|
||||
emit('slideChange', actived_index.value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
<el-radio value="customer_service">客服入口</el-radio>
|
||||
<el-radio value="quick_nav">快捷导航</el-radio>
|
||||
<el-radio value="lang">多语言</el-radio>
|
||||
<el-radio value="share">分享</el-radio>
|
||||
<el-radio value="gotop">回到顶部</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传图片">
|
||||
|
|
|
|||
|
|
@ -270,6 +270,40 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
const new_array_5 = ['custom', 'goods-magic'];
|
||||
// 导航组
|
||||
const new_array_6 = ['nav-group'];
|
||||
// 选项卡数据更新
|
||||
clone_form.tabs_data = clone_form.tabs_data.map((item: any) => {
|
||||
if (['tabs-magic'].includes(item.key)) {
|
||||
// 获取所有组件名称
|
||||
const all_type = ['hot_zone', 'custom', 'img_magic', 'goods_magic', 'goods_list', 'article_list', 'nav_group', 'video', 'carousel'];
|
||||
// 将数据信息合并起来
|
||||
const new_data_list = [item.com_data.content.home_data, ...item.com_data.content.tabs_list];
|
||||
// 对整个数据进行处理
|
||||
new_data_list.forEach((item1: any) => {
|
||||
if (['goods-list', 'article-list'].includes(item1.magic_type)) {
|
||||
// 处理商品或者文章的数据
|
||||
goods_or_article_data_processing(item1[item1.magic_type], item1.magic_type == new_array_1[0], item1.magic_type);
|
||||
} else if (new_array_5.includes(item1.magic_type)) {
|
||||
// 自定义数据处理
|
||||
custom_data_processing(item1[item1.magic_type].content);
|
||||
}
|
||||
item = Object.keys(item1)
|
||||
.filter(key => !all_type.filter((item2: string) => item2 !== item1.magic_type).includes(key))
|
||||
.reduce((acc: Record<string, any>, key: string) => {
|
||||
acc[key] = item1[key];
|
||||
return acc;
|
||||
}, {});
|
||||
console.log(item);
|
||||
});
|
||||
// 处理完成之后拆分开
|
||||
item.home_data = new_data_list.length > 0 ? new_data_list[0] : null;
|
||||
item.tabs_list = new_data_list.slice(1, new_data_list.length);
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
show_tabs: '0',
|
||||
}
|
||||
});
|
||||
// 拖拽区域更新
|
||||
clone_form.diy_data = clone_form.diy_data.map((item: any) => {
|
||||
if (new_array_1.includes(item.key)) {
|
||||
// 商品或文章的数据处理
|
||||
|
|
@ -627,4 +661,4 @@ const get_id = () => {
|
|||
-ms-user-select: none; /* Internet Explorer/Edge */
|
||||
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Loading…
Reference in New Issue