diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index f25adf6643..6e5dc74124 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit f25adf66433ef097f110b09af9e5f9e25933a212 +Subproject commit 6e5dc74124fd1130f326e5332d25103add3de2d2 diff --git a/frontend/src/business/components/api/automation/report/SysnApiReportDetail.vue b/frontend/src/business/components/api/automation/report/SysnApiReportDetail.vue index 3a04293e5f..4404ec75a9 100644 --- a/frontend/src/business/components/api/automation/report/SysnApiReportDetail.vue +++ b/frontend/src/business/components/api/automation/report/SysnApiReportDetail.vue @@ -127,6 +127,7 @@ export default { messageWebSocket: {}, websocket: {}, stepFilter: new STEP, + tempResult: [], } }, activated() { @@ -315,7 +316,18 @@ export default { this.content.success = (this.content.total - this.content.error - this.content.errorCode - this.content.unExecute); this.totalTime = this.content.totalTime; this.resetLabel(this.content.steps); - this.fullTreeNodes = this.content.steps + if(this.report.reportType === "UI_INDEPENDENT"){ + this.tempResult = this.content.steps; + //校对执行次序 + try{ + this.checkOrder(this.tempResult); + this.fullTreeNodes = this.tempResult; + }catch(e){ + this.fullTreeNodes = this.content.steps; + } + }else{ + this.fullTreeNodes = this.content.steps; + } this.recursiveSorting(this.fullTreeNodes); this.reload(); } @@ -324,6 +336,58 @@ export default { } }); }, + checkOrder(origin){ + if(!origin){ + return; + } + if(Array.isArray(origin)){ + this.sortChildren(origin); + origin.forEach(v => { + if(v.children){ + this.checkOrder(v.children) + } + }) + } + }, + sortChildren(source){ + if(!source){ + return; + } + source.forEach( item =>{ + let children = item.children; + if(children && children.length > 0){ + let tempArr = new Array(children.length); + let tempMap = new Map(); + for(let i = 0; i < children.length; i++){ + if(!children[i].value || !children[i].value.startTime || children[i].value.startTime === 0){ + //若没有value或未执行的,则step留在当前位置 + tempArr[i] = children[i]; + //进行标识 + tempMap.set(children[i].stepId, children[i]) + } + } + //过滤出还没有指定好位置的step + let arr = children.filter(m => { + return !tempMap.get(m.stepId); + }).sort((m, n) => { + //按时间排序 + return m.value.startTime - n.value.startTime; + }); + //找出arr(已经有序,从头取即可)中时间最小的插入 tempArr 可用位置 + for(let j = 0, i = 0; j < tempArr.length; j++){ + if(!tempArr[j]){ + //占位 + tempArr[j] = arr[i]; + i++; + } + //重新排序 + tempArr[j].index = j + 1; + } + //赋值 + item.children = tempArr; + } + }) + }, runningNodeChild(arr, resourceId) { arr.forEach(item => { if (resourceId === item.resId) { diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 8e321b56d9..59033ce419 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 8e321b56d9cd47bf37db047b53cc9a76411a84af +Subproject commit 59033ce419978dbfb7b55d115f300f4a2143c9de