|
@@ -44,14 +44,13 @@
|
|
|
? 'acitve-img-style img-style'
|
|
|
: 'img-style'
|
|
|
">
|
|
|
- <img :src="$route.path == item.path ? item.beimgs : item.imgs" />
|
|
|
- <div class="text-style" v-if="$route.path != item.path">
|
|
|
- {{ item.label }}
|
|
|
- </div>
|
|
|
- <span class="yuandian" v-if="
|
|
|
- hasNewMessage &&
|
|
|
- item.path == '/index' &&
|
|
|
- ($route.path != item.path || isSwitchFileIframe)
|
|
|
+ <img :src="$route.path == item.path ? item.beimgs : item.imgs" />
|
|
|
+ <div class="text-style" v-if="$route.path != item.path">
|
|
|
+ {{ item.label }}
|
|
|
+ </div>
|
|
|
+ <span class="yuandian" v-if="hasNewMessage &&
|
|
|
+ item.path == '/index' &&
|
|
|
+ ($route.path != item.path || isSwitchFileIframe)
|
|
|
"></span>
|
|
|
</div>
|
|
|
</router-link><br />
|
|
@@ -113,16 +112,8 @@
|
|
|
<div v-show="!isAlive" style="width: 100%">
|
|
|
<div v-for="item in iFrameData" :key="item.id">
|
|
|
<div style="width: 100%" v-show="item.show">
|
|
|
- <iframe
|
|
|
- :src="item.src"
|
|
|
- frameborder="0"
|
|
|
- :id="`iframe${item.id}`"
|
|
|
- :name="`iframe${item.id}`"
|
|
|
- width="100%"
|
|
|
- height="800px"
|
|
|
- class="iframeBox"
|
|
|
- v-show="item.show"
|
|
|
- ></iframe>
|
|
|
+ <iframe :src="item.src" frameborder="0" :id="`iframe${item.id}`" :name="`iframe${item.id}`" width="100%"
|
|
|
+ height="800px" class="iframeBox" v-show="item.show"></iframe>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -133,7 +124,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onMounted, provide, ref,watchEffect,watch } from "vue";
|
|
|
+import { nextTick, onMounted, provide, ref, watchEffect, watch } from "vue";
|
|
|
import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
import useAppStore from "@/store/modules/app";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
@@ -177,7 +168,7 @@ const wangzhi = import.meta.env.VITE_APP_BASE_API;
|
|
|
const isAlive = ref(true);
|
|
|
const toFileData = ref();
|
|
|
const uid = useUserStore().uid;
|
|
|
-let hasNewMessage=ref(false)
|
|
|
+let hasNewMessage = ref(false)
|
|
|
let isSwitchFileIframe = ref(false); //是否切换到文件预览标签
|
|
|
const iFrameData = ref(JSON.parse(sessionStorage.getItem('fileTabData')) || [
|
|
|
{
|
|
@@ -290,7 +281,7 @@ function toggleSideBar() {
|
|
|
appStore.toggleSideBar();
|
|
|
}
|
|
|
const logingName = ref("");
|
|
|
-let lisetenMessageTime=null;
|
|
|
+let lisetenMessageTime = null;
|
|
|
onMounted(() => {
|
|
|
logingName.value = Cookies.get("username");
|
|
|
clearInterval(lisetenMessageTime)
|
|
@@ -298,25 +289,25 @@ onMounted(() => {
|
|
|
//if(router.currentRoute.value.path=='/index') return;
|
|
|
//console.log("===============window.noReadList:", localStorage.getItem("noreadlist"),'===========',isSwitchFileIframe.value)
|
|
|
let tmplist = localStorage.getItem("noreadlist")
|
|
|
- if(tmplist==null || tmplist==''){
|
|
|
+ if (tmplist == null || tmplist == '') {
|
|
|
hasNewMessage.value = false
|
|
|
return
|
|
|
}
|
|
|
tmplist = JSON.parse(tmplist);
|
|
|
- if(tmplist!=null)hasNewMessage.value = true
|
|
|
+ if (tmplist != null) hasNewMessage.value = true
|
|
|
else hasNewMessage.value = false
|
|
|
}, 1000);
|
|
|
// console.log('onMt',editableTabsValue.value);
|
|
|
// console.log('type',typeof editableTabsValue.value);
|
|
|
|
|
|
- nextTick(()=>{ // 要放在对响应式数据修改之后
|
|
|
- if(typeof editableTabsValue.value == 'number'){
|
|
|
+ nextTick(() => { // 要放在对响应式数据修改之后
|
|
|
+ if (typeof editableTabsValue.value == 'number') {
|
|
|
setTimeout(() => {
|
|
|
iframeSize(editableTabsValue.value)
|
|
|
}, 1000);
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
|
|
|
// console.log('router',router)
|
|
|
});
|
|
@@ -373,7 +364,14 @@ const toSearch = async () => {
|
|
|
// console.log("res", res);
|
|
|
// console.log("router", route.path);
|
|
|
if (route.path != "/search") {
|
|
|
- router.push('/search' + '/' + JSON.stringify(res) + '/' + searchText.value);
|
|
|
+ let listArr = JSON.stringify(res);
|
|
|
+ router.push({
|
|
|
+ name: 'search',
|
|
|
+ params: {
|
|
|
+ listArr: listArr,
|
|
|
+ searchText: searchText.value
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
router.replace({
|
|
|
path: "/allback",
|
|
@@ -482,11 +480,11 @@ if (hasRole) {
|
|
|
|
|
|
const clickPath = (index, items) => {
|
|
|
items = toRaw(items);
|
|
|
- localStorage.setItem("inChat",items.path=="/index"?1:0)
|
|
|
+ localStorage.setItem("inChat", items.path == "/index" ? 1 : 0)
|
|
|
// toFileData.value = null
|
|
|
console.log("clickPathitems", items);
|
|
|
// editableTabs.value = arr;
|
|
|
- isSwitchFileIframe.value=false
|
|
|
+ isSwitchFileIframe.value = false
|
|
|
const arr = toRaw(editableTabs.value);
|
|
|
if (!arr.some((item) => item.label == items.label)) {
|
|
|
editableTabs.value.push({
|
|
@@ -509,7 +507,7 @@ const clickTab = (item) => {
|
|
|
setTimeout(() => {
|
|
|
console.log("toFileData.value", toFileData.value);
|
|
|
if (toFileData.value) {
|
|
|
- localStorage.setItem("inChat",0)
|
|
|
+ localStorage.setItem("inChat", 0)
|
|
|
console.log(
|
|
|
"tofolder",
|
|
|
JSON.stringify(toRaw(toFileData.value.clickRowId))
|
|
@@ -523,7 +521,7 @@ const clickTab = (item) => {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- localStorage.setItem("inChat",url=="/index" ? 1: 0)
|
|
|
+ localStorage.setItem("inChat", url == "/index" ? 1 : 0)
|
|
|
let regExp = new RegExp(/^\//);
|
|
|
if (!regExp.test(url)) {
|
|
|
const data = JSON.parse(url);
|
|
@@ -538,7 +536,7 @@ const clickTab = (item) => {
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
|
- editableTabsValue.value = url
|
|
|
+ editableTabsValue.value = url
|
|
|
router.push({
|
|
|
path: item,
|
|
|
});
|
|
@@ -561,7 +559,7 @@ const paneClick = (item) => {
|
|
|
};
|
|
|
// 点击文件标签
|
|
|
const filePaneClick = (item) => {
|
|
|
- localStorage.setItem("inChat",0)
|
|
|
+ localStorage.setItem("inChat", 0)
|
|
|
console.log("filePaneClickitem", item);
|
|
|
isSwitchFileIframe.value = true
|
|
|
console.log(98588546543);
|
|
@@ -575,7 +573,7 @@ const filePaneClick = (item) => {
|
|
|
const inIframe =
|
|
|
outIframe.contentDocument.getElementsByTagName("iframe")[0];
|
|
|
setTimeout(() => {
|
|
|
- console.log('outIframe',outIframe.parentElement);
|
|
|
+ console.log('outIframe', outIframe.parentElement);
|
|
|
console.error(outIframe.parentElement);
|
|
|
inIframe.style.height = outIframe.style.height =
|
|
|
outIframe.parentElement.offsetHeight + "px";
|
|
@@ -607,20 +605,20 @@ const addFileTab = (data) => {
|
|
|
const thisPane = toRaw(hasThis)
|
|
|
// console.log('hasThis',thisPane);
|
|
|
const arr = oldIFrameData.map((par) => {
|
|
|
- if (par.id == thisPane.id) {
|
|
|
- par.show = true
|
|
|
- editableTabsValue.value = par.id// 标签跳转
|
|
|
- setTimeout(() => {
|
|
|
-
|
|
|
- iframeSize(par.id)
|
|
|
- }, 1000);
|
|
|
- }else{
|
|
|
- par.show = false
|
|
|
- }
|
|
|
- return toRaw(par);
|
|
|
- });
|
|
|
- iFrameData.value = arr;
|
|
|
- isAlive.value = false;
|
|
|
+ if (par.id == thisPane.id) {
|
|
|
+ par.show = true
|
|
|
+ editableTabsValue.value = par.id// 标签跳转
|
|
|
+ setTimeout(() => {
|
|
|
+
|
|
|
+ iframeSize(par.id)
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
+ par.show = false
|
|
|
+ }
|
|
|
+ return toRaw(par);
|
|
|
+ });
|
|
|
+ iFrameData.value = arr;
|
|
|
+ isAlive.value = false;
|
|
|
return
|
|
|
}
|
|
|
const arr = oldIFrameData.map((par) => {
|
|
@@ -634,7 +632,7 @@ const addFileTab = (data) => {
|
|
|
thisData.docId = "";
|
|
|
editableTabsValue.value = par.id// 新建时标签跳转
|
|
|
setTimeout(() => {
|
|
|
-
|
|
|
+
|
|
|
iframeSize(par.id)
|
|
|
}, 1000);
|
|
|
}
|
|
@@ -757,27 +755,27 @@ const closeFileTab = (item, index, e) => {
|
|
|
console.log("iFrameData", iFrameData.value);
|
|
|
};
|
|
|
// 控制iframe大小
|
|
|
-const iframeSize = (id)=>{
|
|
|
- const outIframe = document.getElementById("iframe" + id);
|
|
|
+const iframeSize = (id) => {
|
|
|
+ const outIframe = document.getElementById("iframe" + id);
|
|
|
const inIframe =
|
|
|
outIframe.contentDocument.getElementsByTagName("iframe")[0];
|
|
|
- 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('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);
|
|
|
+ // console.log('dom',outIframe.parentElement.offsetWidth);
|
|
|
+ // console.log('inIframe',inIframe);
|
|
|
}
|
|
|
// 监听和保存标签信息
|
|
|
-const setTabLocal = (data)=>{
|
|
|
+const setTabLocal = (data) => {
|
|
|
// console.log('setTabLocal',data);
|
|
|
sessionStorage.setItem('tabData', JSON.stringify(data))
|
|
|
}
|
|
|
-const setFileTabLocal = (data)=>{
|
|
|
- console.log('setFileTabLocal',data);
|
|
|
+const setFileTabLocal = (data) => {
|
|
|
+ console.log('setFileTabLocal', data);
|
|
|
isSwitchFileIframe.value = true
|
|
|
// console.log('setFileTabLocal',data);
|
|
|
sessionStorage.setItem('fileTabData', JSON.stringify(data))
|