Merge branch 'dev-sws' into dev-yxl
commit
9b72e9c4de
|
|
@ -2,13 +2,16 @@
|
|||
<VueDraggable v-model="from" :animation="500" target=".sort-target" handle=".icon-drag" :scroll="true" :on-sort="on_sort">
|
||||
<TransitionGroup type="transition" tag="ul" name="fade" class="sort-target flex-col gap-x-20">
|
||||
<li v-for="(item, index) in from" :key="index" :class="className" class="flex gap-y-16 re" @click="on_click(item, index)">
|
||||
<el-icon class="iconfont icon-drag size-16 cursor-move" />
|
||||
<icon name="drag" size="16" class="cursor-move" />
|
||||
<slot :row="item" :index="index" />
|
||||
<el-icon v-if="type == 'card'" class="iconfont icon-close-fillup size-16 abs c-pointer cr-c top-de-5 right-de-5" @click.stop="remove(index)" />
|
||||
<el-icon v-if="type == 'line'" class="iconfont icon-delete-o size-16 c-pointer do-not-trigger cr-6" @click.stop="remove(index)" />
|
||||
<!-- <el-icon v-if="isShowEdit" class="iconfont size-16 cr-primary do-not-trigger two-click" @click.stop="edit(index)" /> -->
|
||||
<div class="abs c-pointer top-de-5 right-de-5" @click.stop="remove(index)">
|
||||
<icon v-if="type == 'card'" name="close-fillup" size="18" color="c" />
|
||||
</div>
|
||||
<div class="c-pointer do-not-trigger" @click.stop="remove(index)">
|
||||
<icon v-if="type == 'line'" name="delete-o" size="18" color="6" />
|
||||
</div>
|
||||
<el-dropdown v-if="isShowEdit" placement="bottom">
|
||||
<icon name="more-o" size="16" class="icon-edit-o" color="primary"></icon>
|
||||
<icon name="more-o" size="18" color="primary"></icon>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click.stop="edit(index)">编辑</el-dropdown-item>
|
||||
|
|
@ -87,13 +90,7 @@ const on_sort = () => {
|
|||
padding-left: 1.6rem;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
.size-16 {
|
||||
font-size: 1.6rem !important;
|
||||
}
|
||||
.icon-del-o,
|
||||
.icon-edit-o {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cursor-move {
|
||||
color: #ddd;
|
||||
cursor: move;
|
||||
|
|
|
|||
|
|
@ -392,7 +392,6 @@ const open_hot_event = () => {
|
|||
temp_data.img_width = imgBoxRef.value?.clientWidth || 0;
|
||||
// 根据原始数据的宽高和更新后的宽高的比例,计算出事实的坐标比例
|
||||
const scale = temp_data.img_width / modelValue.value.img_width;
|
||||
console.log(scale);
|
||||
temp_data.data.forEach((item) => {
|
||||
item.drag_start.x = item.drag_start.x * scale;
|
||||
item.drag_start.y = item.drag_start.y * scale;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<el-input v-model="form.shop_button_text" placeholder="请输入按钮文字" clearable></el-input>
|
||||
</template>
|
||||
<template v-else>
|
||||
<upload v-model:icon-value="form.shop_button_icon_class" is-icon type="icon" :limit="1" size="50"></upload>
|
||||
<upload v-model:icon-value="form.shop_button_icon_class" :is-delete="false" is-icon type="icon" :limit="1" size="50"></upload>
|
||||
</template>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</template>
|
||||
<div class="title" :style="title_style(index)">{{ item.title }}</div>
|
||||
<div class="desc" :style="tabs_theme_index == '1' && index == activeIndex ? tabs_check : ''">{{ item.desc }}</div>
|
||||
<icon name="checked-1" class="icon" :style="tabs_theme_index == '3' ? icon_tabs_check() : ''"></icon>
|
||||
<icon name="checked-smooth" class="icon" :style="tabs_theme_index == '3' ? icon_tabs_check() : ''"></icon>
|
||||
<div class="bottom_line" :class="tabs_bottom_line_theme" :style="tabs_check"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -166,7 +166,6 @@ const upload_file = ref({
|
|||
const file_list = ref<UploadFile[]>([]);
|
||||
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
|
||||
const upload_change = async (uploadFile: UploadFile) => {
|
||||
console.log('文件状态改变时的钩子', uploadFile);
|
||||
upload_file.value.name = uploadFile.name || '';
|
||||
upload_file.value.size = uploadFile.size || 0;
|
||||
file_list.value = [uploadFile];
|
||||
|
|
@ -241,7 +240,6 @@ const buy_event = (item: any, status: number) => {
|
|||
loading.value = true;
|
||||
Loading_text.value = '正在获取中...';
|
||||
install(new_data);
|
||||
console.log(1);
|
||||
}
|
||||
};
|
||||
interface install_data {
|
||||
|
|
|
|||
|
|
@ -130,9 +130,10 @@ const confirm_event = async (formEl: FormInstance | undefined) => {
|
|||
emit('confirm');
|
||||
});
|
||||
cancel_event(formEl);
|
||||
} else {
|
||||
console.log('error submit!', fields);
|
||||
}
|
||||
// else {
|
||||
// console.log('error submit!', fields);
|
||||
// }
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@
|
|||
</div>
|
||||
<template v-else>
|
||||
<div :class="'upload-btn upload-btn-style-' + styles" :style="'height:' + upload_size + ';width:' + upload_size + ';'" @click="dialog_visible = true">
|
||||
<div v-if="!isEmpty(icon_value)" class="upload-del-icon" @click.stop="del_icon_event">
|
||||
<div v-if="isDelete && !isEmpty(icon_value)" class="upload-del-icon" @click.stop="del_icon_event">
|
||||
<icon name="close-fillup" color="c" size="14"></icon>
|
||||
</div>
|
||||
<div class="flex-col gap-10 align-c">
|
||||
|
|
@ -244,6 +244,7 @@ const app = getCurrentInstance();
|
|||
* @param tipsText{String} 提示文字
|
||||
* @param size{Number|String} 上传图片大小
|
||||
* @param style{Number} 样式 0.默认样式 1.自定义样式1 2.自定义样式2
|
||||
* @param isDelete{Boolean} 是否可以删除
|
||||
* @return {*} update:model_value_upload
|
||||
*/
|
||||
const props = defineProps({
|
||||
|
|
@ -287,6 +288,10 @@ const props = defineProps({
|
|||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isDelete: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
const model_value_upload = defineModel({ type: Array as PropType<uploadList[]>, default: [] });
|
||||
|
|
@ -584,7 +589,6 @@ const del_event = (item: uploadList) => {
|
|||
view_list_value.value = view_list_value.value.filter((items: any) => {
|
||||
return items.id != item.id;
|
||||
});
|
||||
console.log(view_list_value.value);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ const clear_model_value = () => {
|
|||
label.value = '';
|
||||
temp_label.value = '';
|
||||
cascader_val.value = '';
|
||||
console.log('清空', label.value);
|
||||
};
|
||||
const temp_label = ref('');
|
||||
const cascader_val = ref('');
|
||||
|
|
@ -90,7 +89,6 @@ const cascader_change = (val: any) => {
|
|||
const get_label = (item: any, val: any) => {
|
||||
if (!item) return;
|
||||
item.forEach((item: any) => {
|
||||
console.log(item.value + '-' + val);
|
||||
if (item.value == val) {
|
||||
temp_label.value = item.label;
|
||||
} else {
|
||||
|
|
@ -140,7 +138,6 @@ const filterData = (input: string, data: cascaderData[]) => {
|
|||
const emit = defineEmits(['call-back']);
|
||||
// 确定提交事件
|
||||
const confirm = () => {
|
||||
console.log(props.checkImgIds);
|
||||
if (props.checkImgIds && category_id.value) {
|
||||
app?.appContext.config.globalProperties.$common.message_box('确定转移吗?', 'warning').then(() => {
|
||||
// 调用删除接口,然后,更新数据
|
||||
|
|
|
|||
|
|
@ -302,12 +302,10 @@ const folder_mode = (type: boolean) => {
|
|||
}
|
||||
nextTick(() => {
|
||||
(state.uploadEle as HTMLInputElement).webkitdirectory = type;
|
||||
// console.log(state.uploadEle);
|
||||
});
|
||||
};
|
||||
// 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用
|
||||
const upload_change = async (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
|
||||
// console.log('文件状态改变时的钩子', uploadFile, uploadFiles);
|
||||
// // 过滤已上传的文件和重复的文件
|
||||
const results = uploadFiles.flat(Infinity).filter((f: any) => validExt(f.name) && validSize(f.size));
|
||||
const new_upload_files = results.filter((item: UploadFile) => {
|
||||
|
|
@ -333,10 +331,8 @@ const validSize = (size: number) => size <= props.fileSize;
|
|||
const before_upload = (file: any) => {
|
||||
// 检查文件是否为图片
|
||||
if (validExt(file.name) && validSize(file.size)) {
|
||||
console.log('允许上传');
|
||||
return true; // 允许上传
|
||||
} else {
|
||||
console.log('不允许上传');
|
||||
return false; // 不允许上传
|
||||
}
|
||||
};
|
||||
|
|
@ -443,14 +439,12 @@ const del_upload = (index: number) => {
|
|||
};
|
||||
// 粘贴上传
|
||||
const handle_paste = (event: any) => {
|
||||
console.log(event);
|
||||
// 获取粘贴板中的文件列表
|
||||
const files = event.clipboardData.files;
|
||||
// 过滤符合条件的数据 文件后缀名,文件大小过滤
|
||||
const results = [...files].filter((f: any) => validExt(f.name) && validSize(f.size));
|
||||
// 遍历过滤后的数据,过滤重复数据后并添加到上传列表中
|
||||
if (results.length + form.value.file.length <= props.limit) {
|
||||
console.log(results);
|
||||
results.forEach((file: any) => {
|
||||
// 判断是否重复
|
||||
// 如果上传列表中没有与当前文件相同的文件,则添加到上传列表中
|
||||
|
|
@ -489,9 +483,7 @@ const submit_event = async (formEl: FormInstance | undefined) => {
|
|||
if (item.status == 'ready') {
|
||||
item.status = 'loading';
|
||||
const on_upload_progress = (progressEvent: any) => {
|
||||
console.log('progressEvent', progressEvent);
|
||||
item.progress = Number(((progressEvent.loaded / progressEvent.total) * 100).toFixed(2));
|
||||
console.log('1', item.progress);
|
||||
};
|
||||
UploadAPI.uploadAttachment(formData, on_upload_progress)
|
||||
.then((res) => {
|
||||
|
|
@ -504,9 +496,10 @@ const submit_event = async (formEl: FormInstance | undefined) => {
|
|||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('error submit!', fields);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// console.log('error submit!', fields);
|
||||
// }
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -553,9 +546,10 @@ const extract_images = async (formEl: FormInstance | undefined) => {
|
|||
} else {
|
||||
ElMessage.warning('请输入地址后再提取!');
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!', fields);
|
||||
}
|
||||
// else {
|
||||
// console.log('error submit!', fields);
|
||||
// }
|
||||
});
|
||||
};
|
||||
const emit = defineEmits(['closeAll', 'close']);
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ const carousel_key = ref('0');
|
|||
const interval_time = ref(2000);
|
||||
// 轮播图是否滚动
|
||||
const is_roll = ref(1);
|
||||
// 获取自动数据
|
||||
const get_auto_data_list = async () => {
|
||||
const { category_ids, number, order_by_type, order_by_rule, is_cover } = new_content.value;
|
||||
const new_data = {
|
||||
|
|
@ -153,14 +154,16 @@ const get_auto_data_list = async () => {
|
|||
data_list.value = Array(4).fill(default_data_list);
|
||||
}
|
||||
};
|
||||
|
||||
// 内容
|
||||
const new_content = computed(() => props.value?.content || {});
|
||||
// 样式
|
||||
const new_style = computed(() => props.value?.style || {});
|
||||
onMounted(() => {
|
||||
// 判断数据类型是选择文章且数据不为空
|
||||
if (new_content.value.data_type == '0' && !isEmpty(new_content.value.data_list)) {
|
||||
data_list.value = new_content.value.data_list;
|
||||
} else if (new_content.value.data_type == '1' && !isEmpty(new_content.value.data_auto_list)) {
|
||||
// data_list.value = new_content.value.data_auto_list;
|
||||
// 判断数据是筛选文章且数据不为空
|
||||
data_list.value = new_content.value.data_auto_list.map((item: any) => ({
|
||||
id: get_math(),
|
||||
new_title: '',
|
||||
|
|
@ -168,18 +171,21 @@ onMounted(() => {
|
|||
data: item,
|
||||
}));
|
||||
} else {
|
||||
// 否则走默认数据
|
||||
data_list.value = Array(4).fill(default_data_list);
|
||||
}
|
||||
});
|
||||
// 监听new_content指定的数据变化
|
||||
const data_list_computer = computed(() => {
|
||||
const { data_type, category_ids, number, order_by_type, order_by_rule, is_cover, data_list } = new_content.value;
|
||||
return { data_type, category_ids, number, order_by_type, order_by_rule, is_cover, data_list };
|
||||
});
|
||||
// 监听new_content指定的数据的变化,来获取最新数据
|
||||
watch(
|
||||
() => data_list_computer.value,
|
||||
(new_value, old_value) => {
|
||||
// 使用JSON.stringify()进行判断 新值和旧值是否一样 不一样就重新获取数据
|
||||
if ((JSON.stringify(new_value) !== JSON.stringify(old_value)) || props.isCommonStyle) {
|
||||
if (JSON.stringify(new_value) !== JSON.stringify(old_value) || props.isCommonStyle) {
|
||||
if (new_value.data_type == '1') {
|
||||
get_auto_data_list();
|
||||
} else {
|
||||
|
|
@ -204,6 +210,7 @@ const multicolumn_columns_width = computed(() => {
|
|||
const article_name_height_computer = computed(() => {
|
||||
return new_style.value.name_size * 2.4 + 'px';
|
||||
});
|
||||
// 文章行高计算
|
||||
const article_name_line_height_computer = computed(() => {
|
||||
return new_style.value.name_size * 1.2 + 'px';
|
||||
});
|
||||
|
|
@ -211,6 +218,7 @@ const article_name_line_height_computer = computed(() => {
|
|||
const carousel_height_computer = computed(() => {
|
||||
return new_style.value.name_size * 2 + new_style.value.article_height + 'px';
|
||||
});
|
||||
// 监听value数据变化
|
||||
watch(
|
||||
() => props.value,
|
||||
(newVal, oldValue) => {
|
||||
|
|
@ -259,6 +267,7 @@ watch(
|
|||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
// 文章主题class计算
|
||||
const article_theme_class = computed(() => {
|
||||
switch (article_theme.value) {
|
||||
case '0':
|
||||
|
|
@ -277,6 +286,7 @@ const article_theme_class = computed(() => {
|
|||
interface ArticleCarouselList {
|
||||
carousel_list: ArticleList[];
|
||||
}
|
||||
// 文章轮播
|
||||
const article_carousel_list = computed(() => {
|
||||
// 深拷贝一下,确保不会出现问题
|
||||
const cloneList = cloneDeep(data_list.value);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<el-form-item label="选项卡置顶">
|
||||
<div class="flex-row align-c gap-10">
|
||||
<el-switch v-model="form.tabs_top_up" active-value="1" inactive-value="0" :disabled="is_immersion_model" />
|
||||
<el-tooltip effect="dark" :show-after="200" :hide-after="200" content="<span>开启沉浸样式时,选项卡置顶功能禁用</span>" raw-content placement="top">
|
||||
<el-tooltip effect="dark" :show-after="200" :hide-after="200" content="<span>1.开启沉浸样式时,选项卡置顶功能禁用</span><br/><span>2.滑动置顶仅手机端有效</span>" raw-content placement="top">
|
||||
<icon name="miaosha-hdgz" size="12" color="#999"></icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
|
@ -255,7 +255,6 @@ const article_add = (index: number) => {
|
|||
};
|
||||
const url_value_dialog_call_back = (item: any[]) => {
|
||||
if (url_value_multiple_bool.value) {
|
||||
// console.log(item);
|
||||
item.forEach((child: any) => {
|
||||
form.tabs_list[article_index.value].data_list.push({
|
||||
id: get_math(),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<el-form-item label="选项卡置顶">
|
||||
<div class="flex-row align-c gap-10">
|
||||
<el-switch v-model="form.tabs_top_up" active-value="1" inactive-value="0" :disabled="is_immersion_model" />
|
||||
<el-tooltip effect="dark" :show-after="200" :hide-after="200" content="<span>开启沉浸样式时,选项卡置顶功能禁用</span>" raw-content placement="top">
|
||||
<el-tooltip effect="dark" :show-after="200" :hide-after="200" content="<span>1.开启沉浸样式时,选项卡置顶功能禁用</span><br/><span>2.滑动置顶仅手机端有效</span>" raw-content placement="top">
|
||||
<icon name="miaosha-hdgz" size="12" color="#999"></icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@
|
|||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="滑动置顶">
|
||||
<el-switch v-model="form.tabs_top_up" active-value="1" inactive-value="0"></el-switch>
|
||||
<el-switch v-model="form.tabs_top_up" class="mr-10" active-value="1" inactive-value="0"></el-switch>
|
||||
<el-tooltip effect="light" :show-after="200" :hide-after="200" content="滑动置顶仅手机端有效" raw-content placement="top">
|
||||
<icon name="miaosha-hdgz" size="12" color="#999"></icon>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
</card-container>
|
||||
<div class="divider-line"></div>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<el-form-item v-if="form.header_background_type == 'transparent'" label="沉浸样式">
|
||||
<div class="flex-row align-c gap-10">
|
||||
<el-switch v-model="form.immersive_style" active-value="1" inactive-value="0" :disabled="is_have_tabs" @change="change_immersive_style"></el-switch>
|
||||
<el-tooltip effect="dark" :show-after="200" :hide-after="200" content="<span>开启沉浸样式时,不可添加选项卡和选项卡轮播。<br/>并且商品选项卡和文章选项卡的选项卡置顶功能禁用</span>" raw-content placement="top">
|
||||
<el-tooltip effect="light" :show-after="200" :hide-after="200" content="<span>开启沉浸样式时,不可添加选项卡和选项卡轮播。<br/>并且商品选项卡和文章选项卡的选项卡置顶功能禁用</span>" raw-content placement="top">
|
||||
<icon name="miaosha-hdgz" size="12" color="#999"></icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
|
@ -53,7 +53,10 @@
|
|||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="返回颜色">
|
||||
<color-picker v-model="form.left_back_btn_color" default-color="#333"></color-picker>
|
||||
<color-picker v-model="form.left_back_btn_color" class="mr-10" default-color="#333"></color-picker>
|
||||
<el-tooltip effect="light" :show-after="200" :hide-after="200" content="打开新页面才会出现返回按钮" raw-content placement="top">
|
||||
<icon name="miaosha-hdgz" size="12" color="#999"></icon>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
</card-container>
|
||||
<div class="bg-f5 divider-line" />
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ const message_error = (info: string) => {
|
|||
messageInstance = ElMessage.error({
|
||||
type: 'error',
|
||||
message: info,
|
||||
duration: 60000,
|
||||
duration: 30000,
|
||||
showClose: true,
|
||||
});
|
||||
};
|
||||
|
|
@ -25,7 +25,7 @@ const index = window.location.href.lastIndexOf('?s=');
|
|||
const pro_url = window.location.href.substring(0, index);
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API == '/dev-api' ? import.meta.env.VITE_APP_BASE_API : pro_url + '?s=',
|
||||
timeout: 3000,
|
||||
timeout: 60000,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
});
|
||||
/** @ts-ignore */
|
||||
|
|
|
|||
|
|
@ -115,9 +115,10 @@ const confirm_event = async (formEl: FormInstance | undefined) => {
|
|||
...form.value,
|
||||
logo: form.value.logo.length > 0 ? form.value.logo[0].url : '',
|
||||
};
|
||||
} else {
|
||||
console.log('error submit!', fields);
|
||||
}
|
||||
// else {
|
||||
// console.log('error submit!', fields);
|
||||
// }
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ const default_merge = (data: any, key: string) => {
|
|||
if (data.content) {
|
||||
data.content = Object.assign({}, cloneDeep((defaultSettings as any)[key.replace(/-/g, '_')]).content, data.content);
|
||||
} else {
|
||||
console.log(data.content);
|
||||
data.content = cloneDeep((defaultSettings as any)[key.replace(/-/g, '_')]).content;
|
||||
}
|
||||
return data;
|
||||
|
|
|
|||
Loading…
Reference in New Issue