数据选项卡文章信息处理
parent
a70ad338e3
commit
be17019f41
|
|
@ -0,0 +1,44 @@
|
|||
<template>
|
||||
<div class="data-tabs-style">
|
||||
<model-article-list-styles :value="form" :content="data" :default-config="defaultConfig" :is-common-style="false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
content: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
defaultConfig: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
// 图片不同风格下的圆角
|
||||
img_radius_0: 4,
|
||||
img_radius_1: 0,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
// 默认值
|
||||
const state = reactive({
|
||||
form: props.value,
|
||||
data: props.content,
|
||||
});
|
||||
// 如果需要解构,确保使用toRefs
|
||||
const { form, data } = toRefs(state);
|
||||
watch(() => props.value, (value) => {
|
||||
form.value = value;
|
||||
},{deep: true, immediate: true });
|
||||
|
||||
watch(() => props.content, (value) => {
|
||||
data.value = value;
|
||||
},{deep: true, immediate: true });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
<template>
|
||||
<card-container>
|
||||
<div class="mb-12">展示设置</div>
|
||||
<el-form-item label="选择风格">
|
||||
<el-radio-group v-model="form.theme" @change="theme_change">
|
||||
<el-radio v-for="item in base_list.theme_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.theme == '4'" label="轮播列数">
|
||||
<el-radio-group v-model="form.carousel_col">
|
||||
<el-radio v-for="item in base_list.carousel_col_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</card-container>
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">列表设置</div>
|
||||
<el-form-item label="是否显示">
|
||||
<el-checkbox-group v-model="form.field_show">
|
||||
<el-checkbox v-for="item in base_list.field_show_list" :key="item.value" :value="item.value">{{ item.name }}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.field_show.includes('2')" label="描述行数">
|
||||
<el-radio-group v-model="form.field_desc_row">
|
||||
<el-radio v-for="item in base_list.field_desc_row" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<template v-if="form.theme == '4'">
|
||||
<el-form-item label="标题浮起">
|
||||
<el-switch v-model="form.name_float" active-value="1" inactive-value="0" @change="switch_chage"></el-switch>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</card-container>
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">角标设置</div>
|
||||
<!-- 角标设置 -->
|
||||
<subscript-content :value="form"></subscript-content>
|
||||
</card-container>
|
||||
<div class="divider-line"></div>
|
||||
<!-- 数据筛选组件, 根据数据源类型显示不同的筛选组件 -->
|
||||
<data-filter type="article" :value="form" :list="form.data_list" :base-list="base_list" @add="add" @data_list_replace="data_list_replace" @data_list_remove="data_list_remove" @data_list_sort="data_list_sort"></data-filter>
|
||||
<url-value-dialog v-model:dialog-visible="url_value_dialog_visible" :type="['article']" :multiple="url_value_multiple_bool" @update:model-value="url_value_dialog_call_back"></url-value-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { get_math } from '@/utils';
|
||||
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
tabStyle: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
defaultConfig: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
// 图片不同风格下的圆角
|
||||
img_radius_0: 4,
|
||||
img_radius_1: 0,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const base_list = reactive({
|
||||
theme_list: [
|
||||
{ name: '单列展示', value: '0', width:110, height: 83 },
|
||||
{ name: '两列展示(纵向)', value: '1', width:180, height: 180 },
|
||||
{ name: '大图展示', value: '2', width:0, height: 180 },
|
||||
{ name: '无图模式', value: '3', width:0, height: 0 },
|
||||
{ name: '左右滑动展示', value: '4', width:0, height: 0 },
|
||||
],
|
||||
carousel_col_list: [
|
||||
{ name: '单列展示', value: '0' },
|
||||
{ name: '两列展示', value: '1' },
|
||||
{ name: '三列展示', value: '2' },
|
||||
{ name: '四列展示', value: '3' },
|
||||
],
|
||||
data_type_list: [
|
||||
{ name: '选择文章', value: '0' },
|
||||
{ name: '筛选文章', value: '1' },
|
||||
],
|
||||
field_show_list: [
|
||||
{ name: '文章标题', value: '3' },
|
||||
{ name: '日期时间', value: '0' },
|
||||
{ name: '浏览量', value: '1' },
|
||||
{ name: '描述', value: '2' },
|
||||
],
|
||||
field_desc_row: [
|
||||
{ name: '一行', value: '1' },
|
||||
{ name: '两行', value: '2' }
|
||||
]
|
||||
});
|
||||
|
||||
// 默认值
|
||||
const state = reactive({
|
||||
form: props.value,
|
||||
data: props.tabStyle,
|
||||
});
|
||||
// 如果需要解构,确保使用toRefs
|
||||
const { form, data } = toRefs(state);
|
||||
watch(() => props.value, (value) => {
|
||||
form.value = value;
|
||||
},{deep: true, immediate: true });
|
||||
|
||||
watch(() => props.tabStyle, (value) => {
|
||||
data.value = value;
|
||||
},{deep: true, immediate: true });
|
||||
// 主题改变
|
||||
const theme_change = (val: any) => {
|
||||
if (val == '3' || val == '4') {
|
||||
form.value.field_show = ['1', '3'];
|
||||
} else {
|
||||
form.value.field_show = ['0', '1', '3'];
|
||||
}
|
||||
if (val == '0') {
|
||||
if (data.value.img_radius.radius == props.defaultConfig.img_radius_0 || (data.value.img_radius.radius_bottom_left == props.defaultConfig.img_radius_1 && data.value.img_radius.radius_bottom_right == props.defaultConfig.img_radius_1 && data.value.img_radius.radius_top_left == props.defaultConfig.img_radius_1 && data.value.img_radius.radius_top_right == props.defaultConfig.img_radius_1)) {
|
||||
data.value.img_radius.radius = props.defaultConfig.img_radius_0;
|
||||
data.value.img_radius.radius_bottom_left = props.defaultConfig.img_radius_0;
|
||||
data.value.img_radius.radius_bottom_right = props.defaultConfig.img_radius_0;
|
||||
data.value.img_radius.radius_top_left = props.defaultConfig.img_radius_0;
|
||||
data.value.img_radius.radius_top_right = props.defaultConfig.img_radius_0;
|
||||
}
|
||||
} else {
|
||||
if (data.value.img_radius.radius == props.defaultConfig.img_radius_0 || (data.value.img_radius.radius_bottom_left == props.defaultConfig.img_radius_1 && data.value.img_radius.radius_bottom_right == props.defaultConfig.img_radius_1 && data.value.img_radius.radius_top_left == props.defaultConfig.img_radius_1 && data.value.img_radius.radius_top_right == props.defaultConfig.img_radius_1)) {
|
||||
data.value.img_radius.radius = props.defaultConfig.img_radius_1;
|
||||
data.value.img_radius.radius_bottom_left = props.defaultConfig.img_radius_1;
|
||||
data.value.img_radius.radius_bottom_right = props.defaultConfig.img_radius_1;
|
||||
data.value.img_radius.radius_top_left = props.defaultConfig.img_radius_1;
|
||||
data.value.img_radius.radius_top_right = props.defaultConfig.img_radius_1;
|
||||
}
|
||||
}
|
||||
// 切换风格时,将对应图片的默认值宽度和高度赋值
|
||||
const list = base_list.theme_list.filter(item => item.value == form.value.theme);
|
||||
if (list.length > 0) {
|
||||
data.value.style.content_img_width = list[0].width;
|
||||
data.value.style.content_img_height = list[0].height;
|
||||
}
|
||||
};
|
||||
// 移除
|
||||
const data_list_remove = (index: number) => {
|
||||
form.value.data_list.splice(index, 1);
|
||||
};
|
||||
const url_value_multiple_bool = ref(true);
|
||||
const data_list_replace_index = ref(0);
|
||||
// 替换
|
||||
const data_list_replace = (index: number) => {
|
||||
data_list_replace_index.value = index;
|
||||
url_value_multiple_bool.value = false;
|
||||
url_value_dialog_visible.value = true;
|
||||
};
|
||||
// 拖动排序
|
||||
const data_list_sort = (item: any) => {
|
||||
form.value.data_list = item;
|
||||
};
|
||||
// 新增
|
||||
const add = () => {
|
||||
url_value_multiple_bool.value = true;
|
||||
url_value_dialog_visible.value = true;
|
||||
};
|
||||
// 开启关闭链接
|
||||
const url_value_dialog_visible = ref(false);
|
||||
const url_value_dialog_call_back = (item: any[]) => {
|
||||
if (url_value_multiple_bool.value) {
|
||||
item.forEach((child: any) => {
|
||||
form.value.data_list.push({
|
||||
id: get_math(),
|
||||
new_title: '',
|
||||
new_cover: [],
|
||||
data: child,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
form.value.data_list[data_list_replace_index.value] = {
|
||||
id: get_math(),
|
||||
new_title: '',
|
||||
new_cover: form.value.data_list[data_list_replace_index.value]?.new_cover || [],
|
||||
data: item[0],
|
||||
};
|
||||
}
|
||||
};
|
||||
// 标题浮起之后文章标题的颜色和字体更新
|
||||
const switch_chage = (val: string | number | boolean) => {
|
||||
if (val == '1') {
|
||||
data.value.name_color = '#fff';
|
||||
data.value.name_weight = '400';
|
||||
} else {
|
||||
data.value.name_color = '#333';
|
||||
data.value.name_weight = 'bold';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,31 +1,29 @@
|
|||
<template>
|
||||
<div class="data-tabs-style">
|
||||
<el-form-item label="商品风格">
|
||||
<el-radio-group v-model="form.theme" @change="change_style">
|
||||
<el-radio v-for="item in base_list.product_style_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.theme == '5'" label="轮播列数">
|
||||
<el-radio-group v-model="form.carousel_col">
|
||||
<el-radio :value="1">单列展示</el-radio>
|
||||
<el-radio :value="2">两列展示</el-radio>
|
||||
<el-radio :value="3">三列展示</el-radio>
|
||||
<el-radio :value="4">四列展示</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div class="divider-line"></div>
|
||||
<!-- 商品显示的配置信息 -->
|
||||
<product-show-config :value="form" @change_shop_type="change_shop_type"></product-show-config>
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">角标设置</div>
|
||||
<!-- 角标设置 -->
|
||||
<subscript-content :value="form"></subscript-content>
|
||||
</card-container>
|
||||
<div class="divider-line"></div>
|
||||
<!-- 数据筛选组件, 根据数据源类型显示不同的筛选组件 -->
|
||||
<data-filter type="goods" :value="form" :list="form.data_list" :base-list="base_list" @add="product_add" @data_list_replace="data_list_replace" @data_list_remove="goods_list_remove" @data_list_sort="goods_list_sort"></data-filter>
|
||||
</div>
|
||||
<el-form-item label="商品风格">
|
||||
<el-radio-group v-model="form.theme" @change="change_style">
|
||||
<el-radio v-for="item in base_list.product_style_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.theme == '5'" label="轮播列数">
|
||||
<el-radio-group v-model="form.carousel_col">
|
||||
<el-radio :value="1">单列展示</el-radio>
|
||||
<el-radio :value="2">两列展示</el-radio>
|
||||
<el-radio :value="3">三列展示</el-radio>
|
||||
<el-radio :value="4">四列展示</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div class="divider-line"></div>
|
||||
<!-- 商品显示的配置信息 -->
|
||||
<product-show-config :value="form" @change_shop_type="change_shop_type"></product-show-config>
|
||||
<div class="divider-line"></div>
|
||||
<card-container>
|
||||
<div class="mb-12">角标设置</div>
|
||||
<!-- 角标设置 -->
|
||||
<subscript-content :value="form"></subscript-content>
|
||||
</card-container>
|
||||
<div class="divider-line"></div>
|
||||
<!-- 数据筛选组件, 根据数据源类型显示不同的筛选组件 -->
|
||||
<data-filter type="goods" :value="form" :list="form.data_list" :base-list="base_list" @add="product_add" @data_list_replace="data_list_replace" @data_list_remove="goods_list_remove" @data_list_sort="goods_list_sort"></data-filter>
|
||||
<url-value-dialog v-model:dialog-visible="url_value_dialog_visible" :type="['goods']" :multiple="url_value_multiple_bool" @update:model-value="url_value_dialog_call_back"></url-value-dialog>
|
||||
</template>
|
||||
|
||||
|
|
@ -50,6 +48,7 @@ const props = defineProps({
|
|||
}),
|
||||
},
|
||||
});
|
||||
|
||||
const base_list = reactive({
|
||||
product_style_list: [
|
||||
{ name: '单列展示', value: '0', width: 110, height: 120 },
|
||||
|
|
@ -117,7 +116,6 @@ const change_style = (val: any): void => {
|
|||
styles.value.content_img_width = list[0].width;
|
||||
styles.value.content_img_height = list[0].height;
|
||||
}
|
||||
console.log(styles.value);
|
||||
};
|
||||
const url_value_multiple_bool = ref(true);
|
||||
const data_list_replace_index = ref(0);
|
||||
|
|
@ -155,7 +155,9 @@ const theme_change = (val: any) => {
|
|||
// 切换风格时,将对应图片的默认值宽度和高度赋值
|
||||
const list = base_list.theme_list.filter(item => item.value == form.value.theme);
|
||||
if (list.length > 0) {
|
||||
emits('theme_change', list[0].width, list[0].height);
|
||||
// emits('theme_change', list[0].width, list[0].height);
|
||||
data.value.content_img_width = list[0].width;
|
||||
data.value.content_img_height = list[0].height;
|
||||
}
|
||||
};
|
||||
// 移除
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="setting-content">
|
||||
<template v-if="type == '1'">
|
||||
<model-article-list-content :value="form.content" :styles="form.style" :default-config="data_config" @theme_change="theme_change"></model-article-list-content>
|
||||
<model-article-list-content :value="form.content" :styles="form.style" :default-config="data_config"></model-article-list-content>
|
||||
</template>
|
||||
<template v-else-if="type == '2'">
|
||||
<model-article-list-styles :value="form.style" :content="form.content" :default-config="data_config"></model-article-list-styles>
|
||||
|
|
@ -30,9 +30,4 @@ const data_config = reactive({
|
|||
img_radius_1: 0,
|
||||
});
|
||||
const form = ref(props.value);
|
||||
|
||||
const theme_change = (width: number, height: number) => {
|
||||
form.value.style.content_img_width = width;
|
||||
form.value.style.content_img_height = height;
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -105,8 +105,10 @@
|
|||
<subscript-styles :value="form.subscript_style" :data="data"></subscript-styles>
|
||||
</template>
|
||||
</el-form>
|
||||
<div class="divider-line"></div>
|
||||
<common-styles :value="form.common_style" @update:value="common_style_update" />
|
||||
<template v-if="isCommonStyle">
|
||||
<div class="divider-line"></div>
|
||||
<common-styles :value="form.common_style" @update:value="common_style_update" />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
@ -125,6 +127,10 @@ const props = defineProps({
|
|||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
isCommonStyle: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
defaultConfig: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
|
|
|
|||
|
|
@ -207,7 +207,9 @@ const article_theme_change = (val: any) => {
|
|||
// 切换风格时,将对应图片的默认值宽度和高度赋值
|
||||
const list = base_list.article_theme_list.filter(item => item.value == val);
|
||||
if (list.length > 0) {
|
||||
emits('theme_change', list[0].width, list[0].height);
|
||||
// emits('theme_change', list[0].width, list[0].height);
|
||||
styles.value.content_img_width = list[0].width;
|
||||
styles.value.content_img_height = list[0].height;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="setting-content">
|
||||
<template v-if="type == '1'">
|
||||
<model-article-tabs-content :value="form.content" :tab-style="form.style" :default-config="data_config" @theme_change="theme_change"></model-article-tabs-content>
|
||||
<model-article-tabs-content :value="form.content" :tab-style="form.style" :default-config="data_config"></model-article-tabs-content>
|
||||
</template>
|
||||
<template v-else-if="type == '2'">
|
||||
<model-article-tabs-styles :value="form.style" :content="form.content" :tabs-style="form.content.tabs_theme" :default-config="data_config"></model-article-tabs-styles>
|
||||
|
|
@ -30,9 +30,4 @@ const data_config = reactive({
|
|||
img_radius_1: 0,
|
||||
});
|
||||
const form = ref(props.value);
|
||||
|
||||
const theme_change = (width: number, height: number) => {
|
||||
form.value.style.content_img_width = width;
|
||||
form.value.style.content_img_height = height;
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -78,6 +78,10 @@ const props = defineProps({
|
|||
return {};
|
||||
},
|
||||
},
|
||||
isCommonStyle: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
outerContainerPadding: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
|
|
@ -131,8 +135,8 @@ watchEffect(() => {
|
|||
});
|
||||
//#endregion
|
||||
// 公共样式
|
||||
const style_container = computed(() => common_styles_computer(new_style.value.common_style));
|
||||
const style_img_container = computed(() => common_img_computer(new_style.value.common_style));
|
||||
const style_container = computed(() => props.isCommonStyle ? common_styles_computer(new_style.value.common_style) : '');
|
||||
const style_img_container = computed(() => props.isCommonStyle ? common_img_computer(new_style.value.common_style) : '');
|
||||
// 内容样式
|
||||
const style_content_container = computed(() => common_styles_computer(new_style.value.data_content_style));
|
||||
const style_content_img_container = computed(() => common_img_computer(new_style.value.data_content_style));
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@
|
|||
<template v-if="tabs_data_type == 'goods'">
|
||||
<model-goods-list :value="tabs_list" :is-common-style="false"></model-goods-list>
|
||||
</template>
|
||||
<template v-else-if="tabs_data_type == 'article'">
|
||||
<model-article-list :value="tabs_list" :is-common-style="false"></model-article-list>
|
||||
</template>
|
||||
<template v-else-if="tabs_data_type == 'custom'">
|
||||
<model-custom :value="tabs_list" :is-common-style="false"></model-custom>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -68,17 +74,13 @@ watch(
|
|||
// 显示的数据处理
|
||||
const tabs_data_list = new_data.content.tabs_list[tabs_active_index.value] || {};
|
||||
tabs_data_type.value = tabs_data_list?.tabs_data_type || '';
|
||||
console.log(tabs_data_list);
|
||||
if (tabs_data_list.tabs_data_type === 'goods') {
|
||||
tabs_list.value = tabs_data_list.goods_config;
|
||||
} else if (tabs_data_list.tabs_data_type === 'article') {
|
||||
tabs_list.value = tabs_data_list.goods_config;
|
||||
tabs_list.value = tabs_data_list.article_config;
|
||||
} else if (tabs_data_list.tabs_data_type === 'custom') {
|
||||
tabs_list.value = tabs_data_list.goods_config;
|
||||
tabs_list.value = tabs_data_list.custom_config;
|
||||
}
|
||||
console.log(
|
||||
tabs_list.value
|
||||
);
|
||||
// 公共样式
|
||||
style_container.value += common_styles_computer(new_style.common_style);
|
||||
style_img_container.value = common_img_computer(new_style.common_style) + `gap: ${new_style.shop_content_spacing}px;`;
|
||||
|
|
|
|||
|
|
@ -59,25 +59,25 @@
|
|||
</el-form-item>
|
||||
<el-tabs v-model="row.tabs_name" class="content-tabs">
|
||||
<el-tab-pane label="内容设置" name="content">
|
||||
<div v-show="row.tabs_data_type == 'goods'">
|
||||
<goods-content :value="row.goods_config.content" :tab-style="row.goods_config.style"></goods-content>
|
||||
<div v-show="row.tabs_data_type == 'goods'" class="data-tabs-style">
|
||||
<data-goods-content :value="row.goods_config.content" :tab-style="row.goods_config.style"></data-goods-content>
|
||||
</div>
|
||||
<div v-show="row.tabs_data_type == 'article'">
|
||||
<goods-content :value="row.goods_config.content" :tab-style="row.goods_config.style"></goods-content>
|
||||
<div v-show="row.tabs_data_type == 'article'" class="data-tabs-style">
|
||||
<data-article-content :value="row.article_config.content" :tab-style="row.article_config.style"></data-article-content>
|
||||
</div>
|
||||
<div v-show="row.tabs_data_type == 'custom'">
|
||||
<goods-content :value="row.goods_config.content" :tab-style="row.goods_config.style"></goods-content>
|
||||
<div v-show="row.tabs_data_type == 'custom'" class="data-tabs-style">
|
||||
<data-goods-content :value="row.goods_config.content" :tab-style="row.goods_config.style"></data-goods-content>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="样式设置" name="styles">
|
||||
<div v-show="row.tabs_data_type == 'goods'">
|
||||
<goods-style :value="row.goods_config.style" :content="row.goods_config.content"></goods-style>
|
||||
<div v-show="row.tabs_data_type == 'goods'" class="data-tabs-style">
|
||||
<model-goods-list-styles :value="row.goods_config.style" :content="row.goods_config.content" :is-common-style="false"></model-goods-list-styles>
|
||||
</div>
|
||||
<div v-show="row.tabs_data_type == 'article'">
|
||||
<goods-style :value="row.goods_config.style" :content="row.goods_config.content"></goods-style>
|
||||
<div v-show="row.tabs_data_type == 'article'" class="data-tabs-style">
|
||||
<model-article-list-styles :value="row.article_config.style" :content="row.article_config.content" :is-common-style="false" />
|
||||
</div>
|
||||
<div v-show="row.tabs_data_type == 'custom'">
|
||||
<goods-style :value="row.goods_config.style" :content="row.goods_config.content"></goods-style>
|
||||
<div v-show="row.tabs_data_type == 'custom'" class="data-tabs-style">
|
||||
<data-goods-style :value="row.goods_config.style" :content="row.goods_config.content"></data-goods-style>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
|
|
|||
|
|
@ -458,21 +458,8 @@ const icon_style = (item: { bg_color: string; color: string; br_color: string })
|
|||
return style;
|
||||
};
|
||||
// 公共样式
|
||||
const style_container = computed(() => {
|
||||
if (props.isCommonStyle) {
|
||||
return common_styles_computer(new_style.value.common_style);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
const style_img_container = computed(() => {
|
||||
if (props.isCommonStyle) {
|
||||
return common_img_computer(new_style.value.common_style);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
});
|
||||
const style_container = computed(() => props.isCommonStyle ? common_styles_computer(new_style.value.common_style) : '');
|
||||
const style_img_container = computed(() => props.isCommonStyle ? common_img_computer(new_style.value.common_style) : '');
|
||||
// 不换行显示
|
||||
const multicolumn_columns_width = computed(() => {
|
||||
const { carousel_col } = toRefs(form.value);
|
||||
|
|
|
|||
|
|
@ -168,7 +168,9 @@ const change_style = (val: string | number | boolean | undefined): void => {
|
|||
// 切换风格时,将对应图片的默认值宽度和高度赋值
|
||||
const list = base_list.product_style_list.filter(item => item.value == form.value.theme);
|
||||
if (list.length > 0) {
|
||||
emits('theme_change', list[0].width, list[0].height);
|
||||
// emits('theme_change', list[0].width, list[0].height);
|
||||
data.value.shop_img_width = list[0].width;
|
||||
data.value.shop_img_height = list[0].height;
|
||||
}
|
||||
};
|
||||
const is_revise = ref(false);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="auxiliary-line-setting">
|
||||
<template v-if="type == '1'">
|
||||
<model-goods-list-content :value="form.content" :styles="form.style" :default-config="data_config" @theme_change="theme_change"></model-goods-list-content>
|
||||
<model-goods-list-content :value="form.content" :styles="form.style" :default-config="data_config"></model-goods-list-content>
|
||||
</template>
|
||||
<template v-if="type == '2'">
|
||||
<model-goods-list-styles :value="form.style" :content="form.content" :default-config="data_config"></model-goods-list-styles>
|
||||
|
|
@ -25,10 +25,6 @@ const data_config = reactive({
|
|||
img_radius_1: 0,
|
||||
});
|
||||
const form = ref(props.value);
|
||||
const theme_change = (width: number, height: number) => {
|
||||
form.value.style.content_img_width = width;
|
||||
form.value.style.content_img_height = height;
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.auxiliary-line-setting {
|
||||
|
|
|
|||
|
|
@ -277,7 +277,9 @@ const change_style = (val: any): void => {
|
|||
// 切换风格时,将对应图片的默认值宽度和高度赋值
|
||||
const list = base_list.product_style_list.filter(item => item.value == form.value.theme);
|
||||
if (list.length > 0) {
|
||||
emits('theme_change', list[0].width, list[0].height);
|
||||
// emits('theme_change', list[0].width, list[0].height);
|
||||
styles.value.content_img_width = list[0].width;
|
||||
styles.value.content_img_height = list[0].height;
|
||||
}
|
||||
};
|
||||
const is_revise = ref(false);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="auxiliary-line-setting">
|
||||
<template v-if="type == '1'">
|
||||
<model-goods-tabs-content :value="form.content" :tab-style="form.style" :default-config="data_config" @theme_change="theme_change"></model-goods-tabs-content>
|
||||
<model-goods-tabs-content :value="form.content" :tab-style="form.style" :default-config="data_config"></model-goods-tabs-content>
|
||||
</template>
|
||||
<template v-if="type == '2'">
|
||||
<model-goods-tabs-styles :value="form.style" :tabs-style="form.content.tabs_theme" :content="form.content" :default-config="data_config"></model-goods-tabs-styles>
|
||||
|
|
@ -26,10 +26,6 @@ const data_config = reactive({
|
|||
img_radius_1: 0,
|
||||
});
|
||||
const form = ref(props.value);
|
||||
const theme_change = (width: number, height: number) => {
|
||||
form.value.style.content_img_width = width;
|
||||
form.value.style.content_img_height = height;
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.auxiliary-line-setting {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import defaultCommon from './index';
|
||||
import defaultGoodsList from '@/config/const/goods-list';
|
||||
import defaultArticleList from '@/config/const/article-list';
|
||||
import defaultCustom from '@/config/const/custom';
|
||||
import commonTop from './common-top';
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
|
|
@ -15,6 +17,8 @@ interface articleTabsList {
|
|||
tabs_data_type: string;
|
||||
tabs_name: string;
|
||||
goods_config: any;
|
||||
article_config: any;
|
||||
custom_config: any;
|
||||
}
|
||||
interface DefaultProductList {
|
||||
content: {
|
||||
|
|
@ -85,10 +89,10 @@ const defaultProductList: DefaultProductList = {
|
|||
tabs_top_up: '0',
|
||||
// 选项卡数据
|
||||
tabs_list: [
|
||||
{ id: '1', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '热门推荐', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList) },
|
||||
{ id: '2', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '测试一', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList) },
|
||||
{ id: '3', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '测试二', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList) },
|
||||
{ id: '4', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '测试三', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList) },
|
||||
{ id: '1', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '热门推荐', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList), article_config: cloneDeep(defaultArticleList), custom_config: cloneDeep(defaultCustom) },
|
||||
{ id: '2', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '测试一', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList), article_config: cloneDeep(defaultArticleList), custom_config: cloneDeep(defaultCustom) },
|
||||
{ id: '3', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '测试二', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList), article_config: cloneDeep(defaultArticleList), custom_config: cloneDeep(defaultCustom) },
|
||||
{ id: '4', tabs_type: '0', tabs_img: [], tabs_icon: '', title: '测试三', img: [], desc: '简介', data_type: '0', tabs_data_type: 'goods', tabs_name: 'content', goods_config: cloneDeep(defaultGoodsList), article_config: cloneDeep(defaultArticleList), custom_config: cloneDeep(defaultCustom) },
|
||||
],
|
||||
// 选中的内容索引
|
||||
tabs_active_index: 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue