|
@ -3,27 +3,19 @@ |
|
|
<!-- tab展示内容 --> |
|
|
<!-- tab展示内容 --> |
|
|
<template> |
|
|
<template> |
|
|
<template v-if="tabIsIframe($router.currentRoute.meta.iframeURL)"> |
|
|
<template v-if="tabIsIframe($router.currentRoute.meta.iframeURL)"> |
|
|
<iframe :src=" |
|
|
<iframe :src="$router.currentRoute.meta.iframeURL + '?token=' + token + '&customerId=' + customerId" ref="iframe" class="m-iframe" id="iframe" width="100%" height="100%" frameborder="0" scrolling="yes" :style="{ height: $store.state.fixed1920.height - 100 + 'px' }" /> |
|
|
$router.currentRoute.meta.iframeURL + |
|
|
|
|
|
'?token=' + |
|
|
|
|
|
token + |
|
|
|
|
|
'&customerId=' + |
|
|
|
|
|
customerId |
|
|
|
|
|
" ref="iframe" class="m-iframe" id="iframe" width="100%" height="100%" frameborder="0" scrolling="yes" |
|
|
|
|
|
:style="{ height: $store.state.fixed1920.height - 100 + 'px' }" /> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)"> |
|
|
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)"> |
|
|
<router-view @changeCustomerName="changeCustomerName" /> |
|
|
<router-view ref="reloadPage" @changeCustomerName="changeCustomerName" /> |
|
|
</keep-alive> |
|
|
</keep-alive> |
|
|
</template> |
|
|
</template> |
|
|
</main> |
|
|
</main> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { isURL } from "@/utils/validate"; |
|
|
isURL |
|
|
|
|
|
} from "@/utils/validate"; |
|
|
|
|
|
import Cookie from "js-cookie"; |
|
|
import Cookie from "js-cookie"; |
|
|
export default { |
|
|
export default { |
|
|
|
|
|
props: ["name"], |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
iframeUrl: "", |
|
|
iframeUrl: "", |
|
@ -37,6 +29,7 @@ |
|
|
// }, |
|
|
// }, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
|
|
|
// console.log("name", this.name); |
|
|
this.token = localStorage.getItem("token"); |
|
|
this.token = localStorage.getItem("token"); |
|
|
this.customerId = localStorage.getItem("customerId"); |
|
|
this.customerId = localStorage.getItem("customerId"); |
|
|
}, |
|
|
}, |
|
@ -58,16 +51,15 @@ |
|
|
}, |
|
|
}, |
|
|
// tabs, 选中tab |
|
|
// tabs, 选中tab |
|
|
tabSelectedHandle(tab) { |
|
|
tabSelectedHandle(tab) { |
|
|
tab = this.$store.state.contentTabs.filter( |
|
|
tab = this.$store.state.contentTabs.filter((item) => item.name === tab.name)[0]; |
|
|
(item) => item.name === tab.name)[0]; |
|
|
|
|
|
if (tab) { |
|
|
if (tab) { |
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
name: tab.name, |
|
|
name: tab.name, |
|
|
params: { |
|
|
params: { |
|
|
...tab.params |
|
|
...tab.params, |
|
|
}, |
|
|
}, |
|
|
query: { |
|
|
query: { |
|
|
...tab.query |
|
|
...tab.query, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -77,8 +69,7 @@ |
|
|
if (tabName === "home") { |
|
|
if (tabName === "home") { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => item.name !== tabName); |
|
|
(item) => item.name !== tabName); |
|
|
|
|
|
if (this.$store.state.contentTabs.length <= 0) { |
|
|
if (this.$store.state.contentTabs.length <= 0) { |
|
|
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = "home"; |
|
|
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = "home"; |
|
|
return false; |
|
|
return false; |
|
@ -89,27 +80,25 @@ |
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
name: tab.name, |
|
|
name: tab.name, |
|
|
params: { |
|
|
params: { |
|
|
...tab.params |
|
|
...tab.params, |
|
|
}, |
|
|
}, |
|
|
query: { |
|
|
query: { |
|
|
...tab.query |
|
|
...tab.query, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// tabs, 关闭其它 |
|
|
// tabs, 关闭其它 |
|
|
tabsCloseOtherHandle() { |
|
|
tabsCloseOtherHandle() { |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => { |
|
|
(item) => { |
|
|
return item.name === "home" || item.name === this.$store.state.contentTabsActiveName; |
|
|
return (item.name === "home" || item.name === this.$store.state.contentTabsActiveName); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// tabs, 关闭全部 |
|
|
// tabs, 关闭全部 |
|
|
tabsCloseAllHandle() { |
|
|
tabsCloseAllHandle() { |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( |
|
|
this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => item.name === "home"); |
|
|
(item) => item.name === "home"); |
|
|
|
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
name: "home" |
|
|
name: "home", |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|