ic-tree-picker.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <ic-value-picker ref="picker" v-bind="$props" :selectclick="selectclick" v-on="$listeners">
  3. <template v-if="$scopedSlots.suffixIcon" v-slot:suffixIcon>
  4. <!-- @slot input框最后的图标 -->
  5. <slot name="suffixIcon" />
  6. </template>
  7. <template v-slot:targetListHeader="scope">
  8. <!--
  9. @slot 右侧列表顶部<p>8.0.7 新增</p>
  10. @binding targetKeys {array} 右侧列表所有项目的 key 值
  11. @binding targetValues {array} 右侧列表所有项目的完整 Object 值
  12. -->
  13. <slot
  14. :targetKeys="scope.targetKeys"
  15. :targetValues="scope.targetValues"
  16. name="targetListHeader"
  17. />
  18. </template>
  19. <template v-slot="scope">
  20. <IcPickerSourceTree ref="tree" v-bind="{ ...$props, ...scope }" />
  21. </template>
  22. </ic-value-picker>
  23. </template>
  24. <script>
  25. import pickerMixinInternal from './picker-mixin-internal'
  26. import IcPickerSourceTree from './ic-picker-source-tree.vue'
  27. import icValuePicker from './ic-value-picker.vue'
  28. import components from './_import-components/ic-tree-picker-import'
  29. /**
  30. * input框,通过弹出对话框,从树形结构中选择数据
  31. * @displayName SdTreePicker 树选择器
  32. */
  33. export default {
  34. name: 'IcTreePicker',
  35. components: {
  36. ...components,
  37. IcPickerSourceTree,
  38. icValuePicker,
  39. },
  40. mixins: [pickerMixinInternal],
  41. props: {
  42. selectclick: {
  43. type: Function,
  44. default: null,
  45. },
  46. versionId: {
  47. type: String,
  48. default: '',
  49. },
  50. orgId: {
  51. type: String,
  52. default: '',
  53. },
  54. selecttype: {
  55. type: String,
  56. default: 'control',
  57. },
  58. types: {
  59. type: String,
  60. default: 'NK',
  61. },
  62. /**
  63. * 根节点{code:'200000',name:'西安分公司'}
  64. */
  65. rootNode: {
  66. type: [Object, Array],
  67. default: undefined,
  68. },
  69. /**
  70. * <p>获取数据的回调,获取根节点时,parentId为undefined</p>
  71. * <pre>(parentId,parent) => childrenItems</pre>
  72. */
  73. loadTreeData: {
  74. type: Function,
  75. required: true,
  76. },
  77. /**
  78. * <p>搜索数据的回调</p>
  79. * <pre>(searchText) => items</pre>
  80. * @since 8.0.2
  81. */
  82. searchTreeData: {
  83. type: Function,
  84. default: undefined,
  85. },
  86. /**
  87. * 默认展开指定的树节点
  88. * @since 8.0.7
  89. */
  90. defaultExpandedKeys: {
  91. type: Array,
  92. default: undefined,
  93. },
  94. moduleId: {
  95. type: String,
  96. default: undefined,
  97. },
  98. isAbandonment: {
  99. type: String,
  100. default: 'NO',
  101. },
  102. },
  103. data() {
  104. return {
  105. v3: [],
  106. }
  107. },
  108. }
  109. </script>
  110. <style module lang="scss">
  111. @use '@/common/design' as *;
  112. </style>