|
@@ -712,7 +712,7 @@ const closeFileTab = (item, index, e) => {
|
|
|
e.stopPropagation();
|
|
|
const data = toRaw(item);
|
|
|
console.log("closeFileTab", data);
|
|
|
- const arr = iFrameData.value.map((par) => {
|
|
|
+ let arr = iFrameData.value.map((par) => {
|
|
|
if (par.id === data.id) {
|
|
|
par.src = "";
|
|
|
par.show = false;
|
|
@@ -721,27 +721,47 @@ const closeFileTab = (item, index, e) => {
|
|
|
}
|
|
|
return toRaw(par);
|
|
|
});
|
|
|
- iFrameData.value = arr;
|
|
|
if(data.id == editableTabsValue.value){
|
|
|
- isAlive.value = true;
|
|
|
+ console.log('data.id',data.id);
|
|
|
+ let isLeft = true
|
|
|
+ //如果不是第一个就左移
|
|
|
+ for (let thisId = data.id; thisId>0; thisId--) {
|
|
|
+ console.log(arr[thisId - 1].id,arr[thisId - 1].src);
|
|
|
+ if(arr[thisId - 1].src){
|
|
|
+ arr[thisId -1].show = true
|
|
|
+ isLeft = false
|
|
|
+ editableTabsValue.value = arr[thisId - 1].id
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ // 如果是第一个就跳到文件夹标签右一
|
|
|
+ if(isLeft){
|
|
|
+ const num = toRaw(editableTabs.value).length - 1
|
|
|
+ const nextTab = editableTabs.value[num]
|
|
|
+ paneClick(toRaw(nextTab));
|
|
|
+ console.log('left',nextTab);
|
|
|
+ }
|
|
|
+ // isAlive.value = true;
|
|
|
}
|
|
|
+ iFrameData.value = arr;
|
|
|
// console.log("index", index);
|
|
|
console.log("iFrameData", iFrameData.value);
|
|
|
};
|
|
|
const setTabLocal = (data)=>{
|
|
|
- console.log('setTabLocal',data);
|
|
|
+ // console.log('setTabLocal',data);
|
|
|
sessionStorage.setItem('tabData', JSON.stringify(data))
|
|
|
}
|
|
|
const setFileTabLocal = (data)=>{
|
|
|
- console.log('setFileTabLocal',data);
|
|
|
+ // console.log('setFileTabLocal',data);
|
|
|
sessionStorage.setItem('fileTabData', JSON.stringify(data))
|
|
|
}
|
|
|
const setEditableTabsValue = (data)=>{
|
|
|
- console.log('setEditableTabsValue',data);
|
|
|
+ // console.log('setEditableTabsValue',data);
|
|
|
sessionStorage.setItem('editableTabsValue', JSON.stringify(data))
|
|
|
}
|
|
|
watch(() => iFrameData.value, (newValue, oldValue) => {
|
|
|
- console.log('iFrameData 发生改变了', newValue, oldValue);
|
|
|
+ // console.log('iFrameData 发生改变了', newValue, oldValue);
|
|
|
setFileTabLocal(toRaw(toRaw(newValue)))
|
|
|
|
|
|
}, {
|
|
@@ -749,14 +769,14 @@ watch(() => iFrameData.value, (newValue, oldValue) => {
|
|
|
deep: true
|
|
|
});
|
|
|
watch(() => editableTabs.value, (newValue, oldValue) => {
|
|
|
- console.log('editableTabs 发生改变了', newValue, oldValue);
|
|
|
+ // console.log('editableTabs 发生改变了', newValue, oldValue);
|
|
|
setTabLocal(toRaw(newValue))
|
|
|
}, {
|
|
|
immediate: true,
|
|
|
deep: true
|
|
|
});
|
|
|
watch(() => editableTabsValue.value, (newValue, oldValue) => {
|
|
|
- console.log('editableTabsValue 发生改变了', newValue, oldValue);
|
|
|
+ // console.log('editableTabsValue 发生改变了', newValue, oldValue);
|
|
|
setEditableTabsValue(toRaw(newValue))
|
|
|
let regExp = new RegExp(/^\//);
|
|
|
if(!regExp.test(editableTabsValue.value)){
|