<template>
  <div>
    <div class="page-header-index-wide welcome" v-if="indexStyle==0">
      <h1>欢迎进入慧盈服务平台</h1>
      <img src="~@/assets/welcome.png" class="logo">
    </div>
    <index-chart v-if="indexStyle==1"></index-chart>
    <index-bdc v-if="indexStyle==2"></index-bdc>
    <index-task v-if="indexStyle==3"></index-task>
    <!--<div style="width: 100%;text-align: right;margin-top: 20px">-->
      <!--请选择首页样式：-->
      <!--<a-radio-group v-model="indexStyle">-->
        <!--<a-radio :value="1">统计图表</a-radio>-->
        <!--<a-radio :value="2">统计图表2</a-radio>-->
        <!--<a-radio :value="3">任务表格</a-radio>-->
      <!--</a-radio-group>-->
    <!--</div>-->
  </div>
</template>

<script>
  import IndexChart from './IndexChart'
  import IndexTask from "./IndexTask"
  import IndexBdc from './IndexBdc'
  import { mapGetters } from 'vuex'
  import { USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"

  export default {
    name: "Analysis",
    components: {
      IndexChart,
      IndexTask,
      IndexBdc
    },
    data() {
      return {
        indexStyle: 0,
      }
    },
    created() {
      //获取页面权限
      let authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || "[]");
      var bo = false;
      for (var auth of authList) {
        if(auth.action == 'require:dashboard') {
          bo = true;
          break;
        }
      }
      if (bo) {
        this.indexStyle = 0;
      } else {
        this.indexStyle = 1;
      }
    },
    methods: {
      ...mapGetters(["nickname"]),
    }
  }
</script>
<style lang="less" scoped>
  .welcome{
    margin: 8% auto 0 auto;
    text-align: center;
    .logo {
      margin-top: 6px;
      height: 385px;
      width: 584px;
    }
    h1{
      font-size: 32px;
      font-weight: 600;
    }
  }
</style>