<template>
  <div>
    <el-button v-for="(item,index) in links" @click="openPage(item.link)">
      {{ item.name }}
    </el-button>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: "DashboardZyjhLink",
  data(){
    return{
      links:[],
      一区:[
        {name:'上料报工',link:'/#/sliao?zyq=一区&zyType=0&deviceId=122222222222'},
        {name:'抛丸',link:'/#/pwpg?zyq=一区&zyType=0&deviceId=122222222222'},
      ],
      二区:[
        {name:'划线',link:'/#/hxpg?zyq=二区&zyType=0&deviceId=122222222222'},
        {name:'切割',link:'/#/qgpg?zyq=二区&zyType=0&deviceId=122222222222'},
        {name:'预配盘',link:'/#/bfang?zyq=二区&zyType=0&deviceId=122222222222'},
      ],
      三区:[
        {name:'划线',link:'/#/hxpg?zyq=三区&zyType=0&deviceId=122222222222'},
        {name:'切割',link:'/#/qgpg?zyq=三区&zyType=0&deviceId=122222222222'},
        {name:'预配盘',link:'/#/bfang?zyq=三区&zyType=0&deviceId=122222222222'},
      ],
      四区:[
        {name:'划线',link:'/#/hxpg?zyq=四区&zyType=0&deviceId=122222222222'},
        {name:'切割',link:'/#/qgpg?zyq=四区&zyType=0&deviceId=122222222222'},
        {name:'预配盘',link:'/#/bfang?zyq=四区&zyType=0&deviceId=122222222222'},
      ],
    }
  },
  computed: {
    ...mapGetters(['name', 'bmbm'])
  },
  mounted(){
    console.log(window.location)
    console.log(this.name,this.bmbm)
    this.links=this.$data[this.bmbm];
    console.log(this.links)
  },
  methods:{
    openPage(link){
      window.location.href = window.location.origin+link;
    }
  }
}
</script>
