<template>
  <Modal
    class="scan-area-dialog"
    v-model="modalIsShow"
    title="设置当前试卷采集信息"
    :mask-closable="false"
    :closable="false"
    fullscreen
    footer-hide
  >
    <div class="part-box">
      <scan-area-steps
        :image-url="curImage.url"
        :cur-setting="curCollectConfig"
        @on-finished="finished"
        v-if="curImage.url && modalIsShow && curCollectConfig"
      ></scan-area-steps>
    </div>
  </Modal>
</template>

<script>
import ScanAreaSteps from "../components/ScanAreaSteps";

export default {
  name: "scan-area-dialog",
  components: { ScanAreaSteps },
  props: {
    curImage: {
      type: Object,
      default() {
        return {
          url: "",
          name: ""
        };
      }
    },
    curCollectConfig: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  data() {
    return {
      modalIsShow: false,
      curSetting: null
    };
  },
  methods: {
    cancel() {
      this.modalIsShow = false;
    },
    open() {
      this.modalIsShow = true;
    },
    finished(setting) {
      this.$emit("confirm", setting);
      this.cancel();
    }
  }
};
</script>
