-
-
+
+
- {{scope.row.name}}
+ {{ scope.row.name }}
- {{scope.row.fileSize?toSize(scope.row.fileSize):'-'}}
+ {{ scope.row.fileSize ? toSize(scope.row.fileSize) : '-' }}
-
+
同步成功
同步失败
@@ -39,6 +41,7 @@ import { checkLightweightName, getBimModel, addBimModel, updateBimModel, delBimM
import modelDialog from './modelDialog2.vue'
import useUserStore from '@/store/modules/user'
import { fileSize } from '../../../utils'
+import { getProjectBimConfig } from "@/api/manage/proProjectInfo.js";
export default {
components: { modelDialog },
data() {
@@ -47,10 +50,12 @@ export default {
show: false,
modelList: [],
selRow: null,
+ currentPrjId: null,
+ userStore: null,
+ bimCfg: {},
}
},
mounted() {
- console.log('===>', useUserStore())
},
methods: {
tbDblClick() {
@@ -62,6 +67,16 @@ export default {
showDialog() {
this.show = true
this.selRow = null
+ this.userStore = useUserStore()
+ this.currentPrjId = this.userStore.currentPrjId;
+ getProjectBimConfig(this.currentPrjId).then(d => {
+ let config = this.$tryToJson(d.msg, {});
+ this.bimCfg = {
+ background: config.background || "",
+ showGis: config.showGis || false,
+ clientApi: config.clientApi || false
+ }
+ });
queryModels().then((d) => {
let models = d.data.datas || []
let modelIds = models.map((it) => it.lightweightName)
@@ -93,7 +108,7 @@ export default {
}
},
showModel(row) {
- this.$refs.modelDialog.showDialog(row)
+ this.$refs.modelDialog.showDialog(row,this.bimCfg)
},
},
}
@@ -105,7 +120,7 @@ export default {
cursor: pointer;
}
- .el-table__body tr.current-row > td.el-table__cell {
+ .el-table__body tr.current-row>td.el-table__cell {
background: rgb(30, 144, 255);
color: #fff;
diff --git a/yanzhu-ui-vue3/src/views/bim/bimSetting/PersonRoaming.vue b/yanzhu-ui-vue3/src/views/bim/bimSetting/PersonRoaming.vue
index af457112..52d555c2 100644
--- a/yanzhu-ui-vue3/src/views/bim/bimSetting/PersonRoaming.vue
+++ b/yanzhu-ui-vue3/src/views/bim/bimSetting/PersonRoaming.vue
@@ -14,10 +14,12 @@
-
+
-
+
开始漫游
@@ -95,15 +97,9 @@
@@ -239,14 +235,15 @@ export default {
},
mounted() {
window.xapp = this
- api.Plugin.addMiniMap()
- let options = {
- Anchor: 3,
- Offset: [70, -380],
- Size: 300,
+ if (!this.me.bimCfg.clientApi) {
+ api.Plugin.addMiniMap()
+ let options = {
+ Anchor: 3,
+ Offset: [70, -380],
+ Size: 300,
+ }
+ api.Plugin.updateMiniMap(options)
}
- api.Plugin.updateMiniMap(options)
-
const userStore = useUserStore()
this.currentPrjId = userStore.currentPrjId
this.currentComId = userStore.currentComId
@@ -487,22 +484,27 @@ export default {
.roaming-settings {
width: 340px;
padding: 0px 10px 10px;
+
.op-table {
.cell {
font-size: 12px;
}
}
+
.his-tool {
font-size: 12px;
margin-bottom: 8px;
}
+
.pagination-container {
margin-top: 10px;
height: 32px;
display: flex;
justify-content: flex-end;
+
.el-pagination {
font-size: 12px;
+
.el-pagination__total,
.el-pagination__sizes {
margin-right: 16px;
diff --git a/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue b/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue
index f90da266..8541407b 100644
--- a/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue
+++ b/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue
@@ -165,7 +165,9 @@ export default {
requestVertexNormals: true, //开启地形光照
requestWaterMask: true, // 开启水面波纹
})
-
+ api.viewer.camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(108.93934, 34.25777, 4000)
+ });
} else {
api.Public.setGisState(true);
api.Public.setTerrainState(false, "http://113.201.2.107:9304/layer.json", false)
@@ -256,7 +258,7 @@ export default {
}
},
doModelMove() {
- let that=this
+ let that = this
if (api.m_model.size == 1) {
let modelId = api.m_model.keys().toArray()[0];
that.showMove = true;
diff --git a/yanzhu-ui-vue3/src/views/bim/bimTools.js b/yanzhu-ui-vue3/src/views/bim/bimTools.js
new file mode 100644
index 00000000..1caede00
--- /dev/null
+++ b/yanzhu-ui-vue3/src/views/bim/bimTools.js
@@ -0,0 +1,174 @@
+function initEngine(apiID, elId, bimCfg, cb) {
+ if (bimCfg.clientApi) {
+ initAPIEngine(apiID, elId, bimCfg, cb)
+ } else {
+ initSAPIEngine(apiID, elId, bimCfg, cb)
+ }
+}
+
+function initAPIEngine(apiID, elId, bimCfg, cb) {
+ let opt = {
+ container: elId, //[必须]容器id
+ showfps: false, //[可选]显示fps
+ openearth: true, //[可选]开启gis场景
+ // imageryprovider: "tianditu_image", //[可选]gis底图
+ openterrain: false, //[可选]开启gis地形
+ maxspaceerror: 5000, //[可选]模型可视距离; 建议设置:常规BIM时3000或更大、BIM启用LOD时100~1000、倾斜摄影,点云数据时0.1~0.5
+ loading: false, //[可选]gis模式加载动画
+ bgcolor: "#87CEFA", //[可选]bim模式场景背景色
+ selectedcolor: "#FFFF00", //[可选]选中构件颜色
+ throughwall: true, //[可选]相机是否穿墙
+ sitepath: "../Cesium/",//[可选]设置天空盒路径,指向Cesium文件夹
+ editmode: true, //[可选]是否开启编辑模式
+ searchbox: true, //[可选]gis模型是否显示搜索框
+ mapbox: true, //[可选]gis模型是否显示地图选择
+ isRequestWebgl2: true, //[可选]是否使用webgl2进行渲染
+ colorBlendMode: 1, //0:HIGHLIGHT 1:REPLACE 2:MIX ,构件选中后的着色模式
+ secretkey: window.config.secretKey,
+ language: "zh-CN", // 语言国际化 中文简体(zh-CN)、中文繁体(zh-TW)、英文(en), 默认中文简体
+ targetFrameRate: 20, //目标渲染帧率 默认20
+ };
+ let api = new API(opt);
+
+ window[apiID] = api
+ console.log("初始化成功");
+ doChangeGis(bimCfg, api)
+
+ cb && cb();
+
+}
+
+function doChangeGis(bimCfg, api) {
+ if (bimCfg.showGis) {
+ if (bimCfg.clientApi) {
+ api.Public.setGisState(true);
+ api.viewer.terrainProvider = Cesium.createWorldTerrain({
+ requestVertexNormals: true, //开启地形光照
+ requestWaterMask: true, // 开启水面波纹
+ })
+ api.viewer.camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(108.93934, 34.25777, 4000)
+ });
+ } else {
+ api.Public.setGisState(true);
+ api.Public.setTerrainState(false, "http://113.201.2.107:9304/layer.json", false)
+ api.Public.setGisState(true);
+ }
+ } else {
+ let color = bimCfg.background || "rgba(135 ,206 ,250,1)"
+ api.Public.setGisState(false, color);
+ api.Public.setSkyBoxState(0)
+ }
+}
+
+
+function initSAPIEngine(apiID, elId, bimCfg, cb) {
+ let api = new SAPI(
+ {
+ serverIP: window.config.serverIP, //服务ip地址
+ port: window.config.port, //HTTP端口
+ useHttps: window.config.useHttps, //使用Https
+ container: elId, //[必须]容器id
+ secretKey: window.config.secretKey,
+ openEarth: window.config.openEarth, //[可选]开启Gis场景
+ bgColor: window.config.bgColor, //[可选]bim场景背景色, 传值即为纯色天空盒
+ tintColor: window.config.tintColor, //[可选]osgb单体化颜色
+ sceneTime: window.config.sceneTime, //[可选]分别为当前时间、日出时间、日落时间
+ cadMode: window.config.cadMode, // 是否是Cad图纸预览模式
+ },
+ () => {
+ console.log("初始化成功");
+ let mapOptions = {
+ imgs: {
+ // 六面图片
+ top: "/cdn/bim/sapi/img/top.png",
+ bottom: "/cdn/bim/sapi/img/under.png",
+ east: "/cdn/bim/sapi/img/east.png",
+ south: "/cdn/bim/sapi/img/south.png",
+ west: "/cdn/bim/sapi/img/west.png",
+ north: "/cdn/bim/sapi/img/north.png",
+ },
+ offset: {
+ // 屏幕坐标偏移
+ corner: GLENavigationCube.RightTop,
+ x: 25,
+ y: 20,
+ },
+ cube: {
+ hoverColor: "#7193dc", // 立方导航快鼠标移过显示颜色
+ size: 32, // 导航立方尺寸
+ hotPointSize: 7, // 导航立方棱角热点区域尺寸
+ cubeTextColor: "#4c4c4ccc", // cube 各个面文字颜色
+ cubeStrokeColor: "#374769cc", // cube 各个面边框颜色
+ cubeFillColor: "#374769cc", // cube 各个面填充颜色
+ },
+ zoomRatios: 1, // 缩放倍率
+ show: true, // 是否显示
+ showAxes: true, // 是否显示XYZ轴线
+ };
+ window[apiID] = api
+ api.Plugin.initNavCube(mapOptions);
+ doChangeGis(bimCfg, api)
+ cb && cb();
+ }
+ );
+}
+
+function addModel(api, bimCfg, modelId, cb, models) {
+ let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`;
+ let direction = null;
+ let modelInfo = null;
+ if (models) {
+ modelInfo = models.find(m => m.modelId == modelId);
+ }
+ if (bimCfg.clientApi) {
+ url = `/bimdata/Tools/output/model/${modelId}/root.glt`;
+ if (modelInfo) {
+ direction = modelInfo.bimCfg.direction;
+ }
+ }
+ console.log("加载模型:" + url);
+ api.Model.add(
+ url,
+ modelId,
+ () => {
+ console.log("加载模型成功2");
+ },
+ () => {
+ console.log("加载模型成功");
+
+ if (modelInfo) {
+ let cfg = modelInfo.bimCfg;
+
+ let x = cfg?.x || 0;
+ let y = cfg?.y || 0;
+ let z = cfg?.z || 0;
+ let rotateZ = cfg?.rotateZ || 0;
+ let rotateX = cfg?.rotateX || 0;
+ let rotateY = cfg?.rotateY || 0;
+ if (x * 1 + y * 1 + z * 1 != 0) {
+ console.log(x, y, z)
+ api.Model.moveToPosition([x, y, z], 0, modelId)
+ }
+ if (rotateZ * 1 != 0) {
+ if (this.me.bimCfg.clientApi) {
+
+ } else {
+ api.Model.rotate(rotateX, rotateY, rotateZ, modelId)
+ }
+ }
+ if (cfg && cfg.hideParts) {
+ cfg.hideParts.forEach(it => {
+ this.me.hideParts.push(it);
+ })
+ }
+ }
+ cb && cb();
+
+ }, direction);
+}
+
+export default {
+ initEngine,
+ addModel
+}
\ No newline at end of file