|
@@ -589,6 +589,7 @@ const filePaneClick = (item) => {
|
|
const inIframe =
|
|
const inIframe =
|
|
outIframe.contentDocument.getElementsByTagName("iframe")[0];
|
|
outIframe.contentDocument.getElementsByTagName("iframe")[0];
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
+ console.log('outIframe',outIframe.parentElement);
|
|
console.error(outIframe.parentElement);
|
|
console.error(outIframe.parentElement);
|
|
inIframe.style.height = outIframe.style.height =
|
|
inIframe.style.height = outIframe.style.height =
|
|
outIframe.parentElement.offsetHeight + "px";
|
|
outIframe.parentElement.offsetHeight + "px";
|
|
@@ -619,11 +620,12 @@ const addFileTab = (data) => {
|
|
const hasThis = oldIFrameData.find((par) => par.docId == data.docId);//是否已存在
|
|
const hasThis = oldIFrameData.find((par) => par.docId == data.docId);//是否已存在
|
|
if (hasThis){
|
|
if (hasThis){
|
|
const thisPane = toRaw(hasThis)
|
|
const thisPane = toRaw(hasThis)
|
|
- console.log('hasThis',thisPane);
|
|
|
|
|
|
+ // console.log('hasThis',thisPane);
|
|
const arr = oldIFrameData.map((par) => {
|
|
const arr = oldIFrameData.map((par) => {
|
|
if (par.id == thisPane.id) {
|
|
if (par.id == thisPane.id) {
|
|
par.show = true
|
|
par.show = true
|
|
editableTabsValue.value = par.id// 标签跳转
|
|
editableTabsValue.value = par.id// 标签跳转
|
|
|
|
+ // iframeSize(par.id)
|
|
}else{
|
|
}else{
|
|
par.show = false
|
|
par.show = false
|
|
}
|
|
}
|
|
@@ -643,6 +645,7 @@ const addFileTab = (data) => {
|
|
par.show = true
|
|
par.show = true
|
|
thisData.docId = "";
|
|
thisData.docId = "";
|
|
editableTabsValue.value = par.id// 新建时标签跳转
|
|
editableTabsValue.value = par.id// 新建时标签跳转
|
|
|
|
+ // iframeSize(par.id)
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
par.show = false
|
|
par.show = false
|
|
@@ -651,6 +654,20 @@ const addFileTab = (data) => {
|
|
});
|
|
});
|
|
iFrameData.value = arr;
|
|
iFrameData.value = arr;
|
|
isAlive.value = false;
|
|
isAlive.value = false;
|
|
|
|
+ // const outIframe = document.getElementById("iframe" + par.id);
|
|
|
|
+ // const inIframe =
|
|
|
|
+ // outIframe.contentDocument.getElementsByTagName("iframe")[0];
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // console.log('outIframe',outIframe.parentElement);
|
|
|
|
+ // console.error(outIframe.parentElement);
|
|
|
|
+ // inIframe.style.height = outIframe.style.height =
|
|
|
|
+ // outIframe.parentElement.offsetHeight + "px";
|
|
|
|
+ // inIframe.style.width = outIframe.style.width =
|
|
|
|
+ // outIframe.parentElement.offsetWidth + "px";
|
|
|
|
+
|
|
|
|
+ // // console.log('dom',outIframe.parentElement.offsetWidth);
|
|
|
|
+ // // console.log('inIframe',inIframe);
|
|
|
|
+ // }, 500);
|
|
console.log("addFileTab", arr);
|
|
console.log("addFileTab", arr);
|
|
};
|
|
};
|
|
//创建tab标签事件
|
|
//创建tab标签事件
|
|
@@ -748,6 +765,24 @@ const closeFileTab = (item, index, e) => {
|
|
// console.log("index", index);
|
|
// console.log("index", index);
|
|
console.log("iFrameData", iFrameData.value);
|
|
console.log("iFrameData", iFrameData.value);
|
|
};
|
|
};
|
|
|
|
+// 控制iframe大小
|
|
|
|
+const iframeSize = (id)=>{
|
|
|
|
+ const outIframe = document.getElementById("iframe" + id);
|
|
|
|
+ const inIframe =
|
|
|
|
+ outIframe.contentDocument.getElementsByTagName("iframe")[0];
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ console.log('outIframe',outIframe.parentElement);
|
|
|
|
+ console.error(outIframe.parentElement);
|
|
|
|
+ inIframe.style.height = outIframe.style.height =
|
|
|
|
+ outIframe.parentElement.offsetHeight + "px";
|
|
|
|
+ inIframe.style.width = outIframe.style.width =
|
|
|
|
+ outIframe.parentElement.offsetWidth + "px";
|
|
|
|
+
|
|
|
|
+ // console.log('dom',outIframe.parentElement.offsetWidth);
|
|
|
|
+ // console.log('inIframe',inIframe);
|
|
|
|
+ }, 500);
|
|
|
|
+}
|
|
|
|
+// 监听和保存标签信息
|
|
const setTabLocal = (data)=>{
|
|
const setTabLocal = (data)=>{
|
|
// console.log('setTabLocal',data);
|
|
// console.log('setTabLocal',data);
|
|
sessionStorage.setItem('tabData', JSON.stringify(data))
|
|
sessionStorage.setItem('tabData', JSON.stringify(data))
|