EmergencyOrganization.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div class="emergency-organization-container">
  3. <div class="container-title">
  4. <span class="line"></span>
  5. <span class="title">应急架构体系</span>
  6. </div>
  7. <div class="container-chart">
  8. <OrgChart :treeData="treeData" @node-click="handleNodeClick" @canvas-click="handleCanvasClick" />
  9. </div>
  10. </div>
  11. </template>
  12. <script setup lang="ts">
  13. import OrgChart from '../../components/OrgChart.vue';
  14. const treeData = {
  15. id: 'root',
  16. data: { name: '应急领导小组' },
  17. children: [
  18. {
  19. id: 'group1',
  20. data: { name: '应急指挥小组' },
  21. },
  22. {
  23. id: 'group2',
  24. data: { name: '应急响应小组' },
  25. },
  26. {
  27. id: 'group3',
  28. data: { name: '应急支援小组' },
  29. },
  30. ],
  31. };
  32. const handleNodeClick = (nodeData: any) => {
  33. console.log('节点被点击:', nodeData);
  34. // 在这里处理节点点击事件
  35. };
  36. const handleCanvasClick = () => {
  37. console.log('画布被点击');
  38. // 在这里处理画布点击事件
  39. };
  40. </script>
  41. <style scoped lang="scss">
  42. .container-title {
  43. display: flex;
  44. align-items: center;
  45. font-weight: 500;
  46. font-size: 16px;
  47. color: #000000;
  48. .line {
  49. width: 3px;
  50. height: 16px;
  51. background: #1777ff;
  52. margin-right: 10px;
  53. }
  54. .title {
  55. margin-right: 12px;
  56. }
  57. }
  58. .emergency-organization-container {
  59. padding: 10px 0;
  60. .container-chart {
  61. width: 100%;
  62. height: calc(100% - 34px);
  63. margin: 10px 0;
  64. padding: 10px;
  65. }
  66. }
  67. </style>