Commit 9474d3d9 authored by zhang's avatar zhang

feat: (首页/检测内容) /检测要点:标准名称由超链接更新为字符形式,/测试用例库:页面整体更新

parent 72bb5a3f
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>
...@@ -2,8 +2,8 @@ empty ...@@ -2,8 +2,8 @@ empty
<template> <template>
<div class="page-data"> <div class="page-data">
<div class="page-box"> <div class="page-box">
<el-row :gutter="24"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="3">
<div class="standard-box"> <div class="standard-box">
<!-- <el-input <!-- <el-input
v-model="queryParams.name" v-model="queryParams.name"
...@@ -18,7 +18,7 @@ empty ...@@ -18,7 +18,7 @@ empty
</i> </i>
</el-input> --> </el-input> -->
<ul class="select-list"> <ul class="select-list">
<!-- <template v-for="item in standardList"> <template v-for="item in standardList">
<li <li
@click="selectStandard(item)" @click="selectStandard(item)"
:class="item.id === standard ? 'selected' : ''" :class="item.id === standard ? 'selected' : ''"
...@@ -31,29 +31,11 @@ empty ...@@ -31,29 +31,11 @@ empty
<div class="standard-item">{{ item.standardNo }}</div> <div class="standard-item">{{ item.standardNo }}</div>
</el-tooltip> </el-tooltip>
</li> </li>
</template> --> </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> </ul>
</div> </div>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="21">
<div class="table-box"> <div class="table-box">
<template v-if="$slots.tab && $slots.tab.length"> <template v-if="$slots.tab && $slots.tab.length">
<!-- <div slot="header" class="clearfix"> --> <!-- <div slot="header" class="clearfix"> -->
...@@ -72,10 +54,6 @@ empty ...@@ -72,10 +54,6 @@ empty
<script> <script>
// import request from '@/utils/request' // import request from '@/utils/request'
import { mapGetters } from 'vuex' 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 { export default {
name: 'standardOption', name: 'standardOption',
props: { props: {
...@@ -83,44 +61,11 @@ export default { ...@@ -83,44 +61,11 @@ export default {
}, },
data() { data() {
return { return {
//listUrl: '/review/standard/list',
queryParams: { queryParams: {
value: '',
pageNum: 1, pageNum: 1,
pageSize: 99, 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() { created() {
...@@ -132,163 +77,13 @@ export default { ...@@ -132,163 +77,13 @@ export default {
computed: { computed: {
...mapGetters(['standard', 'standardList']) ...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: { methods: {
search() { search() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.$store.dispatch('standard/setStandardList', this.queryParams.name) this.$store.dispatch('standard/setStandardList', this.queryParams.name)
}, },
selectStandard(value) { selectStandard(value) {
this.$store.dispatch('standard/setStandard', '') this.$store.dispatch('standard/setStandard', value)
//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
} }
} }
} }
...@@ -305,7 +100,7 @@ export default { ...@@ -305,7 +100,7 @@ export default {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
justify-content: flex-start; justify-content: flex-start;
padding: 15px 0; padding: 15px 11px;
flex-wrap: wrap; flex-wrap: wrap;
align-items: flex-start; align-items: flex-start;
min-height: 80vh; min-height: 80vh;
...@@ -350,60 +145,5 @@ export default { ...@@ -350,60 +145,5 @@ export default {
color: $--color-primary; color: $--color-primary;
font-weight: bold; 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> </style>
...@@ -118,9 +118,7 @@ ...@@ -118,9 +118,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="标准名称" align="left"> <el-table-column prop="name" label="标准名称" align="left">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="font-color" @click="downPdf(scope.row,'name')">
{{ scope.row.name }} {{ scope.row.name }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="keypointName" label="检测要点文件" align="left"> <el-table-column prop="keypointName" label="检测要点文件" align="left">
......
<template> <template>
<page-standard-option> <page-chapter-option>
<div class="container"> <div class="container">
<div> <div>
<el-form <el-form
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
@close="documentReviewDialogManger.dialogVisible = false" @close="documentReviewDialogManger.dialogVisible = false"
> >
</document-review-dialog> --> </document-review-dialog> -->
</page-standard-option> </page-chapter-option>
</template> </template>
<script> <script>
import page from '@/mixins/page' import page from '@/mixins/page'
......
<template> <template>
<page-standard> <page-standard-option>
<el-form <el-collapse class="container" v-loading="loading" v-model="activeNames" @change="handleChange">
v-show="showSearch" <span class="title">
ref="queryForm" <span
:model="queryParams" ><span style="color: red">{{ total || 0 }}</span
size="small" >条标准要求,<span style="color: red">{{ caseTotal || 0 }}</span
:inline="true" >个测试用例</span
label-width="68px"
> >
<el-form-item prop="status"> <div>
<el-select <el-button
v-model="queryParams.scenario" type="text"
placeholder="请选择测试场景" style="color: #ffb444"
clearable size="medium"
> @click="allExpend"
<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
> >
</el-select> <li class="el-icon-caret-bottom"></li>
</el-form-item> 全部展开
<el-form-item prop="postCode"> </el-button>
<el-input
v-model="queryParams.searchKeywords"
placeholder="用例编号或名称关键字"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button <el-button
type="primary" type="text"
icon="el-icon-search" style="color: #ffb444"
size="mini" size="medium"
@click="handleQuery" @click="allClose"
>查询</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"> <li class="el-icon-caret-top"></li>
重置</el-button 全部收缩
</el-button>
</div>
</span>
<el-collapse-item
v-for="(item, index) in tableData"
:name="item.id"
> >
</el-form-item> <template>
</el-form> <span class="collapse-title" slot="title" style="display: inline;">
<!-- <el-row :gutter="10" class="mb8">--> <span style="color: blue;font-weight: bold;">标准要求:</span>
<!-- <right-toolbar--> {{ item.serialNumber + item.requirements }}
<!-- :show-search.sync="showSearch"--> </span>
<!-- @queryTable="getList"-->
<!-- ></right-toolbar>-->
<!-- </el-row>-->
<el-table <el-table
v-loading="loading" :data="item.useCases"
border border
:scroll-x="'1500px'" style="width: 80%; margin-left: 20px; margin-top: 10px"
:data="tableData"
@sort-change="sortChange"
> >
<el-table-column type="index" width="55" label="序号" align="center"> <el-table-column prop="customizedID" label="用例编号" width="180">
<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> </el-table-column>
<el-table-column label="用例描述" align="left" prop="description"> <el-table-column prop="description" label="用例描述">
<template slot-scope="scope">
<span>{{ scope.row.description || '--' }}</span>
</template>
</el-table-column> </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> </el-table>
</template>
</el-collapse-item>
</el-collapse>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
style="height: 45px"
:total="total" :total="total"
:background="false" :background="false"
:page.sync="queryParams.offset" :page.sync="queryParams.offset"
:limit.sync="queryParams.limit" :limit.sync="queryParams.limit"
@pagination="getList" @pagination="getList"
/> />
</page-standard> </page-standard-option>
</template> </template>
<script> <script>
// import page from '@/mixins/page' // import page from '@/mixins/page'
import { forEach } from 'lodash'
import { mapGetters } from 'vuex'
import { getStandardList } from '@/api/standard/standard.js'
import { import {
listTestCase, listTestCase,
listTestScenar, listTestScenar,
...@@ -143,9 +80,11 @@ export default { ...@@ -143,9 +80,11 @@ export default {
limit: 10, limit: 10,
scenario: '', scenario: '',
method: '', method: '',
searchKeywords: '' searchKeywords: '',
standardName: ''
}, },
total: 0, total: 0,
caseTotal: 0,
loading: false, loading: false,
listUrl: '/system/testCase/getList', listUrl: '/system/testCase/getList',
// 显示搜索条件 // 显示搜索条件
...@@ -154,6 +93,8 @@ export default { ...@@ -154,6 +93,8 @@ export default {
tableData: [], tableData: [],
testScenarList: [], testScenarList: [],
testTypeList: [], testTypeList: [],
standardList: [],
loading: false,
// 表单校验 // 表单校验
rules: { rules: {
postName: [ postName: [
...@@ -169,13 +110,36 @@ export default { ...@@ -169,13 +110,36 @@ export default {
orderBy: { orderBy: {
field: 'scenario', field: 'scenario',
order: 'DESC' 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() { '$store.getters.standard': {
this.getTestScenar() handler(newVal, oldVal) {
this.getTestType() console.log(this.count)
this.count++
if (this.count > 1) {
this.getList() this.getList()
}
}
}
}, },
methods: { methods: {
sortChange(column, prop, order) { sortChange(column, prop, order) {
...@@ -198,6 +162,9 @@ export default { ...@@ -198,6 +162,9 @@ export default {
this.queryParams.offset = 1 this.queryParams.offset = 1
this.getList() this.getList()
}, },
handleChange(val) {
console.log(val)
},
resetQuery() { resetQuery() {
this.queryParams = { this.queryParams = {
offset: 1, offset: 1,
...@@ -208,39 +175,86 @@ export default { ...@@ -208,39 +175,86 @@ export default {
} }
this.handleQuery() this.handleQuery()
}, },
/** 获取测试场景 */ allExpend() {
getTestScenar() { this.activeNames = []
listTestScenar().then(res => { forEach(this.tableData, item => {
this.testScenarList = res.data this.activeNames.push(item.id)
}) })
}, },
/** 获取测试方法 */ allClose() {
getTestType() { this.activeNames = []
listMethod().then(res => {
this.testTypeList = res.data
})
}, },
/** 获取测试场景 */
// 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 pageNum = (this.queryParams.offset - 1) * this.queryParams.limit
const data = { const data = {
name: standardName,
offset: { offset: {
offset: pageNum, offset: pageNum,
limit: this.queryParams.limit 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 => { listTestCase(data).then(res => {
if (res.code === 200) {
this.tableData = res.data.useCases this.tableData = res.data.useCases
this.total = res.data.totalCount this.total = res.data.totalCount
}
})
this.loading = false
}
}) })
} }
} }
...@@ -250,4 +264,33 @@ export default { ...@@ -250,4 +264,33 @@ export default {
.select-width { .select-width {
width: 100%; 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> </style>
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