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
9017ae25
Commit
9017ae25
authored
Jan 06, 2022
by
王晓铜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据库重新选择
parent
7551b1b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
28 deletions
+66
-28
DetailTestDescription.vue
src/views/qa/DetailTestDescription.vue
+32
-8
TestDescription.vue
src/views/qa/TestDescription.vue
+34
-20
No files found.
src/views/qa/DetailTestDescription.vue
View file @
9017ae25
...
@@ -300,20 +300,44 @@ export default {
...
@@ -300,20 +300,44 @@ export default {
},
},
// 保存方法
// 保存方法
saveTestDescription
()
{
saveTestDescription
()
{
// 将数组对象转化为Json字符串
// 判断是否选择了重复分支
this
.
addTestDescriptionForm
.
serviceAndBranch
=
JSON
.
stringify
(
for
(
var
a
=
0
;
a
<
this
.
serviceAndBranchList
.
length
;
a
++
)
{
this
.
serviceAndBranchList
for
(
var
b
=
a
+
1
;
b
<
this
.
serviceAndBranchList
.
length
;
b
++
)
{
)
if
(
this
.
addTestDescriptionForm
.
apollo
=
JSON
.
stringify
(
this
.
apolloList
)
this
.
serviceAndBranchList
[
a
].
serviceName
===
this
.
addTestDescriptionForm
.
database
=
JSON
.
stringify
(
this
.
databaseList
)
this
.
serviceAndBranchList
[
b
].
serviceName
// console.log('参数信息', this.addTestDescriptionForm)
)
{
return
this
.
$message
.
error
(
'
已经选择了已有的分支,请重新选择新分支!
'
)
}
}
}
// 判断添加的数据库key值是否有重复
for
(
var
i
=
0
;
i
<
this
.
databaseList
.
length
;
i
++
)
{
for
(
var
j
=
i
+
1
;
j
<
this
.
databaseList
.
length
;
j
++
)
{
if
(
this
.
databaseList
[
i
].
db
===
this
.
databaseList
[
j
].
db
)
{
return
this
.
$message
.
error
(
'
已经选择了已有的数据库,请重新选择数据库!
'
)
}
}
}
this
.
$refs
.
addTestDescriptionRef
.
validate
((
valid
)
=>
{
this
.
$refs
.
addTestDescriptionRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
if
(
!
valid
)
{
return
false
return
false
}
else
{
}
else
{
// 将数组对象转化为Json字符串
this
.
addTestDescriptionForm
.
serviceAndBranch
=
JSON
.
stringify
(
this
.
serviceAndBranchList
)
this
.
addTestDescriptionForm
.
apollo
=
JSON
.
stringify
(
this
.
apolloList
)
this
.
addTestDescriptionForm
.
database
=
JSON
.
stringify
(
this
.
databaseList
)
editTestDescription
(
this
.
addTestDescriptionForm
).
then
((
resp
)
=>
{
editTestDescription
(
this
.
addTestDescriptionForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
businessCode
===
'
0000
'
)
{
if
(
resp
.
data
.
businessCode
===
'
0000
'
)
{
this
.
$message
.
success
(
resp
.
data
.
msg
)
this
.
$message
.
success
(
'
编辑成功!
'
)
this
.
isShowDetail
=
true
this
.
isShowDetail
=
true
// 返回列表页
// 返回列表页
this
.
$router
.
push
({
path
:
`/qa/testDescription`
})
this
.
$router
.
push
({
path
:
`/qa/testDescription`
})
...
...
src/views/qa/TestDescription.vue
View file @
9017ae25
...
@@ -186,7 +186,7 @@
...
@@ -186,7 +186,7 @@
<el-input
v-model=
"addTestDescriptionForm.api"
></el-input>
<el-input
v-model=
"addTestDescriptionForm.api"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"备注:"
class=
"input-style"
>
<el-form-item
label=
"备注:"
class=
"input-style"
>
<el-input
v-model=
"addTestDescriptionForm.scope"
type=
"textarea"
></el-input>
<el-input
v-model=
"addTestDescriptionForm.scope"
type=
"textarea"
autosize
></el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
...
@@ -380,37 +380,51 @@ export default {
...
@@ -380,37 +380,51 @@ export default {
this
.
addTestDescriptionForm
.
scope
=
''
this
.
addTestDescriptionForm
.
scope
=
''
this
.
addTestDescriptionForm
.
updateTime
=
''
this
.
addTestDescriptionForm
.
updateTime
=
''
this
.
serviceAndBranchList
=
[]
this
.
serviceAndBranchList
=
[]
// this.serviceAndBranchList.push({
// serviceName: '',
// branch: '',
// developer: this.getUserName
// })
this
.
apolloList
=
[]
this
.
apolloList
=
[]
this
.
databaseList
=
[]
this
.
databaseList
=
[]
},
},
// 保存数据按钮
// 保存数据按钮
addTestDescriptionFrom
()
{
addTestDescriptionFrom
()
{
// 判断添加的数据是否有重复
// 判断是否选择了重复分支
// console.log('888', this.databaseList)
for
(
var
a
=
0
;
a
<
this
.
serviceAndBranchList
.
length
;
a
++
)
{
// var newDatabaseList = []
for
(
var
b
=
a
+
1
;
b
<
this
.
serviceAndBranchList
.
length
;
b
++
)
{
// this.database.forEach((element) => {
if
(
// if()
this
.
serviceAndBranchList
[
a
].
serviceName
===
// })
this
.
serviceAndBranchList
[
b
].
serviceName
// 将数组对象转化为Json字符串
)
{
this
.
addTestDescriptionForm
.
serviceAndBranch
=
JSON
.
stringify
(
return
this
.
$message
.
error
(
this
.
serviceAndBranchList
'
已经选择了已有的分支,请重新选择新分支!
'
)
)
this
.
addTestDescriptionForm
.
apollo
=
JSON
.
stringify
(
this
.
apolloList
)
}
this
.
addTestDescriptionForm
.
database
=
JSON
.
stringify
(
this
.
databaseList
)
}
}
// 判断添加的数据库key值是否有重复
for
(
var
i
=
0
;
i
<
this
.
databaseList
.
length
;
i
++
)
{
for
(
var
j
=
i
+
1
;
j
<
this
.
databaseList
.
length
;
j
++
)
{
if
(
this
.
databaseList
[
i
].
db
===
this
.
databaseList
[
j
].
db
)
{
return
this
.
$message
.
error
(
'
已经选择了已有的数据库,请重新选择数据库!
'
)
}
}
}
this
.
$refs
.
addTestDescriptionRef
.
validate
((
valid
)
=>
{
this
.
$refs
.
addTestDescriptionRef
.
validate
((
valid
)
=>
{
if
(
!
valid
)
{
if
(
!
valid
)
{
return
false
return
false
}
else
{
}
else
{
// 将数组对象转化为Json字符串
this
.
addTestDescriptionForm
.
serviceAndBranch
=
JSON
.
stringify
(
this
.
serviceAndBranchList
)
this
.
addTestDescriptionForm
.
apollo
=
JSON
.
stringify
(
this
.
apolloList
)
this
.
addTestDescriptionForm
.
database
=
JSON
.
stringify
(
this
.
databaseList
)
// 编辑测试文档
// 编辑测试文档
if
(
this
.
addTestDescriptionForm
.
id
)
{
if
(
this
.
addTestDescriptionForm
.
id
)
{
editTestDescription
(
this
.
addTestDescriptionForm
).
then
((
resp
)
=>
{
editTestDescription
(
this
.
addTestDescriptionForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
businessCode
===
'
0000
'
)
{
if
(
resp
.
data
.
businessCode
===
'
0000
'
)
{
this
.
$message
.
success
(
resp
.
data
.
msg
)
this
.
$message
.
success
(
'
修改成功!
'
)
this
.
DialogAddVisible
=
false
this
.
DialogAddVisible
=
false
this
.
getTestDescriptionList
()
this
.
getTestDescriptionList
()
}
else
{
}
else
{
...
@@ -421,7 +435,7 @@ export default {
...
@@ -421,7 +435,7 @@ export default {
// 添加测试文档
// 添加测试文档
addTestDescription
(
this
.
addTestDescriptionForm
).
then
((
resp
)
=>
{
addTestDescription
(
this
.
addTestDescriptionForm
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
businessCode
===
'
0000
'
)
{
if
(
resp
.
data
.
businessCode
===
'
0000
'
)
{
this
.
$message
.
success
(
resp
.
data
.
msg
)
this
.
$message
.
success
(
'
添加成功!
'
)
this
.
DialogAddVisible
=
false
this
.
DialogAddVisible
=
false
this
.
getTestDescriptionList
()
this
.
getTestDescriptionList
()
}
else
{
}
else
{
...
...
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