refactor(测试跟踪): 选择用例较多时,依赖关系图滚动条居中
--bug=1025898 --user=陈建星 【测试跟踪】功能用例关联的用例太多时,页面查看依赖关系是空白的 https://www.tapd.cn/55049933/s/1368661
This commit is contained in:
parent
7cbeecea43
commit
0ed71bc9ec
|
@ -9,6 +9,7 @@
|
||||||
:group="group"
|
:group="group"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
@datazoom="datazoom"
|
@datazoom="datazoom"
|
||||||
|
@finished="$emit('finished')"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
:watch-shallow="watchShallow"
|
:watch-shallow="watchShallow"
|
||||||
:manual-update="manualUpdate"
|
:manual-update="manualUpdate"
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<ms-chart v-if="visible" :options="options" :height="height" :width="width" ref="msChart"/>
|
<ms-chart
|
||||||
|
v-if="visible"
|
||||||
|
:options="options"
|
||||||
|
:height="height"
|
||||||
|
:width="width"
|
||||||
|
@finished="$emit('finished')"
|
||||||
|
ref="msChart"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -6,8 +6,13 @@
|
||||||
<drawer-header :title="$t('commons.relationship.graph')" @close="close" @export="exportCharts"/>
|
<drawer-header :title="$t('commons.relationship.graph')" @close="close" @export="exportCharts"/>
|
||||||
</template>
|
</template>
|
||||||
<div>
|
<div>
|
||||||
<el-scrollbar>
|
<el-scrollbar class="graph-scrollbar">
|
||||||
<relationship-graph :height="height" :width="width" :data="graphData.data" :links="graphData.links"
|
<relationship-graph
|
||||||
|
:height="height"
|
||||||
|
:width="width"
|
||||||
|
:data="graphData.data"
|
||||||
|
:links="graphData.links"
|
||||||
|
@finished="handleFinished"
|
||||||
ref="relationshipGraph"/>
|
ref="relationshipGraph"/>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
@ -73,6 +78,12 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleFinished() {
|
||||||
|
// 滚动条设置居中
|
||||||
|
let graphScrollbar = document.querySelector('.graph-scrollbar .el-scrollbar__wrap');
|
||||||
|
let graphScrollbarView = document.querySelector('.graph-scrollbar .el-scrollbar__wrap .ms-chart');
|
||||||
|
graphScrollbar.scrollLeft = (graphScrollbarView.clientWidth - graphScrollbar.clientWidth)/2
|
||||||
|
},
|
||||||
close() {
|
close() {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue