Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
中汽测评-信息安全测评系统
web
Commits
b158a0fb
Commit
b158a0fb
authored
May 08, 2024
by
mengzixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(测试用例库): table列表逻辑修改
parent
b1a7c623
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
14 deletions
+92
-14
index.vue
src/views/informationBase/viewUseCaseLibrary/index.vue
+46
-7
index.vue
src/views/setting/useCaseLibrary/index.vue
+46
-7
No files found.
src/views/informationBase/viewUseCaseLibrary/index.vue
View file @
b158a0fb
...
@@ -67,7 +67,13 @@
...
@@ -67,7 +67,13 @@
<!-- @queryTable="getList"-->
<!-- @queryTable="getList"-->
<!-- >
</right-toolbar>
-->
<!-- >
</right-toolbar>
-->
<!--
</el-row>
-->
<!--
</el-row>
-->
<el-table
v-loading=
"loading"
border
:scroll-x=
"'1500px'"
:data=
"tableData"
>
<el-table
v-loading=
"loading"
border
:scroll-x=
"'1500px'"
:data=
"tableData"
@
sort-change=
"sortChange"
>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
align=
"center"
>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
align=
"center"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
<span>
{{
scope
.
$index
+
1
}}
</span>
...
@@ -79,7 +85,12 @@
...
@@ -79,7 +85,12 @@
align=
"left"
align=
"left"
prop=
"testScenario"
prop=
"testScenario"
/>
/>
<el-table-column
label=
"测试方法"
sortable
align=
"left"
prop=
"testType"
/>
<el-table-column
label=
"测试方法"
sortable
align=
"left"
prop=
"testMethod"
/>
<el-table-column
label=
"用例编号"
align=
"left"
prop=
"displayID"
/>
<el-table-column
label=
"用例编号"
align=
"left"
prop=
"displayID"
/>
<el-table-column
label=
"用例名称"
align=
"left"
prop=
"name"
/>
<el-table-column
label=
"用例名称"
align=
"left"
prop=
"name"
/>
<!-- <el-table-column label="工具" align="left" prop="tools" /> -->
<!-- <el-table-column label="工具" align="left" prop="tools" /> -->
...
@@ -129,7 +140,8 @@ export default {
...
@@ -129,7 +140,8 @@ export default {
return
{
return
{
queryParams
:
{
queryParams
:
{
offset
:
0
,
offset
:
0
,
limit
:
10
limit
:
10
,
searchKeywords
:
''
},
},
total
:
0
,
total
:
0
,
loading
:
false
,
loading
:
false
,
...
@@ -151,6 +163,10 @@ export default {
...
@@ -151,6 +163,10 @@ export default {
postSort
:
[
postSort
:
[
{
required
:
true
,
message
:
'岗位顺序不能为空'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'岗位顺序不能为空'
,
trigger
:
'blur'
}
]
]
},
orderBy
:
{
field
:
'scenario'
,
order
:
'DESC'
}
}
}
}
},
},
...
@@ -160,13 +176,32 @@ export default {
...
@@ -160,13 +176,32 @@ export default {
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
methods
:
{
sortChange
(
column
,
prop
,
order
)
{
this
.
queryParams
.
offset
=
1
// 排序后返回第一页
if
(
column
.
order
)
{
this
.
orderBy
.
order
=
column
.
order
===
'ascending'
?
'DESC'
:
'ASC'
this
.
orderBy
.
field
=
column
.
prop
switch
(
column
.
prop
)
{
case
'testScenario'
:
this
.
orderBy
.
field
=
'scenario'
break
case
'testMethod'
:
this
.
orderBy
.
field
=
'method'
break
}
this
.
getList
()
}
},
handleQuery
()
{
handleQuery
()
{
this
.
queryParams
.
offset
=
1
this
.
queryParams
.
offset
=
1
this
.
getList
()
this
.
getList
()
},
},
resetQuery
()
{
resetQuery
()
{
this
.
queryParams
.
offset
=
1
this
.
queryParams
=
{
this
.
queryParams
.
limit
=
10
offset
:
1
,
limit
:
10
,
searchKeywords
:
''
}
this
.
handleQuery
()
this
.
handleQuery
()
},
},
/** 获取测试场景 */
/** 获取测试场景 */
...
@@ -183,13 +218,17 @@ export default {
...
@@ -183,13 +218,17 @@ export default {
},
},
/** 获取测试用例列表 */
/** 获取测试用例列表 */
getList
()
{
getList
()
{
console
.
log
(
this
.
queryParams
.
limit
)
const
pageNum
=
(
this
.
queryParams
.
offset
-
1
)
*
this
.
queryParams
.
limit
const
pageNum
=
(
this
.
queryParams
.
offset
-
1
)
*
this
.
queryParams
.
limit
const
data
=
{
const
data
=
{
offset
:
{
offset
:
{
offset
:
pageNum
,
offset
:
pageNum
,
limit
:
this
.
queryParams
.
limit
limit
:
this
.
queryParams
.
limit
}
},
orderBy
:
{
field
:
this
.
orderBy
.
field
,
order
:
this
.
orderBy
.
order
},
search
:
this
.
queryParams
.
searchKeywords
}
}
listTestCase
(
data
).
then
(
res
=>
{
listTestCase
(
data
).
then
(
res
=>
{
this
.
tableData
=
res
.
data
.
useCases
this
.
tableData
=
res
.
data
.
useCases
...
...
src/views/setting/useCaseLibrary/index.vue
View file @
b158a0fb
...
@@ -67,7 +67,13 @@
...
@@ -67,7 +67,13 @@
<!-- @queryTable="getList"-->
<!-- @queryTable="getList"-->
<!-- >
</right-toolbar>
-->
<!-- >
</right-toolbar>
-->
<!--
</el-row>
-->
<!--
</el-row>
-->
<el-table
v-loading=
"loading"
border
:scroll-x=
"'1500px'"
:data=
"tableData"
>
<el-table
v-loading=
"loading"
border
:scroll-x=
"'1500px'"
:data=
"tableData"
@
sort-change=
"sortChange"
>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
align=
"center"
>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
align=
"center"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
<span>
{{
scope
.
$index
+
1
}}
</span>
...
@@ -79,7 +85,12 @@
...
@@ -79,7 +85,12 @@
align=
"left"
align=
"left"
prop=
"testScenario"
prop=
"testScenario"
/>
/>
<el-table-column
label=
"测试方法"
sortable
align=
"left"
prop=
"testType"
/>
<el-table-column
label=
"测试方法"
sortable
align=
"left"
prop=
"testMethod"
/>
<el-table-column
label=
"用例编号"
align=
"left"
prop=
"displayID"
/>
<el-table-column
label=
"用例编号"
align=
"left"
prop=
"displayID"
/>
<el-table-column
label=
"用例名称"
align=
"left"
prop=
"name"
/>
<el-table-column
label=
"用例名称"
align=
"left"
prop=
"name"
/>
<!-- <el-table-column label="工具" align="left" prop="tools" /> -->
<!-- <el-table-column label="工具" align="left" prop="tools" /> -->
...
@@ -129,7 +140,8 @@ export default {
...
@@ -129,7 +140,8 @@ export default {
return
{
return
{
queryParams
:
{
queryParams
:
{
offset
:
0
,
offset
:
0
,
limit
:
10
limit
:
10
,
searchKeywords
:
''
},
},
total
:
0
,
total
:
0
,
loading
:
false
,
loading
:
false
,
...
@@ -151,6 +163,10 @@ export default {
...
@@ -151,6 +163,10 @@ export default {
postSort
:
[
postSort
:
[
{
required
:
true
,
message
:
'岗位顺序不能为空'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'岗位顺序不能为空'
,
trigger
:
'blur'
}
]
]
},
orderBy
:
{
field
:
'scenario'
,
order
:
'DESC'
}
}
}
}
},
},
...
@@ -160,13 +176,32 @@ export default {
...
@@ -160,13 +176,32 @@ export default {
this
.
getList
()
this
.
getList
()
},
},
methods
:
{
methods
:
{
sortChange
(
column
,
prop
,
order
)
{
this
.
queryParams
.
offset
=
1
// 排序后返回第一页
if
(
column
.
order
)
{
this
.
orderBy
.
order
=
column
.
order
===
'ascending'
?
'DESC'
:
'ASC'
this
.
orderBy
.
field
=
column
.
prop
switch
(
column
.
prop
)
{
case
'testScenario'
:
this
.
orderBy
.
field
=
'scenario'
break
case
'testMethod'
:
this
.
orderBy
.
field
=
'method'
break
}
this
.
getList
()
}
},
handleQuery
()
{
handleQuery
()
{
this
.
queryParams
.
offset
=
1
this
.
queryParams
.
offset
=
1
this
.
getList
()
this
.
getList
()
},
},
resetQuery
()
{
resetQuery
()
{
this
.
queryParams
.
offset
=
1
this
.
queryParams
=
{
this
.
queryParams
.
limit
=
10
offset
:
1
,
limit
:
10
,
searchKeywords
:
''
}
this
.
handleQuery
()
this
.
handleQuery
()
},
},
/** 获取测试场景 */
/** 获取测试场景 */
...
@@ -183,13 +218,17 @@ export default {
...
@@ -183,13 +218,17 @@ export default {
},
},
/** 获取测试用例列表 */
/** 获取测试用例列表 */
getList
()
{
getList
()
{
console
.
log
(
this
.
queryParams
.
limit
)
const
pageNum
=
(
this
.
queryParams
.
offset
-
1
)
*
this
.
queryParams
.
limit
const
pageNum
=
(
this
.
queryParams
.
offset
-
1
)
*
this
.
queryParams
.
limit
const
data
=
{
const
data
=
{
offset
:
{
offset
:
{
offset
:
pageNum
,
offset
:
pageNum
,
limit
:
this
.
queryParams
.
limit
limit
:
this
.
queryParams
.
limit
}
},
orderBy
:
{
field
:
this
.
orderBy
.
field
,
order
:
this
.
orderBy
.
order
},
search
:
this
.
queryParams
.
searchKeywords
}
}
listTestCase
(
data
).
then
(
res
=>
{
listTestCase
(
data
).
then
(
res
=>
{
this
.
tableData
=
res
.
data
.
useCases
this
.
tableData
=
res
.
data
.
useCases
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment