<template>
	<div class="yui-tree-box">
		<project-item-tree @treeclick="treeclick" type="isInit" iconfontClass="el-icon-place" :isCancel="false">
		</project-item-tree>
		<div class="hui-tree-content" v-if="target.bimIntegrateId && target.id">
			<operation-models ref="operationModels" v-if="target.bimIntegrateId === '3102248339366592'"
				:target="target">
			</operation-models>
			<operation-model v-else></operation-model>
		</div>
		<div class="hui-tree-content" v-else-if="target.id">
			<operation-plan v-if="target.floorPlanType === 2" :target="target"></operation-plan>
			<operation-room v-else></operation-room>
		</div>
	</div>
</template>

<script>
	import operationModel from '@/components/work/bim/operationModel'
	import operationModels from '@/components/work/bim/operationModels'
	import operationRoom from '@/components/work/bim/operationRoom'
	import operationPlan from '@/components/work/bim/operationPlan'
	import projectItemTree from '@/components/common/projectItemTree'
	export default {
		data() {
			return {
				target: {}
			}
		},
		mounted() {},
		methods: {
			treeclick(e, type) {
				this.target = e;
				console.log(this.target);
				if (this.$refs.operationModels && type != 'isInit') this.$refs.operationModels.changeTarget(e);
			}
		},
		components: {
			operationModel,
			operationModels,
			projectItemTree,
			operationRoom,
			operationPlan
		}
	}
</script>

<style lang="scss">
</style>