Merge branch 'dev-sws' into dev-yxl
commit
3e9da6c902
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<i class="iconfont" :class="className" :style="'font-size:' + size + 'px;' + (props.color.indexOf('#') !== -1 || props.color.indexOf('rgba') !== -1 ? 'color:' + props.color + ';' : '') + styles" @click="onClick">
|
||||
<i class="iconfont" :class="className" :style="'font-size:' + size + 'px;' + (props.color.indexOf('#') != -1 || props.color.indexOf('rgba') != -1 ? 'color:' + props.color + ';' : '') + styles" @click="onClick">
|
||||
<slot></slot>
|
||||
</i>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</template>
|
||||
</el-image>
|
||||
</div>
|
||||
<div v-if="src !== '' && isSrc" class="flex-row align-c gap-10 size-12">
|
||||
<div v-if="src != '' && isSrc" class="flex-row align-c gap-10 size-12">
|
||||
{{ src }}
|
||||
<div class="copy" @click="clipboard_event">复制</div>
|
||||
</div>
|
||||
|
|
@ -66,7 +66,7 @@ const clipboard_event = async () => {
|
|||
watch(
|
||||
() => props.src,
|
||||
(newValue) => {
|
||||
if (newValue !== '') {
|
||||
if (newValue != '') {
|
||||
generateQRCode(newValue, 2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ const model_style = computed(() => {
|
|||
}
|
||||
}
|
||||
let z_index = '';
|
||||
if (item.com_data.style.common_style?.floating_up !== 0) {
|
||||
if (item.com_data.style.common_style?.floating_up != 0) {
|
||||
z_index = `z-index: 1`;
|
||||
}
|
||||
return item.key == 'float-window' ? `bottom: ${((bottom / window.innerHeight) * 100).toFixed(4) + '%'};` : `margin-top: -${ item.com_data.style.common_style?.floating_up || 0 }px;${ z_index };`;
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ const drag_box_scale_bool = ref(false);
|
|||
const start_drag = (event: MouseEvent) => {
|
||||
drag_bool.value = true;
|
||||
if (!imgBoxRef.value) return;
|
||||
rect_start.value.x = rect_start.value.x !== 0 ? rect_start.value.x : event.clientX - imgBoxRef.value.getBoundingClientRect().left;
|
||||
rect_start.value.y = rect_start.value.y !== 0 ? rect_start.value.y : event.clientY - imgBoxRef.value.getBoundingClientRect().top;
|
||||
rect_start.value.x = rect_start.value.x != 0 ? rect_start.value.x : event.clientX - imgBoxRef.value.getBoundingClientRect().left;
|
||||
rect_start.value.y = rect_start.value.y != 0 ? rect_start.value.y : event.clientY - imgBoxRef.value.getBoundingClientRect().top;
|
||||
rect_start.value.width = 0;
|
||||
rect_start.value.height = 0;
|
||||
};
|
||||
|
|
@ -300,8 +300,8 @@ const start_drag_btn = (index: number, event: MouseEvent, type: string) => {
|
|||
|
||||
// 辅助函数用于更新drag_end
|
||||
const updateDragEnd = (dragStart: { x: number; y: number }, dragEnd: { x: number; y: number }, newDragEnd: { x?: number; y?: number }) => {
|
||||
const newX = newDragEnd.x !== undefined ? newDragEnd.x : dragEnd.x;
|
||||
const newY = newDragEnd.y !== undefined ? newDragEnd.y : dragEnd.y;
|
||||
const newX = newDragEnd.x != undefined ? newDragEnd.x : dragEnd.x;
|
||||
const newY = newDragEnd.y != undefined ? newDragEnd.y : dragEnd.y;
|
||||
return {
|
||||
x: newX,
|
||||
y: newY,
|
||||
|
|
@ -312,8 +312,8 @@ const updateDragEnd = (dragStart: { x: number; y: number }, dragEnd: { x: number
|
|||
|
||||
// 辅助函数用于更新drag_start
|
||||
const updateDragStart = (dragStart: { x: number; y: number }, newDragStart: { x?: number; y?: number }) => {
|
||||
const newX = newDragStart.x !== undefined ? newDragStart.x : dragStart.x;
|
||||
const newY = newDragStart.y !== undefined ? newDragStart.y : dragStart.y;
|
||||
const newX = newDragStart.x != undefined ? newDragStart.x : dragStart.x;
|
||||
const newY = newDragStart.y != undefined ? newDragStart.y : dragStart.y;
|
||||
return { x: newX, y: newY };
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ const isContain = (x: number, y: number, item: CubeItem) => {
|
|||
//魔方点击事件。
|
||||
const onClickCubeItem = (event: any) => {
|
||||
let domclass = event.currentTarget.getAttribute('class');
|
||||
if (-1 !== domclass.indexOf('item-selected')) {
|
||||
if (-1 != domclass.indexOf('item-selected')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<div class="define-append">%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="index + 1 !== color_list.length" class="connect-line"></div>
|
||||
<div v-if="index + 1 != color_list.length" class="connect-line"></div>
|
||||
</div>
|
||||
<template v-if="index == 0">
|
||||
<icon name="reset" color="primary" size="16" class="c-pointer" @click="reset_event"></icon>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
</el-dialog>
|
||||
<div class="flex-row align-c gap-10 br-d radius-sm plr-11 theme-input" @click="dialog_visible = true">
|
||||
<div class="flex-1 flex-width size-12 text-line-1">
|
||||
<text v-if="temp_data_obj !== null">{{ temp_data_obj.name }}</text>
|
||||
<text v-if="temp_data_obj != null">{{ temp_data_obj.name }}</text>
|
||||
<text v-else class="cr-9">{{ placeholder }}</text>
|
||||
</div>
|
||||
<div class="theme-icon">
|
||||
|
|
@ -104,7 +104,7 @@ const close_event = () => {
|
|||
};
|
||||
// 确定
|
||||
const confirm_event = () => {
|
||||
if (temp_data.value !== null) {
|
||||
if (temp_data.value != null) {
|
||||
model_value.value = temp_data.value.id;
|
||||
temp_data_obj.value = temp_data.value;
|
||||
close_event();
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ const form = ref<Tree>({
|
|||
watch(
|
||||
() => dialog_visible_category_operate.value,
|
||||
(newValue) => {
|
||||
if (newValue && props.type !== 'add') {
|
||||
if (newValue && props.type != 'add') {
|
||||
form.value = cloneDeep(props.value);
|
||||
} else {
|
||||
form.value = {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<div class="upload-content pa-20">
|
||||
<div v-if="upload_type !== 'icon'" class="flex-row gap-40">
|
||||
<div v-if="upload_type != 'icon'" class="flex-row gap-40">
|
||||
<div class="left-content">
|
||||
<div class="flex-row align-c gap-10 mb-10">
|
||||
<el-input v-model="search_filter" placeholder="请输入分类名称" clearable>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
</template>
|
||||
</el-image>
|
||||
</template>
|
||||
<div class="check-icon fill flex-row jc-c align-c" :class="view_list_value.findIndex((i) => i.id === item.id) !== -1 ? 'active' : ''">
|
||||
<div class="check-icon fill flex-row jc-c align-c" :class="view_list_value.findIndex((i) => i.id === item.id) != -1 ? 'active' : ''">
|
||||
<icon name="true-o" color="f" size="26"></icon>
|
||||
</div>
|
||||
<div class="operate">
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
<div class="flex-1 tc c-pointer" @click.stop="edit_event(item, index)">
|
||||
<icon name="edit" class="flex-1" size="14" color="f"></icon>
|
||||
</div>
|
||||
<div v-if="upload_type !== 'file'" class="operate-icon flex-1 tc c-pointer" @click.stop="preview_event(item, index)">
|
||||
<div v-if="upload_type != 'file'" class="operate-icon flex-1 tc c-pointer" @click.stop="preview_event(item, index)">
|
||||
<icon name="eye" size="14" color="f"></icon>
|
||||
</div>
|
||||
<div class="flex-1 tc c-pointer" @click.stop="del_event(item)">
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="text-line-1 name" @click.stop>
|
||||
<template v-if="edit_index !== -1 && edit_index === index">
|
||||
<template v-if="edit_index != -1 && edit_index === index">
|
||||
<el-input v-model="item.original" v-focus type="text" placeholder="请输入内容" size="small" clearable @blur="edit_index = -1" @keydown="edit_input_keydown" @change="edit_input_change" />
|
||||
</template>
|
||||
<template v-else>
|
||||
|
|
@ -200,7 +200,7 @@
|
|||
<div class="upload-btn-bottom-text">替换</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="limit !== model_value_upload.length" :class="'upload-btn upload-btn-style-' + styles" :style="'height:' + upload_size + ';width:' + upload_size + ';'" @click="dialog_visible = true">
|
||||
<div v-if="limit != model_value_upload.length" :class="'upload-btn upload-btn-style-' + styles" :style="'height:' + upload_size + ';width:' + upload_size + ';'" @click="dialog_visible = true">
|
||||
<icon name="add" :size="Number(size) / 2 + ''" color="c"></icon>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -354,7 +354,7 @@ watch(search_filter, (val) => {
|
|||
});
|
||||
const filter_node = (value: string, data: any): boolean => {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
return data.name.indexOf(value) != -1;
|
||||
};
|
||||
const type_data = ref<Tree[]>([]);
|
||||
const all_tree = {
|
||||
|
|
@ -503,7 +503,7 @@ const check_img_ids = ref('');
|
|||
const check_img_event = (item: any) => {
|
||||
const item_id = item.id;
|
||||
const index = view_list_value.value.findIndex((item: any) => item.id === item_id);
|
||||
if (index !== -1) {
|
||||
if (index != -1) {
|
||||
view_list_value.value.splice(index, 1);
|
||||
} else {
|
||||
if (is_replace.value) {
|
||||
|
|
@ -578,7 +578,7 @@ const del_event = (item: uploadList) => {
|
|||
|
||||
// 过滤已删除的文件
|
||||
view_list_value.value = view_list_value.value.filter((items: any) => {
|
||||
return items.id !== item.id;
|
||||
return items.id != item.id;
|
||||
});
|
||||
console.log(view_list_value.value);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ const scan_uuid = ref('');
|
|||
// 上传方式
|
||||
const upload_type_change = (type: any) => {
|
||||
// 清除之前的定时器(如果存在)
|
||||
if (timer.value && type !== 'scan') {
|
||||
if (timer.value && type != 'scan') {
|
||||
// 直接检查 timer.value 是否存在(不是 null 或 undefined)
|
||||
clearTimeout(timer.value);
|
||||
timer.value = null; // 清除引用,防止内存泄漏
|
||||
|
|
@ -514,7 +514,7 @@ const del_already_upload = (id: number | undefined, index: number) => {
|
|||
// 根据下标删除文件
|
||||
// scan_file_list.value.splice(index, 1);
|
||||
// 调接口真实删除
|
||||
if (id !== undefined) {
|
||||
if (id != undefined) {
|
||||
app?.appContext.config.globalProperties.$common.message_box('删除后不可恢复,确定继续吗?', 'warning').then(() => {
|
||||
// 调用删除接口,然后,更新数据
|
||||
UploadAPI.delAttachment({ ids: id }).then((res) => {
|
||||
|
|
@ -583,7 +583,7 @@ const reset_data = () => {
|
|||
scan_file_list.value = [];
|
||||
scan_uuid.value = '';
|
||||
// 直接检查 timer.value 是否存在(不是 null 或 undefined)
|
||||
if (timer.value !== null) {
|
||||
if (timer.value != null) {
|
||||
clearTimeout(timer.value);
|
||||
}
|
||||
is_mask.value = true;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<div class="url-value-content pa-20 flex-row">
|
||||
<div v-if="custom_link_type.length !== 1" class="left-content">
|
||||
<div v-if="custom_link_type.length != 1" class="left-content">
|
||||
<el-menu :default-active="link_select" class="w br-none" @select="handle_select">
|
||||
<el-menu-item v-for="item in base_data" :key="item.type" :index="item.type" :disabled="!(custom_link_type.includes(item.type) || custom_link_type.length == 0)">
|
||||
<span>{{ item.name }}</span>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ const content_update = (value: any) => {
|
|||
const new_arry = ['margin', 'margin_left', 'margin_right', 'margin_top', 'margin_bottom', 'padding', 'padding_left', 'padding_right', 'padding_top', 'padding_bottom', 'radius', 'radius_top_left', 'radius_top_right', 'radius_bottom_left', 'radius_bottom_right'];
|
||||
if (value.nav_type == 1) {
|
||||
new_arry.forEach((item) => {
|
||||
if (item.indexOf('radius') !== -1) {
|
||||
if (item.indexOf('radius') != -1) {
|
||||
form.value.style.common_style[item] = 100;
|
||||
} else {
|
||||
form.value.style.common_style[item] = 10;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="footer-nav-content flex-row jc-c align-c w" :style="style_container">
|
||||
<ul class="flex-row jc-sa align-c w">
|
||||
<li v-for="(item, index) in nav_content" :key="index" class="flex-1 flex-col jc-c align-c gap-5" @mouseenter="is_hover = index" @mouseleave="is_hover = 0">
|
||||
<div v-if="nav_style !== 2" class="img re">
|
||||
<div v-if="nav_style != 2" class="img re">
|
||||
<div class="img-item abs radius-xs animate-linear w" :class="is_hover != index ? 'active' : ''">
|
||||
<image-empty v-model="item.img[0]" error-img-style="width:1.5rem;height:1.5rem;"></image-empty>
|
||||
</div>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<image-empty v-model="item.img_checked[0]" error-img-style="width:1.5rem;height:1.5rem;"></image-empty>
|
||||
</div>
|
||||
</div>
|
||||
<span v-if="nav_style !== 1" class="animate-linear size-12 re z-i" :style="is_hover == index ? text_color_checked : default_text_color">{{ item.name }}</span>
|
||||
<span v-if="nav_style != 1" class="animate-linear size-12 re z-i" :style="is_hover == index ? text_color_checked : default_text_color">{{ item.name }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<template>
|
||||
<div class="oh" :style="style_container">
|
||||
<div class="re oh" :style="style">
|
||||
<div v-if="!['4'].includes(article_theme)" class="flex-warp" :class="article_theme_class" :style="article_theme !== '3' ? article_spacing : ''">
|
||||
<div v-if="!['4'].includes(article_theme)" class="flex-warp" :class="article_theme_class" :style="article_theme != '3' ? article_spacing : ''">
|
||||
<div v-for="(item, index) in data_list" :key="index" class="item bg-f oh" :class="article_theme == '0' ? 'flex-row' : 'flex-col'" :style="article_style">
|
||||
<template v-if="article_theme !== '3'">
|
||||
<template v-if="article_theme != '3'">
|
||||
<template v-if="item.new_cover.length > 0">
|
||||
<image-empty v-model="item.new_cover[0].url" class="img" :style="img_radius" :error-img-style="error_img"></image-empty>
|
||||
</template>
|
||||
<template v-else> <image-empty v-model="item.data.cover" class="img" :style="img_radius" :error-img-style="error_img"></image-empty> </template>
|
||||
</template>
|
||||
<div class="jc-sb flex-1" :class="article_theme == '3' ? 'flex-row align-c' : 'flex-col'" :style="article_theme !== '0' ? content_padding : ''">
|
||||
<div class="jc-sb flex-1" :class="article_theme == '3' ? 'flex-row align-c' : 'flex-col'" :style="article_theme != '0' ? content_padding : ''">
|
||||
<div class="title" :class="article_theme == '3' ? 'text-line-1 flex-1 flex-width' : 'text-line-2'" :style="article_name">{{ !isEmpty(item.new_title) ? item.new_title : item.data.title }}</div>
|
||||
<div class="flex-row jc-sb gap-8" :class="article_theme == '3' ? 'ml-10' : 'align-e mt-10'">
|
||||
<div :style="article_date">{{ field_show.includes('0') ? (!is_obj_empty(item.data) ? item.data.add_time : '2020-06-05 15:20') : '' }}</div>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<image-empty v-model="item.new_cover[0].url" class="img" :style="img_radius" :error-img-style="error_img"></image-empty>
|
||||
</template>
|
||||
<template v-else> <image-empty v-model="item.data.cover" class="img" :style="img_radius" :error-img-style="error_img"></image-empty> </template>
|
||||
<div class="jc-sb flex-1 flex-col" :style="article_theme !== '0' ? content_padding : ''">
|
||||
<div class="jc-sb flex-1 flex-col" :style="article_theme != '0' ? content_padding : ''">
|
||||
<div class="title text-line-2" :style="article_name">{{ !isEmpty(item.new_title) ? item.new_title : item.data.title }}</div>
|
||||
<div class="flex-row jc-sb gap-8 align-e mt-10">
|
||||
<div :style="article_date">{{ field_show.includes('0') ? (!is_obj_empty(item.data) ? item.data.add_time : '2020-06-05 15:20') : '' }}</div>
|
||||
|
|
@ -191,7 +191,7 @@ watch(
|
|||
const multicolumn_columns_width = computed(() => {
|
||||
const { carousel_col } = toRefs(new_content.value);
|
||||
// 计算间隔的空间。(gap * gap数量) / 模块数量
|
||||
let gap = carousel_col.value !== '0' ? (new_style.value.article_spacing * carousel_col.value) / (Number(carousel_col.value) + 1) : '0';
|
||||
let gap = carousel_col.value != '0' ? (new_style.value.article_spacing * carousel_col.value) / (Number(carousel_col.value) + 1) : '0';
|
||||
return `calc(${100 / (Number(carousel_col.value) + 1)}% - ${gap}px)`;
|
||||
});
|
||||
// 文章内容高度
|
||||
|
|
@ -206,7 +206,7 @@ const carousel_height_computer = computed(() => {
|
|||
return new_style.value.name_size * 2 + new_style.value.article_height + 'px';
|
||||
});
|
||||
watch(
|
||||
props.value,
|
||||
() => props.value,
|
||||
(newVal, oldValue) => {
|
||||
const new_content = newVal?.content;
|
||||
const new_style = newVal?.style;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<el-form-item label="内容圆角">
|
||||
<radius :value="form.content_radius"></radius>
|
||||
</el-form-item>
|
||||
<template v-if="theme !== '3'">
|
||||
<template v-if="theme != '3'">
|
||||
<el-form-item label="图片圆角">
|
||||
<radius :value="form.img_radius"></radius>
|
||||
</el-form-item>
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<slider v-model="form.content_spacing"></slider>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-if="theme !== '3'">
|
||||
<template v-if="theme != '3'">
|
||||
<el-form-item label="文章间距">
|
||||
<slider v-model="form.article_spacing"></slider>
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<el-form-item label="内容圆角">
|
||||
<radius :value="form.content_radius"></radius>
|
||||
</el-form-item>
|
||||
<template v-if="theme !== '3'">
|
||||
<template v-if="theme != '3'">
|
||||
<el-form-item label="图片圆角">
|
||||
<radius :value="form.img_radius"></radius>
|
||||
</el-form-item>
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
<slider v-model="form.content_spacing"></slider>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-if="theme !== '3'">
|
||||
<template v-if="theme != '3'">
|
||||
<el-form-item label="文章间距">
|
||||
<slider v-model="form.article_spacing"></slider>
|
||||
</el-form-item>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
</card-container>
|
||||
</el-form>
|
||||
<div class="divider-line"></div>
|
||||
<common-styles :value="form.common_style" :is-mult-background="theme !== '7'" @update:value="common_styles_update" />
|
||||
<common-styles :value="form.common_style" :is-mult-background="theme != '7'" @update:value="common_styles_update" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
|
|||
|
|
@ -351,8 +351,8 @@ const drag_box_scale_bool = ref(false);
|
|||
const start_drag = (event: MouseEvent) => {
|
||||
drag_bool.value = true;
|
||||
if (!imgBoxRef.value) return;
|
||||
rect_start.value.x = rect_start.value.x !== 0 ? rect_start.value.x : event.clientX - imgBoxRef.value.getBoundingClientRect().left;
|
||||
rect_start.value.y = rect_start.value.y !== 0 ? rect_start.value.y : event.clientY - imgBoxRef.value.getBoundingClientRect().top;
|
||||
rect_start.value.x = rect_start.value.x != 0 ? rect_start.value.x : event.clientX - imgBoxRef.value.getBoundingClientRect().left;
|
||||
rect_start.value.y = rect_start.value.y != 0 ? rect_start.value.y : event.clientY - imgBoxRef.value.getBoundingClientRect().top;
|
||||
rect_start.value.width = 0;
|
||||
rect_start.value.height = 0;
|
||||
};
|
||||
|
|
@ -554,8 +554,8 @@ const start_drag_btn = (index: number, event: MouseEvent, type: string) => {
|
|||
|
||||
// 辅助函数用于更新drag_end
|
||||
const updateDragEnd = (dragStart: { x: number; y: number }, dragEnd: { x: number; y: number }, newDragEnd: { x?: number; y?: number }) => {
|
||||
const newX = newDragEnd.x !== undefined ? newDragEnd.x : dragEnd.x;
|
||||
const newY = newDragEnd.y !== undefined ? newDragEnd.y : dragEnd.y;
|
||||
const newX = newDragEnd.x != undefined ? newDragEnd.x : dragEnd.x;
|
||||
const newY = newDragEnd.y != undefined ? newDragEnd.y : dragEnd.y;
|
||||
return {
|
||||
x: newX,
|
||||
y: newY,
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="actived != 7 || props.num !== 1">
|
||||
<div v-for="(item, index) in split_list" :key="index" :class="['flex-col gap-10 h', { 'half-width': props.num !== 1, 'w': props.num == 1 }]">
|
||||
<template v-else-if="actived != 7 || props.num != 1">
|
||||
<div v-for="(item, index) in split_list" :key="index" :class="['flex-col gap-10 h', { 'half-width': props.num != 1, 'w': props.num == 1 }]">
|
||||
<div class="w h re">
|
||||
<template v-if="!isEmpty(item.new_cover)">
|
||||
<image-empty v-model="item.new_cover[0]" :style="contentImgRadius"></image-empty>
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ watch(props.value.content, (val) => {
|
|||
const oldDataStringified = JSON.stringify(old_list.value[key]);
|
||||
// 新数据
|
||||
const newDataStringified = JSON.stringify(new_data);
|
||||
if (oldDataStringified !== newDataStringified) {
|
||||
if (oldDataStringified != newDataStringified) {
|
||||
// 更新旧数据
|
||||
old_list.value[key] = JSON.parse(newDataStringified);
|
||||
// 更新轮播图的key,确保更换时能重新更新轮播图
|
||||
|
|
@ -300,7 +300,7 @@ const text_style = (typeface: string, size: number, color: string) => {
|
|||
|
||||
// 不属于第9个,并且第9个的第一个和第二个
|
||||
const spacing_processing = (index: number) => {
|
||||
return form.value.style_actived !== 8 || (form.value.style_actived === 8 && [0, 1].includes(index))
|
||||
return form.value.style_actived != 8 || (form.value.style_actived === 8 && [0, 1].includes(index))
|
||||
}
|
||||
// 公共样式
|
||||
const style_container = computed(() => common_styles_computer(new_style.value.common_style));
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export function is_obj(obj: unknown): boolean {
|
|||
// 特殊处理 null值,因为 typeof null 返回 "object",但 null 并不是我们要检查的对象
|
||||
if (obj === null) return false;
|
||||
// 使用 typeof 排除非对象类型
|
||||
if (typeof obj !== 'object') return false;
|
||||
if (typeof obj != 'object') return false;
|
||||
// 确认是普通对象
|
||||
return Object.prototype.toString.call(obj) === '[object Object]';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import { online_url } from '@/utils';
|
|||
const new_url = await online_url('/static/app/tabbar/').then((res) => res);
|
||||
interface DefaultFooterNav {
|
||||
content: {
|
||||
nav_style: number;
|
||||
nav_type: number;
|
||||
nav_style: string;
|
||||
nav_type: string;
|
||||
nav_content: { id: string; name: string; img: uploadList[]; img_checked: uploadList[]; link: object }[];
|
||||
};
|
||||
style: {
|
||||
|
|
@ -15,13 +15,49 @@ interface DefaultFooterNav {
|
|||
}
|
||||
const defaultFooterNav = ref<DefaultFooterNav>({
|
||||
content: {
|
||||
nav_style: 0,
|
||||
nav_type: 0,
|
||||
nav_style: '0',
|
||||
nav_type: '0',
|
||||
nav_content: [
|
||||
{ id: '1', name: '首页', img: [{ id: 1, url: new_url + 'home.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 2, url: new_url + 'active/home.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{ id: '2', name: '分类', img: [{ id: 3, url: new_url + 'category.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 4, url: new_url + 'active/category.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{ id: '3', name: '购物车', img: [{ id: 5, url: new_url + 'cart.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 6, url: new_url + 'active/cart.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{ id: '4', name: '我的', img: [{ id: 7, url: new_url + 'user.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 8, url: new_url + 'active/user.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{
|
||||
id: '1',
|
||||
name: '首页',
|
||||
img: [{ id: 1, url: new_url + 'home.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 2, url: new_url + 'active/home.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '商城首页',
|
||||
page: '/pages/index/index',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '分类',
|
||||
img: [{ id: 3, url: new_url + 'category.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 4, url: new_url + 'active/category.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '商品分类',
|
||||
page: '/pages/goods-category/goods-category',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '购物车',
|
||||
img: [{ id: 5, url: new_url + 'cart.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 6, url: new_url + 'active/cart.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '购物车',
|
||||
page: '/pages/cart/cart',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '我的',
|
||||
img: [{ id: 7, url: new_url + 'user.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 8, url: new_url + 'active/user.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '我的',
|
||||
page: '/pages/user/user',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
style: {
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ const set_show_tabs = (index: number) => {
|
|||
emits('rightUpdate', item, diy_data.value, page_data.value, footer_nav.value, tabs_data.value);
|
||||
item.show_tabs = '1';
|
||||
// 悬浮按钮的时候不用滚动到指定位置
|
||||
if (item.key !== 'float-window') {
|
||||
if (item.key != 'float-window') {
|
||||
scroll();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
<div class="nav-right">
|
||||
<el-button class="btn-plain" @click="upload_manage">上传管理</el-button>
|
||||
<el-button class="btn-plain" @click="preview_event">预览</el-button>
|
||||
<el-button class="btn-plain" @click="save_event">仅保存</el-button>
|
||||
<el-button class="btn-white" @click="save_close_event">保存关闭</el-button>
|
||||
<el-button class="btn-plain" :disabled="saveDisabled" @click="save_event">仅保存</el-button>
|
||||
<el-button class="btn-white" :disabled="saveDisabled" @click="save_close_event">保存关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="dialog_visible" class="radius-lg" width="650" draggable :close-on-click-modal="false" append-to-body>
|
||||
|
|
@ -53,6 +53,12 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { FormInstance, FormRules } from 'element-plus';
|
||||
const props = defineProps({
|
||||
saveDisabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const modelValue = defineModel({ type: Object, default: {} });
|
||||
// #region 变量 --------------------start
|
||||
const is_custom_dialog = ref(false);
|
||||
|
|
@ -91,15 +97,13 @@ const upload_manage = () => {
|
|||
const preview_event = () => {
|
||||
emit('preview');
|
||||
};
|
||||
|
||||
// 点击仅保存时的事件处理函数。
|
||||
const save_event = () => {
|
||||
emit('save');
|
||||
emit('save', true);
|
||||
};
|
||||
|
||||
// 点击保存并关闭时的事件处理函数。
|
||||
const save_close_event = () => {
|
||||
emit('saveClose');
|
||||
emit('saveClose', true);
|
||||
};
|
||||
|
||||
const confirm_event = async (formEl: FormInstance | undefined) => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div v-loading.fullscreen.lock="loading" class="app-wrapper no-copy" element-loading-background="rgba(255,255,255,1)" element-loading-custom-class="loading-custom">
|
||||
<template v-if="!loading_content">
|
||||
<template v-if="!is_empty">
|
||||
<navbar v-model="form.model" @preview="preview_event" @save="save_event" @save-close="save_close_event" />
|
||||
<navbar v-model="form.model" :save-disabled="save_disabled" @preview="preview_event" @save="save_event" @save-close="save_close_event" />
|
||||
<div class="app-wrapper-content flex-row">
|
||||
<app-main :diy-data="form.diy_data" :tabs-data="form.tabs_data" :header="form.header" :footer="form.footer" @right-update="right_update" @import="import_data_event" @export="export_data_event" @clear="clear_data_event"></app-main>
|
||||
<settings :key="key" :value="diy_data_item"></settings>
|
||||
|
|
@ -177,10 +177,13 @@ const diy_id = ref('');
|
|||
const preview_event = () => {
|
||||
save_formmat_form_data(form.value, false, false, true);
|
||||
};
|
||||
const save_event = () => {
|
||||
const save_disabled = ref(false);
|
||||
const save_event = (bool: boolean) => {
|
||||
save_disabled.value = bool;
|
||||
save_formmat_form_data(form.value);
|
||||
};
|
||||
const save_close_event = () => {
|
||||
const save_close_event = (bool: boolean) => {
|
||||
save_disabled.value = bool;
|
||||
save_formmat_form_data(form.value, true);
|
||||
};
|
||||
// save_formmat_form_data: 保存数据, data: 数据, close: 是否关闭, is_export: 是否导出, is_preview: 是否预览
|
||||
|
|
@ -275,6 +278,10 @@ const save_formmat_form_data = (data: diy_data_item, close: boolean = false, is_
|
|||
form.value.id = String(res.data);
|
||||
history.pushState({}, '', '?s=diy/saveinfo/id/' + res.data + '.html');
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
save_disabled.value = false;
|
||||
}, 500);
|
||||
});
|
||||
};
|
||||
//#endregion 顶部导航回调方法 ---------------------end
|
||||
|
|
@ -331,11 +338,11 @@ const form_data_transfor_diy_data = (clone_form: diyData) => {
|
|||
// 截取document.location.search字符串内id/后面的所有字段
|
||||
const get_id = () => {
|
||||
let new_id = '';
|
||||
if (document.location.search.indexOf('id/') !== -1) {
|
||||
if (document.location.search.indexOf('id/') != -1) {
|
||||
new_id = document.location.search.substring(document.location.search.indexOf('id/') + 3);
|
||||
// 去除字符串的.html
|
||||
let html_index = new_id.indexOf('.html');
|
||||
if (html_index !== -1) {
|
||||
if (html_index != -1) {
|
||||
new_id = new_id.substring(0, html_index);
|
||||
}
|
||||
return new_id;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import defaultCommon from './index';
|
||||
import { online_url } from '@/utils';
|
||||
const new_url = await online_url('/static/app/tabbar/').then((res) => res);
|
||||
export interface DefaultFooterNav {
|
||||
interface DefaultFooterNav {
|
||||
content: {
|
||||
nav_style: number;
|
||||
nav_type: number;
|
||||
nav_style: string;
|
||||
nav_type: string;
|
||||
nav_content: { id: string; name: string; img: uploadList[]; img_checked: uploadList[]; link: object }[];
|
||||
};
|
||||
style: {
|
||||
|
|
@ -15,13 +15,49 @@ export interface DefaultFooterNav {
|
|||
}
|
||||
const defaultFooterNav = ref<DefaultFooterNav>({
|
||||
content: {
|
||||
nav_style: 0,
|
||||
nav_type: 0,
|
||||
nav_style: '0',
|
||||
nav_type: '0',
|
||||
nav_content: [
|
||||
{ id: '1', name: '首页', img: [{ id: 1, url: new_url + 'home.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 2, url: new_url + 'active/home.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{ id: '2', name: '分类', img: [{ id: 3, url: new_url + 'category.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 4, url: new_url + 'active/category.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{ id: '3', name: '购物车', img: [{ id: 5, url: new_url + 'cart.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 6, url: new_url + 'active/cart.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{ id: '4', name: '我的', img: [{ id: 7, url: new_url + 'user.png', original: '', title: '', ext: '.png', type: 'img' }], img_checked: [{ id: 8, url: new_url + 'active/user.png', original: '', title: '', ext: '.png', type: 'img' }], link: {} },
|
||||
{
|
||||
id: '1',
|
||||
name: '首页',
|
||||
img: [{ id: 1, url: new_url + 'home.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 2, url: new_url + 'active/home.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '商城首页',
|
||||
page: '/pages/index/index',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '分类',
|
||||
img: [{ id: 3, url: new_url + 'category.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 4, url: new_url + 'active/category.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '商品分类',
|
||||
page: '/pages/goods-category/goods-category',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '购物车',
|
||||
img: [{ id: 5, url: new_url + 'cart.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 6, url: new_url + 'active/cart.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '购物车',
|
||||
page: '/pages/cart/cart',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '我的',
|
||||
img: [{ id: 7, url: new_url + 'user.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
img_checked: [{ id: 8, url: new_url + 'active/user.png', original: '', title: '', ext: '.png', type: 'img' }],
|
||||
link: {
|
||||
name: '我的',
|
||||
page: '/pages/user/user',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
style: {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<settings :key="key" :value="form"></settings>
|
||||
</div>
|
||||
<div class="app-wrapper-footer flex-row align-c">
|
||||
<el-button type="primary" class="footer-save" @click="save_event">保存</el-button>
|
||||
<el-button type="primary" class="footer-save" :disabled="save_disabled" @click="save_event">保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
|
@ -71,16 +71,21 @@ const loading_event = () => {
|
|||
//#endregion 页面初始化数据 ---------------------end
|
||||
|
||||
//#region 顶部导航回调方法 ---------------------start
|
||||
const save_disabled = ref(false);
|
||||
const save_event = () => {
|
||||
const clone_form = cloneDeep(form.value);
|
||||
const new_data = {
|
||||
type: 'home',
|
||||
config: clone_form,
|
||||
};
|
||||
save_disabled.value = true;
|
||||
// 数据改造
|
||||
DiyAPI.saveTabbar(new_data).then((res: any) => {
|
||||
// 如果是导出或预览模式,则不显示保存成功的消息
|
||||
ElMessage.success('保存成功');
|
||||
setTimeout(() => {
|
||||
save_disabled.value = false;
|
||||
}, 500);
|
||||
});
|
||||
};
|
||||
//#endregion 顶部导航回调方法 ---------------------end
|
||||
|
|
|
|||
Loading…
Reference in New Issue