[update] 修改bug81779

This commit is contained in:
lideqin
2024-02-05 12:03:26 +08:00
parent 78ce51e9cb
commit 213828de68
5 changed files with 49 additions and 2 deletions
@@ -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()