mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-13 21:02:10 +08:00
修复分类在顶部,当子分类数量过多超出屏幕范围的问题。
This commit is contained in:
parent
acb9231915
commit
2d82702efe
@ -130,20 +130,20 @@
|
|||||||
<KeyboardArrowDownRound></KeyboardArrowDownRound>
|
<KeyboardArrowDownRound></KeyboardArrowDownRound>
|
||||||
</Icon>
|
</Icon>
|
||||||
</div>
|
</div>
|
||||||
<ul
|
<div
|
||||||
v-show="
|
v-show="
|
||||||
classification.childList &&
|
classification.childList &&
|
||||||
classification.childList.length > 0 &&
|
classification.childList.length > 0 &&
|
||||||
classificationChildShowHiddenMap.has(classification.id)
|
classificationChildShowHiddenMap.has(classification.id)
|
||||||
"
|
"
|
||||||
class="classification-child-list"
|
|
||||||
:class="[
|
:class="[
|
||||||
`${
|
`${
|
||||||
store.setting.classification.layout === 'top'
|
store.setting.classification.layout === 'top'
|
||||||
? 'fixed z-[10000] rounded drop-shadow-[0_0_6px_rgba(0,0,0,0.2)] origin-top-left pt-1 mt-1'
|
? '!fixed !z-[10000] !rounded-lg !drop-shadow-[0_0_6px_rgba(0,0,0,0.2)] !origin-top-left !pt-1 !mt-1'
|
||||||
: ''
|
: ''
|
||||||
}`,
|
}`,
|
||||||
]"
|
]"
|
||||||
|
:data-simplebar="store.setting.classification.layout === 'top'"
|
||||||
:style="{
|
:style="{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
store.setting.classification.layout === 'top'
|
store.setting.classification.layout === 'top'
|
||||||
@ -156,87 +156,95 @@
|
|||||||
store.setting.classification.layout === 'top'
|
store.setting.classification.layout === 'top'
|
||||||
? classificationWidth + 'px'
|
? classificationWidth + 'px'
|
||||||
: '',
|
: '',
|
||||||
|
maxHeight:
|
||||||
|
store.setting.classification.layout === 'top' ? '300px' : 'auto',
|
||||||
}"
|
}"
|
||||||
:classification-parent-id="classification.id"
|
|
||||||
>
|
>
|
||||||
<li
|
<ul
|
||||||
v-for="(
|
class="classification-child-list h-full"
|
||||||
childClassification, childIndex
|
|
||||||
) of classification.childList"
|
|
||||||
:id="'classification-child-' + classification.id"
|
|
||||||
:key="
|
|
||||||
'classification-' +
|
|
||||||
classification.id +
|
|
||||||
'-' +
|
|
||||||
childClassification.id +
|
|
||||||
'-' +
|
|
||||||
childIndex
|
|
||||||
"
|
|
||||||
class="classification-child mb-1 px-2 flex items-center h-[30px]"
|
|
||||||
:class="[
|
|
||||||
`${
|
|
||||||
store.setting.classification.nameAlign === 'center' ||
|
|
||||||
store.setting.classification.mode === 'icon'
|
|
||||||
? 'justify-center'
|
|
||||||
: ''
|
|
||||||
}`,
|
|
||||||
`${
|
|
||||||
store.setting.classification.layout !== 'top' ? 'rounded' : ''
|
|
||||||
}`,
|
|
||||||
`${store.setting.classification.mode === 'normal' ? 'px-2' : ''}`,
|
|
||||||
]"
|
|
||||||
:style="{
|
|
||||||
color:
|
|
||||||
isSelectedChild(childClassification.id, classification.id) ||
|
|
||||||
(store.itemSorting &&
|
|
||||||
store.mouseoverClassificationId === childClassification.id)
|
|
||||||
? store.setting.appearance.theme.secondFontColor
|
|
||||||
: undefined,
|
|
||||||
backgroundColor:
|
|
||||||
isSelectedChild(childClassification.id, classification.id) ||
|
|
||||||
(store.itemSorting &&
|
|
||||||
store.mouseoverClassificationId === childClassification.id)
|
|
||||||
? hexToRGBA(
|
|
||||||
store.setting.appearance.theme.secondBackgroundColor,
|
|
||||||
store.setting.appearance.transparency
|
|
||||||
)
|
|
||||||
: undefined,
|
|
||||||
}"
|
|
||||||
:classification-parent-id="classification.id"
|
:classification-parent-id="classification.id"
|
||||||
:classification-id="childClassification.id"
|
|
||||||
@click="
|
|
||||||
switchChildClassification(
|
|
||||||
classification.id,
|
|
||||||
childClassification.id
|
|
||||||
)
|
|
||||||
"
|
|
||||||
@dragleave="clearMouseOverChangeClassificationSetTimeout"
|
|
||||||
>
|
>
|
||||||
<span
|
<li
|
||||||
class="overflow-hidden text-ellipsis whitespace-nowrap"
|
v-for="(
|
||||||
|
childClassification, childIndex
|
||||||
|
) of classification.childList"
|
||||||
|
:id="'classification-child-' + classification.id"
|
||||||
|
:key="
|
||||||
|
'classification-' +
|
||||||
|
classification.id +
|
||||||
|
'-' +
|
||||||
|
childClassification.id +
|
||||||
|
'-' +
|
||||||
|
childIndex
|
||||||
|
"
|
||||||
|
class="classification-child mb-1 px-2 flex items-center h-[30px]"
|
||||||
|
:class="[
|
||||||
|
`${
|
||||||
|
store.setting.classification.nameAlign === 'center' ||
|
||||||
|
store.setting.classification.mode === 'icon'
|
||||||
|
? 'justify-center'
|
||||||
|
: ''
|
||||||
|
}`,
|
||||||
|
`${
|
||||||
|
store.setting.classification.layout !== 'top' ? 'rounded' : ''
|
||||||
|
}`,
|
||||||
|
`${
|
||||||
|
store.setting.classification.mode === 'normal' ? 'px-2' : ''
|
||||||
|
}`,
|
||||||
|
]"
|
||||||
:style="{
|
:style="{
|
||||||
filter: store.setting.appearance.fontShadow
|
color:
|
||||||
? 'drop-shadow(1px 1px 1px ' +
|
isSelectedChild(childClassification.id, classification.id) ||
|
||||||
store.setting.appearance.fontShadowColor +
|
(store.itemSorting &&
|
||||||
')'
|
store.mouseoverClassificationId === childClassification.id)
|
||||||
: undefined,
|
? store.setting.appearance.theme.secondFontColor
|
||||||
|
: undefined,
|
||||||
|
backgroundColor:
|
||||||
|
isSelectedChild(childClassification.id, classification.id) ||
|
||||||
|
(store.itemSorting &&
|
||||||
|
store.mouseoverClassificationId === childClassification.id)
|
||||||
|
? hexToRGBA(
|
||||||
|
store.setting.appearance.theme.secondBackgroundColor,
|
||||||
|
store.setting.appearance.transparency
|
||||||
|
)
|
||||||
|
: undefined,
|
||||||
}"
|
}"
|
||||||
|
:classification-parent-id="classification.id"
|
||||||
|
:classification-id="childClassification.id"
|
||||||
|
@click="
|
||||||
|
switchChildClassification(
|
||||||
|
classification.id,
|
||||||
|
childClassification.id
|
||||||
|
)
|
||||||
|
"
|
||||||
|
@dragleave="clearMouseOverChangeClassificationSetTimeout"
|
||||||
>
|
>
|
||||||
{{ getClassificationName(childClassification) }}
|
<span
|
||||||
</span>
|
class="overflow-hidden text-ellipsis whitespace-nowrap"
|
||||||
</li>
|
:style="{
|
||||||
<li
|
filter: store.setting.appearance.fontShadow
|
||||||
v-show="store.setting.classification.layout !== 'top'"
|
? 'drop-shadow(1px 1px 1px ' +
|
||||||
class="h-[1px] my-1 border-t-[1px]"
|
store.setting.appearance.fontShadowColor +
|
||||||
style="border-top-style: solid"
|
')'
|
||||||
:style="{
|
: undefined,
|
||||||
borderColor: hexToRGBA(
|
}"
|
||||||
store.setting.appearance.theme.borderColor,
|
>
|
||||||
store.setting.appearance.transparency
|
{{ getClassificationName(childClassification) }}
|
||||||
),
|
</span>
|
||||||
}"
|
</li>
|
||||||
></li>
|
<li
|
||||||
</ul>
|
v-show="store.setting.classification.layout !== 'top'"
|
||||||
|
class="h-[1px] my-1 border-t-[1px]"
|
||||||
|
style="border-top-style: solid"
|
||||||
|
:style="{
|
||||||
|
borderColor: hexToRGBA(
|
||||||
|
store.setting.appearance.theme.borderColor,
|
||||||
|
store.setting.appearance.transparency
|
||||||
|
),
|
||||||
|
}"
|
||||||
|
></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -299,10 +307,17 @@ watch(
|
|||||||
() => {
|
() => {
|
||||||
// +1
|
// +1
|
||||||
count.value = count.value + 1;
|
count.value = count.value + 1;
|
||||||
|
classificationChildShowHiddenMap.value = new Map();
|
||||||
// 刷新DOM完毕执行
|
// 刷新DOM完毕执行
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
// 滚动条
|
||||||
|
createSimpleBar();
|
||||||
// 设置分类宽度
|
// 设置分类宽度
|
||||||
setClassificationWidth();
|
setClassificationWidth();
|
||||||
|
// 创建父级分类拖拽对象;
|
||||||
|
createClassificationParentSortable();
|
||||||
|
// 创建子级分类拖拽对象
|
||||||
|
createClassificationChildSortable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -787,6 +802,8 @@ function createClassificationParentSortable() {
|
|||||||
setClassificationWidth();
|
setClassificationWidth();
|
||||||
// 页面高度 - 34(标题栏固定高度)
|
// 页面高度 - 34(标题栏固定高度)
|
||||||
height.value = document.documentElement.clientHeight - 34;
|
height.value = document.documentElement.clientHeight - 34;
|
||||||
|
// 创建子级分类拖拽对象
|
||||||
|
createClassificationChildSortable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -815,7 +832,7 @@ function createClassificationChildSortable() {
|
|||||||
classificationChildSortable.push(
|
classificationChildSortable.push(
|
||||||
Sortable.create(<HTMLElement>element, {
|
Sortable.create(<HTMLElement>element, {
|
||||||
animation: 0,
|
animation: 0,
|
||||||
forceFallback: true,
|
forceFallback: false,
|
||||||
fallbackTolerance: 4,
|
fallbackTolerance: 4,
|
||||||
disabled: lockClassification,
|
disabled: lockClassification,
|
||||||
onStart() {
|
onStart() {
|
||||||
|
@ -154,6 +154,12 @@ watch(
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
// 监听页面大小
|
// 监听页面大小
|
||||||
resize();
|
resize();
|
||||||
|
// 设置项目宽度
|
||||||
|
setItemWidth();
|
||||||
|
// 创建项目拖拽对象
|
||||||
|
createItemSortable();
|
||||||
|
// 清除批量操作
|
||||||
|
clearBatchOperation();
|
||||||
// 滚动到顶部
|
// 滚动到顶部
|
||||||
scrollToTop(itemContentSimpleBar);
|
scrollToTop(itemContentSimpleBar);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user