<template>
  <div>
    <div class="dimmed confirm" @click="confirmModalCancel();"></div>
    <div class="popup-wrap confirm">
      <!-- 수정 확인 -->
      <div class="popup confirm">
        <div class="pop-head">
          <h3 class="pop-tit">{{ title }}</h3>
        </div>
        <div class="pop-cont">
          <p>{{ msg }}</p>
        </div>
        <div class="popup-btn2">
          <button class="btn-pcolor" @click="confirmModalClose();">확인</button>
          <button class="btn-default" @click="confirmModalCancel();">취소</button>
        </div>
      </div>
    </div>

    <!-- 발신번호차단 등록 - 최초 등록 -->
    <div class="dimmed confirm-insert" @click="confirmInsertClose();"></div>
    <div class="popup-wrap confirm-insert">
      <div class="popup confirm-insert">
        <div class="pop-head">
          <h3 class="pop-tit">발신번호차단 등록</h3>
        </div>
        <div class="pop-cont">
          <p>작성된 내용으로 등록 하시겠습니까?</p>
        </div>
        <div class="popup-btn2">
          <button class="btn-pcolor" @click="confirmInsert();">확인</button>
          <button class="btn-default" @click="confirmInsertClose();">취소</button>
        </div>
      </div>
    </div>

    <!-- 발신번호차단 상세 - 수정 -->
    <div class="dimmed confirm-update" @click="confirmUpdateClose();"></div>
    <div class="popup-wrap confirm-update">
      <div class="popup confirm-update">
        <div class="pop-head">
          <h3 class="pop-tit">발신번호 차단 상세</h3>
        </div>
        <div class="pop-cont">
          <p>작성된 내용으로 수정하겠습니까?</p>
        </div>
        <div class="popup-btn2">
          <button class="btn-pcolor" @click="confirmUpdate();">확인</button>
          <button class="btn-default" @click="confirmUpdateClose();">취소</button>
        </div>
      </div>
    </div>

    <!-- 발신번호차단 상세 삭제-->
    <div class="dimmed confirm-delete" @click="confirmDeleteClose();"></div>
    <div class="popup-wrap confirm-delete">
      <div class="popup confirm-delete">
        <div class="pop-head">
          <h3 class="pop-tit">발신번호 차단 상세</h3>
        </div>
        <div class="pop-cont">
          <p>해당 발신번호를 차단리스트에서</p>
          <p>삭제하시겠습니까?</p>
        </div>
        <div class="popup-btn2">
          <button class="btn-pcolor" @click="confirmDelete();">확인</button>
          <button class="btn-default" @click="confirmDeleteClose();">취소</button>
        </div>
      </div>
    </div>

    <!-- 메세지 등록 - 최초 등록 -->
    <div class="dimmed msgconfirm-insert" @click="msgConfirmInsertClose();"></div>
    <div class="popup-wrap msgconfirm-insert">
      <div class="popup msgconfirm-insert">
        <div class="pop-head">
          <h3 class="pop-tit">메세지차단 등록</h3>
        </div>
        <div class="pop-cont">
          <p>작성된 내용으로 등록 하시겠습니까?</p>
        </div>
        <div class="popup-btn2">
          <button class="btn-pcolor" @click="msgConfirmInsert();">확인</button>
          <button class="btn-default" @click="msgConfirmInsertClose();">취소</button>
        </div>
      </div>
    </div>

    <!-- 메세지차단 상세 - 수정 -->
    <div class="dimmed msgconfirm-update" @click="msgConfirmUpdateClose();"></div>
    <div class="popup-wrap msgconfirm-update">
      <div class="popup msgconfirm-update">
        <div class="pop-head">
          <h3 class="pop-tit">메세지 차단 상세</h3>
        </div>
        <div class="pop-cont">
          <p>작성된 내용으로 수정하겠습니까?</p>
        </div>
        <div class="popup-btn2">
          <button class="btn-pcolor" @click="msgConfirmUpdate();">확인</button>
          <button class="btn-default" @click="msgConfirmUpdateClose();">취소</button>
        </div>
      </div>
    </div>

    <!-- 메세지차단 상세 삭제-->
    <div class="dimmed msgconfirm-delete" @click="msgConfirmDeleteClose();"></div>
    <div class="popup-wrap msgconfirm-delete">
      <div class="popup msgconfirm-delete">
        <div class="pop-head">
          <h3 class="pop-tit">메세지 차단 상세</h3>
        </div>
        <div class="pop-cont">
          <p>해당 메세지를 차단리스트에서</p>
          <p>삭제하시겠습니까?</p>
        </div>
        <div class="popup-btn2">
          <button class="btn-pcolor" @click="msgConfirmDelete();">확인</button>
          <button class="btn-default" @click="msgConfirmDeleteClose();">취소</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "validationConfirmPopup",
  data() {
    return {
      row: {},
      title: '',
      msg: '',
    }
  },
  methods: {
    //발신번호차단등록 - 최초등록 Open
    confirmInsertOpen() {
      var dimmed = document.getElementsByClassName('confirm-insert');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'block';
      }

    },
    //사용자등록 - 최초등록
    confirmInsert() {
      var dimmed = document.getElementsByClassName('confirm-insert');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

      this.$parent.doInsert();

    },
    //발신번호차단등록 - 최초등록 Close
    confirmInsertClose() {
      var dimmed = document.getElementsByClassName('confirm-insert');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }
    },
    // 발신번호차단 삭제 Open
    confirmDeleteOpen() {
      var dimmed = document.getElementsByClassName('confirm-delete');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'block';
      }
    },
    //발신번호차단번호 삭제
    confirmDelete() {
      var dimmed = document.getElementsByClassName('confirm-delete');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }
      this.$parent.IntrcpDeleteModal();
    },
    //발신번호차단 삭제 Close
    confirmDeleteClose() {
      var dimmed = document.getElementsByClassName('confirm-delete');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

    },
    //발신번호차단 수정 확인 Open
    confirmUpdateOpen() {
      var dimmed = document.getElementsByClassName('confirm-update');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'block';
      }

    },
    //발신번호차단 수정 확인
    confirmUpdate() {
      var dimmed = document.getElementsByClassName('confirm-update');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

      this.$parent.IntrcpUpdateModal();

    },
    // 발신번호차단 수정 Close
    confirmUpdateClose() {
      var dimmed = document.getElementsByClassName('confirm-update');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

    },

    //메세지차단등록 - 최초등록 Open
    msgConfirmInsertOpen() {
      var dimmed = document.getElementsByClassName('msgconfirm-insert');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'block';
      }

    },
    //메세지등록 - 최초등록
    msgConfirmInsert() {
      var dimmed = document.getElementsByClassName('msgconfirm-insert');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

      this.$parent.doInsert();

    },
    //메세지차단등록 - 최초등록 Close
    msgConfirmInsertClose() {
      var dimmed = document.getElementsByClassName('msgconfirm-insert');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }
    },
    // 메세지차단 삭제 Open
    msgConfirmDeleteOpen() {
      var dimmed = document.getElementsByClassName('msgconfirm-delete');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'block';
      }
    },
    //메세지차단번호 삭제
    msgConfirmDelete() {
      var dimmed = document.getElementsByClassName('msgconfirm-delete');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }
      this.$parent.MsgIntrcpDeleteModal();
    },
    //메세지차단 삭제 Close
    msgConfirmDeleteClose() {
      var dimmed = document.getElementsByClassName('msgconfirm-delete');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

    },
    //메세지차단 수정 확인 Open
    msgConfirmUpdateOpen() {
      var dimmed = document.getElementsByClassName('msgconfirm-update');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'block';
      }

    },
    //메세지차단 수정 확인
    msgConfirmUpdate() {
      var dimmed = document.getElementsByClassName('msgconfirm-update');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

      this.$parent.MsgIntrcpUpdateModal();

    },
    // 메세지차단 수정 Close
    msgConfirmUpdateClose() {
      var dimmed = document.getElementsByClassName('msgconfirm-update');
      for (var i = 0; i < dimmed.length; i++) {
        dimmed[i].style.display = 'none';
      }

    },
  },
}
</script>
