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
d115a73b
Commit
d115a73b
authored
May 24, 2021
by
王晓铜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
样式修改
parent
8e2c4828
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
509 additions
and
320 deletions
+509
-320
global.css
src/assets/css/global.css
+20
-1
AddCase.vue
src/views/auto/AddCase.vue
+65
-43
AddInterface.vue
src/views/auto/AddInterface.vue
+8
-6
CaseList.vue
src/views/auto/CaseList.vue
+24
-20
EditScene.vue
src/views/auto/EditScene.vue
+98
-51
InterfaceList.vue
src/views/auto/InterfaceList.vue
+21
-21
ModelList.vue
src/views/auto/ModelList.vue
+98
-56
ProjectList.vue
src/views/auto/ProjectList.vue
+94
-71
SceneList.vue
src/views/auto/SceneList.vue
+81
-51
No files found.
src/assets/css/global.css
View file @
d115a73b
...
...
@@ -35,4 +35,23 @@ html, body, #app {
-webkit-transition
:
border-bottom-color
.3s
;
transition
:
border-bottom-color
.3s
;
outline
:
0
;
}
\ No newline at end of file
}
.el-textarea__inner
{
display
:
block
;
resize
:
vertical
;
/* padding: 5px 15px; */
line-height
:
2
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
width
:
100%
;
font-size
:
inherit
;
color
:
#606266
;
background-color
:
#FFF
;
background-image
:
none
;
border
:
1px
solid
#DCDFE6
;
border-radius
:
4px
;
-webkit-transition
:
border-color
.2s
cubic-bezier
(
.645
,
.045
,
.355
,
1
);
transition
:
border-color
.2s
cubic-bezier
(
.645
,
.045
,
.355
,
1
);
margin-top
:
10px
;
height
:
40px
;
}
src/views/auto/AddCase.vue
View file @
d115a73b
This diff is collapsed.
Click to expand it.
src/views/auto/AddInterface.vue
View file @
d115a73b
...
...
@@ -41,7 +41,7 @@
</el-collapse-item>
<!-- Headers添加 -->
<el-collapse-item
title=
"请求头"
name=
"2"
>
<
el-button
type=
"success"
plain
class=
"el-icon-circle-plus"
@
click=
"AddHeaderListRow()"
>
添加行
</el-button
>
<
!--
<el-button
type=
"success"
plain
class=
"el-icon-circle-plus"
@
click=
"AddHeaderListRow()"
>
添加行
</el-button>
--
>
<!-- Header参数添加 -->
<el-table
:data=
"headersList"
border
style=
"width:100%;margin-top:15px;"
>
<el-table-column
label=
"参数名称"
width=
"200"
>
...
...
@@ -73,14 +73,15 @@
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"danger"
@
click=
"headerDelete(scope.$index)"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"headerDelete(scope.$index)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<el-button
type=
"success"
plain
class=
"el-icon-circle-plus"
style=
"margin-top:10px"
@
click=
"AddHeaderListRow()"
>
添加行
</el-button>
</el-collapse-item>
<!-- 参数添加 -->
<el-collapse-item
title=
"请求参数"
name=
"3"
>
<
el-button
type=
"success"
plain
class=
"el-icon-circle-plus"
@
click=
"AddParamsListRow()"
>
添加行
</el-button
>
<
!-- <el-button type="success" plain class="el-icon-circle-plus" @click="AddParamsListRow()">添加行</el-button> --
>
<el-table
:data=
"paramList"
border
style=
"width:100%;margin-top: 15px;"
>
<el-table-column
label=
"参数名称"
width=
"200"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -111,14 +112,14 @@
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"danger"
@
click=
"paramsDelete(scope.$index)"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"paramsDelete(scope.$index)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<el-button
type=
"success"
plain
class=
"el-icon-circle-plus"
style=
"margin-top:10px"
@
click=
"AddParamsListRow()"
>
添加行
</el-button>
</el-collapse-item>
<!-- 响应参数添加 -->
<el-collapse-item
title=
"响应参数"
name=
"4"
>
<el-button
type=
"success"
plain
class=
"el-icon-circle-plus"
@
click=
"AddResponseListRow()"
>
添加行
</el-button>
<el-table
:data=
"responseList"
border
style=
"width:100%;margin-top: 15px;"
>
<el-table-column
label=
"参数名称"
width=
"200"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -149,10 +150,11 @@
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"danger"
@
click=
"responseDelete(scope.$index)"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"danger"
icon=
"el-icon-delete"
@
click=
"responseDelete(scope.$index)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<el-button
type=
"success"
plain
class=
"el-icon-circle-plus"
style=
"mragin-top:10px"
@
click=
"AddResponseListRow()"
>
添加行
</el-button>
</el-collapse-item>
</el-collapse>
</el-form>
...
...
src/views/auto/CaseList.vue
View file @
d115a73b
...
...
@@ -20,8 +20,8 @@
<el-table-column
label=
"操作"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"success"
icon=
"el-icon-link"
@
click=
"executeCaseFrom(scope.row)"
>
执行
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"editCaseFrom(scope.row)"
>
编辑
</el-button>
<
el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delCaseFrom(scope.row)"
>
删除
</el-button
>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"editCaseFrom(scope.row)"
>
编辑
</el-button>
<
!--
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delCaseFrom(scope.row)"
>
删除
</el-button>
--
>
</slot>
</el-table-column>
</el-table>
...
...
@@ -43,7 +43,11 @@
</
template
>
<
script
>
import
{
getModulList
}
from
'
@/api/getAotoInterface
'
import
{
singleCaseList
,
delCase
,
executeCase
}
from
'
@/api/getAutoCase
'
import
{
singleCaseList
,
executeCase
// delCase
}
from
'
@/api/getAutoCase
'
// import bus from '@/utils/bus'
export
default
{
data
()
{
...
...
@@ -147,23 +151,23 @@ export default {
.
catch
(()
=>
{})
},
// 删除用例
delCaseFrom
(
row
)
{
this
.
delCase
.
testcaseId
=
row
.
id
this
.
openMessage
(
'
您确定要删除吗?
'
,
'
删除
'
,
()
=>
{
delCase
(
this
.
delCase
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
$message
.
success
(
'
删除成功!
'
)
this
.
getCaseList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
})
},
//
delCaseFrom(row) {
//
this.delCase.testcaseId = row.id
//
this.openMessage('您确定要删除吗?', '删除', () => {
//
delCase(this.delCase)
//
.then((resp) => {
//
if (resp.data.data === true) {
//
this.$message.success('删除成功!')
//
this.getCaseList()
//
} else if (resp.data.data === false) {
//
this.$message.error(resp.data.msg)
//
}
//
})
//
.catch((error) => {
//
this.$message({ type: 'error', message: error })
//
})
//
})
//
},
handleSizeChange
(
newSize
)
{
this
.
queryModuleInfo
.
pageSize
=
newSize
this
.
getCaseList
()
...
...
src/views/auto/EditScene.vue
View file @
d115a73b
This diff is collapsed.
Click to expand it.
src/views/auto/InterfaceList.vue
View file @
d115a73b
...
...
@@ -27,7 +27,7 @@
<el-table-column
label=
"操作"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"editInterfaceFrom(scope.row)"
>
编辑
</el-button>
<
el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delInterfaceFrom(scope.row)"
>
删除
</el-button
>
<
!--
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delInterfaceFrom(scope.row)"
>
删除
</el-button>
--
>
</slot>
</el-table-column>
</el-table>
...
...
@@ -41,8 +41,8 @@
import
{
getModulList
,
getProjectList
,
interfaceDetailList
,
delInterface
interfaceDetailList
//
delInterface
}
from
'
@/api/getAotoInterface
'
// 引入组件
import
bus
from
'
@/utils/bus
'
...
...
@@ -149,25 +149,25 @@ export default {
doit
()
})
.
catch
(()
=>
{})
},
// 删除接口方法
delInterfaceFrom
(
row
)
{
this
.
delInterfaceParam
.
interfaceId
=
row
.
id
this
.
openMessage
(
'
您确定要删除吗?
'
,
'
删除
'
,
()
=>
{
delInterface
(
this
.
delInterfaceParam
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
$message
.
success
(
'
删除成功!
'
)
this
.
getInterfaceDetailList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
})
}
// 删除接口方法
// delInterfaceFrom(row) {
// this.delInterfaceParam.interfaceId = row.id
// this.openMessage('您确定要删除吗?', '删除', () => {
// delInterface(this.delInterfaceParam)
// .then((resp) => {
// if (resp.data.data === true) {
// this.$message.success('删除成功!')
// this.getInterfaceDetailList()
// } else if (resp.data.data === false) {
// this.$message.error(resp.data.msg)
// }
// })
// .catch((error) => {
// this.$message({ type: 'error', message: error })
// })
// })
// }
}
}
</
script
>
...
...
src/views/auto/ModelList.vue
View file @
d115a73b
...
...
@@ -16,29 +16,30 @@
<el-table-column
label=
"操作"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"openEditDialog(scope.row)"
>
编辑
</el-button>
<
el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delModelFrom(scope.row)"
>
删除
</el-button
>
<
!--
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delModelFrom(scope.row)"
>
删除
</el-button>
--
>
</slot>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryModuleInfo.pageNum"
:page-size=
"queryModuleInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
></el-pagination>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryModuleInfo.pageNum"
:page-size=
"queryModuleInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
></el-pagination>
</el-card>
<!-- 新增模块 -->
<el-dialog
title=
"新增模块"
:visible.sync=
"DialogVisible"
@
close=
"closeAddDialog"
width=
"30%"
>
<el-form
ref=
"
modelFormRef"
:rules=
"rules"
:model=
"m
odelForm"
label-width=
"90px"
>
<el-form
ref=
"
addModelFormRef"
:rules=
"rules"
:model=
"addM
odelForm"
label-width=
"90px"
>
<el-form-item
label=
"模块名称:"
prop=
"name"
style=
"width:400px"
>
<el-input
v-model=
"
m
odelForm.name"
></el-input>
<el-input
v-model=
"
addM
odelForm.name"
></el-input>
</el-form-item>
<el-form-item
label=
"所属项目:"
prop=
"projectId"
>
<el-select
v-model=
"
m
odelForm.projectId"
placeholder=
"请选择项目"
clearable
style=
"width:310px"
>
<el-select
v-model=
"
addM
odelForm.projectId"
placeholder=
"请选择项目"
clearable
style=
"width:310px"
>
<el-option
v-for=
"item in projectList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"模块描述:"
prop=
"description"
style=
"width:400px"
>
<el-input
v-model=
"
m
odelForm.description"
></el-input>
<el-input
v-model=
"
addM
odelForm.description"
></el-input>
</el-form-item>
<el-form-item
label=
"域名:"
prop=
"domain"
style=
"width:400px"
>
<el-input
v-model=
"
m
odelForm.domain"
></el-input>
<el-input
v-model=
"
addM
odelForm.domain"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
...
...
@@ -46,6 +47,29 @@
<el-button
type=
"primary"
@
click=
"addModelFrom"
>
确 定
</el-button>
</span>
</el-dialog>
<!-- 编辑模块 -->
<el-dialog
title=
"编辑模块"
:visible.sync=
"DialogEditVisible"
width=
"30%"
>
<el-form
ref=
"editModelFormRef"
:rules=
"rules"
:model=
"editModelForm"
label-width=
"90px"
>
<el-form-item
label=
"模块名称:"
prop=
"name"
style=
"width:400px"
>
<el-input
v-model=
"editModelForm.name"
></el-input>
</el-form-item>
<el-form-item
label=
"所属项目:"
prop=
"projectId"
>
<el-select
v-model=
"editModelForm.projectId"
placeholder=
"请选择项目"
clearable
style=
"width:310px"
>
<el-option
v-for=
"item in projectList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"模块描述:"
prop=
"description"
style=
"width:400px"
>
<el-input
v-model=
"editModelForm.description"
></el-input>
</el-form-item>
<el-form-item
label=
"域名:"
prop=
"domain"
style=
"width:400px"
>
<el-input
v-model=
"editModelForm.domain"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"DialogEditVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"editModelFrom"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</
template
>
...
...
@@ -54,8 +78,8 @@ import {
getModulList
,
getProjectList
,
addModul
,
editModel
,
delModel
editModel
//
delModel
}
from
'
@/api/getAotoInterface
'
export
default
{
data
()
{
...
...
@@ -67,13 +91,21 @@ export default {
totalNum
:
0
,
modelList
:
[],
projectList
:
[],
modelForm
:
{
addModelForm
:
{
name
:
''
,
projectId
:
''
,
description
:
''
,
domain
:
''
},
editModelForm
:
{
id
:
''
,
name
:
''
,
projectId
:
''
,
description
:
''
,
domain
:
''
},
DialogVisible
:
false
,
DialogEditVisible
:
false
,
delModelParam
:
{
moduleId
:
''
},
...
...
@@ -141,48 +173,58 @@ export default {
// 添加模块按钮
addModelFrom
()
{
this
.
$refs
.
m
odelFormRef
.
validate
((
valid
)
=>
{
this
.
$refs
.
addM
odelFormRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
false
}
else
{
if
(
this
.
modelForm
.
id
)
{
editModel
(
this
.
modelForm
).
then
((
resp
)
=>
{
// 添加模块
addModul
(
this
.
addModelForm
)
.
then
((
resp
)
=>
{
console
.
log
(
'
保存信息
'
,
this
.
modelForm
)
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogVisible
=
false
this
.
$message
.
success
(
'
修改成功!
'
)
this
.
$message
.
success
(
'
新增成功!
'
)
this
.
modelList
.
name
=
''
this
.
modelList
.
projectName
=
''
this
.
modelList
.
description
=
''
this
.
modelList
.
domain
=
''
this
.
getModelList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
}
else
{
// 添加模块
addModul
(
this
.
modelForm
)
.
then
((
resp
)
=>
{
console
.
log
(
'
保存信息
'
,
this
.
modelForm
)
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogVisible
=
false
this
.
$message
.
success
(
'
新增成功!
'
)
this
.
modelList
.
name
=
''
this
.
modelList
.
projectName
=
''
this
.
modelList
.
description
=
''
this
.
modelList
.
domain
=
''
this
.
getModelList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
}
)
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
}
)
})
}
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
}
)
}
}
)
},
// 编辑保存按钮
editModelFrom
()
{
this
.
$refs
.
editModelFormRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
false
}
else
{
editModel
(
this
.
editModelForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogEditVisible
=
false
this
.
$message
.
success
(
'
修改成功!
'
)
this
.
getModelList
(
)
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
}
)
}
})
},
// 编辑模块
openEditDialog
(
row
)
{
this
.
DialogVisible
=
true
this
.
modelForm
=
row
this
.
DialogEditVisible
=
true
this
.
editModelForm
.
id
=
row
.
id
this
.
editModelForm
.
name
=
row
.
name
this
.
editModelForm
.
projectId
=
row
.
projectId
this
.
editModelForm
.
description
=
row
.
description
this
.
editModelForm
.
domain
=
row
.
domain
},
// 对话框方法
openMessage
(
message
,
confirmText
,
doit
)
{
...
...
@@ -198,26 +240,26 @@ export default {
.
catch
(()
=>
{})
},
closeAddDialog
()
{
this
.
$refs
.
modelFormRef
.
resetFields
()
},
// 删除模块
delModelFrom
(
row
)
{
this
.
delModelParam
.
moduleId
=
row
.
id
this
.
openMessage
(
'
您确定要删除吗?
'
,
'
删除
'
,
()
=>
{
delModel
(
this
.
delModelParam
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
$message
.
success
(
'
删除成功!
'
)
this
.
getModelList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
})
this
.
$refs
.
addModelFormRef
.
resetFields
()
}
// 删除模块
// delModelFrom(row) {
// this.delModelParam.moduleId = row.id
// this.openMessage('您确定要删除吗?', '删除', () => {
// delModel(this.delModelParam)
// .then((resp) => {
// if (resp.data.data === true) {
// this.$message.success('删除成功!')
// this.getModelList()
// } else if (resp.data.data === false) {
// this.$message.error(resp.data.msg)
// }
// })
// .catch((error) => {
// this.$message({ type: 'error', message: error })
// })
// })
// }
}
}
</
script
>
src/views/auto/ProjectList.vue
View file @
d115a73b
...
...
@@ -4,7 +4,7 @@
<div
class=
"filter"
>
<!--
<el-input
placeholder=
"请输入项目名称"
style=
"width:15%"
></el-input>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"searchMockList"
>
查询
</el-button>
-->
<el-button
type=
"primary"
icon=
"el-icon-circle-plus"
@
click=
"Dialog
Visible =
true"
>
新增
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-circle-plus"
@
click=
"Dialog
AddVisible=
true"
>
新增
</el-button>
</div>
<el-table
:data=
"projectList"
border
style=
"width: 100%;margin-top:20px"
>
<!--
<el-table-column
prop=
"id"
label=
"序号"
width=
"80px"
></el-table-column>
-->
...
...
@@ -16,7 +16,7 @@
<el-table-column
label=
"操作"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"openEditDialog(scope.row)"
>
编辑
</el-button>
<
el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delProjectFrom(scope.row)"
>
删除
</el-button
>
<
!--
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delProjectFrom(scope.row)"
>
删除
</el-button>
--
>
</slot>
</el-table-column>
</el-table>
...
...
@@ -24,31 +24,41 @@
:total=
"totalNum"
>
</el-pagination>
</el-card>
<!-- 新增页面
/编辑页面
-->
<el-dialog
title=
"新增项目"
:visible.sync=
"DialogVisible"
@
close=
"closeAddDialog"
width=
"30%"
>
<el-form
ref=
"
projectFormRef"
:rules=
"rules"
:model=
"p
rojectForm"
label-width=
"90px"
>
<!-- 新增页面 -->
<el-dialog
title=
"新增项目"
:visible.sync=
"Dialog
Add
Visible"
@
close=
"closeAddDialog"
width=
"30%"
>
<el-form
ref=
"
addProjectFormRef"
:rules=
"rules"
:model=
"addP
rojectForm"
label-width=
"90px"
>
<el-form-item
label=
"项目名称:"
prop=
"name"
style=
"width:400px"
>
<el-input
v-model=
"
p
rojectForm.name"
></el-input>
<el-input
v-model=
"
addP
rojectForm.name"
></el-input>
</el-form-item>
<el-form-item
label=
"项目描述:"
prop=
"description"
style=
"width:400px"
>
<el-input
v-model=
"
p
rojectForm.description"
></el-input>
<el-input
v-model=
"
addP
rojectForm.description"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"Dialog
Visible =
false"
>
取 消
</el-button>
<el-button
@
click=
"Dialog
AddVisible=
false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"addPojectFrom"
>
确 定
</el-button>
</span>
</el-dialog>
<!--编辑页面-->
<el-dialog
title=
"编辑项目"
:visible.sync=
"DialogEditVisible"
width=
"30%"
>
<el-form
ref=
"editProjectFormRef"
:rules=
"rules"
:model=
"editProjectForm"
label-width=
"90px"
>
<el-form-item
label=
"项目名称:"
prop=
"name"
style=
"width:400px"
>
<el-input
v-model=
"editProjectForm.name"
></el-input>
</el-form-item>
<el-form-item
label=
"项目描述:"
prop=
"description"
style=
"width:400px"
>
<el-input
v-model=
"editProjectForm.description"
></el-input>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"DialogEditVisible=false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"editPojectFrom"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
getProjectList
,
addProject
,
editProject
,
delProject
}
from
'
@/api/getAotoInterface
'
import
{
getProjectList
,
addProject
,
editProject
}
from
'
@/api/getAotoInterface
'
export
default
{
data
()
{
return
{
...
...
@@ -58,8 +68,14 @@ export default {
},
projectList
:
[],
totalNum
:
0
,
DialogVisible
:
false
,
projectForm
:
{
DialogAddVisible
:
false
,
DialogEditVisible
:
false
,
addProjectForm
:
{
name
:
''
,
description
:
''
},
editProjectForm
:
{
id
:
''
,
name
:
''
,
description
:
''
},
...
...
@@ -81,7 +97,8 @@ export default {
trigger
:
'
blur
'
}
]
}
},
clearMsg
:
false
}
},
created
()
{
...
...
@@ -99,54 +116,60 @@ export default {
searchMockList
()
{},
// 新增确定按钮
addPojectFrom
()
{
this
.
$refs
.
p
rojectFormRef
.
validate
((
valid
)
=>
{
this
.
$refs
.
addP
rojectFormRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
false
}
else
{
if
(
this
.
projectForm
.
id
)
{
// 编辑接口
editProject
(
this
.
projectForm
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogVisible
=
false
this
.
$message
.
success
(
'
修改成功!
'
)
this
.
getProjectList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
}
else
{
// 添加接口
addProject
(
this
.
projectForm
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogVisible
=
false
this
.
$message
.
success
(
'
新增成功!
'
)
this
.
projectForm
.
name
=
''
this
.
projectForm
.
description
=
''
this
.
getProjectList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
}
// 添加接口
addProject
(
this
.
addProjectForm
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogAddVisible
=
false
this
.
getProjectList
()
this
.
$message
.
success
(
'
新增成功!
'
)
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
}
})
},
// 编辑确定按钮
editPojectFrom
()
{
// 编辑接口
this
.
$refs
.
editProjectFormRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
false
}
else
{
editProject
(
this
.
editProjectForm
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogEditVisible
=
false
this
.
$message
.
success
(
'
修改成功!
'
)
this
.
getProjectList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
}
})
},
// 对话框关闭后清空文本框数据
closeAddDialog
()
{
this
.
$refs
.
p
rojectFormRef
.
resetFields
()
this
.
$refs
.
addP
rojectFormRef
.
resetFields
()
},
// 编辑信息回显
openEditDialog
(
row
)
{
this
.
DialogVisible
=
true
this
.
projectForm
=
row
this
.
DialogEditVisible
=
true
this
.
editProjectForm
.
id
=
row
.
id
this
.
editProjectForm
.
name
=
row
.
name
this
.
editProjectForm
.
description
=
row
.
description
},
// 对话框方法
openMessage
(
message
,
confirmText
,
doit
)
{
...
...
@@ -162,23 +185,23 @@ export default {
.
catch
(()
=>
{})
},
// 删除项目
delProjectFrom
(
row
)
{
this
.
delProjectParam
.
projectId
=
row
.
id
this
.
openMessage
(
'
您确定要删除吗?
'
,
'
删除
'
,
()
=>
{
delProject
(
this
.
delProjectParam
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
$message
.
success
(
'
删除成功!
'
)
this
.
getProjectList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
})
},
//
delProjectFrom(row) {
//
this.delProjectParam.projectId = row.id
//
this.openMessage('您确定要删除吗?', '删除', () => {
//
delProject(this.delProjectParam)
//
.then((resp) => {
//
if (resp.data.data === true) {
//
this.$message.success('删除成功!')
//
this.getProjectList()
//
} else if (resp.data.data === false) {
//
this.$message.error(resp.data.msg)
//
}
//
})
//
.catch((error) => {
//
this.$message({ type: 'error', message: error })
//
})
//
})
//
},
// 分页展示
handleSizeChange
(
newSize
)
{
this
.
queryModuleInfo
.
pageSize
=
newSize
...
...
src/views/auto/SceneList.vue
View file @
d115a73b
...
...
@@ -18,7 +18,7 @@
<el-button
type=
"success"
icon=
"el-icon-link"
@
click=
"executeSceneFrom(scope.row)"
>
执行
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"editeSceneFrom(scope.row)"
>
编辑场景
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"editeSceneCaseFrom(scope.row)"
>
编辑场景用例
</el-button>
<
el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"deleSceneFrom(scope.row)"
>
删除
</el-button
>
<
!--
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"deleSceneFrom(scope.row)"
>
删除
</el-button>
--
>
</slot>
</el-table-column>
</el-table>
...
...
@@ -36,14 +36,14 @@
<json-viewer
:expand-depth=
3
:value=
"requestData"
></json-viewer>
</div>
</el-card>
<!-- 新增
页面 /编辑
页面-->
<el-dialog
title=
"新增场景"
:visible.sync=
"DialogVisible"
width=
"
5
0%"
@
close=
"closeAddDialog"
>
<el-form
ref=
"
sceneFormAddRef"
:rules=
"rules"
:model=
"s
ceneForm"
label-width=
"90px"
>
<!-- 新增
场景
页面-->
<el-dialog
title=
"新增场景"
:visible.sync=
"DialogVisible"
width=
"
3
0%"
@
close=
"closeAddDialog"
>
<el-form
ref=
"
addSceneFormRef"
:rules=
"rules"
:model=
"addS
ceneForm"
label-width=
"90px"
>
<el-form-item
label=
"场景名称:"
prop=
"name"
style=
"width:400px"
>
<el-input
v-model=
"
sceneForm.name
"
></el-input>
<el-input
v-model=
"
addSceneForm.name"
placeholder=
"请输入场景
"
></el-input>
</el-form-item>
<el-form-item
label=
"项目名称:"
prop=
"projectId"
style=
"width:400px"
>
<el-select
v-model=
"
s
ceneForm.projectId"
placeholder=
"请选择项目"
clearable
>
<el-select
v-model=
"
addS
ceneForm.projectId"
placeholder=
"请选择项目"
clearable
>
<el-option
v-for=
"item in projectList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
...
...
@@ -53,13 +53,30 @@
<el-button
type=
"primary"
@
click=
"addSceneFrom"
>
确 定
</el-button>
</span>
</el-dialog>
<!-- 编辑场景页面-->
<el-dialog
title=
"编辑场景"
:visible.sync=
"DialogEditVisible"
width=
"30%"
>
<el-form
ref=
"editSceneFormRef"
:rules=
"rules"
:model=
"editSceneForm"
label-width=
"90px"
>
<el-form-item
label=
"场景名称:"
prop=
"name"
style=
"width:400px"
>
<el-input
v-model=
"editSceneForm.name"
></el-input>
</el-form-item>
<el-form-item
label=
"项目名称:"
prop=
"projectId"
style=
"width:400px"
>
<el-select
v-model=
"editSceneForm.projectId"
placeholder=
"请选择项目"
clearable
>
<el-option
v-for=
"item in projectList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"DialogEditVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"editSceneFrom"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
getSceneList
,
addSecene
,
delSecne
,
//
delSecne,
executeScene
,
editScene
}
from
'
@/api/getAutoScene
'
...
...
@@ -78,12 +95,18 @@ export default {
},
sceneList
:
[],
totalNum
:
0
,
sceneForm
:
{
addSceneForm
:
{
name
:
''
,
projectId
:
''
},
editSceneForm
:
{
id
:
''
,
name
:
''
,
projectId
:
''
},
projectList
:
[],
DialogVisible
:
false
,
DialogEditVisible
:
false
,
rules
:
{
name
:
[
{
...
...
@@ -148,8 +171,10 @@ export default {
},
// 编辑场景
editeSceneFrom
(
row
)
{
this
.
DialogVisible
=
true
this
.
sceneForm
=
row
this
.
DialogEditVisible
=
true
this
.
editSceneForm
.
id
=
row
.
id
this
.
editSceneForm
.
name
=
row
.
name
this
.
editSceneForm
.
projectId
=
row
.
projectId
},
// 编辑场景用例
editeSceneCaseFrom
(
row
)
{
...
...
@@ -158,7 +183,6 @@ export default {
// bus使用
this
.
$nextTick
(
function
()
{
// DOM 现在更新了
this
.
$bus
.
$emit
(
'
scenemsg
'
,
row
)
})
},
...
...
@@ -176,23 +200,23 @@ export default {
.
catch
(()
=>
{})
},
// 删除场景
deleSceneFrom
(
row
)
{
this
.
delSceneForm
.
sceneId
=
row
.
id
this
.
openMessage
(
'
您确定要删除吗?
'
,
'
删除
'
,
()
=>
{
delSecne
(
this
.
delSceneForm
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
$message
.
success
(
'
删除成功!
'
)
this
.
getSecneList
()
}
else
if
(
resp
.
data
.
data
===
false
)
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
})
},
//
deleSceneFrom(row) {
//
this.delSceneForm.sceneId = row.id
//
this.openMessage('您确定要删除吗?', '删除', () => {
//
delSecne(this.delSceneForm)
//
.then((resp) => {
//
if (resp.data.data === true) {
//
this.$message.success('删除成功!')
//
this.getSecneList()
//
} else if (resp.data.data === false) {
//
this.$message.error(resp.data.msg)
//
}
//
})
//
.catch((error) => {
//
this.$message({ type: 'error', message: error })
//
})
//
})
//
},
handleSizeChange
(
newSize
)
{
this
.
queryModuleInfo
.
pageSize
=
newSize
this
.
getSecneList
()
...
...
@@ -203,37 +227,43 @@ export default {
},
// 添加场景
addSceneFrom
()
{
this
.
$refs
.
sceneFormAdd
Ref
.
validate
((
valid
)
=>
{
this
.
$refs
.
addSceneForm
Ref
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
false
}
else
{
if
(
this
.
sceneForm
.
id
)
{
editScene
(
this
.
sceneForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogVisible
=
false
this
.
$message
.
success
(
'
修改成功!
'
)
this
.
getSecneList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
}
else
{
addSecene
(
this
.
sceneForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogVisible
=
false
this
.
$message
.
success
(
'
新增成功!
'
)
this
.
getSecneList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
}
addSecene
(
this
.
addSceneForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogVisible
=
false
this
.
$message
.
success
(
'
新增成功!
'
)
this
.
getSecneList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
}
})
},
// 编辑场景用例按钮
editSceneFrom
()
{
this
.
$refs
.
editSceneFormRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
false
}
else
{
editScene
(
this
.
editSceneForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
DialogEditVisible
=
false
this
.
$message
.
success
(
'
修改成功!
'
)
this
.
getSecneList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
}
})
},
// 关闭清空数据
closeAddDialog
()
{
this
.
$refs
.
sceneFormAdd
Ref
.
resetFields
()
this
.
$refs
.
addSceneForm
Ref
.
resetFields
()
}
}
}
...
...
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