fix: Fix bug in file management with multiple tabs

This commit is contained in:
lan-yonghui 2025-08-28 10:59:25 +08:00
parent 5a34e2d380
commit 146350a9e2
14 changed files with 718 additions and 600 deletions

View file

@ -219,30 +219,30 @@ defineExpose({
closeRightClick,
});
onMounted(() => {
let heightDiff = 320;
let tabHeight = 0;
if (props.heightDiff) {
heightDiff = props.heightDiff;
}
if (globalStore.openMenuTabs) {
tabHeight = 48;
}
function calcHeight() {
let heightDiff = props.heightDiff ?? 320;
let tabHeight = globalStore.openMenuTabs ? 48 : 0;
if (props.height) {
tableHeight.value = props.height - tabHeight;
} else {
tableHeight.value = window.innerHeight - heightDiff - tabHeight;
}
}
window.onresize = () => {
return (() => {
if (props.height) {
tableHeight.value = props.height - tabHeight;
} else {
tableHeight.value = window.innerHeight - heightDiff - tabHeight;
}
})();
};
onMounted(() => {
calcHeight();
window.addEventListener('resize', calcHeight);
watch(
() => props.height,
() => {
calcHeight();
},
);
});
onBeforeUnmount(() => {
window.removeEventListener('resize', calcHeight);
});
</script>

View file

@ -1510,6 +1510,7 @@ const message = {
cancelUpload: 'Cancel Upload',
cancelUploadHelper: 'Whether to cancel the upload, after cancellation the upload list will be cleared.',
keepOneTab: 'Keep at least one tab',
notCanTab: 'Cannot add more tabs',
},
ssh: {
autoStart: 'Auto start',

View file

@ -1454,6 +1454,7 @@ const message = {
cancelUpload: 'アップロードをキャンセル',
cancelUploadHelper: 'アップロードをキャンセルするかどうかキャンセル後アップロードリストはクリアされます',
keepOneTab: '少なくとも1つのタブを保持してください',
notCanTab: 'これ以上タブを追加できません',
},
ssh: {
autoStart: 'オートスタート',

View file

@ -1439,6 +1439,7 @@ const message = {
cancelUpload: '업로드 취소',
cancelUploadHelper: '업로드를 취소할지 여부, 취소 업로드 목록이 비워집니다.',
keepOneTab: '최소한 하나의 탭을 유지하세요',
notCanTab: ' 이상 탭을 추가할 없습니다',
},
ssh: {
autoStart: '자동 시작',

View file

@ -1497,6 +1497,7 @@ const message = {
cancelUploadHelper:
'Adakah hendak membatalkan muat naik, selepas pembatalan senarai muat naik akan dikosongkan.',
keepOneTab: 'Pastikan sekurang-kurangnya satu tab dikekalkan',
notCanTab: 'Tidak dapat menambah tab lagi',
},
ssh: {
autoStart: 'Mula automatik',

View file

@ -1484,6 +1484,7 @@ const message = {
cancelUpload: 'Cancelar Upload',
cancelUploadHelper: 'Deseja cancelar o upload, após o cancelamento, a lista de upload será limpa.',
keepOneTab: 'Mantenha pelo menos uma aba',
notCanTab: 'Não é possível adicionar mais abas',
},
ssh: {
autoStart: 'Início automático',

View file

@ -1485,6 +1485,7 @@ const message = {
cancelUpload: 'Отменить загрузку',
cancelUploadHelper: 'Отменить загрузку или нет, после отмены список загрузок будет очищен.',
keepOneTab: 'Необходимо оставить как минимум одну вкладку',
notCanTab: 'Невозможно добавить больше вкладок',
},
ssh: {
autoStart: 'Автозапуск',

View file

@ -1527,6 +1527,7 @@ const message = {
cancelUpload: 'Yüklemeyi İptal Et',
cancelUploadHelper: 'Yüklemeyi iptal etmek ister misiniz, iptal sonrası yükleme listesi temizlenecektir.',
keepOneTab: 'En az bir sekme ık kalmalıdır',
notCanTab: 'Daha fazla sekme eklenemez',
},
ssh: {
autoStart: 'Otomatik başlat',

View file

@ -1439,6 +1439,7 @@ const message = {
cancelUpload: '取消上傳',
cancelUploadHelper: '是否取消上傳取消後將清空上傳列表',
keepOneTab: '至少保留一個標籤頁',
notCanTab: '無法新增更多標籤頁',
},
ssh: {
autoStart: '開機自啟',

View file

@ -1434,6 +1434,7 @@ const message = {
cancelUpload: '取消上传',
cancelUploadHelper: '是否取消上传取消后将清空上传列表',
keepOneTab: '至少保留一个标签页',
notCanTab: '不可增加更多的标签页',
},
ssh: {
autoStart: '开机自启',

View file

@ -155,6 +155,7 @@ html.dark {
.el-tabs--card > .el-tabs__header .el-tabs__nav {
border: 1px solid var(--panel-main-bg-color-8);
border-bottom: none;
}
.el-tabs--card > .el-tabs__header .el-tabs__item.is-active {

View file

@ -257,6 +257,10 @@ html {
}
}
.el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
border-bottom-color: var(--panel-color-primary) !important;
}
.logo {
color: var(--el-color-primary);
}

View file

@ -53,3 +53,42 @@ export function useSearchableForSelect(paths) {
searchableInputBlur,
};
}
export function useMultipleSearchable(paths) {
const searchableStatus = ref(false);
const searchablePath = ref('');
const searchableInputRefs = ref<Record<string, HTMLInputElement | null>>({});
const setSearchableInputRef = (id: string, el: HTMLInputElement | null) => {
if (el) {
searchableInputRefs.value[id] = el;
} else {
delete searchableInputRefs.value[id];
}
};
watch(searchableStatus, (val) => {
if (val) {
searchablePath.value = paths.value.at(-1)?.url || '';
nextTick(() => {
const keys = Object.keys(searchableInputRefs.value);
if (keys.length > 0) {
const lastKey = keys[keys.length - 1];
searchableInputRefs.value[lastKey]?.focus();
}
});
}
});
const searchableInputBlur = () => {
searchableStatus.value = false;
};
return {
searchableStatus,
searchablePath,
searchableInputRefs,
setSearchableInputRef,
searchableInputBlur,
};
}

File diff suppressed because it is too large Load diff