Commit 135403d7 authored by mengzixuan's avatar mengzixuan

feat(测试用例库): 逻辑修改

parent fbbe2d45
<!-- 查看测试用例库 -->
<template>
<page-standard>
<el-form
......@@ -17,11 +16,11 @@
>
<el-option
v-for="item in testScenarList"
:key="item.id"
:label="item.testScenario"
:value="item.id"
:key="item"
:label="item"
:value="item"
>
{{ item.testScenario }}</el-option
{{ item }}</el-option
>
</el-select>
</el-form-item>
......@@ -33,11 +32,11 @@
>
<el-option
v-for="item of testTypeList"
:key="item.id"
:label="item.testType"
:value="item.id"
:key="item"
:label="item"
:value="item"
>
{{ item.testType }}</el-option
{{ item }}</el-option
>
</el-select>
</el-form-item>
......@@ -76,17 +75,17 @@
</el-table-column>
<el-table-column
label="测试场景"
align="left"
sortable
align="left"
prop="testScenario"
/>
<el-table-column label="测试方法" align="left" sortable prop="testType" />
<el-table-column label="用例编号" align="left" prop="usecaseNo" />
<el-table-column label="测试方法" sortable align="left" prop="testType" />
<el-table-column label="用例编号" align="left" prop="displayID" />
<el-table-column label="用例名称" align="left" prop="name" />
<!-- <el-table-column label="工具" align="left" prop="tools" /> -->
<el-table-column label="对应输入" align="left" prop="input">
<el-table-column label="对应输入" align="left" prop="requirements">
<template slot-scope="scope">
<span>{{ scope.row.input || '--' }}</span>
<span>{{ scope.row.requirements || '--' }}</span>
</template>
</el-table-column>
<el-table-column label="用例描述" align="left" prop="description">
......@@ -94,27 +93,46 @@
<span>{{ scope.row.description || '--' }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="更新人员" align="left" prop="updateBy" />-->
<!-- <el-table-column-->
<!-- label="更新时间"-->
<!-- sortable-->
<!-- align="left"-->
<!-- prop="updateTime"-->
<!-- width="180"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total > 0"
:total="total"
:background="false"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="loadData"
:page.sync="queryParams.offset"
:limit.sync="queryParams.limit"
@pagination="getList"
/>
</page-standard>
</template>
<script>
import page from '@/mixins/page'
// import page from '@/mixins/page'
import {
listTestCase,
listTestScenar,
listTestType
listMethod
} from '../../../api/setting/useCaseLibrary'
export default {
mixins: [page],
// mixins: [page],
data() {
return {
queryParams: {
offset: 0,
limit: 10
},
total: 0,
loading: false,
listUrl: '/system/testCase/getList',
// 显示搜索条件
showSearch: true,
......@@ -139,16 +157,43 @@ export default {
mounted() {
this.getTestScenar()
this.getTestType()
this.getList()
},
methods: {
handleQuery() {
this.queryParams.offset = 1
this.getList()
},
resetQuery() {
this.queryParams.offset = 1
this.queryParams.limit = 10
this.handleQuery()
},
/** 获取测试场景 */
getTestScenar() {
listTestScenar().then(res => {
this.testScenarList = res.rows
this.testScenarList = res.data
})
},
/** 获取测试方法 */
getTestType() {
listTestType({ pageNum: 1, pageSize: 999 }).then(res => {
this.testTypeList = res.rows
listMethod().then(res => {
this.testTypeList = res.data
})
},
/** 获取测试用例列表 */
getList() {
console.log(this.queryParams.limit)
const pageNum = (this.queryParams.offset - 1) * this.queryParams.limit
const data = {
offset: {
offset: pageNum,
limit: this.queryParams.limit
}
}
listTestCase(data).then(res => {
this.tableData = res.data.useCases
this.total = res.data.totalCount
})
}
}
......
......@@ -131,7 +131,7 @@ export default {
offset: 0,
limit: 10
},
total: 1,
total: 0,
loading: false,
listUrl: '/system/testCase/getList',
// 显示搜索条件
......@@ -183,7 +183,8 @@ export default {
},
/** 获取测试用例列表 */
getList() {
const pageNum = (this.queryParams.offset - 1) * 10
console.log(this.queryParams.limit)
const pageNum = (this.queryParams.offset - 1) * this.queryParams.limit
const data = {
offset: {
offset: pageNum,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment