<template>
  <div class="mask" v-if="visibile">
    <div class="comfirm-container">
      <div class="msg">
        <div v-if="msg2">{{ msg2 }}</div>
        <div>{{ msg }}</div>
      </div>
      <div class="btns">
        <!-- <CommonButton size="default" type="info" msg="取消" @click="emit('cancel')" /> -->
        <CommonButton
          v-if="showbtn"
          size="default"
          type="danger"
          msg="结束试验"
          @click="emit('end')" />
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  visibile: {
    type: Boolean,
    default: false
  },
  msg: {
    type: String,
    default: ''
  },
  showbtn: {
    type: Boolean,
    default: true
  },
  msg2: {
    type: String,
    default: ''
  }
});
const emit = defineEmits(['end']);
</script>
<style lang="less" scoped>
.mask {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  .comfirm-container {
    width: 260px;
    height: 150px;
    background: #f8f8f8;
    box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.16);
    border-radius: 8px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 16px;
    justify-content: space-between;
    text-align: center;
    .msg {
      margin-top: 20px;
      font-size: 16px;
      min-height: 80px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .btns {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-around;
    }
  }
}
</style>
