123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <div>
- <n-drawer
- v-model:show="active"
- :width="240"
- placement="right"
- :trap-focus="false"
- :block-scroll="false"
- :show-mask="false"
- :mask-closable="false"
- to="#drawer-target"
- style="--n-body-padding: 0px"
- >
- <n-drawer-content title="专题导航">
- <div class="drawerContent m-5"></div>
- <n-flex justify="center">
- <n-button type="primary" @click="handleAdd">+ 添加</n-button>
- </n-flex>
- <n-list
- hoverable
- clickable
- style="--n-color-modal: none; margin-top: 20px"
- :show-divider="false"
- @select="handleSelect"
- >
- <n-list-item v-for="(nav, index) in dataList" :key="index" style="">
- <n-flex justify="space-between">
- <n-flex align="center">
- <n-icon size="20">
- <WalkSharp />
- </n-icon>
- {{ nav.title }}
- </n-flex>
- <n-dropdown trigger="hover" :options="fullOptions">
- <n-icon :size="20">
- <svg
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- viewBox="0 0 32 32"
- >
- <circle cx="8" cy="16" r="2" fill="currentColor"></circle>
- <circle cx="16" cy="16" r="2" fill="currentColor"></circle>
- <circle cx="24" cy="16" r="2" fill="currentColor"></circle>
- </svg>
- </n-icon>
- </n-dropdown>
- </n-flex>
- </n-list-item>
- </n-list>
- </n-drawer-content>
- </n-drawer>
- </div>
- </template>
- <script setup lang="ts">
- import { ref } from 'vue'
- import { sdk, clearScreen } from '@/sdk'
- import { onMounted, onUnmounted } from 'vue'
- import {
- NRadio,
- NPopover,
- useDialog,
- useMessage,
- NDropdown,
- NList,
- NListItem
- } from 'naive-ui'
- import { WalkSharp, TrashOutline, EllipsisHorizontal } from '@vicons/ionicons5'
- const panos = ref([])
- const isEditing = ref({
- index: NaN
- })
- const dataList = ref<
- {
- title: string
- panos: string[]
- }[]
- >([])
- sdk.then((sdk) => {
- sdk.PanoCheckManager.on('changed', (list: any) => {
- panos.value = list
- console.log('panos', panos.value)
- })
- })
- const handleAdd = () => {
- sdk.then((sdk) => {
- sdk.Scene.whenLoaded(() => {
- sdk.PanoCheckManager.enter()
- clearScreen(true)
- })
- })
- if (panos.value.length === 0) {
- dataList.value.push({
- title: '新增路线',
- panos: []
- })
- } else {
- // message.warning('请先保存数据!')
- }
- }
- onMounted(() => {
- sdk.then((sdk) => {
- sdk.Scene.whenLoaded(() => {
- sdk.PanoCheckManager.enter()
- // debugger
- clearScreen(true)
- })
- })
- })
- onUnmounted(() => {
- sdk.then((sdk) => {
- sdk.PanoCheckManager.leave()
- clearScreen(false)
- })
- })
- defineProps<{ msg: string }>()
- const dialog = useDialog()
- const message = useMessage()
- const active = ref(true)
- // const show = ref(true)
- const fullOptions = ref([
- {
- label: '编辑',
- key: '1'
- },
- {
- label: '删除',
- key: '2'
- }
- ])
- const handleSelect = (key: string) => {
- switch (key) {
- case '1':
- break
- case '2':
- break
- }
- }
- </script>
- <style lang="sass" scoped>
- a
- color: #42b983
- label
- margin: 0 0.5em
- font-weight: bold
- code
- background-color: #eee
- padding: 2px 4px
- border-radius: 4px
- color: #304455
- </style>
|