diff --git a/mindinsight/ui/src/views/train-manage/profiler.vue b/mindinsight/ui/src/views/train-manage/profiler.vue index d2f56609c819588bc40b82621c7e57cc12acf27a..e3064a76ee01469b686df5a64c25df0a358fbd6e 100644 --- a/mindinsight/ui/src/views/train-manage/profiler.vue +++ b/mindinsight/ui/src/views/train-manage/profiler.vue @@ -71,7 +71,9 @@ @@ -80,6 +82,7 @@
{ + const item = this.$refs['expandChild']; + if (item && this.curActiveRow.rowItem) { + item.sort(this.curActiveRow.childProp, this.curActiveRow.childOrder); + } + }); + }, clearCpuData() { this.searchByCPUNameInput = ''; this.opCpuList = { @@ -437,6 +453,15 @@ export default { }); this.opTypeList.push(object); }); + this.$nextTick(() => { + const elementItem = this.$refs['expandTable']; + if (elementItem) { + elementItem.sort( + this.op_sort_condition.name, + this.op_sort_condition.type, + ); + } + }); if ( !this.coreCharts.device_id || this.coreCharts.device_id !== this.currentCard.value @@ -497,6 +522,20 @@ export default { .then((res) => { if (res && res.data) { this.formatterDetailData(row, res.data); + this.$nextTick(() => { + const item = this.$refs['expandChild']; + if (item) { + this.curActiveRow = { + rowItem: row, + childProp: row.op_sort_condition.name, + childOrder: row.op_sort_condition.type, + }; + item.sort( + row.op_sort_condition.name, + row.op_sort_condition.type, + ); + } + }); } }) .catch(() => {}); @@ -591,6 +630,13 @@ export default { } else { this.op_filter_condition = {}; } + if (this.curActiveRow.rowItem) { + this.curActiveRow = { + rowItem: null, + childProp: null, + childOrder: null, + }; + } this.getCoreTypeList(); } }, @@ -664,12 +710,30 @@ export default { expandTypeItem(row) { row.isExpanded = !row.isExpanded; if (row.isExpanded) { + if (this.curActiveRow.rowItem) { + this.curActiveRow.rowItem.isExpanded = false; + const item = this.$refs['expandTable']; + if (item) { + item.toggleRowExpansion(this.curActiveRow.rowItem, false); + } + } + this.curActiveRow = { + rowItem: row, + childProp: null, + childOrder: null, + }; row.opDetailList = []; row.opDetailCol = []; row.opDetailPage.offset = 0; row.pageTotal = 0; row.op_sort_condition = {name: 'execution_time', type: 'descending'}; this.getCoreDetailList(row); + } else { + this.curActiveRow = { + rowItem: null, + childProp: null, + childOrder: null, + }; } }, /**