index.jsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { defineAsyncComponent } from 'vue'
  2. import { useFormInput, useInputProps } from '@cip/components/hooks/form-input'
  3. import { formInputProps, fromInputEmits } from '../../form-input-props'
  4. import { useMultiple } from './use-multiple'
  5. export default {
  6. props: formInputProps,
  7. emits: fromInputEmits,
  8. setup (props, context) {
  9. const { proxyValue, securityConfig, width } = useFormInput(props, context, { maxOtherKey: 1 })
  10. // 做一次兼容设置
  11. // checkType
  12. const multiple = useMultiple(securityConfig)
  13. const inputProps = useInputProps(props, [
  14. 'direction',
  15. 'multiple',
  16. 'entity',
  17. 'curdFn',
  18. 'tableColumns',
  19. 'searchFieldList',
  20. 'optionProps',
  21. 'hideSearch',
  22. 'defaultSearchModel',
  23. 'withPagination',
  24. 'selectable'
  25. ])
  26. const CipSelectTable = defineAsyncComponent(() => import('@cip/components/cip-select-table'))
  27. return () => <CipSelectTable
  28. {...inputProps.value}
  29. style={{ width: width.value }}
  30. multiple={multiple.value}
  31. v-model={proxyValue.value}
  32. />
  33. }
  34. }