feat(user): 添加根据用户名列表查询用户基础数据功能
- 在CuteUserSelectService中新增listMetadataByUsernames方法 - 为CuteUserSelectApi添加listMetadataByUsernames接口 - 在前端cute-user-select.js中新增listMetadataByUsernames请求方法 - 修改CuteSingleUserSelect组件支持初始化时根据用户名加载用户信息 - 修改CuteUserSelect组件移除dataSource属性并支持初始化加载 - 更新CuteBusinessDemo演示页面用户字段默认值为空数组
This commit is contained in:
@@ -41,7 +41,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
user: this.value,
|
||||
user: [],
|
||||
loading: false,
|
||||
options: []
|
||||
}
|
||||
@@ -51,6 +51,13 @@ export default {
|
||||
this.user = newVal
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
const that = this
|
||||
if (that.value && that.value.length > 0) {
|
||||
that.options = await CuteUserSelectApi.listMetadataByUsernames(that.value)
|
||||
that.users = that.value
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
|
||||
@@ -37,16 +37,11 @@ export default {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
dataSource: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
users: this.value,
|
||||
users: [],
|
||||
loading: false,
|
||||
options: []
|
||||
}
|
||||
@@ -56,9 +51,11 @@ export default {
|
||||
this.users = newVal
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.dataSource && this.dataSource.length > 0) {
|
||||
this.options = this.dataSource
|
||||
async mounted() {
|
||||
const that = this
|
||||
if (that.value && that.value.length > 0) {
|
||||
that.options = await CuteUserSelectApi.listMetadataByUsernames(that.value)
|
||||
that.users = that.value
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
user: null,
|
||||
user: [],
|
||||
dept: null,
|
||||
productLine: null,
|
||||
productLinePro: null
|
||||
|
||||
Reference in New Issue
Block a user