index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <!-- 工作台相关 -->
  3. <div class="go-chart">
  4. <n-layout>
  5. <HeaderPro>
  6. <template #left>
  7. <HeaderLeftBtn></HeaderLeftBtn>
  8. </template>
  9. <template #center>
  10. <HeaderTitle></HeaderTitle>
  11. </template>
  12. <template #ri-left>
  13. <HeaderRightBtn></HeaderRightBtn>
  14. </template>
  15. </HeaderPro>
  16. <n-layout-content content-style="overflow:hidden; display: flex">
  17. <ContentCharts></ContentCharts>
  18. <ContentLayers></ContentLayers>
  19. <ContentConfigurations></ContentConfigurations>
  20. </n-layout-content>
  21. </n-layout>
  22. </div>
  23. <!-- 右键 -->
  24. <n-dropdown
  25. placement="bottom-start"
  26. trigger="manual"
  27. size="small"
  28. :x="mousePosition.x"
  29. :y="mousePosition.y"
  30. :options="menuOptions"
  31. :show="chartEditStore.getRightMenuShow"
  32. :on-clickoutside="onClickoutside"
  33. @select="handleMenuSelect"
  34. ></n-dropdown>
  35. </template>
  36. <script setup lang="ts">
  37. import { loadAsyncComponent } from '@/utils'
  38. import { HeaderPro } from '@/layout/components/HeaderPro'
  39. import { useContextMenu } from './hooks/useContextMenu.hook'
  40. import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
  41. import { useChartHistoryStoreStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
  42. const chartHistoryStoreStore = useChartHistoryStoreStore()
  43. const chartEditStore = useChartEditStore()
  44. // 记录初始化
  45. chartHistoryStoreStore.canvasInit(chartEditStore.getEditCanvas)
  46. const HeaderLeftBtn = loadAsyncComponent(() =>
  47. import('./headerLeftBtn/index.vue')
  48. )
  49. const HeaderRightBtn = loadAsyncComponent(() =>
  50. import('./headerRightBtn/index.vue')
  51. )
  52. const HeaderTitle = loadAsyncComponent(() => import('./headerTitle/index.vue'))
  53. const ContentLayers = loadAsyncComponent(() =>
  54. import('./contentLayers/index.vue')
  55. )
  56. const ContentCharts = loadAsyncComponent(() =>
  57. import('./contentCharts/index.vue')
  58. )
  59. const ContentConfigurations = loadAsyncComponent(() =>
  60. import('./contentConfigurations/index.vue')
  61. )
  62. // 右键
  63. const {
  64. menuOptions,
  65. onClickoutside,
  66. mousePosition,
  67. handleContextMenu,
  68. handleMenuSelect
  69. } = useContextMenu()
  70. </script>
  71. <style lang="scss" scoped>
  72. @include go('chart') {
  73. height: 100vh;
  74. width: 100vw;
  75. overflow: hidden;
  76. @include background-image('background-image');
  77. }
  78. </style>