Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qa-platform-ui
Commits
b633c278
Commit
b633c278
authored
Jun 21, 2021
by
晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交添加导入参数功能
parent
9be79da3
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
92 deletions
+137
-92
main.js
src/main.js
+1
-0
AddCase.vue
src/views/auto/AddCase.vue
+25
-25
AddInterface.vue
src/views/auto/AddInterface.vue
+61
-27
EditScene.vue
src/views/auto/EditScene.vue
+48
-38
Notify.vue
src/views/jira/Notify.vue
+2
-2
No files found.
src/main.js
View file @
b633c278
...
...
@@ -95,6 +95,7 @@ Vue.use(Radio)
Vue
.
use
(
Row
)
Vue
.
use
(
Col
)
Vue
.
use
(
JsonViewer
)
// Vue.use(Sortable)
/* eslint-disable no-new */
new
Vue
({
...
...
src/views/auto/AddCase.vue
View file @
b633c278
...
...
@@ -21,21 +21,21 @@
<el-collapse-item
name=
"1"
title=
"请求头"
>
<el-form-item>
<el-row>
<el-col
:span=
"
6
"
>
<div
class=
"grid-content"
style=
"margin-left:1
5
px"
>
参数名称
</div>
<el-col
:span=
"
5
"
>
<div
class=
"grid-content"
style=
"margin-left:1
00
px"
>
参数名称
</div>
</el-col>
<el-col
:span=
"
10
"
>
<div
class=
"grid-content"
style=
"margin-left:1
5
px"
>
参数值
</div>
<el-col
:span=
"
8
"
>
<div
class=
"grid-content"
style=
"margin-left:1
80
px"
>
参数值
</div>
</el-col>
<el-col
:span=
"2"
>
<div
class=
"grid-content"
style=
"margin-left:
25
px"
>
操作
</div>
<div
class=
"grid-content"
style=
"margin-left:
40
px"
>
操作
</div>
</el-col>
</el-row>
<el-row
v-for=
"(item,index) in headersList"
:key=
"index"
>
<el-col
:span=
"
6
"
>
<el-col
:span=
"
5
"
>
<el-input
v-model.trim=
"item.paramsName"
placeholder=
"请输入参数名称"
></el-input>
</el-col>
<el-col
:span=
"
10
"
>
<el-col
:span=
"
8
"
>
<el-input
v-model.trim=
"item.paramsValue"
placeholder=
"请输入参数值"
type=
"textarea"
autosize
></el-input>
</el-col>
<el-col
:span=
"2"
>
...
...
@@ -49,21 +49,21 @@
<el-collapse-item
name=
"2"
title=
"请求参数"
>
<el-form-item>
<el-row>
<el-col
:span=
"
6
"
>
<div
class=
"grid-content"
style=
"margin-left:1
5
px"
>
参数名称
</div>
<el-col
:span=
"
5
"
>
<div
class=
"grid-content"
style=
"margin-left:1
00
px"
>
参数名称
</div>
</el-col>
<el-col
:span=
"
10
"
>
<div
class=
"grid-content"
style=
"margin-left:1
5
px"
>
参数值
</div>
<el-col
:span=
"
8
"
>
<div
class=
"grid-content"
style=
"margin-left:1
80
px"
>
参数值
</div>
</el-col>
<el-col
:span=
"2"
>
<div
class=
"grid-content"
style=
"margin-left:
25
px"
>
操作
</div>
<div
class=
"grid-content"
style=
"margin-left:
40
px"
>
操作
</div>
</el-col>
</el-row>
<el-row
v-for=
"(item,index) in requestParamsList"
:key=
"index"
>
<el-col
:span=
"
6
"
>
<el-col
:span=
"
5
"
>
<el-input
v-model.trim=
"item.paramsName"
placeholder=
"请输入参数名称"
></el-input>
</el-col>
<el-col
:span=
"
10
"
>
<el-col
:span=
"
8
"
>
<el-input
v-model.trim=
"item.paramsValue"
placeholder=
"请输入参数值"
type=
"textarea"
autosize
></el-input>
</el-col>
<el-col
:span=
"2"
>
...
...
@@ -77,21 +77,21 @@
<el-collapse-item
name=
"3"
title=
"响应提取"
>
<el-form-item>
<el-row>
<el-col
:span=
"
6
"
>
<div
class=
"grid-content"
style=
"margin-left:1
5
px"
>
变量名称
</div>
<el-col
:span=
"
5
"
>
<div
class=
"grid-content"
style=
"margin-left:1
00
px"
>
变量名称
</div>
</el-col>
<el-col
:span=
"
10
"
>
<div
class=
"grid-content"
style=
"margin-left:1
5
px"
>
json表达式/正则表达式
</div>
<el-col
:span=
"
8
"
>
<div
class=
"grid-content"
style=
"margin-left:1
60
px"
>
json表达式/正则表达式
</div>
</el-col>
<el-col
:span=
"2"
>
<div
class=
"grid-content"
style=
"margin-left:
25
px"
>
操作
</div>
<div
class=
"grid-content"
style=
"margin-left:
40
px"
>
操作
</div>
</el-col>
</el-row>
<el-row
v-for=
"(item,index) in responseList"
:key=
"index"
>
<el-col
:span=
"
6
"
>
<el-col
:span=
"
5
"
>
<el-input
v-model.trim=
"item.paramsName"
placeholder=
"请输入变量名称"
></el-input>
</el-col>
<el-col
:span=
"
10
"
>
<el-col
:span=
"
8
"
>
<el-input
v-model.trim=
"item.paramsValue"
placeholder=
"请输入表达式"
type=
"textarea"
autosize
></el-input>
</el-col>
<el-col
:span=
"2"
>
...
...
@@ -104,26 +104,26 @@
<!-- 断言 -->
<el-collapse-item
name=
"4"
title=
"结果断言"
>
<el-table
:data=
"assertionList"
border
style=
"width:100%;margin-top: 15px;"
>
<el-table-column
label=
"Json表达式"
width=
"350"
>
<el-table-column
label=
"Json表达式"
width=
"350"
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.check"
>
</el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"比较符"
width=
"250"
>
<el-table-column
label=
"比较符"
width=
"250"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.comparator"
placeholder=
"请选择"
>
<el-option
v-for=
"item in selectAssertionList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</
template
>
</el-table-column>
<el-table-column
label=
"预期结果"
width=
"350"
>
<el-table-column
label=
"预期结果"
width=
"350"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.expect"
>
</el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"AssertionDelete(scope.$index)"
style=
"height:40px"
>
删除
</el-button>
</
template
>
...
...
src/views/auto/AddInterface.vue
View file @
b633c278
...
...
@@ -41,6 +41,7 @@
</el-collapse-item>
<!-- Headers添加 -->
<el-collapse-item
title=
"请求头"
name=
"2"
>
<el-button
type=
"primary"
@
click=
"DialogVisible=true"
style=
"margin-top:10px"
>
导 入
</el-button>
<!-- Header参数添加 -->
<el-table
:data=
"headersList"
border
style=
"width:100%;margin-top:15px;"
>
<el-table-column
label=
"参数名称"
width=
"200"
>
...
...
@@ -57,7 +58,7 @@
</el-table-column>
<el-table-column
label=
"是否必填"
width=
"150"
style=
"text-align:center"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.isRequired"
active-color=
"#13ce66"
inactive-color=
"#A9A9A9"
active-text=
"是"
inactive-text=
"否"
@
change=
"changeState($event,'1')
"
></el-switch>
<el-switch
v-model=
"scope.row.isRequired"
active-color=
"#13ce66"
inactive-color=
"#A9A9A9"
active-text=
"是"
inactive-text=
"否"
:active-value=
"true"
:inactive-value=
"false
"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
width=
"250"
>
...
...
@@ -67,7 +68,7 @@
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"danger"
size=
"mini"
icon=
"el-icon-delete"
@
click=
"headerDelete(scope.$index)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"mini"
icon=
"el-icon-delete"
@
click=
"headerDelete(scope.$index)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -90,7 +91,7 @@
</el-table-column>
<el-table-column
label=
"是否必填"
width=
"150"
style=
"text-align:center"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.isRequired"
active-color=
"#13ce66"
inactive-color=
"#A9A9A9"
active-text=
"是"
inactive-text=
"否"
@
change=
"changeState($event,'2')
"
></el-switch>
<el-switch
v-model=
"scope.row.isRequired"
active-color=
"#13ce66"
inactive-color=
"#A9A9A9"
active-text=
"是"
inactive-text=
"否"
:active-value=
"true"
:inactive-value=
"false
"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
width=
"250"
>
...
...
@@ -123,7 +124,7 @@
</el-table-column>
<el-table-column
label=
"是否必填"
width=
"150"
style=
"text-align:center"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.isRequired"
active-color=
"#13ce66"
inactive-color=
"#A9A9A9"
active-text=
"是"
inactive-text=
"否"
@
change=
"changeState($event,'3')
"
></el-switch>
<el-switch
v-model=
"scope.row.isRequired"
active-color=
"#13ce66"
inactive-color=
"#A9A9A9"
active-text=
"是"
inactive-text=
"否"
:active-value=
"true"
:inactive-value=
"false
"
></el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
width=
"250"
>
...
...
@@ -146,6 +147,18 @@
<el-button
type=
"primary"
@
click=
"addInterfaceFrom"
>
确 定
</el-button>
</div>
<el-dialog
title=
"解析CURL"
:visible.sync=
"DialogVisible"
width=
"40%"
>
<el-form>
<el-form-item
label=
"接口路径:"
>
<el-input
v-model=
"interfaceUrl"
style=
"width:500px"
type=
"textarea"
:rows=
"8"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"DialogVisible=false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"importMsg"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</template>
...
...
@@ -153,7 +166,8 @@
import
{
getModulList
,
addInterface
,
editInterface
editInterface
,
getInterfaceUrl
}
from
'
@/api/getAotoInterface
'
export
default
{
data
()
{
...
...
@@ -242,7 +256,9 @@ export default {
moduleInfo
:
{
pageNum
:
1
,
pageSize
:
100
}
},
DialogVisible
:
false
,
interfaceUrl
:
''
}
},
created
()
{
...
...
@@ -288,7 +304,7 @@ export default {
paramsName
:
''
,
paramsValue
:
''
,
isRequired
:
true
,
examples
:
''
,
//
examples: '',
remarks
:
''
})
},
...
...
@@ -297,7 +313,7 @@ export default {
paramsName
:
''
,
paramsValue
:
''
,
isRequired
:
true
,
examples
:
''
,
//
examples: '',
remarks
:
''
})
},
...
...
@@ -306,7 +322,7 @@ export default {
paramsName
:
''
,
paramsValue
:
''
,
isRequired
:
true
,
examples
:
''
,
//
examples: '',
remarks
:
''
})
},
...
...
@@ -322,24 +338,6 @@ export default {
responseDelete
(
index
)
{
this
.
responseList
.
splice
(
index
,
1
)
},
// 状态按钮
changeState
(
e
,
str
)
{
if
(
e
===
true
&&
str
===
'
1
'
)
{
this
.
headersList
.
isRequired
=
e
}
else
{
this
.
headersList
.
isRequired
=
e
}
if
(
e
===
true
&&
str
===
'
2
'
)
{
this
.
paramList
.
isRequired
=
e
}
else
{
this
.
paramList
.
isRequired
=
e
}
if
(
e
===
true
&&
str
===
'
3
'
)
{
this
.
responseList
.
isRequired
=
e
}
else
{
this
.
responseList
.
isRequired
=
e
}
},
// 刷新列表
sendResh
()
{
// bus使用
...
...
@@ -398,6 +396,42 @@ export default {
cancelInterfaceFrom
()
{
// 返回列表页
this
.
$router
.
push
(
'
InterfaceList
'
)
},
// 导入heads和请求参数
importMsg
()
{
getInterfaceUrl
({
code
:
this
.
interfaceUrl
}).
then
((
resp
)
=>
{
// console.log('iiii', resp)
var
newHeaderList
=
resp
.
data
.
data
.
headersList
newHeaderList
.
map
((
item
)
=>
{
this
.
headersList
.
push
(
Object
.
assign
(
{},
{
paramsName
:
item
.
paramsName
,
paramsValue
:
item
.
paramsValue
,
isRequired
:
true
,
remarks
:
item
.
remarks
}
)
)
})
var
newParamList
=
resp
.
data
.
data
.
parametersList
newParamList
.
map
((
item
)
=>
{
this
.
paramList
.
push
(
Object
.
assign
(
{},
{
paramsName
:
item
.
paramsName
,
paramsValue
:
item
.
paramsValue
,
isRequired
:
true
,
remarks
:
item
.
remarks
}
)
)
})
this
.
DialogVisible
=
false
})
}
}
}
...
...
src/views/auto/EditScene.vue
View file @
b633c278
This diff is collapsed.
Click to expand it.
src/views/jira/Notify.vue
View file @
b633c278
...
...
@@ -169,14 +169,14 @@
<el-row
v-for=
"(item, index) in editPipelineForm.pipelineList"
:key=
"index"
>
<el-col
:span=
"6"
>
<div
style=
"text-align: center;margin-top:5px"
>
<el-select
v-model=
"item.serviceName"
placeholder=
"请选择服务"
@
change=
"selectServiceModel(item.serviceName)"
clearable
>
<el-select
v-model=
"item.serviceName"
filterable
placeholder=
"请选择服务"
@
change=
"selectServiceModel(item.serviceName)"
clearable
>
<el-option
v-for=
"item2 in serviceList"
:key=
"item2.name"
:label=
"item2.name"
:value=
"item2.name"
></el-option>
</el-select>
</div>
</el-col>
<el-col
:span=
"6"
>
<div
style=
"text-align: center;margin-top:5px"
>
<el-select
v-model=
"item.serviceBranch"
placeholder=
"请选择分支"
clearable
@
focus=
"focusevent(item.serviceName)"
>
<el-select
v-model=
"item.serviceBranch"
filterable
placeholder=
"请选择分支"
clearable
@
focus=
"focusevent(item.serviceName)"
>
<el-option
v-for=
"item2 in serviceBranchList"
:key=
"item2.name"
:label=
"item2.name"
:value=
"item2.name"
></el-option>
</el-select>
</div>
...
...
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