<template>
  <div>
    <ImportDialog
      :tablename="tablename"
      :title="title"
      :visible="visible"
      :main-id="mainId"
      :custom-import="customImport"
      :father-method="fatherClose"
      @closeDialog="fatherClose"
    />
  </div>
</template>
<script>


  import ImportDialog from '../../customizedContent/ImportDialog';

  export default {
    components: { ImportDialog },
    props: {
      visible: { // 获取ID用于多选
        type: Boolean,
        default: false
      },
      pageMsgId: { // 明细id
        type: String,
        default: ''
      },
      supportScope: { // 全国或者自定义
        type: String,
        default: ''
      }
    },

    data() {
      return {
        tablename: 'SETLOGISTICSAREAALL',
        mainId: this.pageMsgId,
        title: '物流配送区域',
        customImport: true,
      };
    },
    created() {
    },
    watch: {
      visible: {
        handler(val, oldval) {
          if (this.supportScope == '0') { // 全国
            this.tablename = 'SETLOGISTICSAREAALL';
            this.mainId = this.pageMsgId;
          } else if (this.supportScope == '1') { // 自定义
            this.tablename = 'SETLOGISTICSAREACUSTOM';
            this.mainId = this.pageMsgId;
          }
        }
      }
    },
    methods: {
      fatherClose() {
        this.$emit('closeActionDialog', true);
      }
    }
  };
</script>
