fix: BUG修改

This commit is contained in:
kun 2023-11-16 11:25:21 +08:00
parent 7d1dfd0bde
commit 1b1aa61b08
7 changed files with 102 additions and 17 deletions

View File

@ -7,7 +7,8 @@ NODE_ENV = 'development'
# VITE_API_URL = 'http://192.168.34.221:12360'
# 沈阳合盈线上
# VITE_API_URL = "http://101.43.164.214:45022"
VITE_API_URL = 'http://192.168.34.221:30002'
# VITE_API_URL = 'http://192.168.34.221:30002'
VITE_API_URL = 'http://jxj.zhgdyun.com:9809'
# 上传

View File

@ -109,12 +109,12 @@
<!-- 用于RSA加密 -->
<script src="/jsWebControl-1.0.0.min.js"></script>
<!-- 用于RSA加密 -->
<script
<!-- <script
type="text/javascript"
src="<%= BASE_URL %>lib/include-lib.js?time=20210329"
libpath="<%= BASE_URL %>lib/"
include="jquery,jquery.range,bootstrap,bootstrap-checkbox,font-awesome,web-icons,layer,haoutil,nprogress,toastr,admui,turf,cesium,mars3d,mars3d-widget"
></script>
></script> -->
<script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script>
<script>
// 禁用鼠标滚动事件

4
package-lock.json generated
View File

@ -15682,7 +15682,7 @@
},
"node_modules/vue3-scale-box": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/vue3-scale-box/-/vue3-scale-box-0.1.9.tgz",
"resolved": "https://registry.npmmirror.com/vue3-scale-box/-/vue3-scale-box-0.1.9.tgz",
"integrity": "sha512-URKBWivTHglmwoqQTs9UBA+lWg7pMuyYusxI5ghU1ks3qZHcM+jCF5uoSiwlKpSd9XP47R3sO12oS+Sc5lW9ig=="
},
"node_modules/vue3-seamless-scroll": {
@ -27447,7 +27447,7 @@
},
"vue3-scale-box": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/vue3-scale-box/-/vue3-scale-box-0.1.9.tgz",
"resolved": "https://registry.npmmirror.com/vue3-scale-box/-/vue3-scale-box-0.1.9.tgz",
"integrity": "sha512-URKBWivTHglmwoqQTs9UBA+lWg7pMuyYusxI5ghU1ks3qZHcM+jCF5uoSiwlKpSd9XP47R3sO12oS+Sc5lW9ig=="
},
"vue3-seamless-scroll": {

View File

@ -18,7 +18,7 @@
// console.log('取到的token',token);
let viewer3D;
let app;
let viewToken = "29a730ca254548e18d441293f13d5720";
let viewToken = "6a7c39a4b2324880b98680f5e804f896";
console.log('viewToken',viewToken);
let loaderConfig = new BimfaceSDKLoaderConfig();
loaderConfig.viewToken = viewToken;

View File

@ -1,6 +1,8 @@
<template>
<div class="bimBox">
<iframe :src="url" frameborder="0" width="100%" height="100%" id="iframe"></iframe>
<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>
</template>
@ -18,7 +20,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));
}
});
});
@ -31,16 +33,52 @@ function getBimfaceList() {
//
// });
// }
onMounted(() => {
url.value = window.location.origin + "/static/bim.html";
console.log("url-------的地址", window.location.origin);
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(() => {});
</script>
<style lang="scss" scoped>
.bimBox {
width: 100%;
height: 100%;
height: 90%;
margin-top: 20px;
}
</style>

View File

@ -0,0 +1,46 @@
<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>

View File

@ -13,7 +13,7 @@ import importToCDN from "vite-plugin-cdn-import";
// import AutoImport from "unplugin-auto-import/vite";
// import Components from "unplugin-vue-components/vite";
// import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
import { vitePluginMars3d } from "vite-plugin-mars3d";
// import { vitePluginMars3d } from "vite-plugin-mars3d";
// @see: https://vitejs.dev/config/
// export const BASE_IMAGE_URL = import.meta.env.NODE_ENV === "development" ? "./src" : "";
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
@ -67,7 +67,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
},
plugins: [
vue(),
vitePluginMars3d(),
// vitePluginMars3d(),
createHtmlPlugin({
inject: {
data: {