Merge branch 'dev-sws' into dev-yxl

v1.0.0
于肖磊 2024-10-16 17:04:10 +08:00
commit 9b72e9c4de
17 changed files with 56 additions and 51 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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>

View File

@ -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>

View File

@ -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 {

View File

@ -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>

View File

@ -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);
});
});
};

View File

@ -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(() => {
//

View File

@ -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']);

View File

@ -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);

View File

@ -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(),

View File

@ -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>

View File

@ -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>

View File

@ -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" />

View File

@ -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 */

View File

@ -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>

View File

@ -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;