|
|
@@ -362,33 +362,34 @@ const toSearch = async () => {
|
|
|
console.log("res", res);
|
|
|
if (res) {
|
|
|
const itemData = {
|
|
|
- label:'全局搜索',
|
|
|
- path:'/search',
|
|
|
- data:{
|
|
|
- searchData: JSON.stringify(res),
|
|
|
+ name:'全局搜索',
|
|
|
+ path:'search',
|
|
|
+ clickRowId:{
|
|
|
+ searchData: res,
|
|
|
searchText: searchText.value,
|
|
|
}
|
|
|
}
|
|
|
+ addFolderAdd(itemData)
|
|
|
// console.log("res", res);
|
|
|
// console.log("router", route.path);
|
|
|
- if (route.path != "/search") {
|
|
|
- let listArr = JSON.stringify(res);
|
|
|
- router.push({
|
|
|
- name: 'search',
|
|
|
- params: {
|
|
|
- listArr: listArr,
|
|
|
- searchText: searchText.value
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- router.replace({
|
|
|
- path: "/allback",
|
|
|
- query: {
|
|
|
- searchData: JSON.stringify(res),
|
|
|
- searchText: searchText.value,
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (route.path != "/search") {
|
|
|
+ // let listArr = JSON.stringify(res);
|
|
|
+ // router.push({
|
|
|
+ // name: 'search',
|
|
|
+ // params: {
|
|
|
+ // listArr: listArr,
|
|
|
+ // searchText: searchText.value
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // router.replace({
|
|
|
+ // path: "/allback",
|
|
|
+ // query: {
|
|
|
+ // searchData: JSON.stringify(res),
|
|
|
+ // searchText: searchText.value,
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // }
|
|
|
}
|
|
|
};
|
|
|
const emits = defineEmits(["setLayout"]);
|
|
|
@@ -511,15 +512,24 @@ const clickPath = (index, items) => {
|
|
|
};
|
|
|
const clickTab = (item) => {
|
|
|
let url = toRaw(item)
|
|
|
- // console.log("item", url);
|
|
|
+ console.log("item", url);
|
|
|
setTimeout(() => {
|
|
|
console.log("toFileData.value", toFileData.value);
|
|
|
if (toFileData.value) {
|
|
|
localStorage.setItem("inChat",0)
|
|
|
- // console.log(
|
|
|
- // "tofolder",
|
|
|
- // JSON.stringify(toRaw(toFileData.value.clickRowId))
|
|
|
- // );
|
|
|
+ // 去全文搜索单独判断
|
|
|
+ if(toFileData.value.name == "全局搜索"){
|
|
|
+ console.log("clickRowId.value", JSON.stringify(toRaw(toFileData.value).clickRowId));
|
|
|
+ editableTabsValue.value = toFileData.value.path
|
|
|
+ router.push({
|
|
|
+ name: toFileData.value.path,
|
|
|
+ state: {
|
|
|
+ // row: JSON.stringify(toRaw(toFileData.value.clickRowId)),
|
|
|
+ clickRowId: JSON.stringify(toRaw(toFileData.value).clickRowId),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
editableTabsValue.value = toFileData.value.path
|
|
|
router.push({
|
|
|
path: toFileData.value.path,
|
|
|
@@ -673,9 +683,9 @@ const addTab = (data) => {
|
|
|
}
|
|
|
};
|
|
|
const addFolderAdd = (data) => {
|
|
|
- // console.log("data", data);
|
|
|
+ console.log("data", data);
|
|
|
const arr = toRaw(editableTabs.value);
|
|
|
- if (!arr.some((item) => item.label == data.clickRowId.dirName)) {
|
|
|
+ if (!arr.some((item) => item.label == data.clickRowId.dirName ||item.label == data.name )) {
|
|
|
editableTabs.value.push({
|
|
|
label: data.name,
|
|
|
path: data.path,
|