fix: BUG修改
This commit is contained in:
parent
7d1dfd0bde
commit
1b1aa61b08
@ -7,7 +7,8 @@ NODE_ENV = 'development'
|
|||||||
# VITE_API_URL = 'http://192.168.34.221:12360'
|
# VITE_API_URL = 'http://192.168.34.221:12360'
|
||||||
# 沈阳合盈线上
|
# 沈阳合盈线上
|
||||||
# VITE_API_URL = "http://101.43.164.214:45022"
|
# 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'
|
||||||
|
|
||||||
|
|
||||||
# 上传
|
# 上传
|
||||||
|
|||||||
@ -109,12 +109,12 @@
|
|||||||
<!-- 用于RSA加密 -->
|
<!-- 用于RSA加密 -->
|
||||||
<script src="/jsWebControl-1.0.0.min.js"></script>
|
<script src="/jsWebControl-1.0.0.min.js"></script>
|
||||||
<!-- 用于RSA加密 -->
|
<!-- 用于RSA加密 -->
|
||||||
<script
|
<!-- <script
|
||||||
type="text/javascript"
|
type="text/javascript"
|
||||||
src="<%= BASE_URL %>lib/include-lib.js?time=20210329"
|
src="<%= BASE_URL %>lib/include-lib.js?time=20210329"
|
||||||
libpath="<%= BASE_URL %>lib/"
|
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"
|
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 src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js" charset="utf-8"></script>
|
||||||
<script>
|
<script>
|
||||||
// 禁用鼠标滚动事件
|
// 禁用鼠标滚动事件
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -15682,7 +15682,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/vue3-scale-box": {
|
"node_modules/vue3-scale-box": {
|
||||||
"version": "0.1.9",
|
"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=="
|
"integrity": "sha512-URKBWivTHglmwoqQTs9UBA+lWg7pMuyYusxI5ghU1ks3qZHcM+jCF5uoSiwlKpSd9XP47R3sO12oS+Sc5lW9ig=="
|
||||||
},
|
},
|
||||||
"node_modules/vue3-seamless-scroll": {
|
"node_modules/vue3-seamless-scroll": {
|
||||||
@ -27447,7 +27447,7 @@
|
|||||||
},
|
},
|
||||||
"vue3-scale-box": {
|
"vue3-scale-box": {
|
||||||
"version": "0.1.9",
|
"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=="
|
"integrity": "sha512-URKBWivTHglmwoqQTs9UBA+lWg7pMuyYusxI5ghU1ks3qZHcM+jCF5uoSiwlKpSd9XP47R3sO12oS+Sc5lW9ig=="
|
||||||
},
|
},
|
||||||
"vue3-seamless-scroll": {
|
"vue3-seamless-scroll": {
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
// console.log('取到的token',token);
|
// console.log('取到的token',token);
|
||||||
let viewer3D;
|
let viewer3D;
|
||||||
let app;
|
let app;
|
||||||
let viewToken = "29a730ca254548e18d441293f13d5720";
|
let viewToken = "6a7c39a4b2324880b98680f5e804f896";
|
||||||
console.log('viewToken',viewToken);
|
console.log('viewToken',viewToken);
|
||||||
let loaderConfig = new BimfaceSDKLoaderConfig();
|
let loaderConfig = new BimfaceSDKLoaderConfig();
|
||||||
loaderConfig.viewToken = viewToken;
|
loaderConfig.viewToken = viewToken;
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="bimBox">
|
<div @click="getModelTree" style="color: white">获取信息</div>
|
||||||
<iframe :src="url" frameborder="0" width="100%" height="100%" id="iframe"></iframe>
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -18,7 +20,7 @@ function getBimfaceList() {
|
|||||||
if (item.isEnable) {
|
if (item.isEnable) {
|
||||||
token.value = res.result.viewToken;
|
token.value = res.result.viewToken;
|
||||||
console.log("token的值", token.value);
|
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(() => {
|
// 声明viewer及app变量
|
||||||
url.value = window.location.origin + "/static/bim.html";
|
let viewer, app;
|
||||||
console.log("url-------的地址", window.location.origin);
|
// 声明viewToken变量,填入想要显示的模型/图纸/场景token
|
||||||
getBimfaceList();
|
let viewToken = '3831955cbf80408582ed3833742b6eb5';
|
||||||
});
|
|
||||||
|
// 构造BimfaceSDKLoaderConfig对象
|
||||||
|
let loaderConfig = new BimfaceSDKLoaderConfig();
|
||||||
|
// 设置BimfaceSDKLoaderConfig的viewToken
|
||||||
|
loaderConfig.viewToken = viewToken;
|
||||||
|
|
||||||
|
// 调用BimfaceSDKLoader的load方法加载模型
|
||||||
|
BimfaceSDKLoader.load(loaderConfig, successCallback, failureCallback);
|
||||||
|
|
||||||
|
// 加载成功回调函数
|
||||||
|
function successCallback(viewMetaData) {
|
||||||
|
|
||||||
|
// 获取DOM元素
|
||||||
|
let domShow = document.getElementById('domId');
|
||||||
|
// 创建WebApplicationGISConfig
|
||||||
|
let webAppConfig = new Glodon.Bimface.Application.WebApplicationGISConfig();
|
||||||
|
// 设置创建WebApplicationGIS的dom对象
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.bimBox {
|
.bimBox {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 90%;
|
||||||
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
46
src/views/sevenLargeScreen/bImModel/indexNormal.vue
Normal file
46
src/views/sevenLargeScreen/bImModel/indexNormal.vue
Normal 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>
|
||||||
@ -13,7 +13,7 @@ import importToCDN from "vite-plugin-cdn-import";
|
|||||||
// import AutoImport from "unplugin-auto-import/vite";
|
// import AutoImport from "unplugin-auto-import/vite";
|
||||||
// import Components from "unplugin-vue-components/vite";
|
// import Components from "unplugin-vue-components/vite";
|
||||||
// import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
// import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
||||||
import { vitePluginMars3d } from "vite-plugin-mars3d";
|
// import { vitePluginMars3d } from "vite-plugin-mars3d";
|
||||||
// @see: https://vitejs.dev/config/
|
// @see: https://vitejs.dev/config/
|
||||||
// export const BASE_IMAGE_URL = import.meta.env.NODE_ENV === "development" ? "./src" : "";
|
// export const BASE_IMAGE_URL = import.meta.env.NODE_ENV === "development" ? "./src" : "";
|
||||||
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
||||||
@ -67,7 +67,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
|||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vitePluginMars3d(),
|
// vitePluginMars3d(),
|
||||||
createHtmlPlugin({
|
createHtmlPlugin({
|
||||||
inject: {
|
inject: {
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user