qinzhipeng_v преди 5 години
родител
ревизия
c73b40cba9

+ 0 - 187
src/components/StatusComponent/StatusComponent.vue

@@ -1,187 +0,0 @@
-<template>
-  <div>
-    <el-select
-      v-model="status"
-      :class="{
-        'status_color': status === 0,
-        'status_color2': status === 3,
-        'status_color5': status === 2,
-        'status_color1': status === 4,
-        'status_color3': status === 5
-      }"
-      class="public_botton"
-      size="mini"
-      @change="blurEvent(status)"
-    >
-      <el-option v-for="item in bugStatusList(status)" :key="item.code" :label="item.name" :value="item.code" />
-    </el-select>
-    <el-dialog
-      v-if="statusDialogVisible"
-      :visible.sync="statusDialogVisible"
-      width="30%"
-      :title="statusDialogTitle"
-      class="public_task"
-      :append-to-body="true"
-      :close-on-click-modal="false"
-      @close="modalClose"
-    >
-      <div class="blueStripe" />
-      <el-form ref="statusDialogForm" label-width="110px" label-position="left" :model="statusDialogForm" :rules="rules">
-        <el-form-item v-if="statusDialogTitle === '待测试'" label="修复结果" prop="repairResult" class="bug_manage_dialog">
-          <el-select v-model="statusDialogForm.repairResult" style="width: 100%">
-            <el-option v-for="item in 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 bugReasonEnumList" :key="item.code" :label="item.name" :value="item.code" />
-          </el-select>
-        </el-form-item>
-        <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 === '已完成'" label="修复结果" prop="repairResult" class="bug_manage_dialog">
-          <el-select v-model="statusDialogForm.repairResult" style="width: 100%">
-            <el-option v-for="item in repairResultEnumList" :key="item.code" :label="item.name" :value="item.code" />
-          </el-select>
-        </el-form-item>
-        <el-form-item v-if="statusDialogTitle === 'Reopen'" label="Reopen原因" prop="reasonOrDesc" class="bug_manage_dialog">
-          <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" class="bug_manage_dialog">
-          <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" maxlength="300" show-word-limit rows="4" />
-        </el-form-item>
-      </el-form>
-      <template v-slot:footer>
-        <el-button size="small" @click="modalClose()">取 消</el-button>
-        <el-button size="small" type="primary" @click="statusDialogConfirm">确 定</el-button>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { bugUpdate, bugGetEnum } from '@/api/defectManage'
-import '@/styles/PublicStyle/index.scss'
-
-export default {
-  props: {
-    title: { type: String, default: null }, // 标题
-    statusData: { type: Number, default: null }, // 选择的当前状态
-    statusRow: { type: Object, default: null } // 当前行数据
-  },
-  data() {
-    return {
-      userData: { id: '', ename: localStorage.getItem('username'), name: localStorage.getItem('realname') },
-      status: this.statusData, // 状态的code
-      statusDialogVisible: false, // dialog
-      bugEnumList: [], // 状态option
-      bugReasonEnumList: [], // 缺陷原因
-      repairResultEnumList: [], // 修复结果
-      statusDialogTitle: '', // 状态Name
-      statusDialogForm: {}, // 表单
-      staData: {},
-      statusCode: '',
-      rules: {
-        bugReason: [{ required: true, message: '请选择缺陷原因', trigger: ['blur', 'change'] }],
-        repairResult: [{ required: true, message: '请选择修复结果', trigger: ['blur', 'change'] }],
-        reasonOrDesc: [{ required: true, message: '请输入Reopen原因', trigger: ['blur', 'change'] }]
-      }
-    }
-  },
-  created() {
-    this.bugListSelect()
-  },
-  methods: {
-    blurEvent(status) { // 修改状态为0
-      this.statusCode = status
-      if (status === 0) {
-        this.statusRow.status = status
-        bugUpdate({ bugBaseInfo: this.statusRow, user: this.userData }).then(res => {
-          this.statusRow.isSelected = !this.statusRow.isSelected
-          if (res.code === 200) {
-            this.$emit('getBugList')
-          }
-          this.$message({ message: res.msg, type: res.msg })
-        })
-        return
-      }
-      let data = ''
-      this.bugEnumList.map(item => {
-        item.code === status ? data = item.name : ''
-      })
-      this.statusDialogTitle = data
-      this.statusDialogVisible = true
-    },
-    modalClose() { // 关闭dialog
-      this.statusDialogVisible = false
-      this.status = this.statusData
-    },
-    statusDialogConfirm() { // 点击确定 验证 修改
-      this.$refs.statusDialogForm.validate((valid) => {
-        if (valid) {
-          this.staData = this.statusRow
-          this.staData.status = this.statusCode
-          this.staData.reasonOrDesc = this.statusDialogForm.reasonOrDesc
-          this.staData.repairResult = this.statusDialogForm.repairResult
-          this.staData.bugReason = this.statusDialogForm.bugReason
-          const objData = { bugBaseInfo: this.staData, user: this.userData }
-          alert()
-          bugUpdate(objData).then(res => {
-            if (res.code === 200) {
-              this.statusDialogVisible = false
-              this.statusDialogForm = {}
-            } else if (res.code !== 200) {
-              this.$emit('getBugList')
-            }
-            this.$message({ message: res.msg, type: res.msg })
-          })
-        }
-      })
-    },
-    bugStatusList(status) { // 不同状态返回不同的option
-      if (status === 0) {
-        return this.bugEnumList.filter(item => {
-          return item.code === 0 || item.code === 2 || item.code === 5
-        })
-      }
-      if (status === 2) {
-        return this.bugEnumList.filter(item => {
-          return item.code === 2 || item.code === 3 || item.code === 4
-        })
-      }
-      if (status === 3) {
-        return this.bugEnumList.filter(item => {
-          return item.code === 3
-        })
-      }
-      if (status === 4) {
-        return this.bugEnumList.filter(item => {
-          return item.code === 2 || item.code === 5 || item.code === 4
-        })
-      }
-      if (status === 5) {
-        return this.bugEnumList.filter(item => {
-          return item.code === 5 || item.code === 2
-        })
-      }
-    },
-    bugListSelect() { // 获取下拉数据
-      bugGetEnum().then(res => {
-        this.bugEnumList = res.data.bugEnumList // status
-        this.repairResultEnumList = res.data.repairResultEnumList // 修复结果
-        this.bugReasonEnumList = res.data.bugReasonEnumList
-      })
-    }
-  }
-}
-</script>
-
-<style lang="scss">
-.btns .el-input--suffix .el-input__inner {
-  padding-right: 10px;
-  padding-left: 10px;
-  width: 73px;
-}
-
-</style>

+ 291 - 11
src/views/projectManage/bugList/bugindex.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div>
   <div>
     <el-container class="bgColor">
     <el-container class="bgColor">
-      <el-header v-if="type === 'page'" class="public_header">
+      <el-header v-if="type === 'page'" style="height: auto; margin-top: 1%; padding: 0 1%;">
         <el-row class="headerBg">
         <el-row class="headerBg">
           <div class="Layout_space_between">
           <div class="Layout_space_between">
             <div class="public_themeName">缺陷</div>
             <div class="public_themeName">缺陷</div>
@@ -429,7 +429,7 @@
           </el-row>
           </el-row>
         </el-row>
         </el-row>
       </el-header>
       </el-header>
-      <el-main :style="type === 'page'?{padding: '10px'}:{padding: '0'}">
+      <el-main :style="type === 'page'?{padding: '1%'}:{padding: '0'}">
         <el-row class="headerBg table_v" style=" padding-top: 0px;">
         <el-row class="headerBg table_v" style=" padding-top: 0px;">
           <el-col :span="24" style="min-height: 47vh;">
           <el-col :span="24" style="min-height: 47vh;">
             <div v-if="type !== 'page'" style="position: relative;top: 5px;right: 10px">
             <div v-if="type !== 'page'" style="position: relative;top: 5px;right: 10px">
@@ -469,7 +469,21 @@
               <el-table-column prop="priorityName" label="缺陷等级" align="center" />
               <el-table-column prop="priorityName" label="缺陷等级" align="center" />
               <el-table-column prop="bugStatusName" label="状态" min-width="110" align="center">
               <el-table-column prop="bugStatusName" label="状态" min-width="110" align="center">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
-                  <Status-component :title="'缺陷'" :status-data="scope.row.status" :status-row="scope.row" />
+                  <el-select
+                    v-model="scope.row.status"
+                    :class="{
+                      'status_color': scope.row.status === 0,
+                      'status_color2': scope.row.status === 3,
+                      'status_color5': scope.row.status === 2,
+                      'status_color1': scope.row.status === 4,
+                      'status_color3': scope.row.status === 5
+                    }"
+                    class="btns"
+                    size="mini"
+                    @change="blurEvent(scope.row, scope.row.status)"
+                  >
+                    <el-option v-for="item in bugStatusList(scope.row.status)" :key="item.code" :label="item.name" :value="item.code" />
+                  </el-select>
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
               <el-table-column prop="taskName" label="所属任务" align="center" min-width="250" show-overflow-tooltip />
               <el-table-column prop="taskName" label="所属任务" align="center" min-width="250" show-overflow-tooltip />
@@ -512,8 +526,6 @@
         <bug-details
         <bug-details
           :id="bugQuery.id+''"
           :id="bugQuery.id+''"
           ref="bugDetails"
           ref="bugDetails"
-          :status="bugQuery"
-          :bug-enum-list="bugEnumList"
           :type="'drawer'"
           :type="'drawer'"
           :drawer-show="drawerShow"
           :drawer-show="drawerShow"
           @close="drawerShow = false"
           @close="drawerShow = false"
@@ -522,6 +534,43 @@
         />
         />
       </div>
       </div>
     </el-drawer>
     </el-drawer>
+    <el-dialog
+      v-if="statusDialogVisible"
+      :visible.sync="statusDialogVisible"
+      width="30%"
+      :title="statusDialogTitle"
+      class="public_task"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="modalClose"
+    >
+      <div class="blueStripe" />
+      <el-form ref="statusDialogForm" 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%">
+            <el-option v-for="item in 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 bugReasonEnumList" :key="item.code" :label="item.name" :value="item.code" />
+          </el-select>
+        </el-form-item>
+        <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" class="bug_manage_dialog">
+          <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" class="bug_manage_dialog">
+          <el-input v-model="statusDialogForm.reasonOrDesc" type="textarea" maxlength="300" show-word-limit rows="4" />
+        </el-form-item>
+      </el-form>
+      <template v-slot:footer>
+        <el-button @click="getBugList(),statusDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="statusDialogConfirm">确 定</el-button>
+      </template>
+    </el-dialog>
     <normal-dialog
     <normal-dialog
       :show-dialog="showSaveSearch"
       :show-dialog="showSaveSearch"
       :title="'保存筛选项'"
       :title="'保存筛选项'"
@@ -550,16 +599,17 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import StatusComponent from '@/components/StatusComponent/StatusComponent.vue'
 import BugDetails from './details/index'
 import BugDetails from './details/index'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
 import normalDialog from '@/components/dialog/normalDialog'
 import normalDialog from '@/components/dialog/normalDialog'
 import filterList from '@/views/projectManage/bugList/details/filterList'
 import filterList from '@/views/projectManage/bugList/details/filterList'
 import { deepClone } from '@/utils/global'
 import { deepClone } from '@/utils/global'
+import '@/styles/PublicStyle/index.scss'
 import {
 import {
   bugList,
   bugList,
   bugSelfList,
   bugSelfList,
   bugGetEnum,
   bugGetEnum,
+  bugUpdate,
   settingGetBizList,
   settingGetBizList,
   taskListCreate,
   taskListCreate,
   releaseList,
   releaseList,
@@ -569,17 +619,14 @@ import {
   getFilterList,
   getFilterList,
   getFilterItem
   getFilterItem
 } from '@/api/defectManage'
 } from '@/api/defectManage'
-// import { getCommentList } from '@/api/requirement.js'
 import { memberQueryMemberInfoByIDAPorName } from '@/api/projectIndex'
 import { memberQueryMemberInfoByIDAPorName } from '@/api/projectIndex'
 import '@/views/projectManage/bugList/css/index.css'
 import '@/views/projectManage/bugList/css/index.css'
-import '@/styles/PublicStyle/index.scss'
 export default {
 export default {
   components: {
   components: {
     createdBug,
     createdBug,
     BugDetails,
     BugDetails,
     normalDialog,
     normalDialog,
-    filterList,
-    StatusComponent
+    filterList
   },
   },
   filters: {
   filters: {
     oneA(value) {
     oneA(value) {
@@ -594,7 +641,10 @@ export default {
     }
     }
   },
   },
   props: {
   props: {
-    type: { type: String, default: 'page' }
+    type: {
+      type: String,
+      default: 'page'
+    }
   },
   },
   data() {
   data() {
     return {
     return {
@@ -625,9 +675,18 @@ export default {
           }
           }
         }]
         }]
       },
       },
+      rules: {
+        bugReason: [{ required: true, message: '请选择缺陷原因', trigger: ['blur', 'change'] }],
+        repairResult: [{ required: true, message: '请选择修复结果', trigger: ['blur', 'change'] }],
+        reasonOrDesc: [{ required: true, message: '请输入Reopen原因', trigger: ['blur', 'change'] }]
+      },
+      statusDialogForm: {},
       bugListType: 2,
       bugListType: 2,
       props: { multiple: true },
       props: { multiple: true },
       reopens: [{ code: 1, name: '是' }, { code: 0, name: '否' }],
       reopens: [{ code: 1, name: '是' }, { code: 0, name: '否' }],
+      userData: { id: '', ename: localStorage.getItem('username'), name: localStorage.getItem('realname') },
+      statusDialogTitle: '',
+      statusDialogVisible: false,
       DetailedScreening: false, // 高级筛选
       DetailedScreening: false, // 高级筛选
       bugEnumList: [], // bug状态
       bugEnumList: [], // bug状态
       bugDevRepairTimeList: [], // 开发修复时长
       bugDevRepairTimeList: [], // 开发修复时长
@@ -642,21 +701,36 @@ export default {
       priorityLevelEnumList: [], // 优先级
       priorityLevelEnumList: [], // 优先级
       discoveryMethEnumList: [], // 发现方式
       discoveryMethEnumList: [], // 发现方式
       bugStageEnumList: [], // 发现阶段
       bugStageEnumList: [], // 发现阶段
+      bugReasonEnumList: [], // 缺陷原因
       sysTypeEnumList: [], // 端类型
       sysTypeEnumList: [], // 端类型
       bugQuery: '', // bug详情
       bugQuery: '', // bug详情
       business_platform_Modular: [], // 所属模块
       business_platform_Modular: [], // 所属模块
+      bugQueryModel: '',
+      commentShow: true, // 评论为空默认显示
+      content: '', // 评论
+      comment_content: '', // 评论内容
+      fileList: [], // 储存附件
+      dis: false,
+      commentTxt: [],
       pageSize: 15,
       pageSize: 15,
       curIndex: 1,
       curIndex: 1,
       total: 0,
       total: 0,
       goodName: '更多筛选',
       goodName: '更多筛选',
       modalShow: false, // 弹窗(新建)
       modalShow: false, // 弹窗(新建)
       drawerShow: false, // drawer展示
       drawerShow: false, // drawer展示
+      taskIdStr: [],
       formInline: {}, // list
       formInline: {}, // list
       stratAndEnd: [], // 创建日期
       stratAndEnd: [], // 创建日期
       tableData: [],
       tableData: [],
+      dialogVisible: false,
+      accessory: [],
       loading: false,
       loading: false,
       options: [],
       options: [],
       test: [], // 人员查询
       test: [], // 人员查询
+      dialogImageUrl: '',
+      isBugNameClick: false,
+      staData: {},
+      statusId: '',
       showSaveSearch: false, // 显示保存筛选项对话框
       showSaveSearch: false, // 显示保存筛选项对话框
       showEditSearch: false, // 显示管理过滤器
       showEditSearch: false, // 显示管理过滤器
       searchForm: { name: null }, // 筛选项obj
       searchForm: { name: null }, // 筛选项obj
@@ -758,15 +832,76 @@ export default {
         }
         }
       })
       })
     },
     },
+    modalClose() {
+      this.getBugList()
+    },
     selectStatus(row) {
     selectStatus(row) {
       row.isSelected = !row.isSelected
       row.isSelected = !row.isSelected
     },
     },
+    blurEvent(row, status) {
+      this.staData = row
+      this.statusId = status
+      if (status === 0) {
+        row.status = status
+        const objData = { bugBaseInfo: row, user: this.userData }
+        bugUpdate(objData).then(res => {
+          row.isSelected = !row.isSelected
+          this.$message({ message: res.msg, type: res.msg })
+        })
+        return
+      }
+      let data = ''
+      this.bugEnumList.map(item => {
+        item.code === status ? data = item.name : ''
+      })
+      this.statusDialogTitle = data
+      this.statusDialogForm = {}
+      this.statusDialogVisible = true
+    },
     bugStatusChange(row) {
     bugStatusChange(row) {
       row.isSelected = !row.isSelected
       row.isSelected = !row.isSelected
       this.$nextTick(() => {
       this.$nextTick(() => {
         this.$refs.inputVal.focus()
         this.$refs.inputVal.focus()
       })
       })
     },
     },
+    statusDialogConfirm() { // 点击确定 验证 修改
+      this.$refs.statusDialogForm.validate((valid) => {
+        if (valid) {
+          this.staData.status = this.statusCode
+          this.staData.reasonOrDesc = this.statusDialogForm.reasonOrDesc
+          this.staData.repairResult = this.statusDialogForm.repairResult
+          this.staData.bugReason = this.statusDialogForm.bugReason
+          const objData = { bugBaseInfo: this.staData, user: this.userData }
+          alert()
+          bugUpdate(objData).then(res => {
+            if (res.code === 200) {
+              this.statusDialogVisible = false
+              this.statusDialogForm = {}
+            } else if (res.code !== 200) {
+              this.getBugList()
+            }
+            this.$message({ message: res.msg, type: res.msg })
+          })
+        }
+      })
+    },
+    postDialogForm() {
+      this.staData.status = this.statusId
+      this.staData.reasonOrDesc = this.statusDialogForm.reasonOrDesc
+      this.staData.repairResult = this.statusDialogForm.repairResult
+      this.staData.bugReason = this.statusDialogForm.bugReason
+      const objData = { bugBaseInfo: this.staData, user: this.userData }
+      bugUpdate(objData).then(res => {
+        if (res.code === 200) {
+          this.statusDialogVisible = false
+          this.statusDialogForm = {}
+          this.$message({ message: res.msg, type: res.msg })
+        } else if (res.code !== 200) {
+          this.$message({ message: res.msg, type: res.msg })
+          this.getBugList()
+        }
+      })
+    },
     resetQuery() {
     resetQuery() {
       this.$router.push({ path: this.$route.path })
       this.$router.push({ path: this.$route.path })
       this.stratAndEnd = []
       this.stratAndEnd = []
@@ -815,6 +950,30 @@ export default {
         this.options = []
         this.options = []
       }
       }
     },
     },
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url
+      this.dialogVisible = true
+    },
+
+    // 文件上传时的钩子
+    progress(event, file, fileList) {
+      this.dis = true
+    },
+
+    // 上传成功回调
+    handleChange(response, file, fileList) {
+      this.fileDbList.push({
+        name: file.name,
+        url: 'http:' + file.response.url
+      })
+      this.accessory = JSON.stringify(this.fileDbList)
+      this.dis = false
+      this.$message({
+        showClose: true,
+        message: '文件上传成功',
+        type: 'success'
+      })
+    },
     click_bugName(e) {
     click_bugName(e) {
       this.bugQuery = JSON.parse(
       this.bugQuery = JSON.parse(
         JSON.stringify(this.tableData.filter(value => value.id === e)[0])
         JSON.stringify(this.tableData.filter(value => value.id === e)[0])
@@ -871,6 +1030,7 @@ export default {
         this.repairResultEnumList = res.data.repairResultEnumList // 修复结果
         this.repairResultEnumList = res.data.repairResultEnumList // 修复结果
         this.clientTypeEnumList = res.data.clientTypeEnumList // 版本
         this.clientTypeEnumList = res.data.clientTypeEnumList // 版本
         this.sysTypeEnumList = res.data.sysTypeEnumList // 客户端
         this.sysTypeEnumList = res.data.sysTypeEnumList // 客户端
+        this.bugReasonEnumList = res.data.bugReasonEnumList
         this.bugDevRepairTimeList = res.data.bugDevRepairTimeList // 开发修复时长
         this.bugDevRepairTimeList = res.data.bugDevRepairTimeList // 开发修复时长
       })
       })
       releaseList().then(res => {
       releaseList().then(res => {
@@ -978,6 +1138,33 @@ export default {
     deleteFilter() {
     deleteFilter() {
       this.$router.push({ path: this.$route.path })
       this.$router.push({ path: this.$route.path })
       this.getFilterList()
       this.getFilterList()
+    },
+    bugStatusList(status) { // 不同状态返回不同的option
+      if (status === 0) {
+        return this.bugEnumList.filter(item => {
+          return item.code === 0 || item.code === 2 || item.code === 5
+        })
+      }
+      if (status === 2) {
+        return this.bugEnumList.filter(item => {
+          return item.code === 2 || item.code === 3 || item.code === 4
+        })
+      }
+      if (status === 3) {
+        return this.bugEnumList.filter(item => {
+          return item.code === 3
+        })
+      }
+      if (status === 4) {
+        return this.bugEnumList.filter(item => {
+          return item.code === 2 || item.code === 5 || item.code === 4
+        })
+      }
+      if (status === 5) {
+        return this.bugEnumList.filter(item => {
+          return item.code === 5 || item.code === 2
+        })
+      }
     }
     }
   }
   }
 }
 }
@@ -1014,4 +1201,97 @@ export default {
     }
     }
   }
   }
 }
 }
+
+</style>
+<style lang="scss">
+.btns .el-input--suffix .el-input__inner {
+  padding-right: 10px;
+  padding-left: 10px;
+  width: 73px;
+}
+// .btns .el-input__suffix {
+//     // display: none;
+//     visibility: hidden;
+// }
+// .btns :hover {
+//  /deep/ .el-input__suffix {
+//     // display: inline-block;
+//     visibility: inherit;
+//   }
+// }
+.item{
+  /deep/ input {
+    color: rgb(126, 211, 33);
+    border: 1px solid rgb(126, 211, 33);
+     border-color: rgb(126, 211, 33) !important;
+         font-weight: 900;
+  }
+  /deep/ .el-input__suffix {
+    color: rgb(126, 211, 33) !important;
+    right: 1px;
+  }
+  /deep/ .el-select__caret {
+    color: rgb(126, 211, 33) !important;
+  }
+}
+.item1 {
+  /deep/ input {
+    color: rgb(255, 204, 102);
+     border: 1px solid rgb(255, 204, 102);
+     border-color: rgb(255, 204, 102) !important;
+         font-weight: 900;
+  }
+  /deep/ .el-input__suffix {
+    color: rgb(255, 204, 102) !important;
+    right: 1px;
+  }
+  /deep/ .el-select__caret {
+    color: rgb(255, 204, 102) !important;
+  }
+}
+.item2 {
+  /deep/ input {
+    color: rgb(245, 108, 108);
+    border: 1px solid rgb(245, 108, 108);
+    border-color: rgb(245, 108, 108) !important;
+        font-weight: 900;
+  }
+   /deep/ .el-input__suffix {
+    color: rgb(245, 108, 108) !important;
+    right: 1px;
+  }
+  /deep/ .el-select__caret {
+   color: rgb(245, 108, 108) !important;
+  }
+}
+.item3 {
+  /deep/ input {
+    color: #D675F0;
+    border: 1px solid #D675F0;
+    border-color: #D675F0 !important;
+        font-weight: 900;
+  }
+    /deep/ .el-input__suffix {
+    color: #D675F0 !important;
+    right: 1px;
+  }
+   /deep/ .el-select__caret {
+   color: #D675F0 !important;
+  }
+}
+.item-color {
+  /deep/ input {
+    color: rgb(106, 180, 255);
+    border: 1px solid rgb(106, 180, 255);
+    border-color: rgb(106, 180, 255) !important;
+        font-weight: 900;
+  }
+    /deep/ .el-input__suffix {
+    color: rgb(106, 180, 255) !important;
+    right: 1px;
+  }
+   /deep/ .el-select__caret {
+   color: rgb(106, 180, 255) !important;
+  }
+}
 </style>
 </style>

+ 56 - 0
src/views/projectManage/bugList/details/dropdown.vue

@@ -0,0 +1,56 @@
+<template>
+  <el-dropdown
+    placement="bottom"
+    @command="clickCommand"
+  >
+    <el-button
+      class="el-dropdown-link drop_down"
+      style="cursor: pointer;"
+      :size="size"
+    >
+      <span class="el-dropdown-link">{{ value }}</span>
+      <i class="el-icon-arrow-down el-icon--right" />
+    </el-button>
+    <el-dropdown-menu slot="dropdown">
+      <el-dropdown-item
+        v-for="(item,index) in options"
+        :key="index"
+        :command="item"
+      >{{ item.name }}</el-dropdown-item>
+    </el-dropdown-menu>
+  </el-dropdown>
+</template>
+
+<script>
+export default {
+  name: 'BugDropDown',
+  props: {
+    value: {
+      type: String,
+      default: null
+    },
+    options: {
+      type: Array,
+      default() {
+        return []
+      }
+    },
+    size: {
+      type: String,
+      default: 'medium'
+    }
+  },
+  methods: {
+    getName() {
+
+    },
+    clickCommand(item) {
+      this.$emit('command', item)
+    }
+  }
+}
+</script>
+
+<style>
+
+</style>

+ 260 - 36
src/views/projectManage/bugList/details/index.vue

@@ -1,10 +1,24 @@
 <template>
 <template>
   <div v-loading="loading.drawer" class="bug-detail">
   <div v-loading="loading.drawer" class="bug-detail">
-    <div v-if="type!=='page'" style="padding: 15px 5px 5px 30px" class="bug_manage_container Layout_space_between bug_manage_title">
-      <span class="Layout_flex_start ">
-        <span style="font-size:18px;font-weight:500;color:#333b4a; margin-right: 15px;">{{ 'BUG-'+ id }}</span>
-        <Status-component :title="'缺陷'" :status-data="queryData.status" :status-row="queryData" />
-      </span>
+    <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="enums.bugEnumList"
+        :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 style="display: inline-block;float:right">
       <div style="display: inline-block;float:right">
         <span class="newBtn" @click="getToDetails()"><i class="el-icon-document" /> 查看详情</span>
         <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>
         <span class="newBtn" style="padding: 0 10px" @click="openQueryDialog()"><i class="el-icon-document-copy" /> 复制</span>
@@ -50,7 +64,14 @@
                   />
                   />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item id="itemLength1" style="margin:0">
                 <el-form-item id="itemLength1" style="margin:0">
-                  <Status-component :title="'缺陷'" :status-data="2" :status-row="bug" />
+                  <dropdown
+                    v-if="map.bugEnumList && typeof bug.status !== 'undefined'"
+                    v-model="map.bugEnumList[bug.status]"
+                    size="small"
+                    :options="enums.bugEnumList"
+                    class="button_status"
+                    @command="openStatsDialog"
+                  />
                 </el-form-item>
                 </el-form-item>
                 <el-form-item id="itemLength2" style="margin:0;float:right">
                 <el-form-item id="itemLength2" style="margin:0;float:right">
                   <el-button size="small" class="button_delete2" @click="openDeleteDialog()">删除</el-button>
                   <el-button size="small" class="button_delete2" @click="openDeleteDialog()">删除</el-button>
@@ -547,21 +568,91 @@
       </el-container>
       </el-container>
       <!-- 弹窗 -->
       <!-- 弹窗 -->
       <el-dialog
       <el-dialog
+        v-if="statusDialogVisible"
         :visible.sync="statusDialogVisible"
         :visible.sync="statusDialogVisible"
-        width="30%"
-        title="删除确认"
-        class="public_task"
+        width="33%"
+        class="bug_manage_dialog"
         :append-to-body="true"
         :append-to-body="true"
         :close-on-click-modal="false"
         :close-on-click-modal="false"
       >
       >
-        <div class="blueStripe" />
-        <div style="text-align:center;line-height: 150px">是否要删除当前缺陷?</div>
+        <template v-slot:title>
+          <div style="display:flex;align-items: center;">
+            <div style="width:4px;height:15px;background:#409EFF;border-radius:1px;" />
+            <div
+              style="width:83px;height:18px;font-size:16px;font-family:MicrosoftYaHei;color:rgba(51,59,74,1);margin-left:6px"
+            >{{ statusDialogTitle }}</div>
+          </div>
+        </template>
+        <el-form
+          v-if="statusDialogTitle !== '删除确认'"
+          label-width="110px"
+          label-position="left"
+          :model="statusDialogForm"
+          :rules="rules"
+        >
+          <el-form-item
+            v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'"
+            label="缺陷原因"
+            prop="bugReason"
+          >
+            <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-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 === '已完成'"
+            label="修复结果"
+            prop="repairResult"
+            class="bug_manage_dialog"
+          >
+            <el-select
+              v-model="statusDialogForm.repairResult"
+              style="width: 100%"
+            >
+              <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 === '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>
+        <div v-else style="text-align:center;line-height: 150px">是否要删除当前缺陷?</div>
         <template v-slot:footer>
         <template v-slot:footer>
-          <el-button @click="statusDialogVisible = false">取 消</el-button>
+          <el-button @click="statusDialogCancel">取 消</el-button>
           <el-button type="primary" @click="statusDialogConfirm">确 定</el-button>
           <el-button type="primary" @click="statusDialogConfirm">确 定</el-button>
         </template>
         </template>
       </el-dialog>
       </el-dialog>
-
       <createdBug v-if="modalShow" ref="createdBug" @father="father" />
       <createdBug v-if="modalShow" ref="createdBug" @father="father" />
       <normal-dialog
       <normal-dialog
         :show-dialog="showCopyFile"
         :show-dialog="showCopyFile"
@@ -596,7 +687,8 @@
 <script>
 <script>
 import fackClickOutSide from './fackClickOutSide.js'
 import fackClickOutSide from './fackClickOutSide.js'
 import E from 'wangeditor'
 import E from 'wangeditor'
-import StatusComponent from '@/components/StatusComponent/StatusComponent.vue'
+// import Utils from '../../../../util.js'
+// import { settingGetTypeMap } from '@/api/taskIndex'
 import { getCommentList, addComment, getMemberInfo } from '@/api/requirement.js'
 import { getCommentList, addComment, getMemberInfo } from '@/api/requirement.js'
 import {
 import {
   bugDetails,
   bugDetails,
@@ -607,11 +699,11 @@ import {
   releaseList,
   releaseList,
   settingQueryBizModuleList
   settingQueryBizModuleList
 } from '@/api/defectManage.js'
 } from '@/api/defectManage.js'
+import Dropdown from './dropdown.vue'
 import normalDialog from '@/components/dialog/normalDialog'
 import normalDialog from '@/components/dialog/normalDialog'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
 import axios from 'axios'
 import axios from 'axios'
 import { deepClone } from '@/utils/global'
 import { deepClone } from '@/utils/global'
-import '@/styles/PublicStyle/index.scss'
 
 
 document.body.onpaste = function(event) {
 document.body.onpaste = function(event) {
   const data = (event.clipboardData || window.clipboardData)
   const data = (event.clipboardData || window.clipboardData)
@@ -631,9 +723,9 @@ document.body.onpaste = function(event) {
 export default {
 export default {
   name: 'BugDetails',
   name: 'BugDetails',
   components: {
   components: {
+    Dropdown,
     createdBug,
     createdBug,
-    normalDialog,
-    StatusComponent
+    normalDialog
   },
   },
   mixins: [fackClickOutSide],
   mixins: [fackClickOutSide],
   props: {
   props: {
@@ -641,14 +733,6 @@ export default {
       type: String,
       type: String,
       default: '0'
       default: '0'
     },
     },
-    bugEnumList: {
-      type: Array,
-      default: null
-    },
-    status: {
-      type: Object,
-      default: null
-    },
     type: {
     type: {
       type: String,
       type: String,
       default: 'page'
       default: 'page'
@@ -660,7 +744,6 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
-      queryData: this.status,
       modalShow: false,
       modalShow: false,
       iconName: 'float_反馈_icon_close',
       iconName: 'float_反馈_icon_close',
       bugNameIsFocus: false,
       bugNameIsFocus: false,
@@ -670,10 +753,8 @@ export default {
       bugDescribe: '',
       bugDescribe: '',
       bugNameForm: { bugName: '' },
       bugNameForm: { bugName: '' },
       fileList: [],
       fileList: [],
-      bugEnumLists: this.bugEnumList, // 状态option
       notImageList: [], // 文件非图片数组
       notImageList: [], // 文件非图片数组
       ImageList: [], // 文件图片数组
       ImageList: [], // 文件图片数组
-      statusDialogVisible: false,
       accessory: null,
       accessory: null,
       dialogVisible: false,
       dialogVisible: false,
       dialogImageUrl: [],
       dialogImageUrl: [],
@@ -700,6 +781,9 @@ export default {
       formHeight: '',
       formHeight: '',
       formHeight1: '',
       formHeight1: '',
       userLoading: false,
       userLoading: false,
+      statusDialogVisible: false,
+      statusDialogTitle: '',
+      statusDialogForm: {},
       options: [
       options: [
         { name: '测试', code: 1 },
         { name: '测试', code: 1 },
         { name: '测试2', code: 2 }
         { name: '测试2', code: 2 }
@@ -733,6 +817,15 @@ export default {
         ],
         ],
         bugName: [
         bugName: [
           { required: true, message: '标题不可为空', trigger: 'blur' }
           { required: true, message: '标题不可为空', trigger: 'blur' }
+        ],
+        bugReason: [
+          { required: true, message: '请选择缺陷原因', trigger: 'change' }
+        ],
+        repairResult: [
+          { required: true, message: '请选择修复结果', trigger: 'change' }
+        ],
+        reasonOrDesc: [
+          { required: true, message: '请输入Reopen原因', trigger: 'blur' }
         ]
         ]
       },
       },
       showCopyFile: false, // 复制文件对话框
       showCopyFile: false, // 复制文件对话框
@@ -748,6 +841,11 @@ export default {
     }
     }
   },
   },
   watch: {
   watch: {
+    statusDialogVisible(newVal, oldVal) {
+      if (!newVal) {
+        this.statusDialogForm = null
+      }
+    },
     id(newVal, oldVal) {
     id(newVal, oldVal) {
       this.bug = {}
       this.bug = {}
       this.bugModel = {}
       this.bugModel = {}
@@ -773,10 +871,21 @@ export default {
     }
     }
   },
   },
   mounted() {
   mounted() {
-    console.log(this.status, 'sss')
     this.bugGetEnum()
     this.bugGetEnum()
     this.$nextTick(() => {
     this.$nextTick(() => {
       this.bugGet(this.id, false).then(res => {
       this.bugGet(this.id, false).then(res => {
+        // 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
+        //   })
+        // }
         this.PersonnelData()
         this.PersonnelData()
         this.changeWidthOnBlur()
         this.changeWidthOnBlur()
         releaseList().then(res => {
         releaseList().then(res => {
@@ -840,7 +949,7 @@ export default {
       return arr.filter(item => { return !item.url.match(reg) })
       return arr.filter(item => { return !item.url.match(reg) })
     },
     },
     beforeUpload(file) {
     beforeUpload(file) {
-      const reg = new RegExp(/.*(zip|xlsx|txt|csv|xls|mov|mp4|m4a|avi|amr|mp3|wav|3gpp|gif|jpeg|png|jpg)/i)
+      const reg = new RegExp(/.*(zip|xlsx|text|csv|xls|mov|mp4|m4a|avi|amr|mp3|wav|3gpp|gif|jpeg|png|jpg)/i)
       const isUpload = file.type.match(reg)
       const isUpload = file.type.match(reg)
       if (!isUpload) {
       if (!isUpload) {
         this.$message({
         this.$message({
@@ -1067,7 +1176,6 @@ export default {
           //   }
           //   }
           // }
           // }
           this.bug = res.data
           this.bug = res.data
-          console.log(this.bug, 'xiangqing')
           this.bug.currentHandler = res.data.currentHandler.split(',')
           this.bug.currentHandler = res.data.currentHandler.split(',')
           this.bug.assigner = res.data.assigner.split(',')
           this.bug.assigner = res.data.assigner.split(',')
           this.bug.currentHandler.map(item => {
           this.bug.currentHandler.map(item => {
@@ -1240,9 +1348,19 @@ export default {
     openStatsDialog(item) {
     openStatsDialog(item) {
       this.statusDialogForm = JSON.parse(JSON.stringify(this.bug))
       this.statusDialogForm = JSON.parse(JSON.stringify(this.bug))
       this.statusDialogForm.status = item.code
       this.statusDialogForm.status = item.code
+      if (item.name === '待修复' || item.name === '修复中' || item.name === 'Hold') {
+        this.bugUpdate(this.statusDialogForm, 'title')
+          .then(res => {
+            this.bugGet(this.bug.id, false)
+          })
+        return
+      }
       this.statusDialogTitle = item.name
       this.statusDialogTitle = item.name
       this.statusDialogVisible = true
       this.statusDialogVisible = true
     },
     },
+    statusDialogCancel() {
+      this.statusDialogVisible = false
+    },
     statusDialogConfirm() {
     statusDialogConfirm() {
       if (this.statusDialogTitle === '删除确认') {
       if (this.statusDialogTitle === '删除确认') {
         this.bugDelete().then(res => {
         this.bugDelete().then(res => {
@@ -1255,9 +1373,55 @@ export default {
             }
             }
           }
           }
         })
         })
+      } 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
+      return this.bugUpdate(this.statusDialogForm).then(res => {
+        this.statusDialogVisible = false
+        this.statusDialogForm = {}
+        this.bugGet(this.bug.id)
+        return res
+      })
+    },
     generateMixed(len) {
     generateMixed(len) {
       const chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
       const chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
       let res = ''
       let res = ''
@@ -1353,18 +1517,36 @@ export default {
   line-height: 14px;
   line-height: 14px;
   padding: 7px 10px;
   padding: 7px 10px;
 }
 }
-/* .bug_manage_title .button_delete2,.button_status .el-button {
+.bug_manage_title .button_delete2,.button_status .el-button {
   padding: 7px 10px;
   padding: 7px 10px;
   font-size: 14px;
   font-size: 14px;
   font-weight: normal;
   font-weight: normal;
-} */
-
+}
+.bug_manage_dialog .el-dialog {
+  border-radius:4px;
+}
+.bug_manage_dialog .el-dialog__header {
+  padding: 20px 45px;
+}
+.bug_manage_dialog .el-dialog__body {
+  padding: 0px 45px;
+}
+.bug_manage_dialog .el-dialog__footer {
+  padding: 20px 45px 40px 0;
+}
 .layout_header,
 .layout_header,
 .layout_aside,
 .layout_aside,
 .layout_main {
 .layout_main {
+  /* border-radius: 4px; */
   background-color: #ffffff;
   background-color: #ffffff;
 }
 }
-
+.bug_manage_dialog_fixMethod .el-form-item__label {
+  padding-left: 10px;
+}
+.bug_manage_dialog .el-form-item__label {
+  color: #666666;
+  font-weight: 400;
+}
 .bug_manage_title .el-form-item__label {
 .bug_manage_title .el-form-item__label {
   color: #333b4a;
   color: #333b4a;
   font-size: 18px;
   font-size: 18px;
@@ -1627,3 +1809,45 @@ border-color: #DCDFE6;
   white-space: nowrap;
   white-space: nowrap;
 }
 }
 </style>
 </style>
+<style lang="scss">
+.item-color {
+  /deep/ .el-button {
+    color: rgb(106, 180, 255);
+    border: 1px solid rgb(106, 180, 255);
+    border-color: rgb(106, 180, 255) !important;
+    background: #FFF;
+  }
+}
+.item{
+  /deep/ .el-button {
+    color: rgb(126, 211, 33);
+    border: 1px solid rgb(126, 211, 33);
+     border-color: rgb(126, 211, 33) !important;
+    background: #FFF;
+  }
+}
+.item1 {
+  /deep/ .el-button {
+    color: rgb(255, 204, 102);
+     border: 1px solid rgb(255, 204, 102);
+     border-color: rgb(255, 204, 102) !important;
+    background: #FFF;
+  }
+}
+.item2 {
+  /deep/ .el-button {
+    color: rgb(245, 108, 108);
+    border: 1px solid rgb(245, 108, 108);
+    border-color: rgb(245, 108, 108) !important;
+    background: #FFF;
+  }
+}
+.item3 {
+  /deep/ .el-button {
+    color: #D675F0;
+    border: 1px solid #D675F0;
+    border-color: #D675F0 !important;
+    background: #FFF;
+  }
+}
+</style>