|
@@ -12,6 +12,7 @@
|
|
|
<iframe
|
|
|
v-show="currentIframeId === item['query']['iFrameId']"
|
|
|
v-for="(item, index) in iframeViews"
|
|
|
+ :id="item['name']"
|
|
|
:key="index"
|
|
|
:src="item['query']['url']"
|
|
|
></iframe>
|
|
@@ -45,7 +46,7 @@ const iframeViews = ref<any[]>([])
|
|
|
const currentIframeId = ref<string>('')
|
|
|
|
|
|
const getCaches = computed((): string[] => {
|
|
|
- return tagsViewStore.getCachedViews
|
|
|
+ return Array.from(tagsViewStore.cachedViews)
|
|
|
})
|
|
|
const filterIframe = (arr): any[] => {
|
|
|
return arr.filter((item) => {
|
|
@@ -54,7 +55,15 @@ const filterIframe = (arr): any[] => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+subscribe.on('iframe:reload', (view) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ const iframe = document.getElementById(view.name)
|
|
|
+ if (iframe) {
|
|
|
+ //@ts-ignore
|
|
|
+ iframe.src = iframe.src
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
+})
|
|
|
subscribe.on('update:tagsView', () => {
|
|
|
isFrameView.value = route.query.iframe === '1' ? true : false
|
|
|
nextTick(() => {
|
|
@@ -68,16 +77,19 @@ subscribe.on('update:tagsView', () => {
|
|
|
})
|
|
|
watch(
|
|
|
() => route.query,
|
|
|
- () => {
|
|
|
+ async () => {
|
|
|
isFrameView.value = route.query.iframe === '1' ? true : false
|
|
|
- nextTick(() => {
|
|
|
+ await nextTick()
|
|
|
+ //处理办件中心页面坍塌的问题
|
|
|
+ const timeout = setTimeout(() => {
|
|
|
iframeViews.value = filterIframe(tagsViewStore.visitedViews)
|
|
|
if (!route.query.iframe) {
|
|
|
currentIframeId.value = ''
|
|
|
} else {
|
|
|
currentIframeId.value = route.query.iFrameId as string
|
|
|
}
|
|
|
- })
|
|
|
+ clearTimeout(timeout)
|
|
|
+ }, 200)
|
|
|
},
|
|
|
{
|
|
|
immediate: true
|