<template>
  <div class="inline-16">
    <el-popconfirm :title="`确定${rowData.locked == 0 ? '锁定' : '解锁'}吗？`" @confirm="CheckRow()">
      <el-button slot="reference" size="small" style="width:100%">{{rowData.locked == 0 ? '锁定' : '解锁'}}</el-button>
    </el-popconfirm>
  </div>
</template>

<script>
export default {
  props: ['rowData'],
  methods: {
    async CheckRow() {
      let res = await this.$api.requested({
        "id": 20221024094502,
        "content": {
            "sa_projectids": [this.rowData.sa_projectid],
            "locked": this.rowData.locked == 0 ? 1 : 0
        }
      })
      this.tool.showMessage(res,() => {
        this.$emit('onSuccess')
      })
    },
  }
}

</script>
