diff --git a/yanzhu-bigscreen/src/views/bim/briefingProperty.js b/yanzhu-bigscreen/src/views/bim/briefingTools.js similarity index 57% rename from yanzhu-bigscreen/src/views/bim/briefingProperty.js rename to yanzhu-bigscreen/src/views/bim/briefingTools.js index ebfdeaaa..29cfcd51 100644 --- a/yanzhu-bigscreen/src/views/bim/briefingProperty.js +++ b/yanzhu-bigscreen/src/views/bim/briefingTools.js @@ -16,6 +16,16 @@ function groupData(data) { } return tmps; } +//清除选中构件样式 +function clearSelectFeature(that) { + let api = bimBriefingApi; + if (that.selFeatureId) { + let modelId = that.selFeatureId.split("^")[0]; + api.Feature.setColor(that.selFeatureId, "rgba(255,255,255,1)", modelId); + that.selFeatureId = ""; + } +} +//查询构件属性信息 function dataFiltering(that, id) { const gild = id.split("^"); let modelName = ""; @@ -38,18 +48,15 @@ function dataFiltering(that, id) { /** * 获取构件属性信息 */ -export function getProperty(that) { +function getProperty(that) { let api = bimBriefingApi; api.Feature.getByEvent(true, (n) => { console.log(n); if (n && n["id"]) { let featureId = n.id; - if (featureId.split("^")[1]) { let modelId = featureId.split("^")[0]; - if (that.selFeatureId) { - api.Feature.setColor(that.selFeatureId, "rgba(255,255,255,1)", modelId); - } + clearSelectFeature(that); api.Feature.setColor(featureId, "rgba(255,0,255,1)", modelId); that.selFeatureId = featureId; dataFiltering(that, featureId); @@ -65,17 +72,58 @@ export function getProperty(that) { /** * 获取构件尺寸信息 */ -export function subFeatureSize(that) { +function subFeatureSize(that) { let api = bimBriefingApi; - api.Public.clearHandler(), - api.Measurement.clearAllTrace(); + that.info = []; + api.Public.clearHandler(), api.Measurement.clearAllTrace(); api.Feature.getByEvent(true, (n) => { console.log(n); if (n && n["id"]) { let featureId = n.id; + let modelId = featureId.split("^")[0]; + clearSelectFeature(that); api.Feature.getGeometrySizeById(featureId, (res) => { - console.log(res); + let size = res.size || {}; + that.info = [ + { name: "长", value: (size.x || 0).toFixed(2) + "" }, + { name: "宽", value: (size.y || 0).toFixed(2) + "" }, + { name: "高", value: (size.z || 0).toFixed(2) + "" }, + ]; + api.Feature.setColor(featureId, "rgba(255,0,255,1)", modelId); + that.selFeatureId = featureId; }); } }); } +//构件面积 +function measurementArea(that) {} + +//构件体积 +function measuringVolume(that){ + +} +//构件距离 +function distance(that){ + +} + +//剖切 +function initClipping(that){ + +} + +//构件隐藏 +function actorVisible(){ + +} + +export default { + measurementArea, + clearSelectFeature, + getProperty, + subFeatureSize, + measuringVolume, + distance, + initClipping, + actorVisible, +}; diff --git a/yanzhu-bigscreen/src/views/bimBriefing.vue b/yanzhu-bigscreen/src/views/bimBriefing.vue index c1f3c065..507b90c4 100644 --- a/yanzhu-bigscreen/src/views/bimBriefing.vue +++ b/yanzhu-bigscreen/src/views/bimBriefing.vue @@ -37,32 +37,44 @@
- 属性 + {{ title }}
-
- {{ attributeInformation }} -
-
- - 属性 - 类型 - -
-
-
-
- - {{ item.name }} + +
@@ -165,7 +177,7 @@