SearchWidgetExample.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <h1>搜索框</h1>
  3. <SearchWidget
  4. info-window-no="279750"
  5. :field-value="parentOrganizationFieldValue"
  6. :title-name="部门"
  7. display-name="name"
  8. :where-clause="parentOrganizationAdditionHql"
  9. @value-changed="parentOrganizationValueChanged"
  10. />
  11. 您选择的部门是:
  12. <span v-for="item, index in parentOrganizationFieldValue.displayValue" :key="index">
  13. {{ item }}
  14. </span>
  15. </template>
  16. <script>
  17. import SearchWidget from '@/info/search-widget.js';
  18. export default {
  19. components: {
  20. SearchWidget,
  21. },
  22. data: function () {
  23. return {
  24. parentOrganizationFieldValue: {
  25. displayValue: [],
  26. fieldType: 'Key',
  27. id: null,
  28. },
  29. /**
  30. * 上级部门发生修改
  31. */
  32. parentOrganizationValueChanged: function (newFieldValue) {
  33. var _self = this;
  34. _self.parentOrganizationFieldValue = newFieldValue;
  35. _self.organization.parentId = newFieldValue.id;
  36. },
  37. parentOrganizationAdditionHql: 'id IN (:EnvOrganizationIdList)',
  38. };
  39. },
  40. methods: {
  41. },
  42. };
  43. </script>