Blame view

ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiUser.vue 1.33 KB
1
<template>
2
  <!-- 定义在这里的参数都是不可在外部覆盖的,防止出现问题 -->
3
4
5
6
7
  <j-select-biz-component
    :value="value"
    :listUrl="url.list"
    :columns="columns"
    v-on="$listeners"
8
    v-bind="attrs"
9
  />
10
11
12
</template>

<script>
13
14
  import JSelectBizComponent from './JSelectBizComponent'
15
16
  export default {
    name: 'JSelectMultiUser',
17
18
19
    components: { JSelectBizComponent },
    props: ['value'],
    data() {
20
      return {
21
22
        url: { list: '/sys/user/list' },
        columns: [
23
24
25
26
27
28
29
30
31
32
33
34
35
          { title: '姓名', align: 'center', width: '20%', widthRight: '70%', dataIndex: 'realname' },
          { title: '账号', align: 'center', width: '20%', dataIndex: 'username' },
          { title: '电话', align: 'center', width: '23%', dataIndex: 'phone' },
          { title: '出生日期', align: 'center', width: '23%', dataIndex: 'birthday' }
        ],
        // 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
        default: {
          name: '用户',
          width: 1000,
          displayKey: 'realname',
          returnKeys: ['id', 'username'],
          queryParamText: '账号',
        }
36
      }
37
    },
38
39
40
    computed: {
      attrs() {
        return Object.assign(this.default, this.$attrs)
41
      }
42
43
44
    }
  }
</script>
45
46

<style lang="scss" scoped></style>