@ -229,7 +229,7 @@
< el -table -column prop = "status" label = "状态" min -width = " 80 " sortable >
< el -table -column prop = "status" label = "状态" min -width = " 80 " sortable >
< template slot -scope = " scope " >
< template slot -scope = " scope " >
< div class = "cell-text" >
< div class = "cell-text" >
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in [ formatterMenuStatusDicts(scope.row.status)] " :key ="index" > {{ item.name }} < / el -button >
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in formatterMenuStatusDicts(scope.row.status)" :key ="index" > {{ item.name }} < / el -button >
< / div >
< / div >
< span class = "cell-bar" >
< span class = "cell-bar" >
< el -select v-model ="scope.row.status" placeholder="需求状态" style="display:block;" @change="editXmMenuSomeFields(scope.row,'status',$event)" >
< el -select v-model ="scope.row.status" placeholder="需求状态" style="display:block;" @change="editXmMenuSomeFields(scope.row,'status',$event)" >
@ -241,7 +241,7 @@
< el -table -column prop = "priority" label = "优先级" width = "100" sortable >
< el -table -column prop = "priority" label = "优先级" width = "100" sortable >
< template slot -scope = " scope " >
< template slot -scope = " scope " >
< div class = "cell-text" >
< 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 >
< 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 >
< / div >
< span class = "cell-bar" >
< span class = "cell-bar" >
< el -select v-model ="scope.row.priority" placeholder="优先级" style="display:block;" @change="editXmMenuSomeFields(scope.row,'priority',$event)" >
< el -select v-model ="scope.row.priority" placeholder="优先级" style="display:block;" @change="editXmMenuSomeFields(scope.row,'priority',$event)" >
@ -1240,9 +1240,12 @@
} ,
} ,
formatterPriorityDicts ( cellValue ) {
formatterPriorityDicts ( cellValue ) {
if ( ! cellValue && cellValue !== '0' ) {
return [ ]
}
var key = "priority" ;
var key = "priority" ;
if ( this . dicts [ key ] == undefined || this . dicts [ key ] == null || this . dicts [ key ] . length == 0 ) {
if ( this . dicts [ key ] == undefined || this . dicts [ key ] == null || this . dicts [ key ] . length == 0 ) {
return { id : cellValue , name : cellValue , className : 'primary' } ;
return [ { id : cellValue , name : cellValue , className : 'primary' } ] ;
}
}
var list = this . dicts [ key ] . filter ( i => i . id == cellValue )
var list = this . dicts [ key ] . filter ( i => i . id == cellValue )
if ( list . length > 0 ) {
if ( list . length > 0 ) {
@ -1260,16 +1263,19 @@
} else {
} else {
data . className = 'primary'
data . className = 'primary'
}
}
return data ;
return [ data ] ;
} else {
} else {
return { id : cellValue , name : cellValue , className : 'primary' }
return [ { id : cellValue , name : cellValue , className : 'primary' } ]
}
}
} ,
} ,
formatterMenuStatusDicts : function ( cellValue ) {
formatterMenuStatusDicts : function ( cellValue ) {
if ( ! cellValue && cellValue !== '0' ) {
return [ ]
}
var key = "menuStatus" ;
var key = "menuStatus" ;
if ( this . dicts [ key ] == undefined || this . dicts [ key ] == null || this . dicts [ key ] . length == 0 ) {
if ( this . dicts [ key ] == undefined || this . dicts [ key ] == null || this . dicts [ key ] . length == 0 ) {
return { id : cellValue , name : cellValue , className : 'primary' } ;
return [ { id : cellValue , name : cellValue , className : 'primary' } ] ;
}
}
var list = this . dicts [ key ] . filter ( i => i . id == cellValue )
var list = this . dicts [ key ] . filter ( i => i . id == cellValue )
if ( list . length > 0 ) {
if ( list . length > 0 ) {
@ -1285,9 +1291,9 @@
} else {
} else {
data . className = 'danger'
data . className = 'danger'
}
}
return data ;
return [ data ] ;
} else {
} else {
return { id : cellValue , name : cellValue , className : 'primary' }
return [ { id : cellValue , name : cellValue , className : 'primary' } ]
}
}
} ,
} ,