|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<template>
<!-- 定义在这里的参数都是不可在外部覆盖的,防止出现问题 -->
<j-select-biz-component
:value="value"
:ellipsisLength="25"
:listUrl="url.list"
:columns="columns"
v-on="$listeners"
v-bind="attrs"
/>
</template>
<script>
|
|
14
15
|
import JDate from '@comp/jeecg/JDate'
import JSelectBizComponent from './JSelectBizComponent'
|
|
16
|
|
|
17
18
19
20
21
22
23
24
|
export default {
name: 'JSelectMultiUser',
components: {JDate, JSelectBizComponent},
props: {
value: null, // any type
queryConfig: {
type: Array,
default: () => []
|
|
25
|
},
|
|
26
27
28
29
30
|
},
data() {
return {
url: {list: '/sys/user/list'},
columns: [
|
谭毅彬
authored
|
31
32
33
|
{title: '账号', align: 'center', width: '33%', dataIndex: 'username'},
{title: '姓名', align: 'center', widthRight: '33%', dataIndex: 'realname'},
{title: '电话', align: 'center', width: '33%', dataIndex: 'phone'},
|
|
34
35
36
37
|
],
// 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件
default: {
name: '用户',
|
谭毅彬
authored
|
38
|
width: 1250,
|
谭毅彬
authored
|
39
|
displayKey: 'username',
|
|
40
41
42
43
44
45
|
returnKeys: ['id', 'username'],
queryParamText: '账号',
},
// 多条件查询配置
queryConfigDefault: [
{
|
|
46
47
|
key: 'realname',
label: '姓名',
|
|
48
|
},
|
|
49
50
51
52
53
54
55
56
57
|
// {
// key: 'birthday',
// label: '生日',
// placeholder: '请选择出生日期',
// // 如果想要使用局部注册的组件,就必须要使用箭头函数
// customRender: ({key, queryParam, options}) => {
// return <j-date {...options} vModel={queryParam[key]} style="width:180px;"/>
// },
// },
|
|
58
59
60
61
62
63
64
65
|
],
}
},
computed: {
attrs() {
return Object.assign(this.default, this.$attrs, {
queryConfig: this.queryConfigDefault.concat(this.queryConfig)
})
|
|
66
67
|
}
}
|
|
68
|
}
|
|
69
70
71
|
</script>
<style lang="less" scoped></style>
|