mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-05 05:19:08 +08:00
parent
5b00286e65
commit
cf8aa86a67
@ -550,6 +550,11 @@ const top = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const jump = async (url: string) => {
|
const jump = async (url: string) => {
|
||||||
|
const fileName = url.substring(url.lastIndexOf('/') + 1);
|
||||||
|
let filePath = url.substring(0, url.lastIndexOf('/') + 1);
|
||||||
|
if (!url.includes('.')) {
|
||||||
|
filePath = url;
|
||||||
|
}
|
||||||
history.splice(pointer + 1);
|
history.splice(pointer + 1);
|
||||||
history.push(url);
|
history.push(url);
|
||||||
pointer = history.length - 1;
|
pointer = history.length - 1;
|
||||||
@ -558,7 +563,7 @@ const jump = async (url: string) => {
|
|||||||
const oldPageSize = req.pageSize;
|
const oldPageSize = req.pageSize;
|
||||||
// reset search params before exec jump
|
// reset search params before exec jump
|
||||||
Object.assign(req, initData());
|
Object.assign(req, initData());
|
||||||
req.path = url;
|
req.path = filePath;
|
||||||
req.containSub = false;
|
req.containSub = false;
|
||||||
req.search = '';
|
req.search = '';
|
||||||
req.pageSize = oldPageSize;
|
req.pageSize = oldPageSize;
|
||||||
@ -571,6 +576,14 @@ const jump = async (url: string) => {
|
|||||||
MsgWarning(i18n.global.t('commons.res.notFound'));
|
MsgWarning(i18n.global.t('commons.res.notFound'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (fileName && fileName.length > 1 && fileName.includes('.')) {
|
||||||
|
const fileData = searchResult.data.items.filter((item) => item.name === fileName);
|
||||||
|
if (fileData && fileData.length === 1) {
|
||||||
|
openView(fileData[0]);
|
||||||
|
} else {
|
||||||
|
MsgWarning(i18n.global.t('commons.res.notFound'));
|
||||||
|
}
|
||||||
|
}
|
||||||
handleSearchResult(searchResult);
|
handleSearchResult(searchResult);
|
||||||
getPaths(req.path);
|
getPaths(req.path);
|
||||||
nextTick(function () {
|
nextTick(function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user