<template>
  <div>
    <list ref="list">
      <el-button slot="add" icon="el-icon-plus" type="primary" size="small" @click="$router.push({path:'/submit_add'})">新 增</el-button>
      <template v-if="tool.checkAuth($route.name,'read')" v-slot:detail="scope">
        <el-button class="inline-16" type="text" size="mini" @click="$router.push({path:'/submit_detail',query:{id:scope.data.data.sat_submiteditmodelid}})">明 细</el-button>
      </template>
      <template v-if="tool.checkAuth($route.name,'update')" v-slot:edit="scope">
        <el-button class="inline-16" style="margin-left:0 !important;" type="text" size="mini" @click="$router.push({path:'/submit_edit',query:{id:scope.data.data.sat_submiteditmodelid}})">编 辑</el-button>
      </template>
      <template v-if="tool.checkAuth($route.name,'update')" v-slot:release="scope">
        <release :data="scope.data.data" @onSuccess="onSuccess"></release>
      </template>
      <template v-if="tool.checkAuth($route.name,'update')" v-slot:data_statistics="scope">
        <el-button type="text" size="mini" class="inline-16" @click="$router.push({path:'/submit_statistics',query:{id:scope.data.data.sat_submiteditmodelid}})">数据分析</el-button>
      </template>
      
      <template v-if="tool.checkAuth($route.name,'delete')" v-slot:del="scope">
        <on-del class="inline-16" :data="scope.data.data" @onSuccess="onSuccess"></on-del>
      </template>
    </list>
  </div>
</template>

<script>
import list from './list/list.vue'
import onDel from './list/modules/delete.vue'
import release from './list/modules/release.vue'

export default {
  components:{
    list,
    onDel,
    release
  },
  methods:{
    onSuccess () {
      this.$refs.list.listData()
    }
  }
}

</script>
<style>
</style>