1.代码注释

v1.0.0
sws 2024-10-18 15:31:30 +08:00
parent 2ee47d7b93
commit 95dacb4c92
13 changed files with 88 additions and 4 deletions

View File

@ -10,7 +10,7 @@
</template>
<script setup lang="ts">
/**
* @description: 文章列表切换
* @description: 文章选项卡列表设置
* @param type{String} 类型是进入内容组件还是样式组件
* @param value{Object} 样式数据
*/

View File

@ -12,7 +12,7 @@
import { common_img_computer, common_styles_computer } from '@/utils';
import { cloneDeep } from 'lodash';
/**
* @description: 文章选项啊哭列表渲染
* @description: 文章选项列表渲染
* @param value{Object} 样式数据
*/
const props = defineProps({

View File

@ -97,9 +97,14 @@
</template>
<script setup lang="ts">
import { get_math, tabs_style } from '@/utils';
import ArticleAPI from '@/api/article';
import { commonStore } from '@/store';
const common_store = commonStore();
/**
* @description: 文章选项卡列表内容
* @param value{Object} 内容数据
* @param tabsStyle{Object} tabs样式数据
* @param defaultConfig{Object} 默认配置
*/
const props = defineProps({
value: {
type: Object,
@ -167,6 +172,7 @@ onMounted(() => {
}
});
});
// tabs_theme_list
const article_theme_change = (val: any) => {
if (val == '3' || val == '4') {
form.field_show = ['1'];
@ -194,6 +200,8 @@ const article_theme_change = (val: any) => {
//
const url_value_dialog_visible = ref(false);
//
const tabs_list_click = (item: any, index: number) => {
form.tabs_active_index = index;
};
@ -211,11 +219,12 @@ const tabs_list_remove = (index: number) => {
ElMessage.warning('至少保留一个选项卡');
}
};
//
const tabs_list_sort = (item: any) => {
//
form.tabs_list = item;
};
//
const tabs_add = () => {
form.tabs_list.push({
id: get_math(),
@ -236,12 +245,15 @@ const tabs_add = () => {
const data_list_remove = (index: number, article_index: number) => {
form.tabs_list[article_index].data_list.splice(index, 1);
};
//
const data_list_sort = (item: any, index: number) => {
form.tabs_list[index].data_list = item;
};
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;
@ -249,11 +261,13 @@ const data_list_replace = (index: number) => {
};
const article_index = ref(0);
//
const article_add = (index: number) => {
url_value_multiple_bool.value = true;
url_value_dialog_visible.value = true;
article_index.value = index;
};
//
const url_value_dialog_call_back = (item: any[]) => {
if (url_value_multiple_bool.value) {
item.forEach((child: any) => {
@ -275,10 +289,13 @@ const url_value_dialog_call_back = (item: any[]) => {
};
const styles = reactive(props.tabStyle);
//
const tabs_theme_change = (val: string | number | boolean | undefined): void => {
styles.tabs_color_checked = tabs_style(styles.tabs_color_checked, val);
};
//
const is_immersion_model = computed(() => common_store.is_immersion_model);
//
watchEffect(() => {
if (is_immersion_model.value) {
form.tabs_top_up = '0';

View File

@ -9,6 +9,11 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 文章选项卡列表设置
* @param type{String} 类型1内容2样式
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
type: {
type: String,

View File

@ -84,6 +84,13 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 文章选项卡列表样式
* @param value{Object} 样式数据
* @param content{Object} 内容数据
* @param defaultConfig{Object} 默认配置
* @param tabsStyle{String} 选项卡风格
*/
const props = defineProps({
value: {
type: Object,
@ -113,7 +120,9 @@ const state = reactive({
});
// 使toRefs
const { form, data } = toRefs(state);
//
const theme = computed(() => data.value.article_theme);
//
if (theme.value == '0') {
if (form.value.img_radius.radius == props.defaultConfig.img_radius_0 || (form.value.img_radius.radius_bottom_left == props.defaultConfig.img_radius_1 && form.value.img_radius.radius_bottom_right == props.defaultConfig.img_radius_1 && form.value.img_radius.radius_top_left == props.defaultConfig.img_radius_1 && form.value.img_radius.radius_top_right == props.defaultConfig.img_radius_1)) {
form.value.img_radius.radius = props.defaultConfig.img_radius_0;
@ -131,10 +140,12 @@ if (theme.value == '0') {
form.value.img_radius.radius_top_right = props.defaultConfig.img_radius_1;
}
}
//
const tabs_checked_event = (arry: string[], type: number) => {
form.value.tabs_checked = arry;
form.value.tabs_direction = type.toString();
};
//
const common_styles_update = (val: Object) => {
form.value.common_style = val;
};

View File

@ -7,6 +7,10 @@
</template>
<script setup lang="ts">
import { common_img_computer, common_styles_computer } from '@/utils';
/**
* @description: 辅助线渲染
* @param value{Object} 样式数据
*/
const props = defineProps({
value: {
type: Object,
@ -17,6 +21,7 @@ const props = defineProps({
const style = ref('');
const style_container = ref('');
const style_img_container = ref('');
//
watch(
props.value,
(newVal, oldValue) => {

View File

@ -21,6 +21,10 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 辅助线内容
* @param value{Object} 内容数据
*/
const props = defineProps({
value: {
type: Object,
@ -28,6 +32,7 @@ const props = defineProps({
},
});
const form = reactive(props.value);
// 线
const line_change = (val: any) => {
form.styles = val;
};

View File

@ -9,6 +9,11 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 辅助线设置
* @param type{String} 类型1内容2样式
* @param value{Object} 样式数据
*/
const props = defineProps({
type: {
type: String,

View File

@ -16,6 +16,10 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 辅助线样式
* @param value{Object} 样式数据
*/
const props = defineProps({
value: {
type: Object,
@ -35,6 +39,7 @@ const state = reactive({
});
// 使toRefs
const { form } = toRefs(state);
//
const common_styles_update = (val: Object) => {
form.value.common_style = val;
};

View File

@ -145,6 +145,10 @@ import CouponAPI from '@/api/coupon';
import { commonStore } from '@/store';
const common_store = commonStore();
const currency_symbol = common_store.common.config.currency_symbol;
/**
* @description: 优惠券渲染
* @param value{Object} 样式数据
*/
const props = defineProps({
value: {
type: Object,
@ -188,6 +192,7 @@ const theme_bg_img = ref<themeBgImg>({
url_2: ``,
url_3: ``,
});
//
onMounted(() => {
if (!isEmpty(form.value.data_list) && form.value.data_type == '1') {
data_list.value = form.value.data_list;
@ -206,6 +211,7 @@ onMounted(() => {
url_3: form.value.theme_5_static_img[0].url,
};
});
//
const get_coupon = () => {
const { number, type } = form.value;
const params = {
@ -222,10 +228,12 @@ const get_coupon = () => {
}
});
};
//
const data_list_computer = computed(() => {
const { data_type, type, number, data_list } = form.value;
return { data_type, type, number, data_list };
});
//
watch(
() => data_list_computer.value,
(new_value) => {
@ -241,7 +249,9 @@ watch(
},
{ deep: true }
);
//
const theme = computed(() => props.value?.content?.theme);
//
const theme_style = computed(() => {
const new_background = gradient_computer({ color_list: props.value?.style?.background, direction: props.value?.style?.direction }, false);
const new_background_inside = gradient_computer({ color_list: props.value?.style?.background_inside, direction: props.value?.style?.direction_inside }, false);
@ -263,9 +273,11 @@ const theme_style = computed(() => {
...(!['1', '2', '3', '5', '6', '7'].includes(theme.value) && { content_desc_color: props.value?.style?.content_desc_color }),
};
});
// 3
const theme_3_border_style = computed(() => {
return props.value?.style?.background[0].color;
});
// 7
const theme_7_background_style = computed(() => {
if (props.value?.style?.common_style.color_list.length > 0) {
return props.value?.style?.common_style.color_list[0].color;

View File

@ -54,6 +54,12 @@
import { online_url, is_obj_empty } from '@/utils';
import { commonStore } from '@/store';
const common_store = commonStore();
/**
* @description: 文章选项卡列表内容
* @param value{Object} 内容数据
* @param styles{Object} 样式数据
* @param defaultConfig{Object} 默认配置
*/
const props = defineProps({
value: {
type: Object,
@ -84,7 +90,9 @@ const base_list = reactive({
coupon_type_list: [] as select_2[],
});
onMounted(async () => {
//
new_url.value = await online_url('/static/plugins/coupon/images/diy/').then((res) => res);
//
base_list.themeList.forEach((item) => {
item.url = `${new_url.value}${item.url}`;
});
@ -96,18 +104,23 @@ onMounted(async () => {
});
});
const emit = defineEmits(['update:change-theme']);
//
const themeChange = (val: string) => {
emit('update:change-theme', val);
};
//
const remove = (index: number) => {
form.value.data_list.splice(index, 1);
};
//
const on_sort = (item: any) => {
form.value.data_list = item;
};
//
const add = () => {
url_value_dialog_visible.value = true;
};
//
const url_value_dialog_call_back = (item: any[]) => {
item.forEach((child: any) => {
form.value.data_list.push(child);

View File

@ -10,6 +10,11 @@
</template>
<script setup lang="ts">
import { online_url } from '@/utils';
/**
* @description: 优惠券设置
* @param type{String} 类型1内容2样式
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
type: {
type: String,

View File

@ -260,6 +260,7 @@
@media screen and (max-width: 1560px) {
.siderbar {
width: 32rem;
padding: 0.5rem 1rem;
}
.drawer-container {
width: 0 !important;