@ -17,8 +17,8 @@
< / e l - o p t i o n >
< / e l - s e l e c t >
< el -button v-if ="!filters.tags||filters.tags.length==0" @click.native="tagSelectVisible=true " > 标签 < / el -button >
< el -tag v -else @click ="tagSelectVisible=true " closable @close ="clearFiltersTag(filters.tags[0])" > {{ filters.tags [ 0 ] .tagName.substr ( 0 , 5 ) }} 等 ( {{ filters.tags.length }} ) 个 < / el -tag >
< el -button v-if ="!filters.tags||filters.tags.length==0" @click.native="$refs.tagDialog.open() " > 标签 < / el -button >
< el -tag v -else @click ="$refs.tagDialog.open() " closable @close ="clearFiltersTag(filters.tags[0])" > {{ filters.tags [ 0 ] .tagName.substr ( 0 , 5 ) }} 等 ( {{ filters.tags.length }} ) 个 < / el -tag >
< el -input style = "width:200px;" v -model = " filters.key " placeholder = "缺陷名称" clearable >
< / e l - i n p u t >
@ -125,27 +125,56 @@
< el -table -column prop = "name" label = "缺陷名称" min -width = " 150 " >
< template slot -scope = " scope " >
< span class = "vlink" @click ="showEdit(scope.row)" :title ="scope.row.name" >
< el -tag type = "info" v-if ="scope.row.bugSeverity=='4' " > {{ formatterOption ( scope.row , { property : ' bugSeverity ' } , scope.row.bugSeverity ) }} < / el -tag >
< el -tag type = "primary" v -else -if = " scope.row.bugSeverity = = ' 3 ' " > { { formatterOption ( scope . row , { property : 'bugSeverity' } , scope . row . bugSeverity ) } } < / e l - t a g >
< el -tag type = "warning" v -else -if = " scope.row.bugSeverity = = ' 2 ' " > { { formatterOption ( scope . row , { property : 'bugSeverity' } , scope . row . bugSeverity ) } } < / e l - t a g >
< el -tag type = "danger" v -else -if = " scope.row.bugSeverity = = ' 1 ' " > { { formatterOption ( scope . row , { property : 'bugSeverity' } , scope . row . bugSeverity ) } } < / e l - t a g >
< el -tag v-else > {{ formatterOption ( scope.row , { property : ' bugSeverity ' } , scope.row.bugSeverity ) }} < / el -tag >
& nbsp ; & nbsp ; { { scope . row . name } }
{ { scope . row . name } }
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "bugStatus" label = "状态" width = "100" >
< template slot -scope = " scope " >
< el -tag type = "info" v-if ="scope.row.bugStatus=='create' " > 创建 < / el -tag >
< el -tag type = "primary" v -else -if = " scope.row.bugStatus = = ' active ' " > 已激活 < / e l - t a g >
< el -tag type = "warning" v -else -if = " scope.row.bugStatus = = ' confirm ' " > 确认 < / e l - t a g >
< el -tag type = "warning" v -else -if = " scope.row.bugStatus = = ' confirmed ' " > 已确认 < / e l - t a g >
< el -tag type = "success" v -else -if = " scope.row.bugStatus = = ' solve ' " > 解决 < / e l - t a g >
< el -tag type = "success" v -else -if = " scope.row.bugStatus = = ' resolved ' " > 已解决 < / e l - t a g >
< el -tag type = "success" v -else -if = " scope.row.bugStatus = = ' close ' " > 关闭 < / e l - t a g >
< el -tag type = "success" v -else -if = " scope.row.bugStatus = = ' closed ' " > 已关闭 < / e l - t a g >
< el -tag v-else > {{ scope.row.bugStatus }} < / el -tag >
< div class = "cell-text" >
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in [formatterBugStatusDicts(scope.row.bugStatus)]" :key ="index" > {{ item.name }} < / el -button >
< / div >
< span class = "cell-bar" >
< el -select v-model ="scope.row.bugStatus" placeholder="类型" style="display:block;" @change="editXmQuestionSomeFields(scope.row,'bugStatus',$event)" >
< el -option :value ="item.id" :label ="item.name" v-for ="(item,index) in dicts.bugStatus" :key ="index" > < / el -option >
< / e l - s e l e c t >
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "priority" label = "优先级" width = "100" >
< template slot -scope = " scope " >
< div class = "cell-text" >
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in [formatterPriorityDicts(scope.row.priority)]" :key ="index" > {{ item.name }} < / el -button >
< / div >
< span class = "cell-bar" >
< el -select v-model ="scope.row.priority" placeholder="优先级" style="display:block;" @change="editXmQuestionSomeFields(scope.row,'priority',$event)" >
< el -option :value ="item.id" :label ="item.name" v-for ="(item,index) in dicts.priority" :key ="index" > < / el -option >
< / e l - s e l e c t >
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "solution" label = "解决方案" width = "100" >
< template slot -scope = " scope " >
< div class = "cell-text" >
{ { formaterByDicts ( scope . row , 'solution' , scope . row . solution ) } }
< / div >
< span class = "cell-bar" >
< el -select v-model ="scope.row.solution" placeholder="类型" style="display:block;" @change="editXmQuestionSomeFields(scope.row,'solution',$event)" >
< el -option :value ="item.id" :label ="item.name" v-for ="(item,index) in dicts.bugSolution" :key ="index" > < / el -option >
< / e l - s e l e c t >
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "bugSeverity" label = "严重程度" width = "100" >
< template slot -scope = " scope " >
< div class = "cell-text" >
{ { formaterByDicts ( scope . row , 'bugSeverity' , scope . row . bugSeverity ) } }
< / div >
< span class = "cell-bar" >
< el -select v-model ="scope.row.bugSeverity" placeholder="类型" style="display:block;" @change="editXmQuestionSomeFields(scope.row,'bugSeverity',$event)" >
< el -option :value ="item.id" :label ="item.name" v-for ="(item,index) in dicts.bugSeverity" :key ="index" > < / el -option >
< / e l - s e l e c t >
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "askUsername" label = "创建人" width = "100" show -overflow -tooltip >
@ -156,16 +185,27 @@
< el -table -column prop = "ltime" label = "更新时间" sortable width = "100" show -overflow -tooltip >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "handlerUsername" label = "指派给" width = "100" show -overflow -tooltip >
< el -table -column prop = "handlerUsername" label = "负责人" width = "100" show -overflow -tooltip >
< template slot -scope = " scope " >
< div class = "cell-text" >
{ { scope . row . handlerUsername } }
< / div >
< span class = "cell-bar" >
< el -button @click ="showGroupUsers('editHandlerUserid',scope.row)" > 负责人 < / el -button >
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "tagNames" label = "标签" width = "100" show -overflow -tooltip >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "menuName" label = "需求" width = "100" show -overflow -tooltip > < / e l - t a b l e - c o l u m n >
< el -table -column header -align = " center " label = "操作" fixed = "right" width = "100" >
< template slot -scope = " scope " >
< el -button type = "primary" @click.stop ="showEdit(scope.row)" > 编辑 < / e l - b u t t o n >
< div class = "cell-text" >
{ { scope . row . tagNames } }
< / div >
< span class = "cell-bar" >
< el -button @click ="$refs.tagDialog.open({data:scope.row,action:'editTagIds'})" > 标签 < / el -button >
< / span >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "menuName" label = "需求" width = "100" show -overflow -tooltip > < / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< el -pagination layout = "total, sizes, prev, pager, next" @current-change ="handleCurrentChange" @size-change ="handleSizeChange" : page -sizes = " [ 10 , 20 , 50 , 100 , 500 ] " :current-page ="pageInfo.pageNum" :page-size ="pageInfo.pageSize" :total ="pageInfo.total" style = "float:right;" > < / e l - p a g i n a t i o n >
< / e l - r o w >
@ -178,19 +218,12 @@
< el -drawer title = "新增缺陷" :visible.sync ="addFormVisible" :with-header ="false" size = "70%" append -to -body :close-on-click-modal ="false" >
< xm -question -add :xm-test-case-exec ="xmTestCaseExec" :xm-test-case ="xmTestCase" :qtype ="qtype" : sel -project = " filters.selProject " :xm-question ="addForm" :visible ="addFormVisible" @cancel ="addFormVisible=false" @submit ="afterAddSubmit" > < / xm -question -add >
< / e l - d r a w e r >
< el -drawer title = "选中用户" v-if =" filters.selProject " :visible.sync="selectUserVisible" size="70%" append-to-body :close-on-click-modal="false" >
< xm -group -mng : sel -project = " filters.selProject " :is-select-single-user ="1" @user-confirm ="onUserConfirm" > < / x m - g r o u p - m n g >
< / e l - d r a w e r >
< xm -group -dialog ref = "xmGroupDialog" : sel -project = " filters.selProject " :is-select-single-user ="1" @user-confirm ="onUserConfirm" > < / x m - g r o u p - d i a l o g >
< el -drawer append -to -body title = "需求选择" :visible.sync ="menuVisible" size = "70%" :close-on-click-modal ="false" >
< xm -menu -select :visible ="menuVisible" :is-select-menu ="true" :multi ="true" @menus-selected ="onSelectedMenus" > < / x m - m e n u - s e l e c t >
< / e l - d r a w e r >
< el -drawer append -to -body title = "标签条件" :visible.sync ="tagSelectVisible" :close-on-click-modal ="false" size = "60%" >
< tag -mng :tagIds ="filters.tags?filters.tags.map(i=>i.tagId):[]" :jump ="true" @select-confirm ="onTagSelected" >
< / t a g - m n g >
< / e l - d r a w e r >
< tag -dialog ref = "tagDialog" :tagIds ="filters.tags?filters.tags.map(i=>i.tagId):[]" :jump ="true" @select-confirm ="onTagSelected" > < / t a g - d i a l o g >
< / section >
< / template >
@ -200,17 +233,17 @@
import config from '@/common/config' ; / / 全 局 公 共 库
/ / i m p o r t S t i c k y f r o m ' @ / c o m p o n e n t s / S t i c k y ' / / 粘 性 h e a d e r 组 件
import { initSimpleDicts } from '@/api/mdp/meta/item' ; / / 下 拉 框 数 据 查 询
import { listXmQuestion , delXmQuestion , batchDelXmQuestion , editStatus } from '@/api/xm/core/xmQuestion' ;
import { listXmQuestion , delXmQuestion , batchDelXmQuestion , editStatus , editXmQuestionSomeFields } from '@/api/xm/core/xmQuestion' ;
import XmQuestionAdd from './XmQuestionAdd' ; / / 新 增 界 面
import XmQuestionEdit from './XmQuestionEdit' ; / / 修 改 界 面
import { mapGetters } from 'vuex'
import xmMenuSelect from '../xmMenu/XmMenuSelect' ;
import XmGroupMng from '../xmGroup/XmGroupMn g' ;
import XmGroupDialog from '../xmGroup/XmGroupDialo g' ;
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect' ;
import XmProductSelect from '@/views/xm/core/components/XmProductSelect' ; / / 修 改 界 面
import TagMng from "@/views/mdp/arc/tag/TagMng" ;
import TagDialog from '@/views/mdp/arc/tag/TagDialog.vue' ;
export default {
computed : {
@ -649,27 +682,68 @@
}
} ,
showSolveName : function ( row ) {
if ( row . bugStatus == 'active' ) {
return "去确认"
} else if ( row . bugStatus == 'confirmed' ) {
return "去解决"
} else if ( row . bugStatus == 'resolved' ) {
return "去关闭"
} else if ( row . bugStatus == 'closed' ) {
return "激活"
formatterPriorityDicts ( cellValue ) {
var key = "priority" ;
if ( this . dicts [ key ] == undefined || this . dicts [ key ] == null || this . dicts [ key ] . length == 0 ) {
return { id : cellValue , name : cellValue , className : 'primary' } ;
}
var list = this . dicts [ key ] . filter ( i => i . id == cellValue )
if ( list . length > 0 ) {
var data = { ... list [ 0 ] , className : 'primary' }
if ( data . id == '0' ) {
data . className = 'danger'
} else if ( data . id == '1' ) {
data . className = 'warning'
} else if ( data . id == '2' ) {
data . className = 'success'
} else if ( data . id == '3' ) {
data . className = 'primary'
} else if ( data . id == '4' ) {
data . className = 'info'
} else {
data . className = 'primary'
}
return data ;
} else {
return { id : cellValue , name : cellValue , className : 'primary' }
}
} ,
showGroupUsers : function ( userType ) {
this . userType = userType ;
if ( this . filters . selProject == null || this . filters . selProject . id == '' ) {
this . $notify ( { showClose : true , message : "请先选中项目" , type : 'warning' } ) ;
this . nextAction = "showGroupUsers"
this . showProjectList ( ) ;
return ;
formatterBugStatusDicts : function ( cellValue ) {
var key = "bugStatus" ;
if ( this . dicts [ key ] == undefined || this . dicts [ key ] == null || this . dicts [ key ] . length == 0 ) {
return { id : cellValue , name : cellValue , className : 'primary' } ;
}
var list = this . dicts [ key ] . filter ( i => i . id == cellValue )
if ( list . length > 0 ) {
var data = { ... list [ 0 ] , className : 'primary' }
if ( data . id == '1' ) {
data . className = 'primary'
} else if ( data . id == '2' ) {
data . className = 'primary'
} else if ( data . id == '3' ) {
data . className = 'success'
} else if ( data . id == '4' ) {
data . className = 'warning'
} else if ( data . id == '5' ) {
data . className = 'success'
} else if ( data . id == '6' ) {
data . className = 'info'
} else if ( data . id == '7' ) {
data . className = 'info'
} else {
data . className = 'danger'
}
return data ;
} else {
return { id : cellValue , name : cellValue , className : 'primary' }
}
this . selectUserVisible = true ;
} ,
showGroupUsers : function ( userType , row ) {
this . $refs . xmGroupDialog . open ( { data : row , action : userType } )
} ,
handleExport ( ) {
this . downloadLoading = true
let header = [ ] ;
@ -725,21 +799,24 @@
} ,
/**end 自定义函数请在上面加**/
onUserConfirm : function ( groupUsers ) {
if ( this . userType == 'createUser' ) {
onUserConfirm : function ( groupUsers , option ) {
if ( option . action == 'createUser' ) {
if ( groupUsers == null || groupUsers . length == 0 ) {
this . filters . createUser = null
} else {
var user = groupUsers [ 0 ]
this . filters . createUser = user
}
} else if ( this . userType == 'hisHandler' ) {
} else if ( option . action == 'hisHandler' ) {
if ( groupUsers == null || groupUsers . length == 0 ) {
this . filters . hisHandler = null
} else {
var user = groupUsers [ 0 ]
this . filters . hisHandler = user
}
} else if ( option . action == 'editHandlerUserid' ) {
this . editXmQuestionSomeFields ( option . data , "handlerUserid" , groupUsers )
return ;
} else {
if ( groupUsers == null || groupUsers . length == 0 ) {
this . filters . handlerUserid = ''
@ -900,8 +977,10 @@
return msg ;
} ,
onTagSelected ( tags ) {
this . tagSelectVisible = false ;
onTagSelected ( tags , option ) {
if ( option . action == "editTagIds" ) {
this . editXmQuestionSomeFields ( option . data , "tagIds" , tags ) ;
} else {
if ( ! tags || tags . length == 0 ) {
this . filters . tags = [ ]
} else {
@ -910,11 +989,82 @@
this . searchXmQuestions ( ) ;
}
} ,
editXmQuestionSomeFields ( row , fieldName , $event ) {
var params = { ids : [ row . id ] } ;
if ( this . sels . length > 0 ) {
if ( ! this . sels . some ( k => k . id == row . id ) ) {
this . $notify ( { showClose : true , message : '请操作选中的行或者取消选中的行再操作其它行' , type : 'warning' } )
return ;
}
params . ids = this . sels . map ( i => i . id )
}
if ( fieldName === 'handlerUserid' ) {
if ( $event ) {
params [ fieldName ] = $event [ 0 ] . userid ;
params . handlerUsername = $event [ 0 ] . username
} else {
return ;
}
} else if ( fieldName === 'tagIds' ) {
if ( $event ) {
params [ fieldName ] = $event . map ( i => i . tagId ) . join ( "," ) ;
params . tagNames = $event . map ( i => i . tagName ) . join ( "," ) ;
} else {
return ;
}
} else if ( fieldName === 'workload' ) {
params = { ... params , ... $event }
} else {
params [ fieldName ] = $event
}
editXmQuestionSomeFields ( params ) . then ( res => {
var tips = res . data . tips ;
if ( tips . isOk ) {
if ( this . sels . length > 0 ) {
this . sels . forEach ( i => {
Object . assign ( i , params )
} )
} else {
Object . assign ( row , params )
}
} else {
this . $notify ( { showClose : true , message : tips . msg , type : tips . isOk ? 'success' : 'error' } )
}
} )
} ,
/ * *
* 'bugSeverity' , 'bugSolution' , 'bugStatus' , 'bugType' , 'priority' bugRepRate
* /
formaterByDicts ( row , property , cellValue ) {
var property = property
var dict = null ;
if ( property == 'bugSeverity' ) {
dict = this . dicts [ 'bugSeverity' ]
} else if ( property == 'solution' ) {
dict = this . dicts [ 'bugSolution' ]
} else if ( property == 'bugStatus' ) {
dict = this . dicts [ 'bugStatus' ]
} else if ( property == 'priority' ) {
dict = this . dicts [ 'priority' ]
} else if ( property == 'bugType' ) {
dict = this . dicts [ 'bugType' ]
} else if ( property == 'repRate' ) {
dict = this . dicts [ 'bugRepRate' ]
}
if ( ! dict ) {
return cellValue ;
} else {
var item = dict . find ( i => i . id == cellValue )
return item ? item . name : cellValue ;
}
} ,
} , / / e n d m e t h o d s
components : {
'xm-question-add' : XmQuestionAdd ,
'xm-question-edit' : XmQuestionEdit ,
XmGroupMng , XmProjectSelect , xmMenuSelect , XmProductSelect , TagMng ,
XmGroupDialo g , XmProjectSelect , xmMenuSelect , XmProductSelect , TagDialog
/ / 在 下 面 添 加 其 它 组 件
} ,
mounted ( ) {
@ -935,13 +1085,9 @@
this . maxTableHeight = util . calcTableMaxHeight ( this . $refs . table . $el ) ;
this . getXmQuestions ( ) ;
} ) ;
initSimpleDicts ( 'all' , [ 'bugSeverity' , 'bugSolution' , 'bugStatus' , 'bugType' , 'priority' ] ) . then ( res => {
initSimpleDicts ( 'all' , [ 'bugSeverity' , 'bugSolution' , 'bugStatus' , 'bugType' , 'priority' , 'bugRepRate' ] ) . then ( res => {
if ( res . data . tips . isOk ) {
this . dicts [ 'bugSeverity' ] = res . data . data . bugSeverity
this . dicts [ 'bugSolution' ] = res . data . data . bugSolution
this . dicts [ 'bugStatus' ] = res . data . data . bugStatus
this . dicts [ 'bugType' ] = res . data . data . bugType
this . dicts [ 'priority' ] = res . data . data . priority
this . dicts = res . data . data ;
}
} ) ;
}