无人机管理后台前端(已迁走)
shuishen
2025-05-22 15aa22b07c8fa7e7fc072c604ce5d1905972f201
src/mac/index.vue
@@ -44,11 +44,8 @@
      <div class="dock">
        <template v-for="item in openAppList" :key="item.key">
          <div class="item" @click="openApp(item)">
            <i
              :style="{ backgroundColor: item.iconBgColor, color: item.iconColor }"
              class="iconfont"
              :class="item[iconKey]"
            ></i>
            <i :style="{ backgroundColor: item.iconBgColor, color: item.iconColor }" class="iconfont"
              :class="item[iconKey]"></i>
            <small style="margin-top: 5px; font-size: 10px">{{ item[labelKey] }}</small>
          </div>
        </template>
@@ -58,93 +55,93 @@
  </div>
</template>
<script>
import { mapGetters } from 'vuex';
import $Mode from './mode/index';
import index from '@/mixins/index';
import topLock from '@/page/index/top/top-lock.vue';
import { mapGetters } from 'vuex'
import $Mode from './mode/index'
import index from '@/mixins/index'
import topLock from '@/page/index/top/top-lock.vue'
export default {
  mixins: [index],
  components: {
    topLock,
  },
  data() {
  data () {
    return {
      app: false,
      timeString: '',
    };
    }
  },
  computed: {
    ...mapGetters(['menu', 'tagList', 'tagWel', 'tag', 'userInfo', 'isMacOs']),
    labelKey() {
      return this.website.menu.label;
    ...mapGetters(['menu', 'bsTagList', 'tagWel', 'tag', 'userInfo', 'isMacOs']),
    labelKey () {
      return this.website.menu.label
    },
    pathKey() {
      return this.website.menu.path;
    pathKey () {
      return this.website.menu.path
    },
    hrefKey() {
      return this.website.menu.href;
    hrefKey () {
      return this.website.menu.href
    },
    childrenKey() {
      return this.website.menu.children;
    childrenKey () {
      return this.website.menu.children
    },
    queryKey() {
      return this.website.menu.query;
    queryKey () {
      return this.website.menu.query
    },
    iconKey() {
      return this.website.menu.icon;
    iconKey () {
      return this.website.menu.icon
    },
    menuList() {
      let result = [];
    menuList () {
      let result = []
      const findMenu = list => {
        list.forEach(ele => {
          if (ele[this.childrenKey] && ele[this.childrenKey].length !== 0) {
            findMenu(ele[this.childrenKey]);
            findMenu(ele[this.childrenKey])
          } else {
            result.push(ele);
            result.push(ele)
          }
        });
      };
      findMenu(this.menu);
      return result;
        })
      }
      findMenu(this.menu)
      return result
    },
    deskTopAppList() {
      return this.menuList;
    deskTopAppList () {
      return this.menuList
    },
    openAppList() {
      return [];
    openAppList () {
      return []
    },
  },
  created() {
    this.startTimer();
    this.$store.dispatch('GetMenu');
  created () {
    this.startTimer()
    this.$store.dispatch('GetMenu')
  },
  methods: {
    switchTheme() {
      this.$store.commit('SET_THEME_NAME', '');
      this.$router.push(this.tagWel);
      setTimeout(() => location.reload());
    switchTheme () {
      this.$store.commit('SET_THEME_NAME', '')
      this.$router.push(this.tagWel)
      setTimeout(() => location.reload())
    },
    logout() {
      this.$store.commit('SET_THEME_NAME', '');
    logout () {
      this.$store.commit('SET_THEME_NAME', '')
      this.$store.dispatch('LogOut').then(() => {
        this.$router.push({ path: '/login' });
        setTimeout(() => location.reload());
      });
        this.$router.push({ path: '/login' })
        setTimeout(() => location.reload())
      })
    },
    startTimer() {
    startTimer () {
      setInterval(() => {
        this.timeString = this.$dayjs().format('YYYY年MM月DD日 HH:mm');
      }, 1000);
        this.timeString = this.$dayjs().format('YYYY年MM月DD日 HH:mm')
      }, 1000)
    },
    openApp(item) {
    openApp (item) {
      $Mode({
        title: item[this.labelKey],
        path: item[this.hrefKey] ? item[this.hrefKey] : item[this.pathKey],
      });
      })
    },
  },
};
}
</script>
<style>
.top .el-dropdown {