<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.submitedit.submitedit",
        "method": "releasesubmit",
        "content": {
          "sat_submiteditmodelid": this.data.sat_submiteditmodelid,
          "isrelease":this.data.status === '新建'?1:0
        }
      })
      this.tool.showMessage(res)
      res.code === 1?this.$emit('onSuccess'):''
    }
  }
}

</script>
<style>
</style>