From 2e62839c72e2f70ac8928838951f93d00f0ac511 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Tue, 26 Dec 2023 16:14:29 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9=E4=BC=81=E6=A0=87?= =?UTF-8?q?=E7=AB=8B=E9=A1=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=93=E5=AE=B6?= =?UTF-8?q?=E8=87=B3=E5=B0=91=E9=80=89=E4=B8=A4=E4=BA=BA=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/lang/zh-cn.js | 3 +++ src/components/PersonnelInfo.vue | 23 ++++++++++++------- .../selection/UserSelectByWorkGroupModal.vue | 12 +++++----- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js index 6b1b97b9..fc14ab5e 100644 --- a/src/common/lang/zh-cn.js +++ b/src/common/lang/zh-cn.js @@ -176,6 +176,9 @@ module.exports = { attach: '附件', checkedAll: '全选', pleaseCompleteTableInfo: '请完善表格信息', + node: '节点', + atLeastSelect: '至少选择', + personnal: '人', // 树右键 treeRight: { addFolder: '新增文件夹', diff --git a/src/components/PersonnelInfo.vue b/src/components/PersonnelInfo.vue index c62aa3d8..a2cf6923 100644 --- a/src/components/PersonnelInfo.vue +++ b/src/components/PersonnelInfo.vue @@ -156,17 +156,24 @@ export default { let personnelObj = {} console.log(this.stepsData) for (let i = 0; i < this.stepsData.length; i++) { - // 该属性还没有人就给他赋值 + // 该属性还没有人就给他赋值,并且如果minLength有值的话,需要判断选的人数过了这个限制 if ((this.stepsData[i].canChoose || i === 0) && !personnelObj[this.stepsData[i].variableName]) { - personnelObj[this.stepsData[i].variableName] = this.stepsData[i].linkUserIds + if (this.stepsData[i].minLength) { + // 有设置至少选几人 + if (this.stepsData[i].linkUserIds && this.stepsData[i].linkUserIds.split(',').length >= this.stepsData[i].minLength) { + // 说明人数通过了限制 + personnelObj[this.stepsData[i].variableName] = this.stepsData[i].linkUserIds + } else { + // 提示XX节点至少选择XX人 + this.$message.warning(this.stepsData[i].nodeName + this.$t('node') + this.$t('atLeastSelect') + this.stepsData[i].minLength + this.$t('personnal')) + personnelObj[this.stepsData[i].variableName] = '' + return + } + } else { + personnelObj[this.stepsData[i].variableName] = this.stepsData[i].linkUserIds + } } } - // for (const item of this.stepsData) { - // // 该属性还没有人就给他赋值 - // if ((item.canChoose || item.sort === 1) && !personnelObj[item.variableName]) { - // personnelObj[item.variableName] = item.linkUserIds - // } - // } console.log(personnelObj) for (const item in personnelObj) { if (!this.notPermissField.includes(item) && !personnelObj[item]) { diff --git a/src/components/selection/UserSelectByWorkGroupModal.vue b/src/components/selection/UserSelectByWorkGroupModal.vue index 5e35add0..e48076a0 100644 --- a/src/components/selection/UserSelectByWorkGroupModal.vue +++ b/src/components/selection/UserSelectByWorkGroupModal.vue @@ -81,7 +81,7 @@