husq
2023-09-21 67338a9d75216fd17bf5d679e585c21a9f10a451
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,18 @@
      { 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 snList = computed(() => store.state.common.snList)
    async function goBack () {
      snList.value.forEach(async (v: string) => {
        await testUnBind(v)
      })
      root.$router.push('/' + ERouterName.PROJECT_LIST)
    }
    return {
      options,
      selectedRoute,