<template>
  <div>
    <Input
      v-model="orgName"
      icon="md-search"
      placeholder="请选择"
      readonly
      :disabled="disabled"
      :size="size"
      @click.native="select()"
    ></Input>
  </div>
</template>
<script>
import SelectOrgTree from '../selectOrgTree/SelectOrgTree.vue';
import { type } from 'os';
export default {
  name: 'SelectOrg',
  props: {
    size: {
      type: String,
      default: 'default'
    },
    orgId: {
      type: String,
      default() {
        return '';
      }
    },
    orgName: {
      type: String,
      default() {
        return '';
      }
    },
    disabled: {
      type: Boolean,
      default() {
        return false;
      }
    }

  },
  data() {
    return {

    };
  },
  methods: {
    select() {
      if (this.disabled) return;
      new this.$pageModal(
        SelectOrgTree,
        {
          props: {
            orgId: this.orgId,
            orgName: this.orgName
          }
        }, (data) => {
          this.$emit('change', data);
        }
      );
    }
  }
};
</script>
