1.文章选项卡接口联调

sws 2024-08-22
v1.0.0
sws 2024-08-22 11:22:24 +08:00
parent cad27484dd
commit 49070e7118
5 changed files with 68 additions and 21 deletions

View File

@ -51,9 +51,6 @@
<el-form-item label="文章间距"> <el-form-item label="文章间距">
<slider v-model="form.article_spacing"></slider> <slider v-model="form.article_spacing"></slider>
</el-form-item> </el-form-item>
<el-form-item label="文章间距">
<slider v-model="form.article_spacing"></slider>
</el-form-item>
<el-form-item v-if="article_style == '3'" label="内容宽度"> <el-form-item v-if="article_style == '3'" label="内容宽度">
<slider v-model="form.article_width" :max="1000"></slider> <slider v-model="form.article_width" :max="1000"></slider>
</el-form-item> </el-form-item>

View File

@ -22,7 +22,7 @@ watch(
const new_style = newVal?.style; const new_style = newVal?.style;
let new_data = newVal; let new_data = newVal;
new_data.content.article_check = new_data.content.tabs_list[0].article_check; new_data.content.article_check = new_data.content.tabs_list[0].article_check;
new_data.content.article_type = new_data.content.tabs_list[0].article_type; new_data.content.article_category = new_data.content.tabs_list[0].article_category;
new_data.content.number = new_data.content.tabs_list[0].number; new_data.content.number = new_data.content.tabs_list[0].number;
new_data.content.sort = new_data.content.tabs_list[0].sort; new_data.content.sort = new_data.content.tabs_list[0].sort;
new_data.content.sort_rules = new_data.content.tabs_list[0].sort_rules; new_data.content.sort_rules = new_data.content.tabs_list[0].sort_rules;

View File

@ -4,7 +4,7 @@
<model-article-tabs-content :value="value.content"></model-article-tabs-content> <model-article-tabs-content :value="value.content"></model-article-tabs-content>
</template> </template>
<template v-else-if="type == '2'"> <template v-else-if="type == '2'">
<model-article-tabs-styles :value="value.style"></model-article-tabs-styles> <model-article-tabs-styles :value="value.style" :content="value.content"></model-article-tabs-styles>
</template> </template>
</div> </div>
</template> </template>

View File

@ -65,11 +65,26 @@
<color-picker v-model="form.page_view_color"></color-picker> <color-picker v-model="form.page_view_color"></color-picker>
</el-form-item> </el-form-item>
<el-form-item label="内容圆角"> <el-form-item label="内容圆角">
<radius :value="form"></radius> <radius :value="form.content_radius"></radius>
</el-form-item>
<el-form-item label="图片圆角">
<radius :value="form.img_radius"></radius>
</el-form-item>
<el-form-item label="内间距">
<padding :value="form.padding"></padding>
</el-form-item>
<el-form-item label="内容间距">
<slider v-model="form.content_spacing"></slider>
</el-form-item>
<el-form-item label="文章间距">
<slider v-model="form.article_spacing"></slider>
</el-form-item>
<el-form-item v-if="article_style == '3'" label="内容宽度">
<slider v-model="form.article_width" :max="1000"></slider>
</el-form-item> </el-form-item>
</card-container> </card-container>
</el-form> </el-form>
<common-styles :value="form" @update:value="common_styles_update" /> <common-styles :value="form.common_style" @update:value="common_styles_update" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -79,9 +94,19 @@ const props = defineProps({
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
content: {
type: Object,
default: () => ({}),
},
}); });
// //
let form = ref(props.value); const state = reactive({
form: props.value,
data: props.content,
});
// 使toRefs
const { form, data } = toRefs(state);
const article_style = computed(() => data.value.article_style);
const font_weight = reactive([ const font_weight = reactive([
{ name: '加粗', value: '500' }, { name: '加粗', value: '500' },
{ name: '正常', value: '400' }, { name: '正常', value: '400' },

View File

@ -23,11 +23,10 @@ interface DefaultArticleTabs {
tabs_top_up: boolean; tabs_top_up: boolean;
article_style: string; article_style: string;
tabs_list: articleTabsList[]; tabs_list: articleTabsList[];
is_show: string[]; is_show: string[];
}; };
style: { style: {
tabs_checked: string[]; tabs_checked: color_list[];
tabs_direction: string; tabs_direction: string;
tabs_weight_checked: string; tabs_weight_checked: string;
tabs_size_checked: number; tabs_size_checked: number;
@ -44,11 +43,12 @@ interface DefaultArticleTabs {
page_view_weight: string; page_view_weight: string;
page_view_size: number; page_view_size: number;
page_view_color: string; page_view_color: string;
radius: number; content_radius: radiusStyle;
radius_top_left: number; img_radius: radiusStyle;
radius_top_right: number; padding: paddingStyle;
radius_bottom_left: number; article_spacing: number;
radius_bottom_right: number; content_spacing: number;
article_width: number;
common_style: object; common_style: object;
}; };
} }
@ -68,7 +68,10 @@ const defaultArticleTabs: DefaultArticleTabs = {
is_show: ['0', '1'], is_show: ['0', '1'],
}, },
style: { style: {
tabs_checked: ['rgba(212,212,212,1)', 'rgba(255,210,210,1)'], tabs_checked: [
{ color: 'rgba(212,212,212,2)', color_percentage: '' },
{ color: 'rgba(255,210,210,1)', color_percentage: '' },
],
tabs_direction: '90deg', tabs_direction: '90deg',
tabs_weight_checked: '500', tabs_weight_checked: '500',
tabs_size_checked: 14, tabs_size_checked: 14,
@ -85,11 +88,33 @@ const defaultArticleTabs: DefaultArticleTabs = {
page_view_weight: '400', page_view_weight: '400',
page_view_size: 12, page_view_size: 12,
page_view_color: 'rgba(153, 153, 153, 1)', page_view_color: 'rgba(153, 153, 153, 1)',
radius: 8, // 内容圆角
radius_top_left: 8, content_radius: {
radius_top_right: 8, radius: 8,
radius_bottom_left: 8, radius_top_left: 8,
radius_bottom_right: 8, radius_top_right: 8,
radius_bottom_left: 8,
radius_bottom_right: 8,
},
// 图片圆角
img_radius: {
radius: 0,
radius_top_left: 0,
radius_top_right: 0,
radius_bottom_left: 0,
radius_bottom_right: 0,
},
// 内间距
padding: {
padding: 10,
padding_top: 10,
padding_bottom: 10,
padding_left: 10,
padding_right: 10,
},
content_spacing: 10, // 内容间距
article_spacing: 10, // 文章间距
article_width: 160, // 文章宽度
common_style: { ...defaultCommon, padding_left: 10, padding_right: 10, padding_bottom: 10 }, common_style: { ...defaultCommon, padding_left: 10, padding_right: 10, padding_bottom: 10 },
}, },
}; };