<template> <!-- 定义在这里的参数都是不可在外部覆盖的,防止出现问题 --> <j-select-biz-component :value="value" :ellipsisLength="25" :listUrl="url.list" :columns="columns" v-on="$listeners" v-bind="attrs" /> </template> <script> import JDate from '@comp/jeecg/JDate' import JSelectBizComponent from './JSelectBizComponent' export default { name: 'JSelectMultiUser', components: {JDate, JSelectBizComponent}, props: { value: null, // any type queryConfig: { type: Array, default: () => [] }, }, data() { return { url: {list: '/sys/user/list'}, columns: [ {title: this.$t('system.userAccount'), align: 'center', width: '30%', dataIndex: 'username'}, {title: this.$t('system.userName'), align: 'center', widthRight: '30%', dataIndex: 'realname'}, {title: this.$t('system.mobileNumber'), align: 'center', width: '30%', dataIndex: 'phone'}, ], // 定义在这里的参数都是可以在外部传递覆盖的,可以更灵活的定制化使用的组件 default: { name: this.$t('system.user'), width: 1350, queryParamText: this.$t('system.userAccount'), queryParamPlaceholder: this.$t('system.enterUserAccount'), displayKey: 'username', returnKeys: ['id', 'username'] //用户选择返回字段 }, // 多条件查询配置 queryConfigDefault: [ { key: 'realname', label: this.$t('system.userName'), placeholder: this.$t('system.enterUserName') }, // { // key: 'birthday', // label: '生日', // placeholder: '请选择出生日期', // // 如果想要使用局部注册的组件,就必须要使用箭头函数 // customRender: ({key, queryParam, options}) => { // return <j-date {...options} vModel={queryParam[key]} style="width:180px;"/> // }, // }, ], } }, computed: { attrs() { return Object.assign(this.default, this.$attrs, { queryConfig: this.queryConfigDefault.concat(this.queryConfig) }) } } } </script> <style lang="less" scoped></style>