|
@@ -21,17 +21,17 @@
|
|
|
<template slot-scope="scope">
|
|
|
<span style=" color: #A7AEBC; font-size: 10px;">{{ 'BUG-' + scope.row.id }}</span>
|
|
|
<br>
|
|
|
- <span>{{ scope.row.bugName }}</span>
|
|
|
+ <span class="bug-title" @click="getToDetails(scope.row.id)">{{ scope.row.bugName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="状态" width="110" align="center">
|
|
|
+ <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="blurEvent(scope.row, scope.row.status)"
|
|
|
+ @change="statusChange(scope.row)"
|
|
|
>
|
|
|
<el-option v-for="item in allStatus" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
</el-select>
|
|
@@ -60,11 +60,87 @@
|
|
|
/>
|
|
|
</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 } from '@/api/defectManage'
|
|
|
+import { bugList, bugGetEnum, bugUpdate } from '@/api/defectManage'
|
|
|
+import normalDialog from '@/components/dialog/normalDialog'
|
|
|
export default {
|
|
|
+ components: { normalDialog },
|
|
|
filters: {
|
|
|
naspOut(value) {
|
|
|
if (!value) return ''
|
|
@@ -75,10 +151,35 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
bugsDataList: [],
|
|
|
- allStatus: [],
|
|
|
+ allStatus: [], // 所有状态列表
|
|
|
+ bugReasonEnumList: [], // 所有bug原因列表
|
|
|
+ repairResultEnumList: [], // 修复原因列表
|
|
|
pageSize: 10,
|
|
|
curIndex: 1,
|
|
|
- total: 0
|
|
|
+ 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() {
|
|
@@ -90,6 +191,8 @@ export default {
|
|
|
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() {
|
|
@@ -112,8 +215,37 @@ export default {
|
|
|
this.curIndex = e
|
|
|
this.bugsList()
|
|
|
},
|
|
|
- blurEvent() { // 状态改变
|
|
|
-
|
|
|
+ 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 })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -138,6 +270,9 @@ export default {
|
|
|
>>>.el-row .el-col {
|
|
|
margin: 10px 0;
|
|
|
}
|
|
|
+.bug-title {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
.P0 {
|
|
|
background-color: #F56C6C;
|
|
|
}
|