<template>
  <div class="personal-target">
    <Header>
      <el-button size="small" @click="export1" v-if="tool.checkAuth($route.name,'export')">导出</el-button>
    </Header>
    <div class="container normal-panel">
      <table1 ref="table">
        <template v-slot:detail="scope">
          <el-button v-if="tool.checkAuth($route.name,'read')" type="text" size="small" @click="$router.push({path:'/projectDetail',query:{id:scope.data.data.hrid,year:scope.data.year}})">详情</el-button>
          <el-button v-if="tool.checkAuth($route.name,'update')" type="text" size="small" @click="$router.push({path:'/editProjectInfo',query:{id:scope.data.data.hrid,year:scope.data.year}})">编辑</el-button>
        </template>
      </table1>
    </div>
  </div>
</template>

<script>
import Header from '@/SManagement/archives_upload/components/Header';
import table1 from './components/table'
export default {
  name: '',
  data() {
    return {
    };
  },
  components: { Header , table1},
  computed:{
  },
  watch:{
  },
  created() {
    
  },
  methods: {
    async export1() {
      if(!Object.keys(this.$refs.table.tableData).length > 0) return
      let res = await this.$api.requested({
        "id": 20220916160002,
        "content": {
            "row": this.$refs.table.tableData
        }
      })
      this.tool.showMessage(res,() => {
        window.open(res.msg,'_self')
      })
    }
  },
};
</script>

<style scoped>

</style>
