Commit 27bde41a authored by xioln's avatar xioln

6565 【 通飞MES】通用选人组件多选不生效根据组织过滤不生效

parent 3d1ef966
...@@ -21,13 +21,6 @@ export default { ...@@ -21,13 +21,6 @@ export default {
// name: 'el-switch' // name: 'el-switch'
// } // }
// }, // },
{
key: 'isFilterByOrgId',
title: '根据组织过滤',
component: {
name: 'el-switch'
}
},
{ {
key: 'containInnerUse', key: 'containInnerUse',
title: '是否包含内置用户', title: '是否包含内置用户',
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
v-model="bindValue" v-model="bindValue"
size="small" size="small"
filterable filterable
:multiple="item.multiple" :multiple="isMultiple"
remote remote
:remote-method="remoteMethod" :remote-method="remoteMethod"
:loading="loading"
@change="UserChange" @change="UserChange"
> >
<el-option <el-option
...@@ -53,11 +54,16 @@ export default { ...@@ -53,11 +54,16 @@ export default {
data() { data() {
return { return {
bindValue: '', bindValue: '',
UserData: [] UserData: [],
loading: false
// secretCode: '' // secretCode: ''
} }
}, },
computed: {}, computed: {
isMultiple() {
return this.item.multiple || this.$utils._get(this.item, 'component.multiple') || false
}
},
watch: { watch: {
// 'item.secret': { // 'item.secret': {
// deep: true, // deep: true,
...@@ -84,7 +90,11 @@ export default { ...@@ -84,7 +90,11 @@ export default {
deep: true, deep: true,
handler: function(val) { handler: function(val) {
if (val !== this.bindValue) { if (val !== this.bindValue) {
this.bindValue = val if (!val || (this.$utils.isObect(val) && (Object.keys(val).length === 0))) {
this.bindValue = ''
} else {
this.bindValue = val
}
if (val || val === 0) { if (val || val === 0) {
let searchArray = [] let searchArray = []
if (this.$utils.isObect(val)) { if (this.$utils.isObect(val)) {
...@@ -126,21 +136,29 @@ export default { ...@@ -126,21 +136,29 @@ export default {
if (query) { if (query) {
// 针对审计页面查人 // 针对审计页面查人
if (this.item.isAudPage) { if (this.item.isAudPage) {
getFuzzyMatchUser(query).then(res => { this.loading = true
this.UserData = res.items ? res.items : [] getFuzzyMatchUser(query)
}) .then(res => {
this.UserData = res.items ? res.items : []
})
.finally(() => {
this.loading = false
})
} else { } else {
// 针对非审计页面查人 // 针对非审计页面查人
const params = { userAccount: query, containInnerUser: this.item.containInnerUse || false } const params = { userAccount: query, containInnerUser: this.item.containInnerUse || false }
if (this.item.secret) { if (this.item.secret) {
params.secretCode = this.$store.state.user.userInfo.secretCode params.secretCode = this.$store.state.user.userInfo.secretCode
} }
getUsersByAccount(params).then(res => { this.loading = true
this.UserData = res.items ? res.items : [] getUsersByAccount(params)
}) .then(res => {
this.UserData = res.items ? res.items : []
})
.finally(() => {
this.loading = false
})
} }
} else {
this.UserData = []
} }
}, },
UserChange(val) { UserChange(val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment