<template>
  <h1>搜索框</h1>

  <SearchWidget
    info-window-no="279750"
    :field-value="parentOrganizationFieldValue"
    :title-name="部门"
    display-name="name"
    :where-clause="parentOrganizationAdditionHql"
    @value-changed="parentOrganizationValueChanged"
  />

  您选择的部门是: 
  <span v-for="item, index in parentOrganizationFieldValue.displayValue" :key="index">
    {{ item }}
  </span>
</template>

<script>

import SearchWidget from '@/info/search-widget.js';


export default {

  components: {
    SearchWidget,
  },
  data: function () {
    return {


      parentOrganizationFieldValue: {
        displayValue: [],
        fieldType: 'Key',
        id: null,
      },


      /**
             * 上级部门发生修改
             */
      parentOrganizationValueChanged: function (newFieldValue) {
        var _self = this;
        _self.parentOrganizationFieldValue = newFieldValue;
        _self.organization.parentId = newFieldValue.id;
      },

      parentOrganizationAdditionHql: 'id IN (:EnvOrganizationIdList)',

    };
  },

  methods: {
        
  },
};
</script>
