无人机管理后台前端(已迁走)
罗广辉
2025-09-27 8411f7555769a717d711fcee3810a497dddc06bd
src/page/index/index.vue
@@ -24,23 +24,26 @@
        </div>
      </div>
    </div>
    <GlobalWS />
    <!-- <wechat></wechat> -->
  </div>
</template>
<script>
import index from '@/mixins/index'
import wechat from './wechat.vue'
import index from '@/mixins/index';
import wechat from './wechat.vue';
//import { validatenull } from 'utils/validate';
import { mapGetters } from 'vuex'
import tags from './tags.vue'
import search from './search.vue'
import logo from './logo.vue'
import top from './top/index.vue'
import sidebar from './sidebar/index.vue'
import { mapGetters } from 'vuex';
import tags from './tags.vue';
import search from './search.vue';
import logo from './logo.vue';
import top from './top/index.vue';
import sidebar from './sidebar/index.vue';
import GlobalWS from '@/page/index/GlobalWS.vue';
export default {
  mixins: [index],
  components: {
    GlobalWS,
    top,
    logo,
    tags,
@@ -49,10 +52,10 @@
    wechat,
  },
  name: 'index',
  provide () {
  provide() {
    return {
      index: this,
    }
    };
  },
  computed: {
    ...mapGetters([
@@ -64,27 +67,27 @@
      'menu',
      'setting',
    ]),
    validSidebar () {
    validSidebar() {
      return !(
        (this.$route.meta || {}).menu === false || (this.$route.query || {}).menu === 'false'
      )
      );
    },
  },
  props: [],
  methods: {
    //打开菜单
    openMenu (item = {}) {
    openMenu(item = {}) {
      this.$store.dispatch('GetMenu', item.id).then(data => {
        if (data.length !== 0) {
          this.$router.$avueRouter.formatRoutes(data, true)
          this.$router.$avueRouter.formatRoutes(data, true);
          // 获取url里面的redirect
          const redirect = decodeURIComponent(this.$route.query.redirect || '')
          const redirect = decodeURIComponent(this.$route.query.redirect || '');
          if (redirect) {
            console.log('redirect', redirect)
            const [path, queryString] = redirect.split('?')
            const query = queryString ? Object.fromEntries(new URLSearchParams(queryString)) : {}
            this.$router.push({ path, query })
            console.log('redirect', redirect);
            const [path, queryString] = redirect.split('?');
            const query = queryString ? Object.fromEntries(new URLSearchParams(queryString)) : {};
            this.$router.push({ path, query });
          }
        }
        //当点击顶部菜单后默认打开第一个菜单
@@ -108,10 +111,10 @@
            }, itemActive.meta)
          });
        }*/
      })
      });
    },
  },
}
};
</script>
<style lang="scss" scoped>
@@ -130,6 +133,6 @@
  background: transparent;
  padding: 0 10px;
  --el-color-primary: rgba(20, 65, 255, 1);
    height: pxToVh(55);
  height: pxToVh(55);
}
</style>