<template>
  <div class="inline-16">
    <el-button type="text" size="mini" @click="releaseNotice">{{data.status === '新建'?'发 布':'取消发布'}}</el-button>
  </div>
</template>

<script>
export default {
  props:['data'],
  data () {
    return {}
  },
  methods:{
    async releaseNotice () {
      const res = await this.$api.requested({
        "classname": "webmanage.saletool.courseware.courseware",
        "method": "audit",
        "content": {
            "sat_coursewareid": this.data.sat_coursewareid,
            "type":this.data.status === '新建'?1:0
        }
      })
      this.tool.showMessage(res)
      res.code === 1?this.$emit('onSuccess'):''
    }
  }
}

</script>
<style>
</style>