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

<script>
export default {
  name: "scan-area-dialog",
  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>
