From c45c4efb2286aed47094be14515a43c88ff5e2eb Mon Sep 17 00:00:00 2001 From: mayinrain <624899618@qq.com> Date: Sun, 8 Oct 2023 15:19:41 +0800 Subject: [PATCH] fix result set sort bug --- .../linkis/module/globalHistoryManagement/viewHistory.vue | 2 +- linkis-web/src/components/consoleComponent/result.vue | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/linkis-web/src/apps/linkis/module/globalHistoryManagement/viewHistory.vue b/linkis-web/src/apps/linkis/module/globalHistoryManagement/viewHistory.vue index 662a879ed9..2e15ea9a9c 100644 --- a/linkis-web/src/apps/linkis/module/globalHistoryManagement/viewHistory.vue +++ b/linkis-web/src/apps/linkis/module/globalHistoryManagement/viewHistory.vue @@ -391,7 +391,7 @@ export default { if (rst.dirFileTrees) { // The order of the result set in the background is sorted by string according to the name of the result set. When displaying, there will be a problem that the result set cannot be matched, so add sorting(后台的结果集顺序是根据结果集名称按字符串排序的,展示时会出现结果集对应不上的问题,所以加上排序) let scriptResultList = rst.dirFileTrees.children.sort( - (a, b) => parseInt(a.name, 10) - parseInt(b.name, 10) + (a, b) => parseInt(a.name.split('_')[1].split('.')[0], 10) - parseInt(b.name.split('_')[1].split('.')[0], 10) ) if (scriptResultList.length) { const currentResultPath = rst.dirFileTrees.children[0].path diff --git a/linkis-web/src/components/consoleComponent/result.vue b/linkis-web/src/components/consoleComponent/result.vue index f1c9940e9f..d59ac743e5 100644 --- a/linkis-web/src/components/consoleComponent/result.vue +++ b/linkis-web/src/components/consoleComponent/result.vue @@ -253,7 +253,9 @@ export default { }; if (this.script.resultList && this.script.resultSet !== undefined) { res = this.script.resultList[this.script.resultSet].result - res.allPath = this.script.resultList.map(result => result.path); + if(res) { + res.allPath = this.script.resultList.map(result => result.path); + } } if(!res && this.script.result){ res = this.script.result