Skip to content

Commit 428a0d4

Browse files
committed
测试用例:新增光标悬停后显示请求JSON
1 parent 15fa76a commit 428a0d4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<div class="left-panel">
133133
<ul v-show="isTestCaseShow" class="historys" style="width: 100%;height: 100%;overflow: hidden;overflow-y: scroll;padding-bottom: 50px">
134134
<li v-for="(item, index) in testCases" >
135-
<a href="javascript:void(0)" @click="restoreRemote(item)" > {{(item.Document.version > 0 ? 'V' + item.Document.version : 'V*') + ' ' + item.Document.name + ' ' + item.Document.url}}</a>
135+
<a class="hint--rounded hint--no-animate" ref="testCaseTexts" @mouseover="setRequestHint(index, item)" href="javascript:void(0)" @click="restoreRemote(item)" > {{(item.Document.version > 0 ? 'V' + item.Document.version : 'V*') + ' ' + item.Document.name + ' ' + item.Document.url}}</a>
136136
<div :style="{ background: item.compareColor }" v-show="item.compareType != null" style="position: absolute;top: 8px;right: 36px;display: inline-block;">
137137
<button class="hint--left" ref="testResultButtons" @mouseover="setTestHint(index, item)" v-show="item.compareType != null" @click="handleTest(false, index, item)" style="position: relative;">{{ item.compareMessage + (item.showType == 'before' ? '-前' : '-后') }}</button>
138138
<svg class="icon" style="position: relative;margin-left: 10px" @click="downloadTest(index, item)">

js/main.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@
12321232

12331233
this.locals = this.locals || []
12341234
if (this.locals.length >= 1000) { //最多1000条,太多会很卡
1235-
this.locals.splice(this.locals.length - 1, 1)
1235+
this.locals.splice(999, this.locals.length - 999)
12361236
}
12371237
var method = App.getMethod()
12381238
this.locals.unshift({
@@ -1945,9 +1945,16 @@
19451945
}
19461946
},
19471947

1948+
//显示详细信息, :data-hint :data, :hint 都报错,只能这样
1949+
setRequestHint(index, item) {
1950+
var d = item == null ? null : item.Document;
1951+
var r = d == null ? null : d.request;
1952+
this.$refs.testCaseTexts[index].setAttribute('data-hint', r == null ? '' : JSON.stringify(JSON.parse(r), null, ' '));
1953+
},
19481954
//显示详细信息, :data-hint :data, :hint 都报错,只能这样
19491955
setTestHint(index, item) {
1950-
this.$refs.testResultButtons[index].setAttribute('data-hint', item.hintMessage);
1956+
var h = item == null ? null : item.hintMessage;
1957+
this.$refs.testResultButtons[index].setAttribute('data-hint', h || '');
19511958
},
19521959

19531960
// APIJSON >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

0 commit comments

Comments
 (0)