修改页面显示

v1.0.0
于肖磊 2024-09-13 18:50:31 +08:00
parent 3c44a223f7
commit 5e14a62150
3 changed files with 41 additions and 31 deletions

View File

@ -205,7 +205,7 @@ const arrow_disable_method = (item_key: string, index: number, key: string) => {
}
return arrow_disable;
};
const emits = defineEmits(['set_show_tabs', 'page_settings']);
const emits = defineEmits(['on_choose', 'set_show_tabs', 'del']);
//
const set_enable = (index: number) => {
@ -215,11 +215,8 @@ const set_enable = (index: number) => {
//
const on_choose = (index: number, show_tabs: string) => {
// ,
if (show_tabs != '1') {
//
emits('set_show_tabs', index);
}
//
emits('on_choose', index, show_tabs);
};
//
@ -235,24 +232,7 @@ const copy = (index: number) => {
};
//
const del = (index: number) => {
app?.appContext.config.globalProperties.$common.message_box('删除后不可恢复,确定继续吗?', 'warning').then(() => {
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;
}
emits('set_show_tabs', new_index);
} else {
emits('page_settings');
}
} else {
diy_data.value.splice(index, 1);
}
});
emits('del', index);
};
// indexdiy_data
const get_diy_index_data = (index: number) => {
@ -427,4 +407,10 @@ const float_bottom_change = (val: { bottom: string; location: string }, id: stri
height: 0.9rem;
}
}
.drag-area .float-window {
position: fixed;
max-width: 39rem;
margin: 0 auto;
z-index: 3;
}
</style>

View File

@ -103,12 +103,6 @@
display: flex;
flex-direction: column;
align-items: stretch;
.drag-area .float-window {
position: fixed;
max-width: 39rem;
margin: 0 auto;
z-index: 3;
}
.main-content {
max-width: 39rem;
overflow: hidden;

View File

@ -58,7 +58,7 @@
<div class="model-wall" :style="content_style">
<div class="model-wall-content" :style="`padding-top:${top_padding}px; margin-top: ${top_margin}px;padding-bottom:${bottom_navigation_show ? footer_nav_counter_store.padding_footer : 0}px;`">
<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">
<DivContent :diy-data="diy_data" :show-model-border="show_model_border" :main-content-style="main_content_style" @page_settings="page_settings" @set_show_tabs="set_show_tabs"></DivContent>
<div-content :diy-data="diy_data" :show-model-border="show_model_border" :main-content-style="main_content_style" @on_choose="on_choose" @del="del" @set_show_tabs="set_show_tabs"></div-content>
</VueDraggable>
</div>
</div>
@ -223,6 +223,36 @@ const on_end = () => {
//#endregion
//
//
const on_choose = (index: number, show_tabs: string) => {
// ,
if (show_tabs != '1') {
//
set_show_tabs(index);
}
};
//
const del = (index: number) => {
app?.appContext.config.globalProperties.$common.message_box('删除后不可恢复,确定继续吗?', 'warning').then(() => {
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 {
page_settings();
}
} else {
diy_data.value.splice(index, 1);
}
});
};
//
const set_show_tabs = (index: number) => {
page_data.value.show_tabs = '0';