Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
泰斯特Test
Taisite-Platform
提交
f3de76bb
T
Taisite-Platform
项目概览
泰斯特Test
/
Taisite-Platform
10 个月 前同步成功
通知
121
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Taisite-Platform
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f3de76bb
编写于
9月 26, 2020
作者:
泰斯特Test
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[feat]新增报告导出按钮
上级
f8ac3b83
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
9 deletion
+53
-9
frontend/src/views/interfaceTestProject/ProjectReport.vue
frontend/src/views/interfaceTestProject/ProjectReport.vue
+53
-9
未找到文件。
frontend/src/views/interfaceTestProject/ProjectReport.vue
浏览文件 @
f3de76bb
<
template
>
<
div
style=
"margin:35px"
>
<
section
style=
"margin:35px"
>
<!--工具条-->
<el-col
:span=
"24"
class=
"toolbar"
style=
"padding-bottom: 0px;"
>
...
...
@@ -24,23 +24,24 @@
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"_id"
label=
"报告编号"
min-width=
"17%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"testCount"
label=
"
测试接口
总数"
min-width=
"8%"
show-overflow-tooltip
>
<el-table-column
sortable=
'custom'
prop=
"testCount"
label=
"
用例
总数"
min-width=
"8%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"passCount"
label=
"通过
的接口总
数"
min-width=
"8%"
show-overflow-tooltip
>
<el-table-column
sortable=
'custom'
prop=
"passCount"
label=
"通过数"
min-width=
"8%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"failedCount"
label=
"失败
的接口总
数"
min-width=
"8%"
show-overflow-tooltip
>
<el-table-column
sortable=
'custom'
prop=
"failedCount"
label=
"失败数"
min-width=
"8%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"passRate"
label=
"通过率"
min-width=
"8%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"comeFrom"
label=
"
执行方式
"
min-width=
"10%"
show-overflow-tooltip
>
<el-table-column
sortable=
'custom'
prop=
"comeFrom"
label=
"
报告来源
"
min-width=
"10%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"executorNickName"
label=
"执行人"
min-width=
"10%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
sortable=
'custom'
prop=
"createAt"
label=
"报告生成时间"
min-width=
"15%"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label=
"操作"
min-width=
"
15
%"
>
<el-table-column
label=
"操作"
min-width=
"
20
%"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"small"
class=
"el-icon-document"
type=
"primary"
@
click=
"showReportDetail(scope.$index, scope.row)"
>
查看详情
</el-button>
<el-button
size=
"small"
class=
"el-icon-download"
:loading=
"exportLoading"
type=
"primary"
@
click=
"exportReportDetail(scope.$index, scope.row)"
>
导出
</el-button>
<!--
<el-button
type=
"danger"
size=
"small"
@
click=
"handleDel(scope.$index, scope.row)"
>
删除
</el-button>
-->
</
template
>
</el-table-column>
...
...
@@ -92,21 +93,33 @@
</el-table-column>
<el-table-column
prop=
"testStartTime"
label=
"测试开始时间"
min-width=
"25%"
sortable
show-overflow-tooltip
>
</el-table-column>
<el-table-column
prop=
"
spendingTimeInSec
"
label=
"测试耗时/s"
min-width=
"18%"
sortable
show-overflow-tooltip
>
<el-table-column
prop=
""
label=
"测试耗时/s"
min-width=
"18%"
sortable
show-overflow-tooltip
>
</el-table-column>
</el-table>
</div>
</el-dialog>
</div>
<a
class=
"js-download-doc"
:href=
"downloadLink"
:download=
"downloadName"
v-show=
"false"
/>
</section>
</template>
<
script
>
import
{
getReportList
,
getReportDetail
}
from
"
../../api/testReport
"
;
import
{
getReportList
,
getReportDetail
,
exportReportDetail
}
from
"
../../api/testReport
"
;
import
moment
from
"
moment
"
;
export
default
{
data
()
{
return
{
downloadLink
:
''
,
downloadName
:
''
,
listLoading
:
false
,
detailLoading
:
false
,
exportLoading
:
false
,
isReportDetailShow
:
false
,
testReports
:
[],
testReportDetail
:
[],
...
...
@@ -159,6 +172,37 @@
self
.
listLoading
=
false
;
})
},
// 导出报告详情
async
exportReportDetail
(
index
,
row
){
let
self
=
this
;
self
.
exportLoading
=
true
;
let
project_id
=
row
.
projectId
let
report_id
=
row
.
_id
let
header
=
{
"
Content-Type
"
:
"
application/json
"
};
exportReportDetail
(
project_id
,
report_id
,
header
).
then
((
res
)
=>
{
const
blob
=
new
Blob
([
res
])
self
.
downloadLink
=
window
.
URL
.
createObjectURL
(
blob
)
self
.
downloadName
=
`接口测试报告_
${
moment
().
format
(
'
YYYY-MM-DD-HH-mm-ss
'
)}
.xlsx`
self
.
$nextTick
(()
=>
{
self
.
$el
.
querySelector
(
'
.js-download-doc
'
).
click
()
window
.
URL
.
revokeObjectURL
(
this
.
downloadLink
)
self
.
exportLoading
=
false
;
self
.
$message
.
success
({
message
:
'
报告导出成功
'
,
center
:
true
,
});
})
}).
catch
((
error
)
=>
{
console
.
log
(
error
)
self
.
$message
.
error
({
message
:
'
报告导出失败,请稍后重试哦~
'
,
center
:
true
,
});
self
.
exportLoading
=
false
;
})
},
showReportDetail
(
index
,
row
){
let
self
=
this
;
self
.
isReportDetailShow
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录