84 lines
2.3 KiB
Vue
Raw Normal View History

2021-12-21 14:57:31 +08:00
<template>
2022-01-26 15:46:25 +08:00
<!-- 工作台相关 -->
2021-12-21 14:57:31 +08:00
<div class="go-chart">
<n-layout>
2022-03-14 19:52:01 +08:00
<layout-header-pro>
2022-01-05 18:04:41 +08:00
<template #left>
2022-03-14 19:52:01 +08:00
<header-left-btn></header-left-btn>
2022-01-05 18:04:41 +08:00
</template>
2022-01-05 20:52:49 +08:00
<template #center>
2022-03-14 19:52:01 +08:00
<header-title></header-title>
2022-01-05 20:52:49 +08:00
</template>
2022-01-05 18:04:41 +08:00
<template #ri-left>
2022-03-14 19:52:01 +08:00
<header-right-btn></header-right-btn>
2022-01-05 18:04:41 +08:00
</template>
2022-03-14 19:52:01 +08:00
</layout-header-pro>
2022-01-06 13:45:51 +08:00
<n-layout-content content-style="overflow:hidden; display: flex">
2022-03-14 19:52:01 +08:00
<content-charts></content-charts>
<content-layers></content-layers>
<content-configurations></content-configurations>
2022-01-05 21:05:55 +08:00
</n-layout-content>
2021-12-21 14:57:31 +08:00
</n-layout>
</div>
<!-- 右键 -->
<n-dropdown
placement="bottom-start"
trigger="manual"
size="small"
:x="mousePosition.x"
:y="mousePosition.y"
:options="menuOptions"
:show="chartEditStore.getRightMenuShow"
2022-03-28 17:24:56 +08:00
:on-clickoutside="onClickOutSide"
@select="handleMenuSelect"
></n-dropdown>
2021-12-21 14:57:31 +08:00
</template>
<script setup lang="ts">
2022-01-20 21:25:35 +08:00
import { loadAsyncComponent } from '@/utils'
2022-03-14 19:52:01 +08:00
import { LayoutHeaderPro } from '@/layout/components/LayoutHeaderPro'
import { useContextMenu } from './hooks/useContextMenu.hook'
2022-03-04 20:57:36 +08:00
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore'
2022-02-03 22:54:31 +08:00
const chartHistoryStoreStore = useChartHistoryStore()
2022-03-04 20:57:36 +08:00
const chartEditStore = useChartEditStore()
2022-01-20 21:25:35 +08:00
2022-02-06 01:04:05 +08:00
// 记录初始化
chartHistoryStoreStore.canvasInit(chartEditStore.getEditCanvas)
2022-01-20 21:25:35 +08:00
const HeaderLeftBtn = loadAsyncComponent(() =>
2022-03-10 14:57:34 +08:00
import('./headerLeftBtn/index.vue')
2022-01-20 21:25:35 +08:00
)
const HeaderRightBtn = loadAsyncComponent(() =>
2022-03-10 14:57:34 +08:00
import('./headerRightBtn/index.vue')
2022-01-20 21:25:35 +08:00
)
2022-03-10 14:57:34 +08:00
const HeaderTitle = loadAsyncComponent(() => import('./headerTitle/index.vue'))
2022-01-20 21:25:35 +08:00
const ContentLayers = loadAsyncComponent(() =>
2022-03-10 14:57:34 +08:00
import('./contentLayers/index.vue')
2022-01-20 21:25:35 +08:00
)
const ContentCharts = loadAsyncComponent(() =>
2022-03-10 14:57:34 +08:00
import('./contentCharts/index.vue')
2022-01-20 21:25:35 +08:00
)
2022-02-26 17:38:24 +08:00
const ContentConfigurations = loadAsyncComponent(() =>
2022-03-10 14:57:34 +08:00
import('./contentConfigurations/index.vue')
2022-01-20 21:25:35 +08:00
)
// 右键
const {
menuOptions,
2022-03-28 17:24:56 +08:00
onClickOutSide,
mousePosition,
handleMenuSelect
} = useContextMenu()
2021-12-21 14:57:31 +08:00
</script>
<style lang="scss" scoped>
2022-01-20 21:25:35 +08:00
@include go('chart') {
2022-01-15 14:56:48 +08:00
height: 100vh;
width: 100vw;
2021-12-21 14:57:31 +08:00
overflow: hidden;
@include background-image('background-image');
}
</style>