修复关联文件夹、聚合分类下右键项目菜单显示多余选项问题。

This commit is contained in:
unknown 2024-08-29 22:43:47 +08:00
parent a411674e3a
commit c23e4f51f0
2 changed files with 31 additions and 4 deletions

View File

@ -179,6 +179,13 @@ export default function () {
// 组装菜单
if (!batchOperation) {
if (item) {
// 查询页面分类信息
let pageClassification = selectClassificationById(
args.pageClassificationId
);
if (!pageClassification && type === "main") {
return;
}
// 后缀
let ext: string | null = null;
// 排除
@ -306,7 +313,8 @@ export default function () {
if (
type === "main" &&
(item.type === 0 || item.type === 1) &&
classification.type === 0
classification.type === 0 &&
pageClassification.type === 0
) {
menuList.push(
new MenuItem({
@ -337,7 +345,11 @@ export default function () {
if (pathMenu) {
menuList.push(new MenuItem({ type: "separator" }));
}
if (type === "main") {
if (
type === "main" &&
classification.type === 0 &&
pageClassification.type === 0
) {
// "图标"菜单
let existPasteIcon = false;
// 获取剪切板图片文件
@ -373,7 +385,9 @@ export default function () {
if (
type === "main" &&
(item.type === 0 || item.type === 1) &&
!item.data.fixedIcon
!item.data.fixedIcon &&
classification.type === 0 &&
pageClassification.type === 0
) {
menuList.push(
new MenuItem({
@ -384,7 +398,11 @@ export default function () {
})
);
}
if (type === "main" && classification.type === 0) {
if (
type === "main" &&
classification.type === 0 &&
pageClassification.type === 0
) {
menuList.push(new MenuItem({ type: "separator" }));
menuList.push(
new MenuItem({

View File

@ -623,6 +623,14 @@ async function contextmenu(e: any) {
// ID
store.itemRightMenuItemId = id;
}
//
let pageClassificationId = null;
let itemListElement = getClassElement(e, "item-list");
if (itemListElement) {
pageClassificationId = parseInt(
itemListElement.getAttribute("classification-id")
);
}
//
window.item.showRightMenu({
classificationId: getSelectedClassificationId(),
@ -633,6 +641,7 @@ async function contextmenu(e: any) {
x: e.screenX,
y: e.screenY,
type: "main",
pageClassificationId,
});
}
// beforeMount