fix: BUG修改

This commit is contained in:
kun 2023-11-16 11:27:23 +08:00
parent 1b1aa61b08
commit 1aaa013028
2 changed files with 9 additions and 93 deletions

View File

@ -1,8 +1,6 @@
<template>
<div @click="getModelTree" style="color: white">获取信息</div>
<div @click="cancelModel" style="color: white">隐藏</div>
<div class="bimBox" id="domId">
<!-- <iframe :src="url" frameborder="0" width="100%" height="100%" id="iframe"></iframe> -->
<div class="bimBox">
<iframe :src="url" frameborder="0" width="100%" height="100%" id="iframe"></iframe>
</div>
</template>
@ -20,7 +18,7 @@ function getBimfaceList() {
if (item.isEnable) {
token.value = res.result.viewToken;
console.log("token的值", token.value);
localStorage.setItem("bimToken", JSON.stringify(token.value));
localStorage.setItem('bimToken', JSON.stringify(token.value));
}
});
});
@ -33,52 +31,16 @@ function getBimfaceList() {
//
// });
// }
// viewerapp
let viewer, app;
// viewToken//token
let viewToken = '3831955cbf80408582ed3833742b6eb5';
// BimfaceSDKLoaderConfig
let loaderConfig = new BimfaceSDKLoaderConfig();
// BimfaceSDKLoaderConfigviewToken
loaderConfig.viewToken = viewToken;
// BimfaceSDKLoaderload
BimfaceSDKLoader.load(loaderConfig, successCallback, failureCallback);
//
function successCallback(viewMetaData) {
// DOM
let domShow = document.getElementById('domId');
// WebApplicationGISConfig
let webAppConfig = new Glodon.Bimface.Application.WebApplicationGISConfig();
// WebApplicationGISdom
webAppConfig.domElement = domShow;
// WebApplicationGIS
app = new Glodon.Bimface.Application.WebApplicationGIS(webAppConfig);
//
app.addScene(viewToken);
// ViewerGIS
viewer = app.getViewer();
};
//
function failureCallback(error) {
console.log(error);
};
onMounted(() => {});
onMounted(() => {
url.value = window.location.origin + "/static/bim.html";
console.log("url-------的地址", window.location.origin);
getBimfaceList();
});
</script>
<style lang="scss" scoped>
.bimBox {
width: 100%;
height: 90%;
margin-top: 20px;
height: 100%;
}
</style>

View File

@ -1,46 +0,0 @@
<template>
<div class="bimBox">
<iframe :src="url" frameborder="0" width="100%" height="100%" id="iframe"></iframe>
</div>
</template>
<script lang="ts" setup>
import { GlobalStore } from "@/stores";
import { getSelectProjectBimfaceList, getViewTokenByFileId } from "@/api/modules/binModel";
import { ref, onMounted } from "vue";
const store = GlobalStore();
const url = ref("");
const token = ref("" as any);
//bim
function getBimfaceList() {
getSelectProjectBimfaceList({ projectSn: store.sn }).then(res => {
res.result.page.records.forEach(item => {
if (item.isEnable) {
token.value = res.result.viewToken;
console.log("token的值", token.value);
localStorage.setItem('bimToken', JSON.stringify(token.value));
}
});
});
}
//token
// function getBimfaceToken(fileId) {
// getViewTokenByFileId({ projectSn: store.sn, fileId }).then(res => {
// console.log("token", res);
//
// });
// }
onMounted(() => {
url.value = window.location.origin + "/static/bim.html";
console.log("url-------的地址", window.location.origin);
getBimfaceList();
});
</script>
<style lang="scss" scoped>
.bimBox {
width: 100%;
height: 100%;
}
</style>