From 7a5f8e39d1b8186afbcde4ea4a83a82c4a3f0bdc Mon Sep 17 00:00:00 2001 From: nihaotian Date: Wed, 17 Jul 2024 16:43:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=BE=E5=AE=B3=E4=BA=BA=E5=91=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=BC=B9=E7=AA=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../responding/component/selectUserNew.vue | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/views/responseManagement/responding/component/selectUserNew.vue b/src/views/responseManagement/responding/component/selectUserNew.vue index 919c1b1..fd55d89 100644 --- a/src/views/responseManagement/responding/component/selectUserNew.vue +++ b/src/views/responseManagement/responding/component/selectUserNew.vue @@ -41,7 +41,7 @@ B2 - + @@ -187,24 +187,31 @@ const sendToLeft = (index,row) => { }; const sendToRight = (index,row) => { - if (row.roleId == '1793193529859244033') { - if (chiefCount>0) { - ElMessage.error('Please select only one B1 user'); - return; - }else { - chiefCount=chiefCount+1 - } - }else { - if (adminCount>0) { - ElMessage.error('Please select only one B2 user'); - return; - }else { - adminCount=adminCount+1 + if (state.selectData.length>0){ + if (state.selectData.length==1){ + if (state.selectData[0].roleId==row.roleId){ + state.tableData.data.splice(index, 1) + state.tableData.data.splice(index,0,state.selectData[0]) + state.selectData[0] =row + }else { + state.tableData.data.splice(index, 1) + state.selectData[state.selectData.length] =row + } + }else if (state.selectData.length==2){ + if (state.selectData[0].roleId==row.roleId){ + state.tableData.data.splice(index, 1) + state.tableData.data.splice(index,0,state.selectData[0]) + state.selectData[0] =row + }else if (state.selectData[1].roleId==row.roleId){ + state.tableData.data.splice(index, 1) + state.tableData.data.splice(index,0,state.selectData[1]) + state.selectData[1] =row + } } + } else { + state.tableData.data.splice(index, 1) + state.selectData[state.selectData.length] =row } - dataIndex[dataIndex.length]=index - state.tableData.data.splice(index, 1) - state.selectData[state.selectData.length] =row }; const selectRow = (row) => { state.selectData = row;