index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <!-- 工作台相关 -->
  3. <div class="go-chart">
  4. <n-layout>
  5. <layout-header-pro>
  6. <template #left>
  7. <header-left-btn></header-left-btn>
  8. </template>
  9. <template #center>
  10. <header-title></header-title>
  11. </template>
  12. <template #ri-left>
  13. <header-right-btn></header-right-btn>
  14. </template>
  15. </layout-header-pro>
  16. <n-layout-content content-style="overflow:hidden; display: flex">
  17. <content-charts></content-charts>
  18. <content-layers></content-layers>
  19. <content-configurations></content-configurations>
  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 { LayoutHeaderPro } from '@/layout/components/LayoutHeaderPro'
  39. import { useContextMenu } from './hooks/useContextMenu.hook'
  40. import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
  41. import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
  42. const chartHistoryStoreStore = useChartHistoryStore()
  43. const chartEditStore = useChartEditStore()
  44. // 记录初始化
  45. chartHistoryStoreStore.canvasInit(chartEditStore.getEditCanvas)
  46. const HeaderLeftBtn = loadAsyncComponent(() => import('./ContentHeader/headerLeftBtn/index.vue'))
  47. const HeaderRightBtn = loadAsyncComponent(() => import('./ContentHeader/headerRightBtn/index.vue'))
  48. const HeaderTitle = loadAsyncComponent(() => import('./ContentHeader/headerTitle/index.vue'))
  49. const ContentLayers = loadAsyncComponent(() => import('./contentLayers/index.vue'))
  50. const ContentCharts = loadAsyncComponent(() => import('./contentCharts/index.vue'))
  51. const ContentConfigurations = loadAsyncComponent(() => import('./contentConfigurations/index.vue'))
  52. // 右键
  53. const {
  54. menuOptions,
  55. onClickOutSide,
  56. mousePosition,
  57. handleMenuSelect
  58. } = useContextMenu()
  59. </script>
  60. <style lang="scss" scoped>
  61. @include go("chart") {
  62. height: 100vh;
  63. width: 100vw;
  64. overflow: hidden;
  65. @include background-image("background-image");
  66. }
  67. </style>