<template>
  <div class="modal-backdrop" v-show="showModalFlag">
    <div class="modal">
      <div class="modal-body">
        <div class="bodyRow">确定删除？</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn-confirm" @click="sonDataDel">
          确定
        </button>
        <button type="button" class="btn-close" @click="closeme2">取消</button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    showModalFlag: {
      type: Boolean,
      default: true,
    },
    chooseItemIndex: {
      type: Number,
      default: 0,
    },
    LinkData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      itemIndex: 0,
      deleteId: 0,
    };
  },
  methods: {
    closeme2: function () {
      this.$emit("hide_modal");
    },
    sonDataDel: function () {
      this.itemIndex = this.chooseItemIndex;
      

      this.$http({
        url: "/deleteAccountReportRecordInfo",
        method: "post",
        data: {
          id: this.deleteId,
        },
      })
        .then((res) => {
          console.log("已删除", res);
          this.$emit("dataDel", this.itemIndex);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    initial: function () {
      this.deleteId=this.LinkData.id;
      console.log(this.LinkData)
    }
  },
  mounted() {
    this.initial();
  },
 /*  created() {
    console.log(this.LinkData)
  } */
};
</script>

<style scoped lang="less">
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal {
  background-color: #ffffff;
  box-shadow: 2px 2px 20px 1px;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  width: 500px;
  border-radius: 0px;
  height: 230px;
}
.modal-footer {
  border-top: 1px solid #eee;
  position: relative;
  top: 124px;
  left: 232px;
  width: 208px;
  display: flex;
  justify-content: space-between;
  padding: 0px;
}
.modal-footer button {
  border-radius: 4px;
  margin-left: 0px;
  width: 80px;
  font-size: 14px;
}

.modal-footer button:nth-child(1) {
  background-color: #0056a0;
}
.modal-footer button:nth-child(2) {
  background-color: #eeeeee;
}
.modal-body {
  position: relative;
  top: 64px;
  margin-left: 50px;
  padding: 0px;
}
.btn-close,
.btn-confirm {
  margin-left: 16px;
  width: 56px;
  height: 36px;
  border: none;
  cursor: pointer;
}
.btn-close {
  color: #313131;
  background-color: gray;
}
.btn-confirm {
  color: #fff;
  background-color: #2d8cf0;
}
.bodyRow {
  font-size: 16px;
  font-family: Arial;
}
</style>
