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

<script>
export default {
  props:['data','disabledFlag'],
  data () {
    return {}
  },
  methods:{
    async releaseNotice () {
      const res = await this.$api.requested({
        "id": this.data.status === '新建'?20220906150703:20220906150803,
        "version":1,
        "content": {
          "sa_salesforecastmodelids":[this.data.sa_salesforecastmodelid]
        }
      })
      this.tool.showMessage(res)
      res.code === 1?this.$emit('onSuccess'):''
    }
  }
}

</script>
<style>
</style>