main
wangqiujuan0808 2023-12-15 13:13:36 +08:00
parent 370b5089c3
commit 5c070bbc93
7 changed files with 192 additions and 37 deletions

View File

@ -2,10 +2,10 @@
<div class="treeDiv"> <div class="treeDiv">
<dv-border-box-10 backgroundColor="#00174b" :color="['#3cbfdf', '#3cbfdf']"> <dv-border-box-10 backgroundColor="#00174b" :color="['#3cbfdf', '#3cbfdf']">
<el-select v-model="applicationValue" class="m-2" placeholder="Select" size="large"> <el-select v-model="applicationValue" class="m-2" placeholder="Select" size="large">
<el-option v-for="item in applicationOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in applicationOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-tree ref="myTree" :data="treeData" :props="defaultProps" node-key="id" highlight-current default-expand-all <el-tree ref="myTree" :data="treeData" :props="defaultProps" node-key="id" highlight-current default-expand-all
:current-node-key="checkedkeys" @node-click="handleNodeClick" /> :current-node-key="checkedkeys" @node-click="handleNodeClick" />
</dv-border-box-10> </dv-border-box-10>
</div> </div>
@ -86,17 +86,11 @@ const handleNodeClick = (value) => {
width: 224px; width: 224px;
margin: 0 10px; margin: 0 10px;
background: transparent; background: transparent;
color: #3cbfdf; color: #fff;
} }
.el-select { .el-select {
margin: 10px; margin: 10px;
} }
:deep(.el-input__wrapper) {
background: transparent;
}
:deep(.el-input__inner) {
color: #3cbfdf;
}
} }
</style> </style>

View File

@ -10,14 +10,46 @@
<span class="name">面积</span> <span class="name">面积</span>
<span class="text">{{ buildInfo.area }}</span> <span class="text">{{ buildInfo.area }}</span>
</div> </div>
<div>
<span class="name">墙体厚度</span>
<span class="text">{{ buildInfo.qthd }}</span>
</div>
<div>
<span class="name">材料类型</span>
<span class="text">{{ buildInfo.cllx }}</span>
</div>
<div>
<span class="name">保温层类型</span>
<span class="text">{{ buildInfo.bwclx }}</span>
</div>
<div>
<span class="name">饰面材料</span>
<span class="text">{{ buildInfo.smcl }}</span>
</div>
<div>
<span class="name">承重能力</span>
<span class="text">{{ buildInfo.cznl }}</span>
</div>
<div> <div>
<span class="name">状态</span> <span class="name">状态</span>
<span class="text">{{ buildInfo.status }}</span> <span class="text">{{ buildInfo.status }}</span>
</div> </div>
<div>
<span class="name">启用日期</span>
<span class="text">{{ buildInfo.date }}</span>
</div>
<div>
<span class="name">上次修缮日期</span>
<span class="text">{{ buildInfo.lastDate }}</span>
</div>
<div> <div>
<span class="name">描述</span> <span class="name">描述</span>
<span class="text">{{ buildInfo.desc }}</span> <span class="text">{{ buildInfo.desc }}</span>
</div> </div>
<!-- <div>
<span class="name">备注</span>
<span class="text">{{ buildInfo.remark }}</span>
</div> -->
</dv-border-box-10> </dv-border-box-10>
</div> </div>
</template> </template>
@ -35,7 +67,7 @@ const buildInfo = computed(() => bimStore().activateTree.info);
// background: #0a1f2e; // background: #0a1f2e;
// border: 1px solid red; // border: 1px solid red;
width: 360px; width: 360px;
height: 340px; // height: 420px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -43,15 +75,15 @@ const buildInfo = computed(() => bimStore().activateTree.info);
:deep(.border-box-content) { :deep(.border-box-content) {
padding: 10px; padding: 10px;
>div { >div {
line-height: 48px; line-height: 36px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.name { .name {
width: 25%; width: 40%;
} }
.text { .text {
width: 75%; width: 59%;
color: #fff; color: #fff;
} }
} }

View File

@ -42,8 +42,16 @@ const data = reactive({
info: { info: {
name: '原料糖化车间', name: '原料糖化车间',
area: '9436 ㎡', area: '9436 ㎡',
qthd: '14 cm',
cllx: '砖石/混凝土/钢结构',
bwclx: '外墙保温',
smcl: '乳胶漆',
cznl: '22 kPa',
status: '启用', status: '启用',
desc: '原料糖化车间负责原料糖化启用于2011年' date: '2021年11月11日',
lastDate: '2022年2月3日',
desc: '原料糖化车间负责原料糖化启用于2011年',
remark: '备注'
}, },
deviceInfo: [ deviceInfo: [
{ {
@ -74,8 +82,16 @@ const data = reactive({
info: { info: {
name: '糖化间', name: '糖化间',
area: '9436 ㎡', area: '9436 ㎡',
qthd: '34 cm',
cllx: '钢结构',
bwclx: '外墙保温',
smcl: '乳胶漆',
cznl: '22 kPa',
status: '启用', status: '启用',
desc: '糖化间负责原料糖化启用于2011年' date: '2021年3月11日',
lastDate: '2022年5月20日',
desc: '原料糖化车间负责原料糖化启用于2011年',
remark: '备注'
}, },
deviceInfo: [ deviceInfo: [
{ {
@ -106,9 +122,17 @@ const data = reactive({
clickName: 'yuanliao_room', clickName: 'yuanliao_room',
info: { info: {
name: '原料处理间', name: '原料处理间',
area: '9436 ㎡', area: '36 ㎡',
qthd: '4 cm',
cllx: '混凝土',
bwclx: '外墙保温',
smcl: '乳胶漆',
cznl: '22 kPa',
status: '启用', status: '启用',
desc: '原料糖化车间负责原料糖化启用于2011年' date: '2013年11月11日',
lastDate: '2020年12月3日',
desc: '原料糖化车间负责原料糖化启用于2011年',
remark: '备注'
}, },
deviceInfo: [ deviceInfo: [
{ {
@ -133,15 +157,23 @@ const data = reactive({
} }
], ],
children: [] children: []
},{ }, {
label: '投料间', label: '投料间',
id: '0-0-3', id: '0-0-3',
clickName: 'touliao_room', clickName: 'touliao_room',
info: { info: {
name: '投料间', name: '投料间',
area: '836 ㎡', area: '936 ㎡',
qthd: '15 cm',
cllx: '砖石/混凝土/钢结构',
bwclx: '内墙保温',
smcl: '石材',
cznl: '12 kPa',
status: '启用', status: '启用',
desc: '投料间负责原料糖化启用于2011年' date: '20200年11月11日',
lastDate: '2022年2月3日',
desc: '原料糖化车间负责原料糖化启用于2011年',
remark: '备注'
}, },
deviceInfo: [ deviceInfo: [
{ {
@ -173,6 +205,23 @@ const data = reactive({
}); });
const { buildValue, treeData, checkedkeys } = toRefs(data); const { buildValue, treeData, checkedkeys } = toRefs(data);
const emit = defineEmits(['handleNodeClick']) const emit = defineEmits(['handleNodeClick'])
Bus.on('handleTreeClick', (obj) => {
let o = treeData.value[0].children.find(ele => {
return ele.clickName == obj.parent.name;
})
if (o) {
nextTick(() => {
checkedkeys.value = o.id;
handleNodeClick(o);
})
}
})
onUnmounted(() => {
Bus.off("handleTreeClick")//
});
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
checkedkeys.value = treeData.value[0].id; checkedkeys.value = treeData.value[0].id;

View File

@ -69,10 +69,10 @@ const openDialog = () => {
<style lang='scss' scoped> <style lang='scss' scoped>
.deviceDiv { .deviceDiv {
position: absolute; position: absolute;
top: 380px; bottom: 20px;
right: 10px; right: 10px;
width: 360px; width: 360px;
height: 380px; height: 330px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;

View File

@ -60,7 +60,7 @@ const data = reactive({
}, },
{ {
label: '过滤槽', label: '过滤槽',
id: '0-1', id: '0-2',
clickName: 'set6', clickName: 'set6',
info: { info: {
name: '过滤槽', name: '过滤槽',
@ -75,7 +75,7 @@ const data = reactive({
}, },
{ {
label: '设备二', label: '设备二',
id: '0-2', id: '0-3',
clickName: 'set2', clickName: 'set2',
info: { info: {
name: '设备二', name: '设备二',
@ -89,7 +89,7 @@ const data = reactive({
}, },
{ {
label: '设备三', label: '设备三',
id: '0-3', id: '0-4',
clickName: 'set3', clickName: 'set3',
info: { info: {
name: '设备三', name: '设备三',
@ -103,7 +103,7 @@ const data = reactive({
}, },
{ {
label: '设备四', label: '设备四',
id: '0-4', id: '0-5',
clickName: 'set4', clickName: 'set4',
info: { info: {
name: '设备四', name: '设备四',
@ -115,6 +115,48 @@ const data = reactive({
}, },
children: [] children: []
}, },
{
label: '设备五',
id: '0-6',
clickName: 'set5',
info: {
name: '设备五',
type: '安防设备',
status: '启用',
location: '漳州厂区糖化间',
belong: '漳州厂区',
date: '2025-12-15'
},
children: []
},
{
label: '设备七',
id: '0-7',
clickName: 'set7',
info: {
name: '设备七',
type: '安防设备',
status: '启用',
location: '漳州厂区糖化间',
belong: '漳州厂区',
date: '2025-12-15'
},
children: []
},
{
label: '设备八',
id: '0-8',
clickName: 'set8',
info: {
name: '设备八',
type: '安防设备',
status: '启用',
location: '漳州厂区糖化间',
belong: '漳州厂区',
date: '2025-12-15'
},
children: []
},
], ],
} }
], ],
@ -128,6 +170,24 @@ onMounted(() => {
handleNodeClick(treeData.value[0]); handleNodeClick(treeData.value[0]);
}) })
}); });
Bus.on('handleTreeClick1', (obj) => {
let o = treeData.value[0].children.find(ele => {
return ele.clickName == obj.parent.name;
})
console.log(123, obj.parent.name);
if (o) {
nextTick(() => {
checkedkeys.value = o.id;
handleNodeClick(o);
})
}
})
onUnmounted(() => {
Bus.off("handleTreeClick")//
});
const handleNodeClick = (value) => { const handleNodeClick = (value) => {
bimStore().setActivateDeviceTree(value); bimStore().setActivateDeviceTree(value);
const isParent = value.children.length > 0; const isParent = value.children.length > 0;

View File

@ -7,6 +7,7 @@
<script setup> <script setup>
import bimStore from '@/store/modules/bim'; import bimStore from '@/store/modules/bim';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import Bus from '@/utils/bus.js';
const menuList = [ const menuList = [
{ {

View File

@ -174,7 +174,7 @@ const isSelent = (obj) => {
} }
let selectedObjects = ref([]); let selectedObjects = ref([]);
let selectBoxByClick, selectBoxByMouseon; let selectBoxByClick, selectBoxByMouseon, pointLabel;
var marginLeft = 0; var marginLeft = 0;
var marginTop = 70; var marginTop = 70;
// //
@ -211,7 +211,7 @@ const onMouseDownRight = (event) => {
const clickedObject = intersects[0].object; const clickedObject = intersects[0].object;
console.log('这是我选中的模型', clickedObject); console.log('这是我选中的模型', clickedObject);
var selectedObject = isSelent(clickedObject); var selectedObject = isSelent(clickedObject);
emit('handleRightClick',selectedObject); emit('handleRightClick', selectedObject);
} }
} }
// //
@ -229,6 +229,17 @@ const onMouseDown = (event) => {
var selectedObject = isSelent(clickedObject); var selectedObject = isSelent(clickedObject);
// //
boxLight(selectedObject); boxLight(selectedObject);
if(bimStore().activateIndex == '0') {
//
Bus.emit('handleTreeClick', clickedObject);
return;
}
if(bimStore().activateIndex == '1') {
//
Bus.emit('handleTreeClick1', clickedObject);
return;
}
} }
} }
@ -352,6 +363,10 @@ const renders = () => {
let roamdObjects = ref([]); let roamdObjects = ref([]);
// //
const toHomeView = () => { const toHomeView = () => {
if (selectBoxByClick) {
scene.remove(selectBoxByClick);
}
removeLabel();
controls.reset(); controls.reset();
} }
// //
@ -385,7 +400,7 @@ const addLabel = () => {
// console.log(123, obj); // console.log(123, obj);
centerSelectedGroup(obj); centerSelectedGroup(obj);
let text = "设备二"; let text = "设备二";
let pointLabel = createLableObj(text); pointLabel = createLableObj(text);
obj.add(pointLabel); obj.add(pointLabel);
labelRenderer.setSize(window.innerWidth, window.innerHeight); labelRenderer.setSize(window.innerWidth, window.innerHeight);
labelRenderer.domElement.style.position = "absolute"; labelRenderer.domElement.style.position = "absolute";
@ -404,7 +419,11 @@ const createLableObj = (text) => {
return pointLabel; return pointLabel;
}; };
const removeLabel = () => { const removeLabel = () => {
document.body.removeChild(labelRenderer.domElement); if(pointLabel) {
isAddLabel.value = true;
document.body.removeChild(labelRenderer.domElement);
}
} }
// //