vr-uniapp/src/views/layout/components/main/index.vue

567 lines
22 KiB
Vue
Raw Normal View History

<template>
<!-- 左侧模块 -->
<div class="siderbar flex-col">
<el-collapse v-model="activeNames">
<template v-for="(com, i) in components">
<el-collapse-item v-if="com.data.length > 0" :key="i" :title="com.name" :name="com.key">
2024-09-14 07:21:54 +00:00
<VueDraggable v-model="com.data" :animation="500" ghost-class="ghost" handle=".is-drag" :group="{ name: 'people', pull: 'clone', put: false }" class="component flex-row flex-wrap" :clone="clone_item_com_data" :sort="false" :force-fallback="true">
<template v-for="item in com.data" :key="item.key">
2024-10-08 08:30:46 +00:00
<el-tooltip effect="dark" :show-after="200" :hide-after="200" content="<span>该组件只可以点击添加, 并且只能添加一次。<br/>如果页面设置开启沉浸模式, 则不可添加</span>" raw-content placement="top" :disabled="!['tabs', 'tabs-carousel'].includes(item.key)">
2024-09-29 10:38:06 +00:00
<div :class="['item', { 'is-drag': !['tabs', 'tabs-carousel'].includes(item.key) }]" @click.stop="draggable_click(item)">
2024-09-14 07:21:54 +00:00
<div class="main-border siderbar-hidden main-show tc">释放鼠标将组件添加到此处</div>
<div class="siderbar-show main-hidden flex-col jc-c align-c gap-4">
<img class="img radius-xs" :src="url_computer(item.key)" />
<div>{{ item.name }}</div>
</div>
</div>
</el-tooltip>
</template>
</VueDraggable>
</el-collapse-item>
</template>
</el-collapse>
</div>
<div class="drawer-container" :style="`width: ${drawer_selected ? '12.8rem' : '0px'}`">
2024-09-05 09:38:28 +00:00
<div class="drawer-content pt-5" :style="{ left: drawer_selected ? '0' : '-100%' }">
<div class="size-14 cr-3 fw pl-12 drawer-title" :style="{ opacity: drawer_selected ? '1' : '0' }">已选组件({{ diy_data.length }})</div>
2024-08-30 09:23:42 +00:00
<div ref="left_scrollTop" class="drawer-drag-area">
2024-09-14 09:29:59 +00:00
<div v-for="(item, index) in tabs_data" :key="index" :class="['flex ptb-12 plr-10 gap-y-8 re align-c drawer-drag', { 'drawer-drag-bg': item.show_tabs == '1' }]" @click="set_tabs_event(true)">
<el-icon class="iconfont icon-jinzhi size-16 cr-d" />
2024-09-14 07:21:54 +00:00
<span class="size-12 cr-6">{{ item.name }}</span>
2024-10-16 02:52:32 +00:00
<el-icon class="iconfont icon-close-round-o size-16 abs" :style="[item.show_tabs == '1' ? '' : 'display:none']" @click.stop="del(index, true)" />
2024-09-14 09:29:59 +00:00
</div>
2024-08-30 08:37:47 +00:00
<VueDraggable v-model="diy_data" :animation="500" target=".sort-target" :scroll="true" :on-sort="on_sort">
<TransitionGroup type="transition" tag="ul" name="fade" class="sort-target flex-col">
2024-09-05 06:29:43 +00:00
<li v-for="(item, index) in diy_data" :key="index" :class="['flex ptb-12 plr-10 gap-y-8 re align-c drawer-drag', { 'drawer-drag-bg': item.show_tabs == '1' }]" @click="on_choose(index, item.show_tabs)">
2024-08-30 08:37:47 +00:00
<el-icon class="iconfont icon-drag size-16 cr-d" />
<span class="size-12 cr-6">{{ item.name }}</span>
2024-10-16 02:52:32 +00:00
<el-icon class="iconfont icon-close-round-o size-16 abs" :style="[item.show_tabs == '1' ? '' : 'display:none']" @click.stop="del(index, false)" />
2024-08-30 08:37:47 +00:00
</li>
</TransitionGroup>
</VueDraggable>
</div>
2024-09-20 09:37:05 +00:00
</div>
2024-08-30 08:37:47 +00:00
</div>
<!-- 视图渲染 -->
2024-09-05 09:38:28 +00:00
<div class="main re">
2024-10-19 03:51:32 +00:00
<div v-if="diy_data.length > 0 || tabs_data.length > 0" :class="['layout-toggle-bar', drawer_selected ? 'layout-toggle-bar-close' : 'layout-toggle-bar-open']" @click="toggle_drawer">
2024-09-05 09:38:28 +00:00
<div class="layout-toggle-bar-top"></div>
<div class="layout-toggle-bar-bottom"></div>
</div>
<div class="model">
<div class="model-content">
2024-08-28 07:31:08 +00:00
<div class="acticons">
2024-09-29 10:38:06 +00:00
<el-button size="large" @click="page_settings"></el-button>
<el-button size="large" @click="export_click"></el-button>
<!-- <el-upload action="#" :accept="exts_text" :show-file-list="false" :auto-upload="false" :on-change="upload_change">
2024-09-05 06:36:28 +00:00
<template #trigger>
<el-button size="large">导入</el-button>
</template>
2024-09-29 10:38:06 +00:00
</el-upload> -->
<el-button size="large" @click="import_click"></el-button>
<el-button size="large" @click="clear_click"></el-button>
2024-08-28 07:31:08 +00:00
</div>
<!-- 拖拽区 -->
2024-10-09 08:44:55 +00:00
<div ref="scrollTop" class="model-drag" @scroll="on_scroll_event">
2024-10-12 07:52:42 +00:00
<div class="page-bg" :style="content_style">
<div class="page-bg-img" :style="content_img_style"></div>
</div>
2024-08-28 07:31:08 +00:00
<!-- 页面设置 -->
2024-10-09 08:44:55 +00:00
<page-settings :show-page="page_data.show_tabs == '1'" :page-data="page_data" :scoll-top="scoll_top" @page_settings="page_settings"></page-settings>
2024-10-12 07:52:42 +00:00
<div class="model-wall" :style="`margin-top: ${top_margin}px;`">
<div class="model-wall-content" :style="`padding-top:${top_padding}px;padding-bottom:${bottom_navigation_show ? footer_nav_counter_store.padding_footer : 0}px;`">
2024-09-29 10:38:06 +00:00
<div-content :diy-data="tabs_data" :show-model-border="show_model_border" :is-tabs="true" :main-content-style="main_content_style" @on_choose="set_tabs_event(true)" @del="del"></div-content>
2024-09-20 09:37:05 +00:00
<div v-if="tabs_data.length > 0" class="seat"></div>
<VueDraggable v-model="diy_data" :animation="500" :touch-start-threshold="2" group="people" class="drag-area re" ghost-class="ghost" :on-sort="on_sort" :on-start="on_start" :on-end="on_end">
2024-09-14 07:21:54 +00:00
<div-content :diy-data="diy_data" :show-model-border="show_model_border" :main-content-style="main_content_style" @on_choose="on_choose" @del="del" @copy="copy" @move-up="moveUp" @move-down="moveDown"></div-content>
</VueDraggable>
</div>
</div>
2024-09-20 09:37:05 +00:00
<!-- <div class="seat"></div> -->
</div>
<!-- 底部区域 -->
2024-08-28 10:51:03 +00:00
<div v-if="bottom_navigation_show" class="model-bottom">
2024-09-05 06:29:43 +00:00
<footer-nav :show-footer="footer_nav.show_tabs == '1'" :footer-data="footer_nav.com_data" @footer-nav="footer_nav_event"></footer-nav>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
2024-09-29 10:38:06 +00:00
import { background_computer, get_math, gradient_computer, padding_computer } from '@/utils';
2024-09-14 07:21:54 +00:00
import { cloneDeep, isEmpty } from 'lodash';
import { SortableEvent, VueDraggable } from 'vue-draggable-plus';
import defaultSettings from './index';
2024-09-02 10:16:16 +00:00
import { footerNavCounterStore, commonStore } from '@/store';
const footer_nav_counter_store = footerNavCounterStore();
2024-09-02 10:16:16 +00:00
const common_store = commonStore();
const app = getCurrentInstance();
const props = defineProps({
diyData: {
type: Array<any>,
default: () => [],
},
2024-09-14 07:21:54 +00:00
tabsData: {
type: Array<any>,
default: () => [],
},
footer: {
type: Object,
default: () => {},
},
header: {
type: Object,
default: () => {},
},
});
const diy_data = ref(props.diyData);
2024-09-14 07:21:54 +00:00
const tabs_data = ref(props.tabsData);
const page_data = ref(props.header);
const footer_nav = ref(props.footer);
// 监听
watch(
() => props.diyData,
(newValue) => {
diy_data.value = newValue;
}
);
2024-09-14 07:21:54 +00:00
watch(
() => props.tabsData,
(newValue) => {
tabs_data.value = newValue;
}
);
2024-08-15 01:40:04 +00:00
// 监听
watch(
() => props.header,
(newValue) => {
page_data.value = newValue;
2024-08-15 01:40:04 +00:00
page_settings();
}
);
watch(
() => props.footer,
(newValue) => {
footer_nav.value = newValue;
},
{ deep: true }
);
2024-08-28 07:31:08 +00:00
const top_padding = ref(90);
const top_margin = ref(0);
2024-08-28 09:52:03 +00:00
const content_style = ref('');
2024-10-10 03:20:17 +00:00
const content_img_style = ref('');
2024-08-28 09:52:03 +00:00
const main_content_style = ref('');
2024-08-28 10:51:03 +00:00
const bottom_navigation_show = ref(true);
2024-10-19 03:33:06 +00:00
// 更新数据第一个的安全距离
const set_padding_top_value = () => {
if (diy_data.value.length > 0) {
diy_data.value.forEach((item: any, index: number) => {
if (index === 0) {
item.com_data.style.common_style.padding_top_safe_value = common_store.header_height;
} else {
item.com_data.style.common_style.padding_top_safe_value = 0;
}
});
}
};
2024-08-15 01:40:04 +00:00
watchEffect(() => {
2024-08-28 10:51:03 +00:00
const data = page_data.value.com_data;
if (data) {
// 底部按钮显示
const content = data.content;
2024-09-02 01:50:15 +00:00
bottom_navigation_show.value = content.bottom_navigation_show == '1' ? true : false;
2024-08-28 10:51:03 +00:00
// 通用样式设置
const new_style = data.style;
2024-10-10 03:20:17 +00:00
content_style.value = gradient_computer(new_style.common_style);
content_img_style.value = background_computer(new_style.common_style);
2024-08-28 09:52:03 +00:00
main_content_style.value = padding_computer(new_style.common_style);
2024-09-02 01:50:15 +00:00
2024-10-19 03:33:06 +00:00
const { immersive_style, up_slide_display, data_alone_row_space, general_safe_distance_value } = new_style;
2024-08-28 07:31:08 +00:00
// 不开启沉浸式 和 上滑显示
2024-09-05 03:34:08 +00:00
if (immersive_style == '1' || up_slide_display != '1') {
top_padding.value = 0;
2024-10-17 08:59:41 +00:00
} else if (content.data_alone_row_value.length > 0) {
top_padding.value = 90 + 32 + data_alone_row_space;
2024-08-28 07:31:08 +00:00
} else {
top_padding.value = 90;
}
// 开启沉浸式并且没有开通上滑显示
2024-09-05 03:34:08 +00:00
if (immersive_style == '1' && up_slide_display != '1') {
2024-10-17 08:59:41 +00:00
if (content.data_alone_row_value.length > 0) {
top_margin.value = -90 - 32 - data_alone_row_space;
} else {
top_margin.value = -90;
}
2024-08-28 07:31:08 +00:00
} else {
top_margin.value = 0;
}
2024-10-19 03:33:06 +00:00
// 开始沉浸式并且开启安全距离
if (immersive_style == '1' && general_safe_distance_value == '1') {
if (content.data_alone_row_value.length > 0) {
common_store.set_header_height(90 + 32 + data_alone_row_space);
} else {
common_store.set_header_height(90);
}
} else {
// 没有开沉浸模式或者没有开启安全距离
common_store.set_header_height(0);
}
set_padding_top_value();
2024-08-22 10:40:15 +00:00
}
});
2024-08-28 09:52:03 +00:00
2024-09-05 09:38:28 +00:00
// 已选组件逻辑处理
const drawer_selected = ref(false);
2024-10-11 06:22:19 +00:00
const is_show_drawer = ref(true);
2024-09-05 09:38:28 +00:00
watchEffect(() => {
2024-10-11 06:22:19 +00:00
if ((diy_data.value.length > 0 || tabs_data.value.length > 0) && is_show_drawer.value) {
2024-09-05 09:38:28 +00:00
drawer_selected.value = true;
} else {
drawer_selected.value = false;
}
});
2024-09-05 09:38:28 +00:00
const toggle_drawer = () => {
2024-10-11 06:22:19 +00:00
is_show_drawer.value = !is_show_drawer.value;
2024-09-05 09:38:28 +00:00
drawer_selected.value = !drawer_selected.value;
};
2024-10-11 06:22:19 +00:00
// 父组件调用的方法
const emits = defineEmits(['rightUpdate', 'import', 'export', 'clear']);
2024-09-02 10:16:16 +00:00
const activeNames = reactive(['base', 'plugins', 'tool']);
interface componentsData {
name: string;
key: string;
data: componentsData[];
}
2024-09-03 06:08:14 +00:00
const components = ref<componentsData[]>([]);
const url_computer = (name: string) => {
2024-09-02 01:58:52 +00:00
const new_url = ref(new URL(`../../../../assets/images/layout/siderbar/${name}.png`, import.meta.url).href).value;
return new_url;
};
//#region 拖拽组件的公共方法
// 是否显示提示用户拖拽位置
const show_model_border = ref(true);
2024-09-14 07:21:54 +00:00
// 点击添加tabs组件
const draggable_click = (item: componentsData) => {
2024-09-24 06:10:45 +00:00
const type_data = ['tabs', 'tabs-carousel'];
2024-10-09 05:54:52 +00:00
if (common_store.is_immersion_model) {
ElMessage.error('开启沉浸样式下不可以添加该组件');
return;
}
2024-09-24 06:10:45 +00:00
if (type_data.includes(item.key) && isEmpty(tabs_data.value)) {
2024-09-14 07:21:54 +00:00
// 添加tabs组件
tabs_data.value.push({
name: item.name,
show_tabs: '1',
is_enable: '1',
src: '',
id: get_math(),
2024-09-24 06:10:45 +00:00
key: item.key,
com_data: cloneDeep((defaultSettings as any)[item.key.replace(/-/g, '_')]),
2024-09-14 07:21:54 +00:00
});
2024-10-09 05:54:52 +00:00
common_store.set_is_have_tabs(true);
2024-09-14 07:21:54 +00:00
set_tabs_event(true);
2024-09-24 06:10:45 +00:00
} else if (type_data.includes(item.key) && !isEmpty(tabs_data.value)) {
if (tabs_data.value[0].key == item.key) {
ElMessage.error('该组件只可以添加一次');
} else if (tabs_data.value[0].key != item.key) {
ElMessage.error('选项卡轮播不能与选项卡同时存在');
}
2024-09-14 07:21:54 +00:00
}
2024-09-29 10:38:06 +00:00
};
2024-10-09 05:54:52 +00:00
watchEffect(() => {
if (tabs_data.value.length <= 0) {
common_store.set_is_have_tabs(false);
}
});
// 复制
const clone_item_com_data = (item: commonComponentData) => {
return {
name: item.name,
2024-09-05 06:29:43 +00:00
show_tabs: '1',
is_enable: '1',
src: item.src,
id: get_math(),
key: item.key,
com_data: cloneDeep((defaultSettings as any)[item.key.replace(/-/g, '_')]),
};
};
// 任何行动都会触发
const on_sort = (item: SortableEvent) => {
let index = item?.newIndex || 0;
// 设置对应的位置为显示
set_show_tabs(index);
2024-10-19 03:33:06 +00:00
// 操作的时候更新一下数据的安全距离
set_padding_top_value();
};
// 开始拖拽时
const on_start = () => {
show_model_border.value = false;
};
// 拖拽结束时
const on_end = () => {
show_model_border.value = true;
};
//#endregion
// 设置复制 删除 移动几个按钮的显示位置,
2024-09-13 10:50:31 +00:00
// 选中时候的效果
const on_choose = (index: number, show_tabs: string) => {
// 如果已经选中了, 设置为不可再次触发事件
if (show_tabs != '1') {
// 设置对应的位置为显示
set_show_tabs(index);
}
};
2024-09-14 07:21:54 +00:00
// 复制
const copy = (index: number) => {
// 获取当前数据, 复制的时候id更换一下
const new_data = {
...cloneDeep(get_diy_index_data(index)),
id: get_math(),
};
// 在当前位置下插入数据
diy_data.value.splice(index, 0, new_data);
set_show_tabs(index + 1);
};
2024-09-13 10:50:31 +00:00
// 删除
2024-09-14 07:21:54 +00:00
const del = (index: number, is_tabs: boolean) => {
2024-09-13 10:50:31 +00:00
app?.appContext.config.globalProperties.$common.message_box('删除后不可恢复,确定继续吗?', 'warning').then(() => {
2024-09-14 07:21:54 +00:00
// 如果是选项卡被删除则删除tabs组件并判断是否有拖拽内容有的选中第一个没有的时候默认选中页面设置
if (is_tabs) {
tabs_data.value.splice(0, 1);
2024-09-13 10:50:31 +00:00
if (diy_data.value.length > 0) {
2024-09-14 07:21:54 +00:00
set_show_tabs(0);
2024-09-13 10:50:31 +00:00
} else {
page_settings();
}
2024-09-14 07:21:54 +00:00
return;
2024-09-13 10:50:31 +00:00
} else {
2024-09-14 07:21:54 +00:00
const show_tabs_index = diy_data.value.findIndex((item: any) => item.show_tabs == '1');
// 删除的是当前的这个数据
if (show_tabs_index == index) {
diy_data.value.splice(index, 1);
if (diy_data.value.length > 0) {
let new_index: number = index;
// 删除的时候如果大于0则显示上边的数据
if (index > 0) {
new_index = new_index - 1;
}
set_show_tabs(new_index);
} else if (tabs_data.value.length > 0) {
// 拖拽数据不存在时选中tabs组件
set_tabs_event(true);
} else {
page_settings();
}
} else {
diy_data.value.splice(index, 1);
}
2024-09-13 10:50:31 +00:00
}
2024-10-19 03:33:06 +00:00
// 操作的时候更新一下数据的安全距离
set_padding_top_value();
2024-09-13 10:50:31 +00:00
});
};
2024-09-14 07:21:54 +00:00
// 向上移动
const moveUp = (index: number, flag: boolean) => {
if (flag) {
const old_data = get_diy_index_data(index);
// 截取前半部分信息, 并反转一下,从最后边往前查询
const new_list = diy_data.value.slice(0, index).reverse();
const count = float_count(new_list);
// 删除当前位置信息
diy_data.value.splice(index, 1);
// 将数据插入上一层数据中
diy_data.value.splice(index - count, 0, old_data);
// 设置对应的位置为显示
set_show_tabs(index - count);
2024-10-19 03:33:06 +00:00
// 操作的时候更新一下数据的安全距离
set_padding_top_value();
2024-09-14 07:21:54 +00:00
}
};
// 向下移动
const moveDown = (index: number, flag: boolean) => {
if (flag) {
const old_data = get_diy_index_data(index);
// 截取后半部分信息, 舍弃自身的信息
const new_list = diy_data.value.slice(index + 1, diy_data.value.length);
const count = float_count(new_list);
// 删除当前位置信息
diy_data.value.splice(index, 1);
// 将数据插入下一层数据中
diy_data.value.splice(index + count, 0, old_data);
set_show_tabs(index + count);
2024-10-19 03:33:06 +00:00
// 操作的时候更新一下数据的安全距离
set_padding_top_value();
2024-09-14 07:21:54 +00:00
}
};
const float_count = (new_list: any[]) => {
// 记录一下当前查询的是否是对应的信息
let key = '';
let conunt = 1;
new_list.forEach((item, index) => {
// 如果当前的key是悬浮按钮并且历史的也是就加一否则的话记录一下当前的key避免多次循环
if (item.key == 'float-window' && isEmpty(key)) {
conunt += 1;
} else {
key = item.key;
}
});
return conunt;
};
// 获取当前传递过来的index对应的diy_data中的数据
const get_diy_index_data = (index: number) => {
return (<arrayIndex>diy_data.value)[index.toString()];
};
// 设置当前选中的是那个
const set_show_tabs = (index: number) => {
2024-09-05 06:29:43 +00:00
page_data.value.show_tabs = '0';
footer_nav.value.show_tabs = '0';
2024-09-14 07:21:54 +00:00
set_tabs_event(false);
diy_data.value.forEach((item, for_index) => {
// 先将全部的设置为false,再将当前选中的设置为true
2024-09-05 06:29:43 +00:00
item.show_tabs = '0';
if (for_index == index) {
2024-09-14 07:21:54 +00:00
emits('rightUpdate', item, diy_data.value, page_data.value, footer_nav.value, tabs_data.value);
2024-09-05 06:29:43 +00:00
item.show_tabs = '1';
2024-08-23 09:04:44 +00:00
// 悬浮按钮的时候不用滚动到指定位置
2024-09-25 10:19:18 +00:00
if (item.key != 'float-window') {
2024-08-23 09:04:44 +00:00
scroll();
}
}
});
};
2024-08-30 09:23:42 +00:00
// 中间区域的滚动效果
2024-08-12 08:10:56 +00:00
const scrollTop = ref<HTMLElement | null>(null);
const activeCard = ref<HTMLElement | null>(null);
2024-08-30 09:23:42 +00:00
// 左边已选组件的滚动效果
const left_scrollTop = ref<HTMLElement | null>(null);
const left_activeCard = ref<HTMLElement | null>(null);
2024-08-12 08:10:56 +00:00
// 滚动到指定位置
const scroll = () => {
nextTick(() => {
2024-08-30 09:23:42 +00:00
// 获取当前选中的内容 --中间区域的滚动效果
activeCard.value = document.querySelector('.plug-in-table.plug-in-border');
2024-08-12 08:10:56 +00:00
if (activeCard.value) {
// 获取选中内容的位置
const scrollY = activeCard.value.offsetTop;
if (scrollTop.value) {
// 选中的滚动到指定位置
2024-09-24 06:10:45 +00:00
scrollTop.value.scrollTo({ top: scrollY - 100, behavior: 'smooth' });
2024-08-12 08:10:56 +00:00
}
}
2024-08-30 09:23:42 +00:00
// 左边已选组件的滚动效果
left_activeCard.value = document.querySelector('.drawer-drag-bg');
if (left_activeCard.value) {
// 获取选中内容的位置
const left_scrollY = left_activeCard.value.offsetTop;
if (left_scrollTop.value) {
// 选中的滚动到指定位置
left_scrollTop.value.scrollTo({ top: left_scrollY - 200, behavior: 'smooth' });
}
}
2024-08-12 08:10:56 +00:00
});
};
2024-10-09 08:44:55 +00:00
const scoll_top = ref(0);
const on_scroll_event = (e: any) => {
scoll_top.value = e.target.scrollTop;
};
//#endregion
//#region 页面设置 导出 导入
// 在组件挂载时默认执行
onMounted(() => {
page_settings();
2024-09-02 10:16:16 +00:00
nextTick(() => {
const interval = setInterval(() => {
// 获取分类
if (common_store.common.module_list.length > 0) {
components.value = common_store.common.module_list;
clearInterval(interval);
}
}, 1000);
});
});
//页面设置
const page_settings = () => {
// 页面设置显示
2024-09-05 06:29:43 +00:00
page_data.value.show_tabs = '1';
footer_nav.value.show_tabs = '0';
2024-09-14 07:21:54 +00:00
set_tabs_event(false);
// 将拖拽的信息全部变为不选中
if (diy_data.value.length > 0) {
diy_data.value.forEach((item) => {
2024-09-05 06:29:43 +00:00
item.show_tabs = '0';
});
}
2024-09-14 07:21:54 +00:00
emits('rightUpdate', page_data.value, diy_data.value, page_data.value, footer_nav.value, tabs_data.value);
};
const set_tabs_event = (choose: Boolean) => {
if (tabs_data.value.length > 0 && !choose) {
tabs_data.value[0].show_tabs = '0';
} else if (tabs_data.value.length > 0 && choose) {
tabs_data.value[0].show_tabs = '1';
page_data.value.show_tabs = '0';
footer_nav.value.show_tabs = '0';
// 将拖拽的信息全部变为不选中
if (diy_data.value.length > 0) {
diy_data.value.forEach((item) => {
item.show_tabs = '0';
});
}
emits('rightUpdate', tabs_data.value[0], diy_data.value, page_data.value, footer_nav.value, tabs_data.value);
}
};
//导出
2024-09-05 06:36:28 +00:00
const export_click = () => {
emits('export');
};
2024-09-29 10:38:06 +00:00
// 导入
const import_click = () => {
emits('import');
2024-09-05 06:36:28 +00:00
};
// 清空列表
const clear_click = () => {
app?.appContext.config.globalProperties.$common.message_box('清空后不可恢复,确定继续吗?', 'warning').then(() => {
emits('clear');
});
};
//#endregion
//#region 底部导航
//底部导航设置
const footer_nav_event = () => {
// 页面设置显示
2024-09-05 06:29:43 +00:00
page_data.value.show_tabs = '0';
footer_nav.value.show_tabs = '1';
2024-09-14 07:21:54 +00:00
set_tabs_event(false);
// 将拖拽的信息全部变为不选中
if (diy_data.value.length > 0) {
diy_data.value.forEach((item) => {
2024-09-05 06:29:43 +00:00
item.show_tabs = '0';
});
}
2024-09-14 07:21:54 +00:00
emits('rightUpdate', footer_nav.value, diy_data.value, page_data.value, footer_nav.value, tabs_data.value);
};
//#endregion
</script>
<style lang="scss" scoped>
2024-08-30 08:37:47 +00:00
@import 'index.scss';
2024-09-02 01:44:14 +00:00
.drag-area {
2024-09-03 07:32:04 +00:00
min-height: 100%;
display: flex;
flex-direction: column;
align-items: stretch;
flex: 1;
}
2024-09-02 01:50:15 +00:00
</style>