Quellcode durchsuchen

测试计划管理

qinzhipeng_v vor 5 Jahren
Ursprung
Commit
f855e07b1d

+ 4 - 4
src/apiConfig/api.js

@@ -1,10 +1,10 @@
 /*eslint-disable*/   //规避eslint的检查,如没有eslint可不写
-// export const mockUrl = 'http://10.179.24.176:8980' // 线下
-export const mockUrl = 'http://10.179.24.123:8980' // 线上
+export const mockUrl = 'http://10.179.24.176:8980' // 线下
+// export const mockUrl = 'http://10.179.24.123:8980' // 线上
 
 // export const mockUrl = 'http://172.23.162.226:8980' // 舒宁本地
 
 export const qualityUrl = 'http://10.179.209.19:8898' // 质量度量
 
-// export const HMvehicleUrl = 'http://10.96.113.197:9999' // 电单车 线下
-export const HMvehicleUrl = 'http://10.179.91.236:9999' // 电单车 线上
+export const HMvehicleUrl = 'http://10.96.113.197:9999' // 电单车 线下
+// export const HMvehicleUrl = 'http://10.179.91.236:9999' // 电单车 线上

+ 2 - 2
src/apiConfig/mock.js

@@ -1,4 +1,4 @@
 /*eslint-disable*/   //规避eslint的检查,如没有eslint可不写
-// export const mockUrl = 'http://10.179.88.110:8089' // stable
-export const mockUrl = 'http://mock.Intra.xiaojukeji.com' // 线上
+export const mockUrl = 'http://10.179.88.110:8089' // stable
+// export const mockUrl = 'http://mock.Intra.xiaojukeji.com' // 线上
 // export const mockUrl = 'http://10.179.101.226:8089' // test

+ 2 - 2
src/apiConfig/virtualDevices.js

@@ -1,3 +1,3 @@
 /*eslint-disable*/ //规避eslint的检查,如没有eslint可不写
-export const mockUrl = 'http://10.179.91.236:9999/virtual-devices' // 线上
-// export const mockUrl = 'http://10.96.113.197:9999/virtual-devices' // 线下
+// export const mockUrl = 'http://10.179.91.236:9999/virtual-devices' // 线上
+export const mockUrl = 'http://10.96.113.197:9999/virtual-devices' // 线下

+ 22 - 4
src/views/Platform/bugManage/bugCreate.vue

@@ -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() {

+ 13 - 13
src/views/Platform/presentation/testPage.vue

@@ -589,20 +589,20 @@ export default {
       e.codes === '2' ? this.taskids = e.id : ''
       if (e.codes === '3') {
         this.pegs = '3'
-      }
-      this.startId = e.id
-      queryTestPlanCaseList({ pageSize: this.pageSize, curIndex: this.curIndex, testPlanId: e.id }).then(res => {
-        this.gridData = []
-        res.data.map(item => {
-          item.caseInfo.thrr = e.id
-          item.caseInfo.ids = item.id
-          item.caseInfo.status_case = item.status
-          item.caseInfo.keys = item.status
-          this.gridData.push(item.caseInfo)
+        this.startId = e.id
+        queryTestPlanCaseList({ pageSize: this.pageSize, curIndex: this.curIndex, testPlanId: e.id }).then(res => {
+          this.gridData = []
+          res.data.map(item => {
+            item.caseInfo.thrr = e.id
+            item.caseInfo.ids = item.id
+            item.caseInfo.status_case = item.status
+            item.caseInfo.keys = item.status
+            this.gridData.push(item.caseInfo)
+          })
+          this.total = this.gridData.length
         })
-        this.total = this.gridData.length
-      })
-      this.implement()
+        this.implement()
+      }
     },
 
     Unclicked(e, index, ele) {

+ 2 - 1
src/views/Platform/useCasePage.vue

@@ -608,7 +608,8 @@ export default {
         formData_s.append('file', f)
         axios.post('http://star.xiaojukeji.com/upload/img.node', formData_s, { headers: { 'Content-Type': 'application/json; charset=UTF-8' }}).then(res => {
           console.error(res.url)
-          this.grid_xmind.push({ 'name': 'f.name', 'url': 'http:' + 'res.url' })
+          window.open(res.url)
+          this.grid_xmind.push({ 'name': f.name, 'url': 'http:' + res.url })
           var xmind_code = {
             id: this.startId,
             xmindUrl: JSON.stringify(this.grid_xmind),