<template>
|
<div class="info_box" v-if="infoBoxShow" v-draw>
|
<div class="info_header">
|
<i class="el-icon-info"></i>
|
<div class="info_title">
|
属性查看
|
</div>
|
<i class="el-icon-close" @click="closeInfoBox"></i>
|
</div>
|
<div class="info_body scrollbar">
|
|
<el-table :data="infoList" border style="width: 100%">
|
<!-- :span-method="objectSpanMethod" -->
|
<el-table-column prop="key" label="属性名">
|
</el-table-column>
|
<el-table-column prop="value" label="属性值">
|
<template slot-scope="scope">
|
{{ scope.row.value }}
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import identifyTool from '@/utils/identifyTools.js'
|
export default {
|
name: "IdentifyTool",
|
data() {
|
return {
|
infoBoxShow: false,
|
bimInfoList: [],
|
modelinfoList: [],
|
activeNames: [],
|
infoList: []
|
}
|
},
|
methods: {
|
open(infoList, infoType) {
|
console.log(infoList, infoType)
|
let arr = []
|
this.infoList = []
|
|
if (!infoList) {
|
this.infoList = []
|
this.infoBoxShow = false
|
return
|
}
|
|
debugger
|
switch (infoType) {
|
case 'B3DM':
|
if (infoList) {
|
let keys = infoList.getPropertyIds()
|
if (keys.length > 0) {
|
keys.forEach(key => {
|
arr.push({
|
key: key,
|
value: infoList.getProperty(key)
|
})
|
});
|
}
|
}
|
this.infoList = arr
|
break;
|
case 'bim':
|
if (infoList.code === 200) {
|
if (Object.keys(infoList.data.attributes).length > 0) {
|
infoList = infoList.data.attributes
|
}
|
}
|
for (const key in infoList) {
|
const value = infoList[key];
|
arr.push({
|
key: key,
|
value: value
|
})
|
}
|
this.infoList = arr
|
break;
|
case '':
|
break;
|
default:
|
break;
|
}
|
this.infoBoxShow = true
|
},
|
closeInfoBox() {
|
this.infoBoxShow = false
|
identifyTool.close()
|
},
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
if (columnIndex === 0) {
|
if (typeof row.value === 'object') {
|
return {
|
rowspan: 2,
|
colspan: 1
|
};
|
}
|
else {
|
return {
|
rowspan: 1,
|
colspan: 1
|
};
|
}
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="less" scoped>
|
.info_box {
|
position: absolute;
|
width: 300px;
|
height: 600px;
|
background: white;
|
top: 80px;
|
left: 400px;
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
padding: 15px;
|
border-radius: 5px;
|
pointer-events: all;
|
|
.info_header {
|
padding: 8px 2px;
|
border-bottom: 1px solid #f0f0f0;
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
position: relative;
|
height: 5%;
|
|
.el-icon-info {
|
font-size: 24px;
|
}
|
|
.info_title {
|
margin-left: 8px;
|
}
|
|
|
.el-icon-close {
|
position: absolute;
|
right: 3px;
|
font-size: 24px;
|
cursor: pointer;
|
}
|
}
|
|
.info_body {
|
height: 92%;
|
overflow: auto;
|
overflow-x: hidden;
|
|
.items {
|
display: flex;
|
|
}
|
}
|
}
|
</style>
|