flx:修改一级路由嵌入报错bug

This commit is contained in:
Rain_ 2025-08-19 16:51:26 +08:00
parent 42d3dcbe14
commit 6488e09820
3 changed files with 36 additions and 9 deletions

View File

@ -10,6 +10,7 @@ VITE_API_URL = 'http://192.168.34.221:8111' #雄哥本地
# VITE_API_URL = 'http://192.168.34.221:28890' #雄哥本地
# VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程
# VITE_API_URL = 'http://192.168.34.221:28889'
# VITE_API_URL = 'http://192.168.34.221:28887'
# VITE_API_URL = 'http://121.196.214.246/api'
# VITE_API_URL = 'http://jxj.zhgdyun.com:100'
# VITE_API_URL = 'http://192.168.34.221:12360'
@ -54,7 +55,8 @@ VITE_API_URL = 'http://192.168.34.221:8111' #雄哥本地
# VITE_API_URL = 'http://101.43.164.214:11126'
# 测试
# VITE_API_URL = 'http://jxj.zhgdyun.com:9500'
VITE_API_URL = 'http://192.168.34.221:19112'
# VITE_API_URL = 'http://192.168.34.221:19112'
# VITE_API_URL = 'https://125.72.229.30:19098'
# 上传
VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='

View File

@ -1,18 +1,26 @@
<template>
<div class="iframe">
<iframe :src="url" width="100%" height="100%" frameborder="0"></iframe>
<iframe :src="url" :key="ikey" width="100%" height="100%" frameborder="0"></iframe>
</div>
</template>
<script setup>
import { useRoute } from 'vue-router';
import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { onMounted, ref, watch } from 'vue';
const route = useRoute();
const router = useRouter()
const url = ref("");
onMounted(() => {
console.log(route.query); //
url.value = route.query.url; // url
});
const ikey = ref(0);
watch(router.currentRoute, (newValue) => {
// console.log(11334455, newValue.query.url, route.query.url); //
url.value = newValue.query.url; // url
ikey.value = new Date().getTime(); // iframe
// console.log(url.value);
}, { immediate: true, deep: true });
// onMounted(() => {
// console.log(444555, route.query); //
// // url.value = route.query.url; // url
// });
</script>
<style scoped>

View File

@ -557,7 +557,7 @@ let menuList = ref([]);
// ]);
const itemList = ref([]);
const activeTab = ref(0);
const activeTab2 = ref(0);
const activeTab2 = ref('');
const router = useRouter();
const getAspectRatioStyle = computed(() => ({
width: `${contentWidth.value}px`,
@ -581,6 +581,23 @@ const navigateTo = (path, type) => {
activeTab.value = path.modulePath;
activeTab2.value = path.menuList.length ? path.menuList[0].companyPath : path.modulePath;
itemList.value = path.menuList;
let index = activeTab2.value.indexOf("?");
console.log("获取到的参数----", index);
if (index > -1) {
let result = activeTab2.value.substring(index);
const uIndex = result.indexOf("url=");
if (uIndex > -1) {
const url = result.substring(uIndex + 4);
console.log("获取到的参数----", url);
router.push({
path: activeTab2.value,
query: {
url,
}
});
return;
}
}
router.push({
path: activeTab2.value
});