|
@@ -0,0 +1,336 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <el-table
|
|
|
|
+ ref="planTable"
|
|
|
|
+ :data="bugsDataList"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ size="mini"
|
|
|
|
+ row-key="id"
|
|
|
|
+ :header-cell-style="{ color: '#4A4A4A', fontSize: '14px', fontWeight: '550', textAlign: 'center' }"
|
|
|
|
+ show-overflow-tooltip="true"
|
|
|
|
+ :header-row-style="{height: '50px'}"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column label="优先级" prop="priority" width="100" sortable align="center">
|
|
|
|
+ <template slot-scope="scope" style="text-align: center;">
|
|
|
|
+ <span class="div_priority" :class="scope.row.priorityName">
|
|
|
|
+ {{ scope.row.priorityName }}
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="bugName" label="缺陷标题" width="200" align="center" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span style=" color: #A7AEBC; font-size: 10px;">{{ 'BUG-' + scope.row.id }}</span>
|
|
|
|
+ <br>
|
|
|
|
+ <span class="bug-title" @click="getToDetails(scope.row.id)">{{ scope.row.bugName }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="状态" width="115" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="scope.row.status"
|
|
|
|
+ :class="['status'+scope.row.status]"
|
|
|
|
+ class="btns"
|
|
|
|
+ size="mini"
|
|
|
|
+ @change="statusChange(scope.row)"
|
|
|
|
+ >
|
|
|
|
+ <el-option v-for="item in allStatus" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="priorityName" label="缺陷等级" align="center" />
|
|
|
|
+ <el-table-column prop="taskName" label="所属任务" align="center" width="200" show-overflow-tooltip />
|
|
|
|
+ <el-table-column prop="creatorList" label="提报人" width="100" align="center" />
|
|
|
|
+ <el-table-column prop="assignerList" label="责任人" width="100" align="center" show-overflow-tooltip />
|
|
|
|
+ <el-table-column prop="currentHandlerList" label="修复人" width="100" align="center" show-overflow-tooltip />
|
|
|
|
+ <el-table-column prop="gmtCreate" label="创建日期" width="150" align="center">
|
|
|
|
+ <template slot-scope="scope">{{ scope.row.gmtCreate | naspOut }}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <div align="right">
|
|
|
|
+ <el-pagination
|
|
|
|
+ :page-sizes="[10, 20, 30, total]"
|
|
|
|
+ :current-page="curIndex"
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
+ background
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="total"
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ <normal-dialog
|
|
|
|
+ :show-dialog.sync="statusDialog"
|
|
|
|
+ :title="statusDialogTitle"
|
|
|
|
+ :width="'50%'"
|
|
|
|
+ :is-default-close="false"
|
|
|
|
+ @confirm="confirmStatus()"
|
|
|
|
+ @cancel="bugsList()"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ v-if="statusDialogTitle !== '删除确认'"
|
|
|
|
+ ref="ruleForm"
|
|
|
|
+ label-width="110px"
|
|
|
|
+ label-position="left"
|
|
|
|
+ :model="nowTaskDetail"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item
|
|
|
|
+ v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'"
|
|
|
|
+ label="缺陷原因"
|
|
|
|
+ prop="bugReason"
|
|
|
|
+ >
|
|
|
|
+ <el-select v-model="nowTaskDetail.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="nowTaskDetail.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="nowTaskDetail.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">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="nowTaskDetail.reasonOrDesc"
|
|
|
|
+ type="textarea"
|
|
|
|
+ placeholder="请输入Reopen"
|
|
|
|
+ maxlength="300"
|
|
|
|
+ show-word-limit
|
|
|
|
+ rows="4"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </normal-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import { bugList, bugGetEnum, bugUpdate } from '@/api/defectManage'
|
|
|
|
+import normalDialog from '@/components/dialog/normalDialog'
|
|
|
|
+export default {
|
|
|
|
+ components: { normalDialog },
|
|
|
|
+ filters: {
|
|
|
|
+ naspOut(value) {
|
|
|
|
+ if (!value) return ''
|
|
|
|
+ var da = value.split(/\s+/)
|
|
|
|
+ return da[0]
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ bugsDataList: [],
|
|
|
|
+ allStatus: [], // 所有状态列表
|
|
|
|
+ bugReasonEnumList: [], // 所有bug原因列表
|
|
|
|
+ repairResultEnumList: [], // 修复原因列表
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ curIndex: 1,
|
|
|
|
+ total: 0,
|
|
|
|
+ nowTaskDetail: null, // 当前需要改变任务的详情
|
|
|
|
+ statusDialog: false, // 状态修改弹框
|
|
|
|
+ statusDialogTitle: '',
|
|
|
|
+ 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' }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.getBugGetEnum()
|
|
|
|
+ this.bugsList()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async getBugGetEnum() {
|
|
|
|
+ const res = await bugGetEnum()
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.allStatus = res.data.bugEnumList
|
|
|
|
+ this.bugReasonEnumList = res.data.bugReasonEnumList
|
|
|
|
+ this.repairResultEnumList = res.data.repairResultEnumList
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async bugsList() {
|
|
|
|
+ const params = {
|
|
|
|
+ bizId: Number(localStorage.getItem('bizId')),
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ curIndex: this.curIndex,
|
|
|
|
+ requireId: this.$route.query.id
|
|
|
|
+ }
|
|
|
|
+ const res = await bugList(params)
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.bugsDataList = res.data
|
|
|
|
+ this.total = res.total
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(e) {
|
|
|
|
+ this.pageSize = e
|
|
|
|
+ this.bugsList()
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(e) {
|
|
|
|
+ this.curIndex = e
|
|
|
|
+ this.bugsList()
|
|
|
|
+ },
|
|
|
|
+ getToDetails(id) { // 详情页跳转
|
|
|
|
+ this.$router.push({ name: '缺陷详情', params: { id: id }})
|
|
|
|
+ },
|
|
|
|
+ statusChange(row) { // 状态改变
|
|
|
|
+ this.nowTaskDetail = row
|
|
|
|
+ const nowStatusObj = this.allStatus.find(item => item.code === row.status)
|
|
|
|
+ if (['待修复', '修复中', 'Hold'].some(item => item === nowStatusObj.name)) {
|
|
|
|
+ this.bugUpdate()
|
|
|
|
+ } else {
|
|
|
|
+ this.statusDialogTitle = nowStatusObj.name
|
|
|
|
+ this.statusDialog = true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ confirmStatus() { // 确认更改状态
|
|
|
|
+ this.$refs['ruleForm'].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.bugUpdate()
|
|
|
|
+ this.statusDialog = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ async bugUpdate() { // 更改状态请求
|
|
|
|
+ const userData = {
|
|
|
|
+ id: '',
|
|
|
|
+ ename: localStorage.getItem('username'),
|
|
|
|
+ name: localStorage.getItem('realname')
|
|
|
|
+ }
|
|
|
|
+ const res = await bugUpdate({ bugBaseInfo: this.nowTaskDetail, user: userData })
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message({ message: '状态修改成功', type: 'success', duration: 1000, offset: 150 })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+@mixin setStatus($color) {
|
|
|
|
+ input {
|
|
|
|
+ color:$color;
|
|
|
|
+ border: 1px solid $color;
|
|
|
|
+ }
|
|
|
|
+ >>> .el-select__caret{
|
|
|
|
+ color:$color;
|
|
|
|
+ }
|
|
|
|
+ >>> .el-input__inner{
|
|
|
|
+ color:$color;
|
|
|
|
+ border-color: $color;
|
|
|
|
+ }
|
|
|
|
+ >>> .el-input__inner:focus {
|
|
|
|
+ border-color: $color;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+>>>.el-row .el-col {
|
|
|
|
+ margin: 10px 0;
|
|
|
|
+}
|
|
|
|
+.bug-title {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+.P0 {
|
|
|
|
+ background-color: #F56C6C;
|
|
|
|
+}
|
|
|
|
+.P1 {
|
|
|
|
+ background-color: #FF8952;
|
|
|
|
+}
|
|
|
|
+.P2 {
|
|
|
|
+ background-color: #F5E300;
|
|
|
|
+}
|
|
|
|
+.P3 {
|
|
|
|
+ background-color: #7ED321;
|
|
|
|
+}
|
|
|
|
+.P4 {
|
|
|
|
+ background-color: #61D3B8;
|
|
|
|
+}
|
|
|
|
+.P5 {
|
|
|
|
+ background-color: #69B3FF;
|
|
|
|
+}
|
|
|
|
+.P6 {
|
|
|
|
+ background-color: #BDBDBD;
|
|
|
|
+}
|
|
|
|
+.status0 {
|
|
|
|
+ @include setStatus(#69B3FF)
|
|
|
|
+}
|
|
|
|
+.status1 {
|
|
|
|
+ @include setStatus(#FF8952)
|
|
|
|
+}
|
|
|
|
+.status2 {
|
|
|
|
+ @include setStatus(#2F54EB)
|
|
|
|
+}
|
|
|
|
+.status3 {
|
|
|
|
+ @include setStatus(#61D3B8)
|
|
|
|
+}
|
|
|
|
+.status4 {
|
|
|
|
+ @include setStatus(#F56C6C)
|
|
|
|
+}
|
|
|
|
+.status5 {
|
|
|
|
+ @include setStatus(#7ED321)
|
|
|
|
+}
|
|
|
|
+.div_priority {
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #ffffff;
|
|
|
|
+ padding: inherit;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ width: 40px;
|
|
|
|
+ display: inline-block;
|
|
|
|
+}
|
|
|
|
+.table-project-name {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ b {
|
|
|
|
+ color: #A7AEBC;
|
|
|
|
+ font-size: 10px;
|
|
|
|
+ }
|
|
|
|
+ span {
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|