Explorar o código

优化缺陷详情

qinzhipeng_v %!s(int64=5) %!d(string=hai) anos
pai
achega
e732fe6225
Modificáronse 2 ficheiros con 56 adicións e 288 borrados
  1. 16 16
      src/styles/PublicStyle/index.scss
  2. 40 272
      src/views/projectManage/bugList/details/index.vue

+ 16 - 16
src/styles/PublicStyle/index.scss

@@ -48,14 +48,14 @@
 
 .status_color { // 迭代状态样式修改(颜色)
   /deep/ input {
-    color: #6AB4FF;
-    border: 1px solid #6AB4FF;
+    color: #6AB4FF !important;
+    border: 1px solid #6AB4FF !important;
     border-color: #6AB4FF !important;
-    font-weight: 900;
+    font-weight: 900 !important;
   }
   /deep/ .el-input__suffix {
     color: #6AB4FF !important;
-    right: 1px;
+    right: 1px !important;
   }
   /deep/ .el-select__caret {
     color: #6AB4FF !important;
@@ -80,14 +80,14 @@
 
   .status_color2 { // 迭代状态样式修改(颜色)
     /deep/ input {
-      color: #7ED321;
-       border: 1px solid #7ED321;
+      color: #7ED321 !important;
+       border: 1px solid #7ED321 !important;
        border-color: #7ED321 !important;
-           font-weight: 900;
+           font-weight: 900 !important;
     }
      /deep/ .el-input__suffix {
       color: #7ED321 !important;
-      right: 1px;
+      right: 1px !important;
     }
     /deep/ .el-select__caret {
       color: #7ED321 !important;
@@ -96,14 +96,14 @@
 
   .status_color3 { // 迭代状态样式修改(颜色)
     /deep/ input {
-      color: #D675F0;
-       border: 1px solid #D675F0;
+      color: #D675F0 !important;
+       border: 1px solid #D675F0 !important;
        border-color: #D675F0 !important;
-           font-weight: 900;
+           font-weight: 900 !important;
     }
      /deep/ .el-input__suffix {
       color: #D675F0 !important;
-      right: 1px;
+      right: 1px !important;
     }
     /deep/ .el-select__caret {
       color: #D675F0 !important;
@@ -128,14 +128,14 @@
 
   .status_color5 { // 迭代状态样式修改(颜色)
     /deep/ input {
-      color: rgb(255, 204, 102);
-       border: 1px solid rgb(255, 204, 102);
+      color: rgb(255, 204, 102) !important;
+       border: 1px solid rgb(163, 140, 94) !important;
        border-color: rgb(255, 204, 102) !important;
-           font-weight: 900;
+           font-weight: 900 !important;
     }
     /deep/ .el-input__suffix {
       color: rgb(255, 204, 102) !important;
-      right: 1px;
+      right: 1px !important;
     }
     /deep/ .el-select__caret {
       color: rgb(255, 204, 102) !important;

+ 40 - 272
src/views/projectManage/bugList/details/index.vue

@@ -1,24 +1,10 @@
 <template>
   <div v-loading="loading.drawer" class="bug-detail">
-    <div v-if="type!=='page'" style="padding: 15px 5px 5px 30px" class="bug_manage_container  bug_manage bug_manage_title">
-      <span style="font-size:18px;font-weight:500;color:#333b4a">{{ 'BUG-'+ id }}</span>
-      <el-button type="text" />
-      <dropdown
-        v-if="map.bugEnumList && typeof bug.status !== 'undefined'"
-        v-model="map.bugEnumList[bug.status]"
-        :options="bugStatusList(map.bugEnumList[bug.status])"
-        :size="'small'"
-        :class="{
-          'item-color' : map.bugEnumList[bug.status] === '待修复',
-          'item' : map.bugEnumList[bug.status] === '已完成',
-          'item1' : map.bugEnumList[bug.status] === '待测试',
-          'item2' : map.bugEnumList[bug.status] === 'Reopen',
-          'item3' : map.bugEnumList[bug.status] === 'Hold'
-        }"
-        style="margin-left: 20px"
-        class="button_status"
-        @command="openStatsDialog"
-      />
+    <div v-if="type!=='page'" style="padding: 15px 5px 5px 30px" class="Layout_space_between bug_manage_container bug_manage_title">
+      <div class="Layout_flex_start">
+        <span style="font-size:18px;font-weight:500;color:#333b4a; margin-right: 20px;">{{ 'BUG-'+ id }}</span>
+        <statusChange v-if="map.bugEnumList && typeof bug.status !== 'undefined'" :status-code="bug.status" :bug-data="bugData" />
+      </div>
       <div style="display: inline-block;float:right">
         <span class="newBtn" @click="getToDetails()"><i class="el-icon-document" /> 查看详情</span>
         <span class="newBtn" style="padding: 0 10px" @click="openQueryDialog()"><i class="el-icon-document-copy" /> 复制</span>
@@ -64,21 +50,7 @@
                   />
                 </el-form-item>
                 <el-form-item id="itemLength1" style="margin:0">
-                  <dropdown
-                    v-if="map.bugEnumList && typeof bug.status !== 'undefined'"
-                    v-model="map.bugEnumList[bug.status]"
-                    size="small"
-                    :class="{
-                      'item-color' : map.bugEnumList[bug.status] === '待修复',
-                      'item' : map.bugEnumList[bug.status] === '已完成',
-                      'item1' : map.bugEnumList[bug.status] === '待测试',
-                      'item2' : map.bugEnumList[bug.status] === 'Reopen',
-                      'item3' : map.bugEnumList[bug.status] === 'Hold'
-                    }"
-                    :options="bugStatusList(map.bugEnumList[bug.status])"
-                    class="button_status"
-                    @command="openStatsDialog"
-                  />
+                  <statusChange v-if="map.bugEnumList && typeof bug.status !== 'undefined'" :status-code="bug.status" :bug-data="bugData" />
                 </el-form-item>
                 <el-form-item id="itemLength2" style="margin:0;float:right">
                   <el-button size="small" class="button_delete2" @click="openDeleteDialog()">删除</el-button>
@@ -303,64 +275,10 @@
                   <div class="bug_manage_div">{{ bug.creatorList }}</div>
                 </el-form-item>
                 <el-form-item label="责任人" prop="assigner" :style="formHeight1 == 'type' ? { 'height': '60px' } : { 'height': 'auto' }">
-                  <el-select
-                    v-model="bug.assigner"
-                    class="current"
-                    filterable
-                    multiple
-                    remote
-                    placeholder="请输入姓名或邮箱前缀"
-                    :remote-method="searchAssigner"
-                    :loading="userLoading"
-                    @change="bugUpdate(bug,'userInfo')"
-                  >
-                    <el-option
-                      v-for="(item,index) in assignerOptions"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.idap"
-                    >
-                      <div style="display: flex;justify-content: start;">
-                        <div
-                          style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden"
-                        >{{ item.deptName }}</div>
-                        <div style="min-width:80px">{{ item.name }}</div>
-                        <div
-                          style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden"
-                        >{{ item.idap }}</div>
-                      </div>
-                    </el-option>
-                  </el-select>
+                  <search-people :value.sync="bug.assigner" :multiple="true" @change="bugUpdate(bug,'userInfo')" />
                 </el-form-item>
                 <el-form-item label="修复人" prop="currentHandler" :style="formHeight == 'type' ? { 'height': '60px' } : { 'height': 'auto' }">
-                  <el-select
-                    v-model="bug.currentHandler"
-                    class="current"
-                    multiple
-                    filterable
-                    remote
-                    placeholder="请输入姓名或邮箱前缀"
-                    :remote-method="searchCurrentHandler"
-                    :loading="userLoading"
-                    @change="bugUpdate(bug,'userInfo')"
-                  >
-                    <el-option
-                      v-for="(item,index) in currentHandlerOptions"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.idap"
-                    >
-                      <div style="display: flex;justify-content: start;">
-                        <div
-                          style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden"
-                        >{{ item.deptName }}</div>
-                        <div style="min-width:80px">{{ item.name }}</div>
-                        <div
-                          style="min-width:100px;color: #8492a6; font-size: 13px; overflow:hidden"
-                        >{{ item.idap }}</div>
-                      </div>
-                    </el-option>
-                  </el-select>
+                  <search-people :value.sync="bug.currentHandler" :multiple="true" @change="bugUpdate(bug,'userInfo')" />
                 </el-form-item>
               </el-form>
             </el-aside>
@@ -573,36 +491,20 @@
         v-if="statusDialogVisible"
         :visible.sync="statusDialogVisible"
         width="33%"
-        :title="statusDialogTitle"
+        title="确认删除"
         class="public_task"
         :append-to-body="true"
         :close-on-click-modal="false"
       >
         <div class="blueStripe" />
-        <el-form v-if="statusDialogTitle !== '删除确认'" label-width="110px" label-position="left" :model="statusDialogForm" :rules="rules">
-          <el-form-item v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'" label="修复结果" prop="repairResult" class="bug_manage_dialog">
-            <el-select v-model="statusDialogForm.repairResult" style="width: 100%" @change="modifyResult(statusDialogForm.repairResult)">
-              <el-option v-for="item in enums.repairResultEnumList" :key="item.code" :label="item.name" :value="item.code" />
-            </el-select>
-          </el-form-item>
-          <el-form-item v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'" label="缺陷原因" prop="bugReason" class="bug_manage_dialog">
-            <el-select v-model="statusDialogForm.bugReason" style="width: 100%">
-              <el-option v-for="item in enums.bugReasonEnumList" :key="item.code" :label="item.name" :value="item.code" />
-            </el-select>
-          </el-form-item>
+        <el-form label-width="110px" label-position="left" :model="statusDialogForm" :rules="rules">
           <el-form-item v-if="statusDialogTitle === '待测试'" label="修复方式" class="bug_manage_dialog bug_manage_dialog_fixMethod">
             <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" placeholder="请输入具体原因,得出结论的过程,具体修复过程或方式" maxlength="300" show-word-limit rows="4" />
           </el-form-item>
-          <el-form-item v-if="statusDialogTitle === 'Reopen'" label="Reopen原因" prop="reasonOrDesc">
-            <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" placeholder="请输入Reopen" maxlength="300" show-word-limit rows="4" />
-          </el-form-item>
-          <el-form-item v-if="statusDialogTitle === 'Hold'" label="Hold原因" prop="reasonOrDesc">
-            <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" maxlength="300" show-word-limit rows="4" />
-          </el-form-item>
         </el-form>
-        <div v-else style="text-align:center;line-height: 150px">是否要删除当前缺陷?</div>
+        <div style="text-align:center;line-height: 150px">是否要删除当前缺陷?</div>
         <template v-slot:footer>
-          <el-button size="small" @click="statusDialogCancel">取 消</el-button>
+          <el-button size="small" @click="statusDialogVisible = false">取 消</el-button>
           <el-button size="small" type="primary" @click="statusDialogConfirm">确 定</el-button>
         </template>
       </el-dialog>
@@ -638,10 +540,11 @@
 </template>
 
 <script>
+import statusChange from '@/views/projectManage/bugList/details/statusChange'
 import fackClickOutSide from './fackClickOutSide.js'
 import E from 'wangeditor'
 import '@/styles/PublicStyle/index.scss'
-import { getCommentList, addComment, getMemberInfo } from '@/api/requirement.js'
+import { getCommentList, addComment } from '@/api/requirement.js'
 import {
   bugDetails,
   bugGetEnum,
@@ -652,11 +555,11 @@ import {
   settingQueryBizModuleList,
   operationLogBug
 } from '@/api/defectManage.js'
-import Dropdown from './dropdown.vue'
 import normalDialog from '@/components/dialog/normalDialog'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
 import axios from 'axios'
 import { deepClone } from '@/utils/global'
+import searchPeople from '@/components/select/searchPeople' // 人员select
 
 document.body.onpaste = function(event) {
   const data = (event.clipboardData || window.clipboardData)
@@ -676,9 +579,10 @@ document.body.onpaste = function(event) {
 export default {
   name: 'BugDetails',
   components: {
-    Dropdown,
     createdBug,
-    normalDialog
+    normalDialog,
+    statusChange,
+    searchPeople
   },
   mixins: [fackClickOutSide],
   props: {
@@ -735,16 +639,12 @@ export default {
       num: 0,
       formHeight: '',
       formHeight1: '',
-      userLoading: false,
       statusDialogVisible: false,
-      statusDialogTitle: '',
       statusDialogForm: {},
       options: [
         { name: '测试', code: 1 },
         { name: '测试2', code: 2 }
       ],
-      assignerOptions: [],
-      currentHandlerOptions: [],
       bug: {},
       bugModel: {},
       editor: null,
@@ -764,28 +664,14 @@ export default {
       showWordLimit: false,
       showRule: false,
       rules: {
-        assigner: [
-          { required: true, message: '责任人不可为空', trigger: 'change' }
-        ],
-        currentHandler: [
-          { required: true, message: '修复人不可为空', trigger: 'change' }
-        ],
-        bugName: [
-          { required: true, message: '标题不可为空', trigger: 'blur' }
-        ],
-        bugReason: [
-          { required: true, message: '请选择缺陷原因', trigger: 'change' }
-        ],
-        repairResult: [
-          { required: true, message: '请选择修复结果', trigger: 'change' }
-        ],
-        reasonOrDesc: [
-          { required: true, message: '请输入Reopen原因', trigger: 'blur' }
-        ]
+        assigner: [{ required: true, message: '责任人不可为空', trigger: 'change' }],
+        currentHandler: [{ required: true, message: '修复人不可为空', trigger: 'change' }],
+        bugName: [{ required: true, message: '标题不可为空', trigger: 'blur' }]
       },
       showCopyFile: false, // 复制文件对话框
       imageName: { name: null },
       imageUrl: null,
+      bugData: {}, // bug数据
       uploadButton: this.drawerShow,
       imageRules: {
         name: [
@@ -829,7 +715,6 @@ export default {
     this.bugGetEnum()
     this.$nextTick(() => {
       this.bugGet(this.id, false).then(res => {
-        this.PersonnelData()
         this.changeWidthOnBlur()
         releaseList().then(res => {
           this.appClientList = res.data.appClient // 客户端
@@ -846,7 +731,6 @@ export default {
   },
   methods: {
     handleClick(tab, event) {
-      console.log(tab, event)
       operationLogBug(this.id).then(res => {
         this.changeRecord = res.data
       })
@@ -858,7 +742,6 @@ export default {
       this.formHeight = ''
       this.formHeight1 = ''
       this.bugGet(this.id, false).then(res => {
-        this.PersonnelData()
         this.changeWidthOnBlur()
         this.getCommentList()
         releaseList().then(res => {
@@ -868,38 +751,6 @@ export default {
         this.editor.txt.html(this.bugDescribe === null ? '' : this.bugDescribe)
       })
     },
-    PersonnelData() {
-      this.assignerOptions = []
-      for (const i in this.bug.assignerList.length) {
-        this.searchUser(this.bug.assigner[i]).then(res => {
-          this.assignerOptions = res.data
-        })
-      }
-      this.currentHandlerOptions = []
-      for (const i in this.bug.currentHandlerList.length) {
-        this.searchUser(this.bug.currentHandler[i]).then(res => {
-          this.currentHandlerOptions = res.data
-        })
-      }
-    },
-    modifyResult(val) { // 修复结果
-      switch (val) {
-        case 9:
-          this.$set(this.statusDialogForm, 'bugReason', 9)
-          break
-        case 11:
-          this.$set(this.statusDialogForm, 'bugReason', 11)
-          break
-        case 2:
-          this.$set(this.statusDialogForm, 'bugReason', 10)
-          break
-        case 3:
-          this.$set(this.statusDialogForm, 'bugReason', 12)
-          break
-        default: this.$set(this.statusDialogForm, 'bugReason', '')
-          break
-      }
-    },
     listen(event) {
       event.preventDefault() // 阻止浏览器默认换行操作
       return false
@@ -1169,16 +1020,6 @@ export default {
           this.bug = res.data
           this.bug.currentHandler = res.data.currentHandler.split(',')
           this.bug.assigner = res.data.assigner.split(',')
-          this.bug.currentHandler.map(item => {
-            this.searchUser(item).then(res => {
-              this.currentHandlerOptions.push(res.data[0])
-            })
-          })
-          this.bug.assigner.map(item => {
-            this.searchUser(item).then(res => {
-              this.assignerOptions.push(res.data[0])
-            })
-          })
           this.bugModel = JSON.parse(JSON.stringify(res.data))
           this.bugDescribe = this.bug.bugDescribe
           if (this.bugDescribe !== null) {
@@ -1241,16 +1082,13 @@ export default {
       })
     },
     bugUpdate(form, loadingStr) {
+      console.log(form, loadingStr, 'update')
       if (form.currentHandler.length > 0) {
         if (form.assigner.length > 0) {
           this.formHeight = ''
           this.formHeight1 = ''
           loadingStr ? this.loading[loadingStr] = true : this.loading.fullscreen = true
-          const userData = {
-            id: '',
-            ename: this.userInformation,
-            name: this.userNames
-          }
+          const userData = { id: '', ename: this.userInformation, name: this.userNames }
           this.num = 1
           let objData
           if (form) {
@@ -1283,13 +1121,6 @@ export default {
         this.formHeight = 'type'
       }
     },
-    searchUser(query) {
-      this.userLoading = true
-      return getMemberInfo({ memberIDAP: query }).then(res => {
-        this.userLoading = false
-        return res
-      })
-    },
     getBusinessLinePlatformModule() {
       settingQueryBizModuleList(Number(localStorage.getItem('bizId'))).then(res => {
         this.business_platform_Modular = res.data.map(item => ({
@@ -1309,18 +1140,6 @@ export default {
         }))
       })
     },
-    searchAssigner(val) {
-      this.assignerOptions = []
-      this.searchUser(val).then(res => {
-        this.assignerOptions = res.data
-      })
-    },
-    searchCurrentHandler(val) {
-      this.currentHandlerOptions = []
-      this.searchUser(val).then(res => {
-        this.currentHandlerOptions = res.data
-      })
-    },
     bugNameChangeWith(val) {
       if (this.showWordLimit) {
         this.showWordLimit = false
@@ -1330,71 +1149,21 @@ export default {
       this.bugNameTextareaStyle.width = val
     },
     openDeleteDialog() {
-      this.openStatsDialog({ code: null, name: '删除确认' })
-    },
-    openStatsDialog(item) {
       this.statusDialogForm = JSON.parse(JSON.stringify(this.bug))
-      this.statusDialogForm.status = item.code
-      if (item.name === '待修复') {
-        this.bugUpdate(this.statusDialogForm, 'title').then(res => {
-          this.bugGet(this.bug.id, false)
-        })
-        return
-      }
-      if (item.name === '待测试') {
-        this.$set(this.statusDialogForm, 'repairResult', 1)
-        this.$set(this.statusDialogForm, 'bugReason', '')
-      }
-      if (item.name === '已完成') {
-        this.$set(this.statusDialogForm, 'repairResult', this.bug.repairResult)
-        this.$set(this.statusDialogForm, 'bugReason', this.bug.bugReason)
-      }
-      this.statusDialogTitle = item.name
+      this.statusDialogForm.status = null
       this.statusDialogVisible = true
     },
-    statusDialogCancel() {
-      this.statusDialogVisible = false
-    },
     statusDialogConfirm() {
-      if (this.statusDialogTitle === '删除确认') {
-        this.bugDelete().then(res => {
-          this.statusDialogVisible = false
-          if (res.code === 200) {
-            if (this.type === 'page') {
-              this.$router.push({ name: '缺陷' })
-            } else {
-              this.$emit('delete', false)
-            }
+      this.bugDelete().then(res => {
+        this.statusDialogVisible = false
+        if (res.code === 200) {
+          if (this.type === 'page') {
+            this.$router.push({ name: '缺陷' })
+          } else {
+            this.$emit('delete', false)
           }
-        })
-      } else if (this.statusDialogTitle === '待测试') {
-        if (typeof this.statusDialogForm.bugReason === 'undefined' || this.statusDialogForm.bugReason === null) {
-          this.$message.warning('请选择缺陷原因')
         }
-        this.postDialogForm().then(res => {
-          this.getCommentList()
-        })
-      } else if (this.statusDialogTitle === '已完成') {
-        if (typeof this.statusDialogForm.bugReason === 'undefined' || this.statusDialogForm.bugReason === null) {
-          this.$message.warning('请选择缺陷原因')
-          return
-        }
-        if (typeof this.statusDialogForm.repairResult === 'undefined' || this.statusDialogForm.repairResult === null) {
-          this.$message.warning('请选择修复结果')
-          return
-        }
-        this.postDialogForm()
-      } else if (this.statusDialogTitle === 'Reopen') {
-        if (!this.statusDialogForm.reasonOrDesc) {
-          this.$message.warning('请输入Reopen原因')
-          return
-        }
-        this.postDialogForm().then(res => {
-          this.getCommentList()
-        })
-        // this.addComment()
-        this.statusDialogVisible = false
-      }
+      })
     },
     postDialogForm() {
       this.statusDialogForm.id = this.id
@@ -1500,11 +1269,11 @@ export default {
   line-height: 14px;
   padding: 7px 10px;
 }
-.bug_manage_title .button_delete2,.button_status .el-button {
+/* .bug_manage_title .button_delete2,.button_status .el-button {
   padding: 7px 10px;
   font-size: 14px;
   font-weight: normal;
-}
+} */
 .bug_manage_dialog .el-dialog {
   border-radius:4px;
 }
@@ -1520,7 +1289,6 @@ export default {
 .layout_header,
 .layout_aside,
 .layout_main {
-  /* border-radius: 4px; */
   background-color: #ffffff;
 }
 .bug_manage_dialog_fixMethod .el-form-item__label {
@@ -1725,11 +1493,11 @@ border-color: #DCDFE6;
   color: #409EFF;
   cursor: pointer;
 }
-.current:hover{
-  cursor: pointer;
-  border-radius: 4px;
-  border: 1px solid #DCDFE6;
-}
+// .current:hover{
+//   cursor: pointer;
+//   border-radius: 4px;
+//   border: 1px solid #DCDFE6;
+// }
 .module_title{
   display:flex;
   align-items: center;