Browse Source

ucd提bug

wenbobowen 4 years ago
parent
commit
48eeed44bc

+ 19 - 0
src/api/usecase/index.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+import { requestIp } from '@/apiConfig/requestIP'
+// const TeamManagement = 'http://127.0.0.1:4523/mock/368525'
+
+// export function getOnlineProblemListRequest(data) {
+//   return request({
+//     url: requestIp + '/case-management/case/getDetails',
+//     method: 'post',
+//     data
+//   })
+// }
+// 获取详情
+export function getExecutionDetialRes(params) {
+  return request({
+    url: requestIp + '/case-management/taskExecutionRecord/getDetails',
+    method: 'GET',
+    params
+  })
+}

+ 9 - 0
src/views/projectManage/bugList/bugindex.vue

@@ -395,6 +395,15 @@ export default {
     }
     this.$store.state.data.status = true
   },
+  mounted() {
+    const { ucd = null } = this.$route.query
+    if (ucd) {
+      this.modalShow = true
+      this.$nextTick(() => {
+        this.$refs.createdBug.init(3)
+      })
+    }
+  },
   destroyed() {
     this.$store.state.data.status = false
   },

+ 44 - 0
src/views/projectManage/bugList/file/createdBug.vue

@@ -206,6 +206,7 @@ import {
 } from '@/api/defectManage'
 import searchPeople from '@/components/select/searchPeople' // 人员select
 import { memberQueryMemberInfoByIDAPorName } from '@/api/projectIndex'
+import { getExecutionDetialRes } from '@/api/usecase'
 import normalDialog from '@/components/dialog/normalDialog'
 import '@/views/projectManage/bugList/css/index.css'
 import normalArea from '@/components/input/normalArea' // 富文本
@@ -412,6 +413,49 @@ export default {
           })
         }
       }
+      if (e === 3) { // 用例新建缺陷
+        const { ucd: id = null } = this.$route.query
+        this.titleName = '新建缺陷'
+        getExecutionDetialRes({ id }).then(res => {
+          console.log('res', res)
+          const {
+            id,
+            name,
+            precondition,
+            stepDescription,
+            expectedResult
+          } = res.data.caseDetails || {}
+          const {
+            executeResult
+          } = res.data.taskExecutionRecord || {}
+          this.formInline = {
+            ...this.formInline,
+            discoveryMeth: 1,
+            bugName: `【C-${id}】${name}-${executeResult.label ? `${executeResult.label}-` : ''}提bug`,
+            bugDescribe: `<p>【前置条件】</p>\n${precondition}\n<p>【执行步骤】</p>\n${stepDescription}\n<p>【预期结果】</p>\n${expectedResult}\<p>【实际结果】</p>`
+          }
+        })
+        // if (ele !== undefined) {
+        //   this.formInline = ele
+        //   this.getTaskList(ele.taskName)
+        //   this.show2 = true
+        //   this.formInline.creatorList = this.userNames
+        //   this.$set(this.formInline, 'bugName', '')
+        //   this.$set(this.formInline, 'accessory', '')
+        //   this.options = []
+        //   this.formData = []
+        //   this.formData1 = []
+        //   this.formData = this.formInline.assigner.concat(
+        //     this.formInline.currentHandler
+        //   )
+        //   this.formData1 = this.unique6(this.formData)
+        //   this.formData1.map(item => {
+        //     this.searchUser(item).then(res => {
+        //       this.options.push(res.data[0])
+        //     })
+        //   })
+        // }
+      }
       this.$nextTick(() => {
         document.getElementById('soll').scrollTop = 0
         this.editr = true