<template>
  <el-card shadow="never" v-loading="loading">
    <div class="panel-title">振动设备树</div>
    <el-tree
      :data="treeData"
      :props="treeProps"
      default-expand-all
      highlight-current
      :expand-on-click-node="false"
      @node-click="emit('nodeClick', $event)"
    />
  </el-card>
</template>

<script setup lang="ts">
defineProps<{
  loading: boolean;
  treeData: any[];
  treeProps: { label: string; children: string };
}>();

const emit = defineEmits<{
  nodeClick: [any];
}>();
</script>

<style scoped>
.panel-title {
  margin-bottom: 12px;
  font-weight: 600;
}
</style>
