|
@@ -176,6 +176,7 @@
|
|
|
<script>
|
|
|
import { bugGetEnum, taskListCreate, bugCreate } from '@/api/defectManage'
|
|
|
import { projectGetTypeMap, teamMembers, getTaskData } from '@/api/projectPage'
|
|
|
+import { queryTestPlanCaseList } from '@/api/caseProject.js'
|
|
|
import axios from 'axios'
|
|
|
|
|
|
export default {
|
|
@@ -234,7 +235,6 @@ export default {
|
|
|
userNames: localStorage.getItem('realname'),
|
|
|
fileDbList: [],
|
|
|
dis: false
|
|
|
- // fileDbList: [{ name: '智慧平台.png', url: 'http://pt-starimg.didistatic.com/static/starimg/node/qo4sKioLko1571277086594.png' }, { name: '智慧平台.png', url: 'http://pt-starimg.didistatic.com/static/starimg/node/qo4sKioLko1571277086594.png' }]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -251,7 +251,6 @@ export default {
|
|
|
this.$message({ showClose: true, message: '文件正在上传······', type: 'success' })
|
|
|
},
|
|
|
handleChange(response, file, fileList) {
|
|
|
- // setTimeout(function() {
|
|
|
this.fileDbList = []
|
|
|
this.fileList = fileList.slice(-3)
|
|
|
for (var a of this.fileList) {
|
|
@@ -260,7 +259,6 @@ export default {
|
|
|
this.accessory = JSON.stringify(this.fileDbList)
|
|
|
this.dis = false
|
|
|
this.$message({ showClose: true, message: '文件上传成功', type: 'success' })
|
|
|
- // }, 500)
|
|
|
},
|
|
|
async bugListSelect() {
|
|
|
await bugGetEnum().then(res => {
|
|
@@ -277,7 +275,6 @@ export default {
|
|
|
if (this.$route.query.id) {
|
|
|
await getTaskData(this.$route.query.id).then(res => {
|
|
|
this.taskStatus = res.data.status
|
|
|
- // const pauseTaskId = this.taskIdStr.filter(value=>value.name === res.data.name)
|
|
|
this.$set(this.form, 'taskId', res.data.id)
|
|
|
this.$set(this.form, 'bizId', res.data.bizId)
|
|
|
this.$set(this.form, 'platformType', res.data.type)
|
|
@@ -295,6 +292,27 @@ export default {
|
|
|
} else {
|
|
|
this.form.creator = this.userNames
|
|
|
}
|
|
|
+ if (this.$route.query.ids) {
|
|
|
+ var url = window.location.href // 获取url中"?"符后的字串
|
|
|
+ var caseFolderId = url.split('&testPlanId=')
|
|
|
+ var id = caseFolderId[0].split('?ids=')
|
|
|
+ var data_status = { testPlanId: caseFolderId[1], id: id[1] }
|
|
|
+ queryTestPlanCaseList(data_status).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ var caseInfo = res.data[0].caseInfo
|
|
|
+ var case_arr = JSON.parse(caseInfo.description.split('{}'))
|
|
|
+ var e = []
|
|
|
+ case_arr.map(item => {
|
|
|
+ e.push({ '测试步骤': item.description, '预期结果': item.expectedResult })
|
|
|
+ })
|
|
|
+ var title = res.data[0].caseInfo.title
|
|
|
+ const arrString = e.reduce((sumString, item) => { return sumString + '测试步骤:' + item['测试步骤'] + ' ' + '预期结果:' + item['预期结果'] + '\n' }, '')
|
|
|
+ var case_caseCondition = '前置条件 : "' + caseInfo.caseCondition + ' \n ' + 'api : ' + caseInfo.api + ' \n ' + '问题描述 : ' + ' \n ' + arrString
|
|
|
+ this.$set(this.form, 'bugName', title)
|
|
|
+ this.$set(this.form, 'bugDescribe', case_caseCondition)
|
|
|
+ this.$set(this.form, 'taskId', caseInfo.taskId)
|
|
|
+ })
|
|
|
+ }
|
|
|
this.getMember() // 保证bizId存在
|
|
|
},
|
|
|
forkDown() {
|