|
|
@@ -70,7 +70,7 @@
|
|
|
<span class="yuandian" v-if="
|
|
|
hasNewMessage &&
|
|
|
item.path == '/index' &&
|
|
|
- $route.path != item.path
|
|
|
+ ($route.path != item.path || isSwitchFileIframe)
|
|
|
"></span>
|
|
|
</div>
|
|
|
</router-link><br />
|
|
|
@@ -154,6 +154,7 @@
|
|
|
:src="item.src"
|
|
|
frameborder="0"
|
|
|
:id="`iframe${item.id}`"
|
|
|
+ :name="`iframe${item.id}`"
|
|
|
width="100%"
|
|
|
height="800px"
|
|
|
class="iframeBox"
|
|
|
@@ -214,6 +215,7 @@ const isAlive = ref(true);
|
|
|
const toFileData = ref();
|
|
|
const uid = useUserStore().uid;
|
|
|
let hasNewMessage=ref(false)
|
|
|
+let isSwitchFileIframe = ref(false); //是否切换到文件预览标签
|
|
|
const iFrameData = ref(JSON.parse(sessionStorage.getItem('fileTabData')) || [
|
|
|
{
|
|
|
id: 1,
|
|
|
@@ -314,7 +316,6 @@ const editableTabs = ref(JSON.parse(sessionStorage.getItem('tabData')) ||[{label
|
|
|
|
|
|
function reload() {
|
|
|
isAlive.value = false;
|
|
|
- console.log(11);
|
|
|
nextTick(() => {
|
|
|
isAlive.value = true;
|
|
|
});
|
|
|
@@ -326,19 +327,24 @@ function toggleSideBar() {
|
|
|
appStore.toggleSideBar();
|
|
|
}
|
|
|
const logingName = ref("");
|
|
|
+let lisetenMessageTime=null;
|
|
|
onMounted(() => {
|
|
|
logingName.value = Cookies.get("username");
|
|
|
-
|
|
|
- // console.log('router',router)
|
|
|
-});
|
|
|
-watchEffect(async() => {
|
|
|
- if(router.currentRoute.value.path=='/index') return;
|
|
|
- if(websoctStore.noReadList!=null)hasNewMessage.value = true
|
|
|
- else hasNewMessage.value = false
|
|
|
- // console.log("===============websoctStore.noReadList:",websoctStore.noReadList,'===========',hasNewMessage.value)
|
|
|
+ clearInterval(lisetenMessageTime)
|
|
|
+ lisetenMessageTime = setInterval(() => {
|
|
|
+ //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==''){
|
|
|
+ hasNewMessage.value = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ tmplist = JSON.parse(tmplist);
|
|
|
+ if(tmplist!=null)hasNewMessage.value = true
|
|
|
+ else hasNewMessage.value = false
|
|
|
+ }, 1000);
|
|
|
});
|
|
|
|
|
|
-
|
|
|
function handleCommand(command) {
|
|
|
switch (command) {
|
|
|
case "setLayout":
|
|
|
@@ -499,9 +505,11 @@ const menuList = reactive({
|
|
|
|
|
|
const clickPath = (index, items) => {
|
|
|
items = toRaw(items);
|
|
|
+ localStorage.setItem("inChat",items.path=="/index"?1:0)
|
|
|
// toFileData.value = null
|
|
|
console.log("clickPathitems", items);
|
|
|
// editableTabs.value = arr;
|
|
|
+ isSwitchFileIframe.value=false
|
|
|
const arr = toRaw(editableTabs.value);
|
|
|
if (!arr.some((item) => item.label == items.label)) {
|
|
|
editableTabs.value.push({
|
|
|
@@ -519,10 +527,12 @@ const clickPath = (index, items) => {
|
|
|
// console.log("editableTabs", editableTabs.value);
|
|
|
};
|
|
|
const clickTab = (item) => {
|
|
|
- console.log("item", toRaw(item));
|
|
|
+ let url = toRaw(item)
|
|
|
+ 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))
|
|
|
@@ -534,17 +544,12 @@ const clickTab = (item) => {
|
|
|
// row: JSON.stringify(toRaw(toFileData.value.clickRowId)),
|
|
|
},
|
|
|
});
|
|
|
- // router.push({
|
|
|
- // path: toFileData.value.path,
|
|
|
- // query: {
|
|
|
- // row: toFileData.value.row,
|
|
|
- // },
|
|
|
- // });
|
|
|
return;
|
|
|
}
|
|
|
+ localStorage.setItem("inChat",url=="/index" ? 1: 0)
|
|
|
let regExp = new RegExp(/^\//);
|
|
|
- if (!regExp.test(toRaw(item))) {
|
|
|
- const data = JSON.parse(toRaw(item));
|
|
|
+ if (!regExp.test(url)) {
|
|
|
+ const data = JSON.parse(url);
|
|
|
console.log("data", data);
|
|
|
router.push({
|
|
|
// path: "/fileEdit" + data.docId,
|
|
|
@@ -556,7 +561,7 @@ const clickTab = (item) => {
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
|
- editableTabsValue.value = item
|
|
|
+ editableTabsValue.value = url
|
|
|
router.push({
|
|
|
path: item,
|
|
|
});
|
|
|
@@ -566,6 +571,7 @@ const clickTab = (item) => {
|
|
|
const paneClick = (item) => {
|
|
|
// 可以拿到当前的标签对象
|
|
|
isAlive.value = true;
|
|
|
+ isSwitchFileIframe.value = false
|
|
|
console.log("paneItem", item);
|
|
|
if (item.clickRowId) {
|
|
|
// 判断是菜单还是目录
|
|
|
@@ -574,11 +580,12 @@ const paneClick = (item) => {
|
|
|
toFileData.value = null;
|
|
|
}
|
|
|
clickTab(item.path);
|
|
|
- // console.log("isAlive", isAlive.value);
|
|
|
};
|
|
|
// 点击文件标签
|
|
|
const filePaneClick = (item) => {
|
|
|
+ localStorage.setItem("inChat",0)
|
|
|
console.log("filePaneClickitem", item);
|
|
|
+ isSwitchFileIframe.value = true
|
|
|
const row = toRaw(item);
|
|
|
const arr = iFrameData.value.map((par) => {
|
|
|
if (par.id === row.id) {
|
|
|
@@ -594,7 +601,6 @@ const filePaneClick = (item) => {
|
|
|
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);
|
|
|
@@ -734,6 +740,7 @@ const setTabLocal = (data)=>{
|
|
|
}
|
|
|
const setFileTabLocal = (data)=>{
|
|
|
console.log('setFileTabLocal',data);
|
|
|
+ isSwitchFileIframe.value = true
|
|
|
sessionStorage.setItem('fileTabData', JSON.stringify(data))
|
|
|
}
|
|
|
const setEditableTabsValue = (data)=>{
|