新增问答组件

v1.3.0
于肖磊 2025-03-17 11:24:13 +08:00
parent 17c82d1801
commit 5e174d8af8
6 changed files with 17 additions and 60 deletions

View File

@ -130,6 +130,10 @@
<template v-else-if="item.key == 'salerecords'">
<model-salerecords :key="item.com_data" :value="item.com_data"></model-salerecords>
</template>
<!-- 问答 -->
<template v-else-if="item.key == 'ask'">
<model-ask :key="item.com_data" :value="item.com_data"></model-ask>
</template>
<!-- 工具组件 -->
<!-- 辅助线 -->
<template v-else-if="item.key == 'row-line'">

View File

@ -95,6 +95,7 @@ const state = reactive({
const { form, data } = toRefs(state);
const tabs_name = ref('details');
const base_list = reactive({
host_graph_theme_list: [
{ name: '单列展示', value: '0', width: 128, height: 128 },
@ -123,18 +124,6 @@ const base_list = reactive({
]
});
const emits = defineEmits(['theme_change']);
onMounted(() => {
//
const { content_img_width = '', content_img_height = '' } = data.value;
//
if ((typeof content_img_width != 'number' || typeof content_img_height != 'number') && !['3', '4'].includes(form.value.theme)) {
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);
}
}
});
const host_graph_theme_change = () => {
//
const list = base_list.host_graph_theme_list.filter(item => item.value == form.value.host_graph_theme);
@ -145,11 +134,6 @@ const host_graph_theme_change = () => {
}
//
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.goods_img_radius.radius == props.defaultConfig.img_radius_0 || (data.value.goods_img_radius.radius_bottom_left == props.defaultConfig.img_radius_1 && data.value.goods_img_radius.radius_bottom_right == props.defaultConfig.img_radius_1 && data.value.goods_img_radius.radius_top_left == props.defaultConfig.img_radius_1 && data.value.goods_img_radius.radius_top_right == props.defaultConfig.img_radius_1)) {
data.value.goods_img_radius.radius = props.defaultConfig.img_radius_0;
@ -217,16 +201,6 @@ const url_value_dialog_call_back = (item: any[]) => {
};
}
};
//
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>
<style lang="scss" scoped>
:deep(.el-tabs.content-tabs) {

View File

@ -115,26 +115,8 @@ const base_list = reactive({
{ name: '描述', value: '2' },
],
});
const emits = defineEmits(['theme_change']);
onMounted(() => {
//
const { content_img_width = '', content_img_height = '' } = data.value;
//
if ((typeof content_img_width != 'number' || typeof content_img_height != 'number') && !['3', '4'].includes(form.value.theme)) {
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);
}
}
});
//
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.shop_img_radius.radius == props.defaultConfig.img_radius_0 || (data.value.shop_img_radius.radius_bottom_left == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_bottom_right == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_top_left == props.defaultConfig.img_radius_1 && data.value.shop_img_radius.radius_top_right == props.defaultConfig.img_radius_1)) {
data.value.shop_img_radius.radius = props.defaultConfig.img_radius_0;
@ -202,16 +184,6 @@ const url_value_dialog_call_back = (item: any[]) => {
};
}
};
//
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>
<style lang="scss" scoped>
.content {

View File

@ -229,13 +229,13 @@ const defaultRealstore: defaultRealstore = {
content_outer_spacing: 10,
content_outer_height: 204,
shop_lable_color: '#ff0036',
shop_lable_size: 12,
shop_lable_size: 10,
shop_lable_padding: {
padding: 3,
padding_top: 3,
padding: 0,
padding_top: 1,
padding_left: 3,
padding_right: 3,
padding_bottom: 3,
padding_bottom: 1,
},
shop_lable_radius: {
radius: 4,

View File

@ -30,6 +30,7 @@ import defaultRealstore from '@/config/const/realstore';
import defaultShop from '@/config/const/shop';
import defaultBinding from '@/config/const/binding';
import defaultSalerecords from '@/config/const/salerecords';
import defaultAsk from '@/config/const/ask';
// 系统设置
interface DefaultSettings {
@ -65,6 +66,7 @@ interface DefaultSettings {
shop: object;
binding: object;
salerecords: object;
ask: object;
}
const defaultSettings: DefaultSettings = {
@ -99,7 +101,8 @@ const defaultSettings: DefaultSettings = {
realstore: defaultRealstore,
shop: defaultShop,
binding: defaultBinding,
salerecords: defaultSalerecords
salerecords: defaultSalerecords,
ask: defaultAsk
};
export default defaultSettings;

View File

@ -117,6 +117,10 @@
<!-- 销售记录 -->
<template v-else-if="value.key == 'salerecords'">
<model-salerecords-setting :type="radio" :value="value.com_data"></model-salerecords-setting>
</template>
<!-- 问答 -->
<template v-else-if="value.key == 'ask'">
<model-ask-setting :type="radio" :value="value.com_data"></model-ask-setting>
</template>
<!-- 工具组件 -->
<!-- 辅助空白 -->