diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/bim/BimDataSource.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/bim/BimDataSource.java new file mode 100644 index 00000000..7e037f18 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/bim/BimDataSource.java @@ -0,0 +1,40 @@ +package com.yanzhu.manage.bim; + +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import org.apache.commons.collections4.map.HashedMap; + +import javax.sql.DataSource; +import java.util.Map; + +public class BimDataSource { + + private String dataPath; + public BimDataSource(String dataPath) { + this.dataPath = dataPath; + } + + private String driverName="org.sqlite.JDBC"; + + public String getDbPath(String name){ + + return dataPath+name+".db"; + } + + public DataSource getDataSource(String dbName) { + + if(dataSourceMap.containsKey(dbName)) { + return dataSourceMap.get(dbName); + } + String url="jdbc:sqlite:"+getDbPath(dbName); + HikariConfig config = new HikariConfig(); + config.setDriverClassName(driverName); + config.setJdbcUrl(url); + config.setMaximumPoolSize(100); + config.setConnectionTestQuery("SELECT 1"); + DataSource ds= new HikariDataSource(config); + dataSourceMap.put(dbName, ds); + return ds; + } + private Map dataSourceMap=new HashedMap<>(); +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/bim/BimDataSourceConfig.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/bim/BimDataSourceConfig.java new file mode 100644 index 00000000..b6004208 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/bim/BimDataSourceConfig.java @@ -0,0 +1,25 @@ +package com.yanzhu.manage.bim; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + + +@Configuration +public class BimDataSourceConfig { + + private static final Logger log = LoggerFactory.getLogger(BimDataSourceConfig.class); + + + @Value("${bim.dataPath}") + private String dataPath; + + + @Bean + public BimDataSource bimDataSource() { + return new BimDataSource(dataPath); + } + +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bim/BimModelController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bim/BimModelController.java new file mode 100644 index 00000000..ed05323f --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bim/BimModelController.java @@ -0,0 +1,272 @@ +package com.yanzhu.manage.controller.bim; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.yanzhu.common.core.utils.StringUtils; +import com.yanzhu.common.core.web.domain.AjaxResult; +import com.yanzhu.manage.bim.BimDataSource; +import com.yanzhu.manage.bim.BimDataSourceConfig; +import com.yanzhu.manage.domain.bim.ModelPropertyVo; +import com.yanzhu.manage.domain.bim.ModelTreeVo; +import com.yanzhu.manage.domain.bim.ModelTypeVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.sql.DataSource; +import java.io.File; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("/bim/modelInfo") +public class BimModelController { + + @Autowired + private BimDataSource bimDataSource; + + /** + * 带子节点的model_tree查询 + * @param name + * @param pid + * @return + */ + @GetMapping("/modelTreeAllChild/{name}") + public AjaxResult getModelTreeAllChild(@PathVariable("name") String name,String pid) { + if(StringUtils.isEmpty(name)){ + return AjaxResult.error("name is null"); + } + String sql=""; + if(StringUtils.isEmpty(pid)){ + sql="select * from model_tree "; + }else{ + sql="with recursive\n" + + " cao as (\n" + + " select * from model_tree where glid = ? \n" + + " union all\n" + + " select model_tree.* from cao join model_tree on cao.glid = model_tree.pGlid\n" + + " )\n" + + "select * from cao where pGlid is not null"; + } + String path=bimDataSource.getDbPath(name); + if(!new File(path).exists()){ + return AjaxResult.error("file not found!"); + } + try { + DataSource ds = bimDataSource.getDataSource(name); + PreparedStatement pss= ds.getConnection().prepareStatement(sql); + if(StringUtils.isNotEmpty(pid)) { + pss.setString(1,pid); + } + ResultSet rs = pss.executeQuery(); + List list = new ArrayList<>(); + while (rs.next()) { + ModelTreeVo modelTreeVo = new ModelTreeVo(); + modelTreeVo.setId(rs.getLong("id")); + modelTreeVo.setGlid(rs.getString("glid")); + modelTreeVo.setName(rs.getString("name")); + modelTreeVo.setLevel(rs.getInt("level")); + modelTreeVo.setGroupname(rs.getString("groupname")); + modelTreeVo.setExternalId(rs.getString("externalId")); + modelTreeVo.setPGlid(rs.getString("pGlid")); + list.add(modelTreeVo); + } + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 不带子节点的Model_Tree查询 + * @param name + * @param pid + * @return + */ + @GetMapping("/modelTree/{name}") + public AjaxResult getModelTree(@PathVariable("name") String name,String pid) { + if(StringUtils.isEmpty(name)){ + return AjaxResult.error("name is null"); + } + String sql=""; + if(StringUtils.isEmpty(pid)){ + sql="select * from model_tree where level=0"; + }else{ + sql="select * from model_tree where pglid = ?"; + } + String path=bimDataSource.getDbPath(name); + if(!new File(path).exists()){ + return AjaxResult.error("file not found!"); + } + try { + DataSource ds = bimDataSource.getDataSource(name); + PreparedStatement pss= ds.getConnection().prepareStatement(sql); + if(StringUtils.isNotEmpty(pid)) { + pss.setString(1,pid); + } + ResultSet rs = pss.executeQuery(); + List list = new ArrayList<>(); + while (rs.next()) { + ModelTreeVo modelTreeVo = new ModelTreeVo(); + modelTreeVo.setId(rs.getLong("id")); + modelTreeVo.setGlid(rs.getString("glid")); + modelTreeVo.setName(rs.getString("name")); + modelTreeVo.setLevel(rs.getInt("level")); + modelTreeVo.setGroupname(rs.getString("groupname")); + modelTreeVo.setExternalId(rs.getString("externalId")); + modelTreeVo.setPGlid(rs.getString("pGlid")); + list.add(modelTreeVo); + } + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 带子节点的model_type查询 + * @param name + * @param pid + * @return + */ + @GetMapping("/modelTypeAllChild/{name}") + public AjaxResult getModelTypeAllChild(@PathVariable("name") String name,String pid) { + if(StringUtils.isEmpty(name)){ + return AjaxResult.error("name is null"); + } + String sql=""; + if(StringUtils.isEmpty(pid)){ + sql="select * from model_type "; + }else{ + sql="WITH recursive cao AS (\n" + + " SELECT * FROM model_type WHERE\n" + + " glid = ? \n" + + " UNION ALL\n" + + " SELECT model_type.* FROM cao JOIN model_type ON cao.glid = model_type.pGlid\n" + + ")\n" + + "SELECT * FROM cao WHERE pGlid IS NOT NULL"; + } + String path=bimDataSource.getDbPath(name); + if(!new File(path).exists()){ + return AjaxResult.error("file not found!"); + } + try { + DataSource ds = bimDataSource.getDataSource(name); + PreparedStatement pss= ds.getConnection().prepareStatement(sql); + if(StringUtils.isNotEmpty(pid)) { + pss.setString(1,pid); + } + ResultSet rs = pss.executeQuery(); + List list = new ArrayList<>(); + while (rs.next()) { + ModelTypeVo vo = new ModelTypeVo(); + vo.setExternalId(rs.getString("externalId")); + vo.setGlid(rs.getString("glid")); + vo.setName(rs.getString("name")); + vo.setLevel(rs.getInt("level")); + vo.setGroupname(rs.getString("groupname")); + vo.setPGlid(rs.getString("pGlid")); + vo.setId(rs.getLong("id")); + list.add(vo); + } + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 不带子节点的model_type查询 + * @param name + * @param pid + * @return + */ + @GetMapping("/modelType/{name}") + public AjaxResult getModelType(@PathVariable("name") String name,String pid) { + if(StringUtils.isEmpty(name)){ + return AjaxResult.error("name is null"); + } + String sql=""; + if(StringUtils.isEmpty(pid)){ + sql="select * from model_type where level=0"; + }else{ + sql="select * from model_type where pglid=?"; + } + String path=bimDataSource.getDbPath(name); + if(!new File(path).exists()){ + return AjaxResult.error("file not found!"); + } + try { + DataSource ds = bimDataSource.getDataSource(name); + PreparedStatement pss= ds.getConnection().prepareStatement(sql); + if(StringUtils.isNotEmpty(pid)) { + pss.setString(1,pid); + } + ResultSet rs = pss.executeQuery(); + List list = new ArrayList<>(); + while (rs.next()) { + ModelTypeVo vo = new ModelTypeVo(); + vo.setExternalId(rs.getString("externalId")); + vo.setGlid(rs.getString("glid")); + vo.setName(rs.getString("name")); + vo.setLevel(rs.getInt("level")); + vo.setGroupname(rs.getString("groupname")); + vo.setPGlid(rs.getString("pGlid")); + vo.setId(rs.getLong("id")); + list.add(vo); + } + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + + @PostMapping("/modelProperty/{name}") + public AjaxResult getModelProperty(@PathVariable("name") String name,@RequestBody List glids) { + if(CollectionUtil.isEmpty(glids)){ + return AjaxResult.error("glids is null"); + } + StringBuilder stringBuilder = new StringBuilder(); + + for (int i = 0; i < glids.size(); i++) { + stringBuilder.append("?,"); + } + String placeHolders = stringBuilder.deleteCharAt(stringBuilder.length() - 1) + .toString(); + String sql="select * from model_property where glid in ("+placeHolders+")"; + + String path=bimDataSource.getDbPath(name); + if(!new File(path).exists()){ + return AjaxResult.error("file not found!"); + } + try { + DataSource ds = bimDataSource.getDataSource(name); + PreparedStatement pss= ds.getConnection().prepareStatement(sql); + for (int i = 1; i <= glids.size(); i++) { + pss.setLong(i, glids.get(i - 1)); + } + ResultSet rs = pss.executeQuery(); + List list = new ArrayList<>(); + while (rs.next()) { + ModelPropertyVo vo = new ModelPropertyVo(); + vo.setId(rs.getLong("id")); + vo.setGlid(rs.getString("glid")); + vo.setModelName(rs.getString("modelName")); + vo.setIfcurl(rs.getString("ifcurl")); + vo.setPropertyname(rs.getString("propertyname")); + vo.setGroupname(rs.getString("groupname")); + vo.setExternalId(rs.getString("externalId")); + vo.setValue(rs.getString("value")); + vo.setPropertySetName(rs.getString("propertySetName")); + vo.setPropertyTypeName(rs.getString("propertyTypeName")); + list.add(vo); + } + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/device/DevIotConfigController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/device/DevIotConfigController.java index b1baf11e..5403bb74 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/device/DevIotConfigController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/device/DevIotConfigController.java @@ -5,7 +5,6 @@ import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.yanzhu.common.core.constant.ApiConstants; import com.yanzhu.common.core.enums.IsDelEnums; -import com.yanzhu.common.core.text.Convert; import com.yanzhu.common.core.utils.StringUtils; import com.yanzhu.common.core.utils.http.HttpUtils; import com.yanzhu.common.core.utils.poi.ExcelUtil; diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelPropertyVo.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelPropertyVo.java new file mode 100644 index 00000000..33c16d9f --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelPropertyVo.java @@ -0,0 +1,53 @@ +package com.yanzhu.manage.domain.bim; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +/** + * 模型构件属性表 + */ +@Data +@Getter +@Setter +public class ModelPropertyVo { + /** + * 自增ID + */ + private Long id; + /** + * 外键ID + */ + private String glid; + /** + * 构件ID,对应结构表externalI + */ + private String externalId; + /** + * 属性大类 + */ + private String propertyTypeName; + /** + * 属性小类 + */ + private String propertySetName; + /** + * 属性名称 + */ + private String propertyname; + /** + * 当前属性ifc文件路径 + */ + private String ifcurl; + /** + * 属性值 + */ + private String value; + /** + * 模型文件名称 + */ + private String modelName; + /** + * 构件类别 + */ + private String groupname; +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelTreeVo.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelTreeVo.java new file mode 100644 index 00000000..1296174d --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelTreeVo.java @@ -0,0 +1,42 @@ +package com.yanzhu.manage.domain.bim; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + * 模型结构表 + */ +@Data +@Getter +@Setter +public class ModelTreeVo { + /** + * 自增ID + */ + private Long id; + /** + * 关联ID + */ + private String glid; + /** + * 父ID,对应glid + */ + private String pGlid; + /** + * 层级ID + */ + private Integer level; + /** + * 构件名称 + */ + private String name; + /** + * 构件ID + */ + private String externalId; + /** + * 构件类别 + */ + private String groupname; +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelTypeVo.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelTypeVo.java new file mode 100644 index 00000000..164705f8 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/domain/bim/ModelTypeVo.java @@ -0,0 +1,42 @@ +package com.yanzhu.manage.domain.bim; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + * 模型专业表 + */ +@Data +@Getter +@Setter +public class ModelTypeVo { + /** + * 自增ID + */ + private Long id; + /** + * 关联ID + */ + private String glid; + /** + * 父Id,对应gli + */ + private String pGlid; + /** + * 层级ID + */ + private Integer level; + /** + * 构件名称 + */ + private String name; + /** + * 构件ID + */ + private String externalId; + /** + * 构件类别 + */ + private String groupname; +} diff --git a/yanzhu-modules/yanzhu-manage/src/main/resources/bootstrap.yml b/yanzhu-modules/yanzhu-manage/src/main/resources/bootstrap.yml index c38ffba5..b02b3f0d 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/resources/bootstrap.yml +++ b/yanzhu-modules/yanzhu-manage/src/main/resources/bootstrap.yml @@ -28,4 +28,7 @@ spring: logging: level: - com.ycx.manage.mapper: DEBUG \ No newline at end of file + com.ycx.manage.mapper: DEBUG + +bim: + dataPath: '/Users/mac/code/bimdata/' \ No newline at end of file diff --git a/yanzhu-ui-vue3/index.html b/yanzhu-ui-vue3/index.html index 27c4b94a..de0bd253 100644 --- a/yanzhu-ui-vue3/index.html +++ b/yanzhu-ui-vue3/index.html @@ -15,7 +15,7 @@ src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=6zAD8CIavtzWnkGg0a7roush5maGMIPn" > - + -
- 从模型服务器选择模型 -
- + - + + + + 从模型服务器选择模型 - + - - - - + - + - - + + - - + +
- + + @@ -102,6 +104,8 @@ import useUserStore from '@/store/modules/user' import { onMounted } from 'vue' import modelSelectDialog from './modelSelectDialog.vue' import uploadModelDialog from './uploadModelDialog.vue' +import modelDialog from './modelDialog2.vue' +import { fileSize } from '@/utils' const { proxy } = getCurrentInstance() const userStore = useUserStore() @@ -116,6 +120,7 @@ const total = ref(0) const title = ref('') const selDlg = ref() const uploadDlg = ref() +const mDlg = ref() const data = reactive({ form: {}, queryParams: { @@ -143,10 +148,27 @@ const data = reactive({ projects: [], currentPrjId: null, subDepts: [], + selModel: null, }) const { queryParams, form, rules } = toRefs(data) - +function showModel(row) { + mDlg.value.showDialog(JSON.parse(row.gisJson)) +} +function toSize(size) { + return fileSize(size) +} +function doModelSelect(model) { + data.selModel = model + form.value.modelName = model.name + form.value.lightweightName = model.lightweightName + form.value.fileSize = model.fileSize + form.value.gisJson = JSON.stringify(model) + form.value.fileType = model.fileType + form.value.modelType = model.softwareType + form.value.modelStatus = model.status + form.value.sand = true +} //上传模型 function handleUpload() { //uploadDlg.value.showDialog() @@ -159,7 +181,10 @@ function selectModelHandler() { function getList() { loading.value = true listBimModel(queryParams.value).then((response) => { - bimModelList.value = response.rows + bimModelList.value = (response.rows || []).map((it) => { + it.sand = it.showSand == 1 + return it + }) total.value = response.total loading.value = false }) @@ -219,6 +244,13 @@ function handleSelectionChange(selection) { function handleAdd() { reset() open.value = true + if (data.subDepts.length > 0) { + form.value.deptId = data.subDepts[0].id + } else { + form.value.deptId = null + } + form.value.comId = userStore.currentComId + form.value.projectId = data.currentPrjId title.value = '添加Bim模型' } @@ -237,6 +269,7 @@ function handleUpdate(row) { function submitForm() { proxy.$refs['bimModelRef'].validate((valid) => { if (valid) { + form.value.showSand = form.value.sand ? 1 : 0 if (form.value.modelId != null) { updateBimModel(form.value).then((response) => { proxy.$modal.msgSuccess('修改成功') @@ -310,5 +343,8 @@ onMounted(() => { data.currentPrjId = userStore.currentPrjId getProjectList() getList() + proxy.$http.get('/manage/bim/modelInfo/modelTree/202310241442202232?pid=2714132083072').then((res) => { + debugger + }) }) diff --git a/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog.vue b/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog.vue index 78dbeafa..5bdb938e 100644 --- a/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog.vue +++ b/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog.vue @@ -52,7 +52,7 @@ export default { throughwall: true, searchbox: false, mapbox: true, - secretkey: window.BIM_CONFIG.secretKey, //token.txt文件里的内容 + secretkey: window.config.secretKey, //token.txt文件里的内容 editmode: false, cadmode: false, isRequestWebgl2: true, @@ -67,9 +67,10 @@ export default { defaults.container = this.elId defaults.bgcolor = '#c6c9d1' - defaults.secretkey = window.BIM_CONFIG.secretKey + defaults.secretkey = window.config.secretKey this.sapi_1 = new API(defaults) let modelUrl = 'https://model.jhncidg.com:18086/Tools/output/model/5513993365509191778/root.glt' + //https://model.jhncidg.com:18086/Tools/output/model/5570926434042339486/root.glt //this.sapi_1.Model.add(this.row.modelAccessAddress, this.row.lightweightName) this.sapi_1.Model.add(modelUrl, this.row.lightweightName) let mapOptions = { diff --git a/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog2.vue b/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog2.vue index 425b6aec..a86ff41d 100644 --- a/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog2.vue +++ b/yanzhu-ui-vue3/src/views/bim/bimModel/modelDialog2.vue @@ -1,7 +1,7 @@ @@ -34,15 +34,13 @@ export default { }) }, initCesium() { - debugger var api = new SAPI( { - serverIP: `//model.jhncidg.com`, //服务ip地址 + serverIP: `model.jhncidg.com`, //服务ip地址 port: 8000, //HTTP端口 useHttps: true, //使用Https container: this.elId, //[必须]容器id - secretKey: - 'cbe8c300dfb0280d71bf6546087c6d2fa49260085f53fca8e5bdce7cde8509800e60acd60891a0dfaedaed48706cede62c884a84004218a7c2eb3de18b4f3783258c47f45b34485a2edb350010e2f42cd5b388af45c6b070850288d284cbbbcda2d085ba47169a7d4fc79609ffbef2dc54455448c112333d4b48d4870843cd1a156822f418515a2ad17683749ba4ff5118ae3f686e966fbfdd71fd75e0bbc3738a94867b381ae88ecd6668e8ca6b6d286dce7e5d799b0a175d5afe5554a4332203e774bed8a04535067c9aac0a18108055b1db541f70363b277050951ab91fcbccd8329463d92cd2f81b95abdf8d437c4965454914fcc7b07d28062bc2976948356e76d9d11fd5b479eb391b46cc93e66da10e0ba1fed735c8b1b1f086973f6152b6a2299e3e22c9cc8c33b16ea71cc03013404ec41c18c9cc748e652ce16fe7061c32d550edfda330c1555e0c08e51f698f96b91615d8220acd9cb22f32e9757681487e0680adfbfacb9b5d2ce5a13b664d8466043270f9f3bde6ac6a05cf25ab0ccc0659a290c9669997be7ccc0086c3d61f7cf5f649cb25f0dbad9f7f66e3165cad25065145affac91bea061f4ff485af667dd7ebaf4baeea64611acbe5c74018be5a8b704fcd4f53d18504940411fac91bea061f4ff49a2f853c245297edc3d61f7cf5f649cb0f9b84173857a7b67c27928b58b4a6a65f517a43f106335e8b1d5c423a171723ffa04d0ac4e5c1a1853fcb2bc95ee8056cd5b4826fa55926733ef859a5f169e6afafd0506174e86864d53d967da98ab0b0e08d14be6d452c6c69755ac3a391993370a029761da893cfbf575da87c6b5ca602467b79c6c9532f438aaafb9ec915692f0287a8db979969e5635404d6fdfb753151533a277044afdd825f7197f2896c69755ac3a391993370a029761da893af24d88c02bccfae6cd5b4826fa55926f7722b78090b30b986f9287101582d8841187054ec673ebd2042f9836ea453c3afafd0506174e86800225b7f4102e3585b1923cb186fe0ceee54c6f17ab8555da26ecd334722494fc515b205e9624a4494c772ef4f023a606882e118fa6321c24ddee4821c840fb56aac929d6d0a052d5ff97d71e43811db939f7340826236af6f10316a04bf618d494a26e0fd06f7daa07177989e1680a4cf14829a5847f70377d6c12f1649400fcab44f4ff52989cf129aa6cca660be152a75b8e35648925dbce381b345d9e137c04a02a4c8252625f5625eed58fd34b7be4266e54212e88b23f012bead9abaef9e18aa308f0ecffaf3dda7d7b4efd2e0c4b8de161864620fc1f2af98bde031b29e0865381c96bbc10921b48a068558915ff023d18526f5d399e0893df43db7122415d52565dc982ea24fbd825734dbaefadc6df0f19d925c7f63d343a622134b1c934d130d662447add19064adbbb2fd24a82c0fbfcbc3175fc32761df099156daf4e86455740207eb4e4a5300d9c1a17ffd43703d476c36ef07df2206bd8d232b844ff3c1d7cf7c47ec502183af4e27b644d89a77efad286dee59796b124081510f8a6ea5c1dff9c3d61f7cf5f649cb25f0dbad9f7f66e3e0e7c3406ae4dd4eebc424f09f933d0eb1a881ed05ca8d5c70958237eb5b91d4e574440ea0c9179a582dc966bcfc1f21cf3630a2823a9a2d22bd09a00b213aae3866768ae2f24dde6784fbf292c2cba136689b286e75a81e016aa63061505f57a8c1113b833628e3a18dff8ae8ac8eaa7a4fba6045bc9b4b', + secretKey: window.config.secretKey, openEarth: false, //[可选]开启Gis场景 bgColor: 'rgba(135 ,206 ,250,1)', //[可选]bim场景背景色, 传值即为纯色天空盒 tintColor: 'rgba(255,255,0,1)', //[可选]osgb单体化颜色 @@ -51,9 +49,13 @@ export default { }, () => { console.log('初始化成功') //初始化成功后在进行其他操作,如加载模型等 + this.InitEngine(api) } ) - console.log('---->', api) + }, + InitEngine(api) { + let url = `${window.config.modelUrl}/Tools/output/model/${this.row.lightweightName}/root.glt` + api.Model.add(url, this.row.lightweightName) }, initCesium2() { // const defaults = { ...this.bimStore.defaults } diff --git a/yanzhu-ui-vue3/src/views/bim/bimModel/modelSelectDialog.vue b/yanzhu-ui-vue3/src/views/bim/bimModel/modelSelectDialog.vue index b9177e48..1d997c0f 100644 --- a/yanzhu-ui-vue3/src/views/bim/bimModel/modelSelectDialog.vue +++ b/yanzhu-ui-vue3/src/views/bim/bimModel/modelSelectDialog.vue @@ -1,7 +1,7 @@