2024-08-20 12:11:31 +00:00
|
|
|
<template>
|
|
|
|
|
<split-pane :min-percent="10" :default-percent="15" split="vertical" style="height: calc(100vh - 110px)">
|
|
|
|
|
<template slot="paneL">
|
|
|
|
|
<SideMenu @handleNodeClick="handleNodeClick"></SideMenu>
|
|
|
|
|
</template>
|
|
|
|
|
<template slot="paneR">
|
2024-08-21 01:17:14 +00:00
|
|
|
<RightList ref="listRef"></RightList>
|
2024-08-20 12:11:31 +00:00
|
|
|
</template>
|
|
|
|
|
</split-pane>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
2024-08-27 07:57:16 +00:00
|
|
|
import { computed, defineComponent, ref, watch } from 'vue'
|
2024-08-20 12:11:31 +00:00
|
|
|
import SplitPane from 'vue-splitpane'
|
|
|
|
|
import SideMenu from './SideMenu.vue'
|
|
|
|
|
import RightList from './List.vue'
|
2024-08-27 07:57:16 +00:00
|
|
|
import { useStore } from '@cmp/cmp-core'
|
2024-08-20 12:11:31 +00:00
|
|
|
export default defineComponent({
|
|
|
|
|
components: { SplitPane, SideMenu, RightList },
|
|
|
|
|
setup() {
|
2024-08-27 07:57:16 +00:00
|
|
|
const store = useStore()
|
|
|
|
|
console.log(store)
|
|
|
|
|
const selectedPostion = computed(() => store.state.position.selectedPostion)
|
|
|
|
|
watch(selectedPostion, (val) => {
|
|
|
|
|
console.log('阵地切换', val)
|
|
|
|
|
})
|
2024-08-20 12:11:31 +00:00
|
|
|
const listRef = ref()
|
|
|
|
|
function handleNodeClick(node: any) {
|
2024-08-21 01:17:14 +00:00
|
|
|
const { type, id } = node
|
2024-08-20 12:11:31 +00:00
|
|
|
if (type === 'module') {
|
|
|
|
|
listRef.value.init(node)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
listRef,
|
2024-08-21 01:17:14 +00:00
|
|
|
handleNodeClick,
|
2024-08-20 12:11:31 +00:00
|
|
|
}
|
2024-08-21 01:17:14 +00:00
|
|
|
},
|
2024-08-20 12:11:31 +00:00
|
|
|
})
|
|
|
|
|
</script>
|