<!--
 * @Description: 重新执行异常调度的确认弹出框组件
 * @Author: liusheng
 * @Date: 2024-11-14 16:30:56
-->
<template>
  <el-popover :visible.sync="visible" v-model="showPopup" placement="bottom-start" width="280" 
    trigger="click" @show="handleShow" @hide="handleHide">
    <div class="text-line">确认重新执行【{{task}}】任务？</div>
    <div class="button-line">
      <el-button size="mini" @click="handleCancel">取 消</el-button>
      <el-button type="primary" size="mini" @click="handleConfirm">确 认</el-button>
    </div>
    <el-button type="text" slot="reference">重新执行</el-button>
  </el-popover>
</template>

<script>
export default {
  name: 'ReexecConfirmPopup',
  props: ['visible', 'task'],

  data() {
    return {
      showPopup: false,
    }
  },

  methods: {
    handleConfirm() {
      this.showPopup = false;
      this.$emit("confirm");
      this.handleHide();
    },
    
    handleCancel() {
      this.showPopup = false;
    },

    handleShow() {
      this.$emit("update:visible", true);
    },

    handleHide() {
      this.$emit("update:visible", false);
    },
  }
}
</script>

<style scoped>
.text-line {
  padding: 10px 0 25px;
  font-size: 14px;
  /* font-weight: bold; */
  text-align: center;
}
.button-line {
  text-align: center; 
  margin-bottom: 10px;
}
</style>
