guoshilong
2023-09-23 fb336f319c71291fa09de3e7f67f1ccfab3cb7c8
src/components/common/sidebar.vue
@@ -28,7 +28,8 @@
import { getRoot } from '/@/root'
import * as icons from '@ant-design/icons-vue'
import { ERouterName } from '/@/types'
import { testUnBind } from '/@/api/manage'
import { useMyStore } from '/@/store'
interface IOptions {
  key: number
  label: string
@@ -60,16 +61,23 @@
      { key: 4, label: '航线库', path: '/' + ERouterName.WAYLINE, icon: 'NodeIndexOutlined' },
      { key: 5, label: '计划库', path: '/' + ERouterName.TASK, icon: 'CalendarOutlined' }
    ]
    const store = useMyStore()
    function selectedRoute (item: IOptions) {
      const path = typeof item.path === 'string' ? item.path : item.path.path
      return root.$route.path?.indexOf(path) === 0
    }
    function goBack () {
    const osdVisible = computed(() => {
      return store.state.osdVisible
    })
    const snList = computed(() => store.state.common.snList)
    async function goBack () {
      const query = toRefs(osdVisible.value)
      snList.value.forEach(async (v: string) => {
        await testUnBind(v)
      })
      store.commit('SET_OSD_VISIBLE_INFO', { ...query, visible: false })
      root.$router.push('/' + ERouterName.PROJECT_LIST)
    }
    return {
      options,
      selectedRoute,