<template>
  <div>
    <!-- 课程列表 -->
    <list ref="list">
      <!-- 新增课程 -->
      <el-button v-if="tool.checkAuth($route.name,'insert')" slot="add" icon="el-icon-plus" type="primary" size="small" @click="$router.push({path:'/archives_scadd'})">新 增</el-button>
      <template v-slot:detail="scope">
        <el-button type="text" size="small" @click="$router.push({path:'/archives_scdetails',query:{id:scope.data.data.sat_coursewareid}})">详 情</el-button>
      </template>
      <template v-if="tool.checkAuth($route.name,'update')" v-slot:edit="scope">
        <el-button slot="edit" type="text" size="small" class="inline-16" @click="$router.push({path:'/archives_scedit',query:{id:scope.data.data.sat_coursewareid}})">编 辑</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,'data_analysis')" v-slot:data_statistics="scope">
        <el-button type="text" size="small" @click="$router.push({path:'/archives_sc_analysis',query:{id:scope.data.data.sat_coursewareid}})">数据分析</el-button>
      </template>
      <template v-if="tool.checkAuth($route.name,'delete')" v-slot:del="scope">
        <on-del :data="scope.data.data" @onSuccess="onSuccess"></on-del>
      </template>
    </list>
  </div>
</template>

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

export default {
  components: {
    list,
    release,
    onDel,
  },
  methods: {
    onSuccess() {
      this.$refs.list.listData();
    },
  },
  created() {},
};
</script>

<style scoped>
</style>