This commit is contained in:
q4speed 2020-05-18 13:54:21 +08:00
parent be60ba1c11
commit fd52e37069
3 changed files with 140 additions and 6 deletions

View File

@ -0,0 +1,59 @@
<template>
<el-card class="table-card" v-loading="result.loading">
<template v-slot:header>
<span class="title">{{$t('api_report.title')}}</span>
</template>
<el-table :data="tableData" class="table-content">
<el-table-column prop="name" :label="$t('commons.name')" width="150" show-overflow-tooltip/>
<el-table-column width="250" :label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column width="250" :label="$t('commons.update_time')">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')">
<template v-slot:default="{row}">
<ms-api-report-status :row="row"/>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<script>
import MsApiReportStatus from "../report/ApiReportStatus";
export default {
name: "MsApiReportRecentList",
components: {MsApiReportStatus},
data() {
return {
result: {},
tableData: [],
loading: false
}
},
methods: {
search() {
this.result = this.$get("/api/report/recent/5", response => {
this.tableData = response.data;
});
},
},
created() {
this.search();
}
}
</script>
<style scoped>
</style>

View File

@ -1,14 +1,29 @@
<template>
<div>
<h1>API测试首页</h1>
</div>
<ms-container>
<ms-main-container>
<el-row :gutter="20">
<el-col :span="12">
<ms-api-test-recent-list/>
</el-col>
<el-col :span="12">
<ms-api-report-recent-list/>
</el-col>
</el-row>
</ms-main-container>
</ms-container>
</template>
<script>
export default {
name: "ApiTestHome"
}
import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import MsApiTestRecentList from "./ApiTestRecentList";
import MsApiReportRecentList from "./ApiReportRecentList";
export default {
name: "ApiTestHome",
components: {MsApiReportRecentList, MsApiTestRecentList, MsMainContainer, MsContainer}
}
</script>
<style scoped>

View File

@ -0,0 +1,60 @@
<template>
<el-card class="table-card" v-loading="result.loading">
<template v-slot:header>
<span class="title">{{$t('api_test.title')}}</span>
</template>
<el-table :data="tableData" class="table-content">
<el-table-column prop="name" :label="$t('commons.name')" width="150" show-overflow-tooltip/>
<el-table-column prop="projectName" :label="$t('load_test.project_name')" width="150" show-overflow-tooltip/>
<el-table-column width="250" :label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column width="250" :label="$t('commons.update_time')">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('commons.status')">
<template v-slot:default="{row}">
<ms-api-test-status :row="row"/>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<script>
import MsApiTestStatus from "../test/ApiTestStatus";
export default {
name: "MsApiTestRecentList",
components: {MsApiTestStatus},
data() {
return {
result: {},
tableData: [],
loading: false
}
},
methods: {
search() {
this.result = this.$get("/api/recent/5", response => {
this.tableData = response.data;
});
}
},
created() {
this.search();
}
}
</script>
<style scoped>
</style>