@ -5,9 +5,15 @@
< el -table -column type = "selection" label = "全选" > < / e l - t a b l e - c o l u m n >
< el -table -column type = "selection" label = "全选" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "name" label = "名称" >
< el -table -column prop = "name" label = "名称" >
< template slot -scope = " scope " >
< template slot -scope = " scope " >
< div class = "icon" : style = "{backgroundColor: scope.row.ntype==='1'?'#E6A23C':'#409EFF '}" >
< div class = "icon" : style = "{backgroundColor: scope.row.ntype==='1'?'#E6A23C':'#1CC7EA '}" >
< i :class ="scope.row.ntype==='1'?'el-icon-odometer':'el-icon-s-operation'" > < / i >
< i :class ="scope.row.ntype==='1'?'el-icon-odometer':'el-icon-s-operation'" > < / i >
< / div > { { scope . row . name } }
< / div >
< span class = "my-cell-text" >
{ { scope . row . sortLevel } } & nbsp ; { { scope . row . name } }
< / span >
< span class = "my-cell-bar" >
< el -input title = "序号" style = "width:20%;" v-model ="scope.row.sortLevel" placeholder="序号" @change="editXmTaskSomeFields(scope.row,'sortLevel',$event)"></el-input><el-input title="名称" style="width:78%;" placeholder="名称" v-model="scope.row.name" @change="editXmTaskSomeFields(scope.row,'name',$event)" > < / el -input >
< / span >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< el -table -column
< el -table -column
@ -20,7 +26,7 @@
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in formatterTaskStateDicts(scope.row.taskState)" :key ="index" > {{ item.name }} < / el -button >
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in formatterTaskStateDicts(scope.row.taskState)" :key ="index" > {{ item.name }} < / el -button >
< / div >
< / div >
< span class = "cell-bar" >
< span class = "cell-bar" >
< el -select v-model ="scope.row.taskState" placeholder="任务状态" style="display:block;" @change="editXmTaskSomeFields(scope.row,'taskState',$event)" >
< el -select @visible-change ="selectVisible(scope.row,$event)" v-model ="scope.row.taskState" placeholder="任务状态" style="display:block;" @change="editXmTaskSomeFields(scope.row,'taskState',$event)" >
< el -option :value ="item.id" :label ="item.name" v-for ="(item,index) in dicts.taskState" :key ="index" > < / el -option >
< el -option :value ="item.id" :label ="item.name" v-for ="(item,index) in dicts.taskState" :key ="index" > < / el -option >
< / e l - s e l e c t >
< / e l - s e l e c t >
< / span >
< / span >
@ -49,7 +55,7 @@
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in formatterPriorityDicts(scope.row.level)" :key ="index" > {{ item.name }} < / el -button >
< el -button style = "display:block;" :type ="item.className" plain round v-for ="(item,index) in formatterPriorityDicts(scope.row.level)" :key ="index" > {{ item.name }} < / el -button >
< / div >
< / div >
< span class = "cell-bar" >
< span class = "cell-bar" >
< el -select v-model ="scope.row.level" placeholder="优先级" style="display:block;" @change="editXmTaskSomeFields(scope.row,'level',$event)" >
< el -select @visible-change ="selectVisible(scope.row,$event)" v-model ="scope.row.level" placeholder="优先级" style="display:block;" @change="editXmTaskSomeFields(scope.row,'level',$event)" >
< el -option :value ="item.id" :label ="item.name" v-for ="(item,index) in dicts.priority" :key ="index" > < / el -option >
< 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 >
< / e l - s e l e c t >
< / span >
< / span >
@ -162,6 +168,11 @@ export default {
} , / / e n d d a t a
} , / / e n d d a t a
methods : {
methods : {
selectVisible ( row , visible ) {
if ( visible ) {
this . rowClick ( row )
}
} ,
/ / 选 择 行 x m T a s k
/ / 选 择 行 x m T a s k
selsChange : function ( sels ) {
selsChange : function ( sels ) {
this . sels = sels ;
this . sels = sels ;
@ -262,6 +273,7 @@ export default {
}
}
editXmTaskSomeFields ( params ) . then ( res => {
editXmTaskSomeFields ( params ) . then ( res => {
debugger ;
var tips = res . data . tips ;
var tips = res . data . tips ;
if ( tips . isOk ) {
if ( tips . isOk ) {
if ( this . sels . length > 0 ) {
if ( this . sels . length > 0 ) {
@ -272,7 +284,10 @@ export default {
} else {
} else {
Object . assign ( row , params )
Object . assign ( row , params )
}
}
Object . assign ( this . editFormBak , this . editForm )
} else {
} else {
Object . assign ( this . editForm , this . editFormBak )
this . $notify ( { position : 'bottom-left' , showClose : true , message : tips . msg , type : tips . isOk ? 'success' : 'error' } )
this . $notify ( { position : 'bottom-left' , showClose : true , message : tips . msg , type : tips . isOk ? 'success' : 'error' } )
}
}
} )
} )
@ -306,6 +321,7 @@ export default {
} ,
} ,
rowClick : function ( row ) {
rowClick : function ( row ) {
this . editForm = row ;
this . editForm = row ;
this . editFormBak = Object . assign ( { } , this . editForm )
/ / t h i s . $ e m i t ( ' r o w - c l i c k ' , r o w , ) ; / / @ r o w - c l i c k = " r o w C l i c k "
/ / t h i s . $ e m i t ( ' r o w - c l i c k ' , r o w , ) ; / / @ r o w - c l i c k = " r o w C l i c k "
} ,
} ,
@ -394,6 +410,17 @@ export default {
} ;
} ;
< / script >
< / script >
< style scoped >
< style lang = "less" scoped >
. my - cell - bar {
display : none ;
}
. el - table__row td : hover {
. my - cell - bar {
display : inline - block ;
}
. my - cell - text {
display : none ;
}
}
< / style >
< / style >