diff --git a/src/views/userManage/roleManage/roleDetail/index.vue b/src/views/userManage/roleManage/roleDetail/index.vue index 9ee9d54..b691e0d 100644 --- a/src/views/userManage/roleManage/roleDetail/index.vue +++ b/src/views/userManage/roleManage/roleDetail/index.vue @@ -191,6 +191,7 @@ export default { saleProcessData = []; if (this.doctorWorkMenus?.length > 0) { this.doctorWorkMenus?.forEach((item) => { + let sChildren = []; const { children = [], menuName: firstName, ...otherItem } = item; (children || []).forEach((item2, index2) => { const { menuName: secondName, id } = item2; @@ -202,11 +203,12 @@ export default { firstName, secondName, }; - if (index2 === 0) { - pushItem.rowspan2 = children.length; - } - doctorWorkData.push(pushItem); + sChildren.push(pushItem); }); + if (sChildren?.length > 0) { + sChildren[0].rowspan2 = sChildren.length; + } + doctorWorkData = [...doctorWorkData, ...sChildren]; }); } if (doctorWorkData.length > 0) { @@ -216,6 +218,7 @@ export default { if (this.saleManageMenus?.length > 0) { this.saleManageMenus.forEach((item) => { + let sChildren = []; const { children = [], menuName: firstName, ...otherItem } = item; (children || []).forEach((item2, index2) => { const { menuName: secondName, id } = item2; @@ -227,11 +230,13 @@ export default { firstName, secondName, }; - if (index2 === 0) { - pushItem.rowspan2 = children.length; - } - saleManageData.push(pushItem); + sChildren.push(pushItem); + }); + if (sChildren?.length > 0) { + sChildren[0].rowspan2 = sChildren.length; + } + saleManageData = [...saleManageData, ...sChildren]; }); } if (saleManageData.length > 0) { @@ -241,6 +246,7 @@ export default { if (this.saleProcessMenus?.length > 0) { this.saleProcessMenus.forEach((item) => { + let sChildren = []; const { children = [], menuName: firstName, ...otherItem } = item; (children || []).forEach((item2, index2) => { const { menuName: secondName, id } = item2; @@ -252,11 +258,12 @@ export default { firstName, secondName, }; - if (index2 === 0) { - pushItem.rowspan2 = children.length; - } - saleProcessData.push(pushItem); + sChildren.push(pushItem); }); + if (sChildren?.length > 0) { + sChildren[0].rowspan2 = sChildren.length; + } + saleProcessData = [...saleProcessData, ...sChildren]; }); } if (saleProcessData.length > 0) {