picker-source-mixin.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import { Empty } from 'ant-design-vue'
  2. const pickerSourceMixin = {
  3. props: {
  4. /**
  5. * 多个数据源时,Tab页的标题
  6. */
  7. title: {
  8. type: String,
  9. default: undefined,
  10. },
  11. /**
  12. * 多个数据源时,Tab页的图标
  13. */
  14. icon: {
  15. type: String,
  16. default: undefined,
  17. },
  18. /**
  19. * @ignore
  20. */
  21. optionLabel: {
  22. type: String,
  23. default: 'name',
  24. },
  25. /**
  26. * @ignore
  27. */
  28. optionValue: {
  29. type: String,
  30. default: 'id',
  31. },
  32. /**
  33. * @ignore
  34. */
  35. render: {
  36. type: Function,
  37. default: function(item) {
  38. return item[this.optionLabel]
  39. },
  40. },
  41. /**
  42. * @ignore
  43. */
  44. single: {
  45. type: Boolean,
  46. default: false,
  47. },
  48. /**
  49. * @ignore
  50. */
  51. targetKeys: {
  52. type: Array,
  53. default: undefined,
  54. },
  55. /**
  56. * @ignore
  57. */
  58. selectedKeys: {
  59. type: Array,
  60. default: undefined,
  61. },
  62. /**
  63. * @ignore
  64. */
  65. itemSelect: {
  66. type: Function,
  67. default: () => {},
  68. },
  69. /**
  70. * @ignore
  71. */
  72. updateDataSource: {
  73. type: Function,
  74. default: () => {},
  75. },
  76. /**
  77. * @ignore
  78. */
  79. dataSource: {
  80. type: Array,
  81. default: undefined,
  82. },
  83. /**
  84. * @ignore
  85. */
  86. itemDblClick: {
  87. type: Function,
  88. default: () => {},
  89. },
  90. /**
  91. * @ignore
  92. */
  93. searchValue: {
  94. type: String,
  95. default: undefined,
  96. },
  97. /**
  98. * @ignore
  99. */
  100. updateShowSearch: {
  101. type: Function,
  102. default: () => {},
  103. },
  104. /**
  105. * @ignore
  106. */
  107. disabledKeys: {
  108. type: Array,
  109. default: () => [],
  110. },
  111. },
  112. data() {
  113. return {
  114. dataLoaded: false,
  115. }
  116. },
  117. beforeCreate() {
  118. this.simpleImage = Empty.PRESENTED_IMAGE_SIMPLE
  119. },
  120. inheritAttrs: false,
  121. }
  122. export default pickerSourceMixin