提交 2663c82a 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!218 UI Fix profiler sort icon highlight bug

Merge pull request !218 from 夏易凡/yf-master
...@@ -75,7 +75,9 @@ ...@@ -75,7 +75,9 @@
</div> </div>
<el-table v-show="statisticType === 0 && opTypeCol && opTypeCol.length" <el-table v-show="statisticType === 0 && opTypeCol && opTypeCol.length"
:data="opTypeList" :data="opTypeList"
ref="expandTable"
@expand-change="expandTypeItem" @expand-change="expandTypeItem"
@sort-change="opTypeSortChange"
stripe stripe
height="calc(100% - 75px)" height="calc(100% - 75px)"
width="100%"> width="100%">
...@@ -84,6 +86,7 @@ ...@@ -84,6 +86,7 @@
<div class="expand-table"> <div class="expand-table">
<el-table :data="props.row.opDetailList" <el-table :data="props.row.opDetailList"
stripe stripe
ref="expandChild"
width="100%" width="100%"
tooltip-effect="light" tooltip-effect="light"
@cell-click="showInfoDetail" @cell-click="showInfoDetail"
...@@ -303,6 +306,11 @@ export default { ...@@ -303,6 +306,11 @@ export default {
}, // operator type filter }, // operator type filter
initOver: false, initOver: false,
objectType: 'object', objectType: 'object',
curActiveRow: {
rowItem: null,
childProp: null,
childOrder: null,
},
}; };
}, },
destroyed() { destroyed() {
...@@ -329,6 +337,14 @@ export default { ...@@ -329,6 +337,14 @@ export default {
/** /**
* clear cpu data * clear cpu data
*/ */
opTypeSortChange() {
this.$nextTick(() => {
const item = this.$refs['expandChild'];
if (item && this.curActiveRow.rowItem) {
item.sort(this.curActiveRow.childProp, this.curActiveRow.childOrder);
}
});
},
clearCpuData() { clearCpuData() {
this.searchByCPUNameInput = ''; this.searchByCPUNameInput = '';
this.opCpuList = { this.opCpuList = {
...@@ -443,6 +459,15 @@ export default { ...@@ -443,6 +459,15 @@ export default {
}); });
this.opTypeList.push(object); 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 ( if (
!this.coreCharts.device_id || !this.coreCharts.device_id ||
this.coreCharts.device_id !== this.currentCard.value this.coreCharts.device_id !== this.currentCard.value
...@@ -503,6 +528,20 @@ export default { ...@@ -503,6 +528,20 @@ export default {
.then((res) => { .then((res) => {
if (res && res.data) { if (res && res.data) {
this.formatterDetailData(row, 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(() => {}); .catch(() => {});
...@@ -597,6 +636,13 @@ export default { ...@@ -597,6 +636,13 @@ export default {
} else { } else {
this.op_filter_condition = {}; this.op_filter_condition = {};
} }
if (this.curActiveRow.rowItem) {
this.curActiveRow = {
rowItem: null,
childProp: null,
childOrder: null,
};
}
this.getCoreTypeList(); this.getCoreTypeList();
} }
}, },
...@@ -670,12 +716,30 @@ export default { ...@@ -670,12 +716,30 @@ export default {
expandTypeItem(row) { expandTypeItem(row) {
row.isExpanded = !row.isExpanded; row.isExpanded = !row.isExpanded;
if (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.opDetailList = [];
row.opDetailCol = []; row.opDetailCol = [];
row.opDetailPage.offset = 0; row.opDetailPage.offset = 0;
row.pageTotal = 0; row.pageTotal = 0;
row.op_sort_condition = {name: 'execution_time', type: 'descending'}; row.op_sort_condition = {name: 'execution_time', type: 'descending'};
this.getCoreDetailList(row); this.getCoreDetailList(row);
} else {
this.curActiveRow = {
rowItem: null,
childProp: null,
childOrder: null,
};
} }
}, },
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册