Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-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
中汽研标准应用数据库
car-database-web
Commits
9474d3d9
Commit
9474d3d9
authored
Sep 05, 2024
by
zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: (首页/检测内容) /检测要点:标准名称由超链接更新为字符形式,/测试用例库:页面整体更新
parent
72bb5a3f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
606 additions
and
416 deletions
+606
-416
chapterOption.vue
src/components/Page/chapterOption.vue
+409
-0
standardOption.vue
src/components/Page/standardOption.vue
+10
-270
index.vue
src/views/setting/standardPoint/index.vue
+0
-2
index.vue
src/views/setting/standardTerms/index.vue
+2
-2
index.vue
src/views/setting/useCaseLibrary/index.vue
+185
-142
No files found.
src/components/Page/chapterOption.vue
0 → 100644
View file @
9474d3d9
empty
<
template
>
<div
class=
"page-data"
>
<div
class=
"page-box"
>
<el-row
:gutter=
"24"
>
<el-col
:span=
"4"
>
<div
class=
"standard-box"
>
<!--
<el-input
v-model=
"queryParams.name"
placeholder=
"输入标准关键词"
@
keyup
.
enter
.
native=
"search()"
>
<i
class=
"el-icon-search el-input__icon"
@
click=
"search()"
slot=
"suffix"
>
</i>
</el-input>
-->
<ul
class=
"select-list"
>
<!--
<template
v-for=
"item in standardList"
>
<li
@
click=
"selectStandard(item)"
:class=
"item.id === standard ? 'selected' : ''"
>
<el-tooltip
effect=
"dark"
:content=
"item.name"
placement=
"bottom-start"
>
<div
class=
"standard-item"
>
{{
item
.
standardNo
}}
</div>
</el-tooltip>
</li>
</
template
>
-->
<el-tree
ref=
"tree"
class=
"tree"
v-loading=
"loading"
:data=
"tableData"
:props=
"defaultProps"
:default-expanded-keys=
"defaultExpandIds"
node-key=
"key"
bordered
@
node-click=
"handleNodeClick"
@
node-expand=
"handleNodeExpand"
@
node-collapse=
"handleNodeCollapse"
>
<span
:class=
"{'clickChange':node.isCurrent}"
style=
"display: flex; justify-content:center;align-items: center;"
slot-scope=
"{ node,data }"
>
<span
>
{{data.label}}
</span>
</span>
</el-tree>
</ul>
</div>
</el-col>
<el-col
:span=
"20"
>
<div
class=
"table-box"
>
<
template
v-if=
"$slots.tab && $slots.tab.length"
>
<!--
<div
slot=
"header"
class=
"clearfix"
>
-->
<div
class=
"tabList mb10"
>
<slot
name=
"tab"
>
</slot>
<!--
</div>
-->
</div>
</
template
>
<slot>
</slot>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<
script
>
// import request from '@/utils/request'
import
{
mapGetters
}
from
'vuex'
import
request
from
'@/utils/request'
import
{
getReviewStandardList
}
from
'@/api/standard/standard.js'
import
{
forEach
}
from
'lodash'
;
import
standard
from
'../../store/modules/standard'
;
export
default
{
name
:
'standardOption'
,
props
:
{
total
:
{}
},
data
()
{
return
{
//listUrl: '/review/standard/list',
queryParams
:
{
pageNum
:
1
,
pageSize
:
99
,
chapter
:
''
,
standardId
:
this
.
$store
.
getters
.
standard
,
type
:
'system'
},
tableData
:[],
loading
:
false
,
expandedList
:[],
clickChange
:
false
,
defaultExpandIds
:
[],
// reviewTypeList: [ // 类型列表
// {
// label: '体系审查',
// type:'system'
// },
// {
// label: '车型审查',
// type:'car'
// },
// {
// label: '车型试验',
// type:'test'
// }
// ],
defaultProps
:
{
// node格式设置
children
:
'children'
,
label
:
'label'
,
// isLeaf: (data, node) => {
// if (node.level === 2 || data.length == 1) {
// return true
// }
// }
},
count
:
0
}
},
created
()
{
this
.
$store
.
dispatch
(
'standard/setStandardList'
)
if
(
this
.
standardList
.
length
>
0
)
{
this
.
selectStandard
(
this
.
standardList
[
0
])
}
},
computed
:
{
...
mapGetters
([
'standard'
,
'standardList'
])
},
watch
:
{
'$store.getters.standard'
:
{
handler
(
newVal
,
oldVal
)
{
this
.
queryParams
.
standardId
=
newVal
this
.
count
++
if
(
this
.
count
<=
1
){
this
.
loadData
()
}
}
},
'$store.getters.standard_type'
:
{
handler
(
newVal
,
oldVal
)
{
this
.
queryParams
.
type
=
newVal
}
},
'$store.getters.standard_chapter'
:{
handler
(
newVal
,
oldVal
)
{
this
.
queryParams
.
chapter
=
newVal
}
}
},
methods
:
{
search
()
{
this
.
queryParams
.
pageNum
=
1
this
.
$store
.
dispatch
(
'standard/setStandardList'
,
this
.
queryParams
.
name
)
},
selectStandard
(
value
)
{
this
.
$store
.
dispatch
(
'standard/setStandard'
,
''
)
//this.loadData()
},
handleNodeClick
(
node
,
data
){
if
(
data
.
isCurrent
){
node
.
isCurrent
=
true
}
if
(
data
.
isLeaf
){
this
.
queryParams
.
chapter
=
node
.
chapter
this
.
queryParams
.
type
=
node
.
type
let
standard
=
{
id
:
node
.
id
,
name
:
node
.
label
,
type
:
node
.
type
,
chapter
:
data
.
level
==
1
?
' '
:
node
.
label
}
this
.
$store
.
dispatch
(
'standard/setStandard'
,
standard
)
}
//this.$store.dispatch('standard/setStandard', standard)
},
handleNodeExpand
(
node
){
let
flag
=
false
this
.
defaultExpandIds
.
some
(
item
=>
{
if
(
item
===
node
.
key
)
{
// 判断当前节点是否存在, 存在不做处理
flag
=
true
return
true
}
})
if
(
!
flag
)
{
// 不存在则存到数组里
this
.
defaultExpandIds
.
push
(
node
.
key
)
}
},
handleNodeCollapse
(
node
)
{
// 删除当前关闭的节点
this
.
defaultExpandIds
.
some
((
item
,
i
)
=>
{
if
(
item
===
node
.
key
)
{
this
.
defaultExpandIds
.
splice
(
i
,
1
)
}
})
this
.
removeChildrenIds
(
node
)
// 这里主要针对多级树状结构,当关闭父节点时,递归删除父节点下的所有子节点
},
removeChildrenIds
(
data
)
{
const
ts
=
this
if
(
data
.
children
)
{
data
.
children
.
forEach
(
function
(
item
)
{
const
index
=
ts
.
defaultExpandIds
.
indexOf
(
item
.
key
)
if
(
index
>
0
)
{
ts
.
defaultExpandIds
.
splice
(
index
,
1
)
}
ts
.
removeChildrenIds
(
item
)
})
}
},
async
loadData
(){
this
.
loading
=
true
this
.
tableData
=
[]
for
(
let
i
=
0
;
i
<
this
.
standardList
.
length
;
i
++
){
let
data
=
{
standardId
:
this
.
standardList
[
i
].
id
,
standardNo
:
this
.
standardList
[
i
].
standardNo
}
await
getReviewStandardList
(
data
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
let
typeList
=
res
.
data
.
typeList
forEach
(
typeList
,(
item
)
=>
{
item
.
isCurrent
=
false
,
item
.
children
=
item
.
reviewStandardChapterListResponses
forEach
(
item
.
children
,(
c
)
=>
{
c
.
label
=
c
.
chapter
})
let
cache
=
[]
forEach
(
item
.
children
,(
p
)
=>
{
// 去重
if
(
cache
.
find
(
c
=>
c
.
label
==
p
.
label
)){
}
else
{
item
.
length
=
1
cache
.
push
({
label
:
p
.
label
,
chapter
:
p
.
label
,
isCurrent
:
false
,
id
:
this
.
standardList
[
i
].
id
,
type
:
item
.
type
})
}
})
item
.
children
=
cache
switch
(
item
.
type
){
case
'system'
:
item
.
label
=
'体系审查'
break
;
case
'car'
:
item
.
label
=
'车型审查'
break
;
case
'test'
:
item
.
label
=
'车型实验'
break
;
}
})
let
obj
=
{
id
:
this
.
standardList
[
i
].
id
,
label
:
this
.
standardList
[
i
].
standardNo
,
children
:
typeList
,
isCurrent
:
false
}
this
.
tableData
.
push
(
obj
)
//let chapters = res.rows
// obj.children.forEach(t=>{
// if(t.type == this.queryParams.type){
// t.children = cache
// }
// })
// page.push(obj)
// this.tableData = page
// console.log(this.standardList)
// this.loading = false
}
})
}
this
.
loading
=
false
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
@import
'~@/assets/styles/element-variables.scss'
;
.page-box
{
padding
:
24px
;
}
.standard-box
{
border
:
1px
solid
#ebebeb
;
display
:
flex
;
flex-flow
:
column
;
justify-content
:
flex-start
;
padding
:
15px
0
;
flex-wrap
:
wrap
;
align-items
:
flex-start
;
min-height
:
80vh
;
width
:
auto
;
}
.table-box
{
min-height
:
80vh
;
}
.header
{
font-size
:
16px
;
font-weight
:
500
;
}
.page-title
{
padding
:
15px
;
// background-color: #f9f9f9;
// background-color: #999;
width
:
100%
;
box-shadow
:
0
0
4px
#cccccc
;
}
.select-list
{
list-style-type
:
none
;
margin-top
:
5px
;
padding
:
0
;
width
:
100%
;
li
{
margin
:
10px
0
;
cursor
:
pointer
;
font-size
:
14px
;
color
:
rgb
(
102
,
102
,
102
);
width
:
100%
;
.standard-item
{
width
:
100%
;
overflow
:
hidden
;
//超出的文本隐藏
text-overflow
:
ellipsis
;
//溢出用省略号显示
white-space
:
nowrap
;
// 默认不换行;
}
}
.selected
{
color
:
$--color-primary
;
font-weight
:
bold
;
}
.tree
{
padding
:
10px
10px
;
::v-deep
.el-tree-node
{
// 节点样式
position
:
relative
;
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
}
::v-deep
.is-leaf
::before
{
// 叶子节点箭头样式设置:不显示
opacity
:
0
;
}
::v-deep
.el-tree-node__content
{
// 节点内容样式设置
width
:
100%
;
height
:
30px
;
//display: flex;
//justify-content: space-between;
margin-top
:
5px
;
color
:black
;
font-size
:
13px
;
border-radius
:
5px
;
}
::v-deep
.el-tree-node__content
:hover
{
// 节点内容样式设置
background-color
:
#f0f7ff
;
}
::v-deep
.el-tree-node__content
.el-tree-node__expand-icon
{
// 节点箭头样式设置
color
:
black
;
}
::v-deep
.el-tree-node__children
{
// 子节点样式设置
transition
:
all
0
.5s
;
}
::v-deep
.el-tree-node__children
.el-tree-node__content
{
// 子节点内容样式设置
width
:
200px
;
background-color
:
white
;
}
::v-deep
.el-tree-node__children
.el-tree-node__content
:hover
{
// 子节点内容样式设置
background-color
:
#f0f7ff
;
}
::v-deep
.el-tree-node__children
.el-tree-node__children
.el-tree-node__content
.el-tree-node__expand-icon
{
opacity
:
0
;
}
::v-deep
.el-tree-label
{
// 树中显示标题(label)设置
text-align
:
center
;
font-size
:
13px
;
font-weight
:
bold
;
}
::v-deep
.el-tree-content
{
// 树中显示内容(content)设置
font-size
:
13px
;
}
::v-deep
.clickChange
{
color
:blue
;
}
}
}
</
style
>
src/components/Page/standardOption.vue
View file @
9474d3d9
...
...
@@ -2,8 +2,8 @@ empty
<
template
>
<div
class=
"page-data"
>
<div
class=
"page-box"
>
<el-row
:gutter=
"2
4
"
>
<el-col
:span=
"
4
"
>
<el-row
:gutter=
"2
0
"
>
<el-col
:span=
"
3
"
>
<div
class=
"standard-box"
>
<!--
<el-input
v-model=
"queryParams.name"
...
...
@@ -18,7 +18,7 @@ empty
</i>
</el-input>
-->
<ul
class=
"select-list"
>
<
!--
<
template
v-for=
"item in standardList"
>
<template
v-for=
"item in standardList"
>
<li
@
click=
"selectStandard(item)"
:class=
"item.id === standard ? 'selected' : ''"
...
...
@@ -31,29 +31,11 @@ empty
<div
class=
"standard-item"
>
{{
item
.
standardNo
}}
</div>
</el-tooltip>
</li>
</
template
>
-->
<el-tree
ref=
"tree"
class=
"tree"
v-loading=
"loading"
:data=
"tableData"
:props=
"defaultProps"
:default-expanded-keys=
"defaultExpandIds"
node-key=
"key"
bordered
@
node-click=
"handleNodeClick"
@
node-expand=
"handleNodeExpand"
@
node-collapse=
"handleNodeCollapse"
>
<span
:class=
"{'clickChange':node.isCurrent}"
style=
"display: flex; justify-content:center;align-items: center;"
slot-scope=
"{ node,data }"
>
<span
>
{{data.label}}
</span>
</span>
</el-tree>
</
template
>
</ul>
</div>
</el-col>
<el-col
:span=
"2
0
"
>
<el-col
:span=
"2
1
"
>
<div
class=
"table-box"
>
<
template
v-if=
"$slots.tab && $slots.tab.length"
>
<!--
<div
slot=
"header"
class=
"clearfix"
>
-->
...
...
@@ -72,10 +54,6 @@ empty
<
script
>
// import request from '@/utils/request'
import
{
mapGetters
}
from
'vuex'
import
request
from
'@/utils/request'
import
{
getReviewStandardList
}
from
'@/api/standard/standard.js'
import
{
forEach
}
from
'lodash'
;
import
standard
from
'../../store/modules/standard'
;
export
default
{
name
:
'standardOption'
,
props
:
{
...
...
@@ -83,44 +61,11 @@ export default {
},
data
()
{
return
{
//listUrl: '/review/standard/list',
queryParams
:
{
value
:
''
,
pageNum
:
1
,
pageSize
:
99
,
chapter
:
''
,
standardId
:
this
.
$store
.
getters
.
standard
,
type
:
'system'
},
tableData
:[],
loading
:
false
,
expandedList
:[],
clickChange
:
false
,
defaultExpandIds
:
[],
// reviewTypeList: [ // 类型列表
// {
// label: '体系审查',
// type:'system'
// },
// {
// label: '车型审查',
// type:'car'
// },
// {
// label: '车型试验',
// type:'test'
// }
// ],
defaultProps
:
{
// node格式设置
children
:
'children'
,
label
:
'label'
,
// isLeaf: (data, node) => {
// if (node.level === 2 || data.length == 1) {
// return true
// }
// }
},
count
:
0
pageSize
:
99
}
}
},
created
()
{
...
...
@@ -132,163 +77,13 @@ export default {
computed
:
{
...
mapGetters
([
'standard'
,
'standardList'
])
},
watch
:
{
'$store.getters.standard'
:
{
handler
(
newVal
,
oldVal
)
{
this
.
queryParams
.
standardId
=
newVal
this
.
count
++
if
(
this
.
count
<=
1
){
this
.
loadData
()
}
}
},
'$store.getters.standard_type'
:
{
handler
(
newVal
,
oldVal
)
{
this
.
queryParams
.
type
=
newVal
}
},
'$store.getters.standard_chapter'
:{
handler
(
newVal
,
oldVal
)
{
this
.
queryParams
.
chapter
=
newVal
}
}
},
methods
:
{
search
()
{
this
.
queryParams
.
pageNum
=
1
this
.
$store
.
dispatch
(
'standard/setStandardList'
,
this
.
queryParams
.
name
)
},
selectStandard
(
value
)
{
this
.
$store
.
dispatch
(
'standard/setStandard'
,
''
)
//this.loadData()
},
handleNodeClick
(
node
,
data
){
if
(
data
.
isCurrent
){
node
.
isCurrent
=
true
}
if
(
data
.
isLeaf
){
this
.
queryParams
.
chapter
=
node
.
chapter
this
.
queryParams
.
type
=
node
.
type
let
standard
=
{
id
:
node
.
id
,
name
:
node
.
label
,
type
:
node
.
type
,
chapter
:
data
.
level
==
1
?
' '
:
node
.
label
}
this
.
$store
.
dispatch
(
'standard/setStandard'
,
standard
)
}
//this.$store.dispatch('standard/setStandard', standard)
},
handleNodeExpand
(
node
){
let
flag
=
false
this
.
defaultExpandIds
.
some
(
item
=>
{
if
(
item
===
node
.
key
)
{
// 判断当前节点是否存在, 存在不做处理
flag
=
true
return
true
}
})
if
(
!
flag
)
{
// 不存在则存到数组里
this
.
defaultExpandIds
.
push
(
node
.
key
)
}
},
handleNodeCollapse
(
node
)
{
// 删除当前关闭的节点
this
.
defaultExpandIds
.
some
((
item
,
i
)
=>
{
if
(
item
===
node
.
key
)
{
this
.
defaultExpandIds
.
splice
(
i
,
1
)
}
})
this
.
removeChildrenIds
(
node
)
// 这里主要针对多级树状结构,当关闭父节点时,递归删除父节点下的所有子节点
},
removeChildrenIds
(
data
)
{
const
ts
=
this
if
(
data
.
children
)
{
data
.
children
.
forEach
(
function
(
item
)
{
const
index
=
ts
.
defaultExpandIds
.
indexOf
(
item
.
key
)
if
(
index
>
0
)
{
ts
.
defaultExpandIds
.
splice
(
index
,
1
)
}
ts
.
removeChildrenIds
(
item
)
})
}
},
async
loadData
(){
this
.
loading
=
true
this
.
tableData
=
[]
for
(
let
i
=
0
;
i
<
this
.
standardList
.
length
;
i
++
){
let
data
=
{
standardId
:
this
.
standardList
[
i
].
id
,
standardNo
:
this
.
standardList
[
i
].
standardNo
}
await
getReviewStandardList
(
data
).
then
(
res
=>
{
if
(
res
.
code
===
200
){
let
typeList
=
res
.
data
.
typeList
forEach
(
typeList
,(
item
)
=>
{
item
.
isCurrent
=
false
,
item
.
children
=
item
.
reviewStandardChapterListResponses
forEach
(
item
.
children
,(
c
)
=>
{
c
.
label
=
c
.
chapter
})
let
cache
=
[]
forEach
(
item
.
children
,(
p
)
=>
{
// 去重
if
(
cache
.
find
(
c
=>
c
.
label
==
p
.
label
)){
}
else
{
item
.
length
=
1
cache
.
push
({
label
:
p
.
label
,
chapter
:
p
.
label
,
isCurrent
:
false
,
id
:
this
.
standardList
[
i
].
id
,
type
:
item
.
type
})
}
})
item
.
children
=
cache
switch
(
item
.
type
){
case
'system'
:
item
.
label
=
'体系审查'
break
;
case
'car'
:
item
.
label
=
'车型审查'
break
;
case
'test'
:
item
.
label
=
'车型实验'
break
;
}
})
let
obj
=
{
id
:
this
.
standardList
[
i
].
id
,
label
:
this
.
standardList
[
i
].
standardNo
,
children
:
typeList
,
isCurrent
:
false
}
this
.
tableData
.
push
(
obj
)
//let chapters = res.rows
// obj.children.forEach(t=>{
// if(t.type == this.queryParams.type){
// t.children = cache
// }
// })
// page.push(obj)
// this.tableData = page
// console.log(this.standardList)
// this.loading = false
}
})
}
this
.
loading
=
false
this
.
$store
.
dispatch
(
'standard/setStandard'
,
value
)
}
}
}
...
...
@@ -305,7 +100,7 @@ export default {
display
:
flex
;
flex-flow
:
column
;
justify-content
:
flex-start
;
padding
:
15px
0
;
padding
:
15px
11px
;
flex-wrap
:
wrap
;
align-items
:
flex-start
;
min-height
:
80vh
;
...
...
@@ -350,60 +145,5 @@ export default {
color
:
$--color-primary
;
font-weight
:
bold
;
}
.tree
{
padding
:
10px
10px
;
::v-deep
.el-tree-node
{
// 节点样式
position
:
relative
;
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
}
::v-deep
.is-leaf
::before
{
// 叶子节点箭头样式设置:不显示
opacity
:
0
;
}
::v-deep
.el-tree-node__content
{
// 节点内容样式设置
width
:
100%
;
height
:
30px
;
//display: flex;
//justify-content: space-between;
margin-top
:
5px
;
color
:black
;
font-size
:
13px
;
border-radius
:
5px
;
}
::v-deep
.el-tree-node__content
:hover
{
// 节点内容样式设置
background-color
:
#f0f7ff
;
}
::v-deep
.el-tree-node__content
.el-tree-node__expand-icon
{
// 节点箭头样式设置
color
:
black
;
}
::v-deep
.el-tree-node__children
{
// 子节点样式设置
transition
:
all
0
.5s
;
}
::v-deep
.el-tree-node__children
.el-tree-node__content
{
// 子节点内容样式设置
width
:
200px
;
background-color
:
white
;
}
::v-deep
.el-tree-node__children
.el-tree-node__content
:hover
{
// 子节点内容样式设置
background-color
:
#f0f7ff
;
}
::v-deep
.el-tree-node__children
.el-tree-node__children
.el-tree-node__content
.el-tree-node__expand-icon
{
opacity
:
0
;
}
::v-deep
.el-tree-label
{
// 树中显示标题(label)设置
text-align
:
center
;
font-size
:
13px
;
font-weight
:
bold
;
}
::v-deep
.el-tree-content
{
// 树中显示内容(content)设置
font-size
:
13px
;
}
::v-deep
.clickChange
{
color
:blue
;
}
}
}
</
style
>
src/views/setting/standardPoint/index.vue
View file @
9474d3d9
...
...
@@ -118,9 +118,7 @@
</el-table-column>
<el-table-column
prop=
"name"
label=
"标准名称"
align=
"left"
>
<
template
slot-scope=
"scope"
>
<div
class=
"font-color"
@
click=
"downPdf(scope.row,'name')"
>
{{
scope
.
row
.
name
}}
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"keypointName"
label=
"检测要点文件"
align=
"left"
>
...
...
src/views/setting/standardTerms/index.vue
View file @
9474d3d9
<
template
>
<page-
standard
-option>
<page-
chapter
-option>
<div
class=
"container"
>
<div>
<el-form
...
...
@@ -207,7 +207,7 @@
@close="documentReviewDialogManger.dialogVisible = false"
>
</document-review-dialog> -->
</page-
standard
-option>
</page-
chapter
-option>
</template>
<
script
>
import
page
from
'@/mixins/page'
...
...
src/views/setting/useCaseLibrary/index.vue
View file @
9474d3d9
<
template
>
<page-standard>
<el-form
v-show=
"showSearch"
ref=
"queryForm"
:model=
"queryParams"
size=
"small"
:inline=
"true"
label-width=
"68px"
<page-standard-option>
<el-collapse
class=
"container"
v-loading=
"loading"
v-model=
"activeNames"
@
change=
"handleChange"
>
<span
class=
"title"
>
<span
>
共
<span
style=
"color: red"
>
{{
total
||
0
}}
</span
>
条标准要求,
<span
style=
"color: red"
>
{{
caseTotal
||
0
}}
</span
>
个测试用例
</span
>
<el-form-item
prop=
"status"
>
<el-select
v-model=
"queryParams.scenario"
placeholder=
"请选择测试场景"
clearable
>
<el-option
v-for=
"item in testScenarList"
:key=
"item"
:label=
"item"
:value=
"item"
>
{{
item
}}
</el-option
>
</el-select>
</el-form-item>
<el-form-item
prop=
"status"
>
<el-select
v-model=
"queryParams.method"
placeholder=
"请选择测试方法"
clearable
>
<el-option
v-for=
"item of testTypeList"
:key=
"item"
:label=
"item"
:value=
"item"
>
{{
item
}}
</el-option
<div>
<el-button
type=
"text"
style=
"color: #ffb444"
size=
"medium"
@
click=
"allExpend"
>
</el-select>
</el-form-item>
<el-form-item
prop=
"postCode"
>
<el-input
v-model=
"queryParams.searchKeywords"
placeholder=
"用例编号或名称关键字"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<li
class=
"el-icon-caret-bottom"
></li>
全部展开
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
查询
</el-button
type=
"text"
style=
"color: #ffb444"
size=
"medium"
@
click=
"allClose"
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button
<li
class=
"el-icon-caret-top"
></li>
全部收缩
</el-button>
</div>
</span>
<el-collapse-item
v-for=
"(item, index) in tableData"
:name=
"item.id"
>
</el-form-item>
</el-form>
<!--
<el-row
:gutter=
"10"
class=
"mb8"
>
-->
<!--
<right-toolbar-->
<!-- :show-search.sync="showSearch"-->
<!-- @queryTable="getList"-->
<!-- >
</right-toolbar>
-->
<!--
</el-row>
-->
<template>
<span
class=
"collapse-title"
slot=
"title"
style=
"display: inline;"
>
<span
style=
"color: blue;font-weight: bold;"
>
标准要求:
</span>
{{
item
.
serialNumber
+
item
.
requirements
}}
</span>
<el-table
v-loading=
"loading
"
:data=
"item.useCases
"
border
:scroll-x=
"'1500px'"
:data=
"tableData"
@
sort-change=
"sortChange"
style=
"width: 80%; margin-left: 20px; margin-top: 10px"
>
<el-table-column
type=
"index"
width=
"55"
label=
"序号"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"测试场景"
sortable
align=
"left"
prop=
"testScenario"
/>
<el-table-column
label=
"测试方法"
sortable
align=
"left"
prop=
"testMethod"
/>
<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=
"requirements"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
requirements
||
'--'
}}
</span>
</
template
>
<el-table-column
prop=
"customizedID"
label=
"用例编号"
width=
"180"
>
</el-table-column>
<el-table-column
label=
"用例描述"
align=
"left"
prop=
"description"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
description
||
'--'
}}
</span>
</
template
>
<el-table-column
prop=
"description"
label=
"用例描述"
>
</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>
</
template
>
</el-collapse-item>
</el-collapse>
<pagination
v-show=
"total > 0"
style=
"height: 45px"
:total=
"total"
:background=
"false"
:page
.
sync=
"queryParams.offset"
:limit
.
sync=
"queryParams.limit"
@
pagination=
"getList"
/>
</page-standard>
</page-standard
-option
>
</template>
<
script
>
// import page from '@/mixins/page'
import
{
forEach
}
from
'lodash'
import
{
mapGetters
}
from
'vuex'
import
{
getStandardList
}
from
'@/api/standard/standard.js'
import
{
listTestCase
,
listTestScenar
,
...
...
@@ -143,9 +80,11 @@ export default {
limit
:
10
,
scenario
:
''
,
method
:
''
,
searchKeywords
:
''
searchKeywords
:
''
,
standardName
:
''
},
total
:
0
,
caseTotal
:
0
,
loading
:
false
,
listUrl
:
'/system/testCase/getList'
,
// 显示搜索条件
...
...
@@ -154,6 +93,8 @@ export default {
tableData
:
[],
testScenarList
:
[],
testTypeList
:
[],
standardList
:
[],
loading
:
false
,
// 表单校验
rules
:
{
postName
:
[
...
...
@@ -169,13 +110,36 @@ export default {
orderBy
:
{
field
:
'scenario'
,
order
:
'DESC'
},
activeNames
:
[],
// 数字16位丢失精度问题
tableData
:
[],
count
:
0
}
},
// 异步请求不到standardList
created
()
{
this
.
loading
=
true
},
computed
:
{
...
mapGetters
([
'standard'
])
},
watch
:
{
'$store.getters.standardList'
:
{
handler
(
newVal
,
oldVal
)
{
this
.
standardList
=
newVal
this
.
getList
()
}
},
mounted
()
{
this
.
getTestScenar
()
this
.
getTestType
()
'$store.getters.standard'
:
{
handler
(
newVal
,
oldVal
)
{
console
.
log
(
this
.
count
)
this
.
count
++
if
(
this
.
count
>
1
)
{
this
.
getList
()
}
}
}
},
methods
:
{
sortChange
(
column
,
prop
,
order
)
{
...
...
@@ -198,6 +162,9 @@ export default {
this
.
queryParams
.
offset
=
1
this
.
getList
()
},
handleChange
(
val
)
{
console
.
log
(
val
)
},
resetQuery
()
{
this
.
queryParams
=
{
offset
:
1
,
...
...
@@ -208,39 +175,86 @@ export default {
}
this
.
handleQuery
()
},
/** 获取测试场景 */
getTestScenar
()
{
listTestScenar
().
then
(
res
=>
{
this
.
testScenarList
=
res
.
data
allExpend
()
{
this
.
activeNames
=
[]
forEach
(
this
.
tableData
,
item
=>
{
this
.
activeNames
.
push
(
item
.
id
)
})
},
/** 获取测试方法 */
getTestType
()
{
listMethod
().
then
(
res
=>
{
this
.
testTypeList
=
res
.
data
})
allClose
()
{
this
.
activeNames
=
[]
},
/** 获取测试场景 */
// getTestScenar() {
// listTestScenar().then(res => {
// this.testScenarList = res.data
// })
// },
/** 获取测试方法 */
// getTestType() {
// listMethod().then(res => {
// this.testTypeList = res.data
// })
// },
/** 获取测试用例列表 */
getList
()
{
async
getList
()
{
this
.
loading
=
true
let
standardName
=
''
if
(
this
.
standardList
.
find
(
item
=>
item
.
id
===
this
.
$store
.
getters
.
standard
)
)
{
standardName
=
this
.
standardList
.
find
(
item
=>
item
.
id
===
this
.
$store
.
getters
.
standard
).
name
}
else
{
standardName
=
''
}
const
pageNum
=
(
this
.
queryParams
.
offset
-
1
)
*
this
.
queryParams
.
limit
const
data
=
{
name
:
standardName
,
offset
:
{
offset
:
pageNum
,
limit
:
this
.
queryParams
.
limit
},
orderBy
:
{
field
:
this
.
orderBy
.
field
,
order
:
this
.
orderBy
.
order
},
searchFields
:
{
name
:
this
.
queryParams
.
searchKeywords
,
scenario
:
this
.
queryParams
.
scenario
,
method
:
this
.
queryParams
.
method
}
// orderBy: {
// field: this.orderBy.field,
// order: this.orderBy.order
// },
// searchFields: {
// standardId: this.$store.getters.standard,
// name: this.queryParams.searchKeywords,
// scenario: this.queryParams.scenario,
// method: this.queryParams.method
// }
}
this
.
caseTotal
=
0
// await getStandardList({
// keyWord: name ? name : '',
// pageNum: 1,
// pageSize: 9999
// }).then(res => {
// if (res.code === 200) {
// this.standardList = res.rows.filter(i => i.standardStatus === 'INFORCE')
// }
// })
await
listTestCase
({
name
:
standardName
,
offset
:
{
offset
:
0
,
limit
:
999
}
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
loading
=
false
this
.
caseTotal
=
res
.
data
.
useCaseNum
listTestCase
(
data
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
tableData
=
res
.
data
.
useCases
this
.
total
=
res
.
data
.
totalCount
}
})
this
.
loading
=
false
}
})
}
}
...
...
@@ -250,4 +264,33 @@ export default {
.select-width
{
width
:
100%
;
}
.container
{
margin-top
:
10px
;
}
.container
.title
{
display
:
flex
;
width
:
100%
;
font-size
:
13px
;
height
:
30px
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
0
20px
;
background-color
:
#fff5e6
;
}
::v-deep
.el-collapse-item__header
{
display
:
flex
;
height
:
auto
;
padding
:
10px
20px
;
line-height
:
20px
;
background-color
:
#f0f7ff
;
}
::v-deep
.collapse-title
{
display
:
flex
;
flex
:
1
0
90%
;
order
:
1
;
.el-collapse-item__header
{
flex
:
1
0
auto
;
order
:
-1
;
}
}
</
style
>
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