[update] 修改bug81779
This commit is contained in:
@@ -126,6 +126,12 @@ export default {
|
||||
default: () => {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
// 是否校验必选
|
||||
checkRequired: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -346,6 +352,14 @@ export default {
|
||||
this.selectedRowKeys = this.selectedRowKeys.filter(item => item !== record.userId)
|
||||
},
|
||||
handleOk () {
|
||||
if (this.checkRequired && (!this.selectedRowKeys || this.selectedRowKeys.length === 0)) {
|
||||
if (this.type === 'radio') {
|
||||
this.$message.warning(this.$t('docTool.split.pleaseSelectUser'))
|
||||
} else {
|
||||
this.$message.warning(this.$t('pleaseAtLeastSelectOneUser'))
|
||||
}
|
||||
return
|
||||
}
|
||||
this.$emit('change', this.selectedRowKeys.join(','))
|
||||
this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(','))
|
||||
this.close()
|
||||
|
||||
Reference in New Issue
Block a user