<template>
  <div id="app">
    <head-nav class="head-nav" />
    <router-view></router-view>
  </div>
</template>

<script>
import { mapActions, mapMutations } from 'vuex';
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
import HeadNav from './components/HeadNav/HeadNav.vue';

export default {
  name: 'App',
  components: { HeadNav },
  data() {
    return { zh_CN };
  },

  async created() {
    const userId = this.$route.query.uid;
    const params = { userId };
    await this.getUserId(params);
    await this.getAllMembers({ projectId: this.$route.query.pid });
    this.setProjectId(this.$route.query.pid);
  },

  methods: {
    ...mapMutations('home', ['setProjectId', 'setMembers']),
    ...mapActions('user', ['getUserId']),
    ...mapActions('home', ['getAllMembers']),
  },
};
</script>

<style>
html,
body,
#app {
  min-height: 100%;
  width: 100%;
}
</style>
