JSelectMultiUser.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <!-- 定义在这里的参数都是不可在外部覆盖的,防止出现问题 -->
  3. <j-select-biz-component
  4. :value="value"
  5. :ellipsisLength="25"
  6. :listUrl="url.list"
  7. :columns="columns"
  8. v-on="$listeners"
  9. v-bind="attrs"
  10. />
  11. </template>
  12. <script>
  13. import JSelectBizComponent from './JSelectBizComponent'
  14. export default {
  15. name: 'JSelectMultiUser',
  16. components: { JSelectBizComponent },
  17. props: ['value'],
  18. data() {
  19. return {
  20. url: { list: '/sys/user/list' },
  21. columns: [
  22. { title: '姓名', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'realname' },
  23. { title: '账号', align: 'center', width: '25%', dataIndex: 'username' },
  24. { title: '电话', align: 'center', width: '20%', dataIndex: 'phone' },
  25. { title: '出生日期', align: 'center', width: '20%', dataIndex: 'birthday' }
  26. ],
  27. // 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
  28. default: {
  29. name: '用户',
  30. width: 1200,
  31. displayKey: 'realname',
  32. returnKeys: ['id', 'username'],
  33. queryParamText: '账号',
  34. }
  35. }
  36. },
  37. computed: {
  38. attrs() {
  39. return Object.assign(this.default, this.$attrs)
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="less" scoped></style>