|
@@ -33,7 +33,8 @@ export const Model = defineComponent({
|
|
|
name: 'model',
|
|
|
setup() {
|
|
|
const scene = computed(() => modelProps.type !== fuseModel && modelProps.type)
|
|
|
- const url = computed(() => {
|
|
|
+ const url = ref("")
|
|
|
+ watchEffect(() => {
|
|
|
if (!scene.value) return;
|
|
|
const type = scene.value.type
|
|
|
const urls = {
|
|
@@ -43,8 +44,20 @@ export const Model = defineComponent({
|
|
|
[SceneType.SWSSMX]: `/swkk/spg.html?m=${scene.value.num}`,
|
|
|
[SceneType.SWMX]: `index.html?caseId=${params.caseId}&modelId=${scene.value.num}&share=1#sign-model`
|
|
|
}
|
|
|
- return urls[type]
|
|
|
+ if (urls[type] !== url.value) {
|
|
|
+ setTimeout(() => {
|
|
|
+ const hook = (iframeRef.value?.contentWindow as any)?.beforeDestroy
|
|
|
+ if (hook) {
|
|
|
+ hook()
|
|
|
+ setTimeout(() => url.value = urls[type], 300)
|
|
|
+ } else {
|
|
|
+ url.value = urls[type]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
const fuseRef = ref<HTMLDivElement>()
|
|
|
const iframeRef = ref<HTMLIFrameElement>()
|
|
|
|