<template>
  <cms-form-tree
    :multiple="false"
    :query-params="queryParams"
    :form-model="formModel"
    :props="{id: 'id', label: 'orgName'}"
    :option-label="{id: 'orgCode', label: 'orgName'}"
    :data-source="dataSource"
    :match-key="matchKey"
    :group="false"
    :placeholder="placeholder"
    @select="selectEvent"
    v-bind="$attrs"
    v-model="inputValue">
  </cms-form-tree>
</template>

<script>
export default {
  name: "CmsOrgSelect",
  computed: {
    inputValue: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val);
      }
    }
  },
  methods: {
    selectEvent(row) {

    }
  },
  props: {
    dataSource: Function,
    queryParams: {
      type: Object,
      default: () => {
        return {}
      }
    },
    formModel: {
      type: Object,
      default: () => {
        return {}
      }
    },
    matchKey: {
      type: Object,
      default: undefined
    },
    value: {
      type: String,
      default: undefined
    },
    placeholder: {
      type: String,
      default: undefined
    }
  }
}
</script>

<style scoped>

</style>
