< el-table:data = " items" style = " width :  100%; margin-top :  16px" border :key = " randomKey" > < el-table-columnlabel = " 计划名称" property = " name" > < templateslot-scope = " {row}" > < templatev-if = " row.edit" > < el-inputv-model = " row.name" > </ el-input> </ template> < spanv-else > </ span> </ template> </ el-table-column> < el-table-columnlabel = " 计划完成时间" property = " executionDate" width = " 175" > < templateslot-scope = " scope" > < el-date-pickerv-if = " scope.row.edit" style = " width :  153px; " type = " date" v-model = " scope.row.timeEnd" > </ el-date-picker> < spanv-else > </ span> </ template> </ el-table-column> < el-table-columnlabel = " 协同人" property = " leaderList" > < templateslot-scope = " scope" > < templatev-if = " scope.row.edit" > < el-selectv-model = " scope.row.leaderList" clearable  filterable  multiple > < el-optionv-for = " item in userList" :key = " item.userId" :label = " item.nickname" :value = " item.userId" > </ el-option> </ el-select> </ template> < spanv-else > </ span> </ template> </ el-table-column> < el-table-columnlabel = " 执行人" width = " 80" > < template> < span> </ span> </ template> </ el-table-column> < el-table-columnalign = " center" label = " 操作" width = " 100" > < templateslot-scope = " {row,column,$index}" > < el-buttonv-if = " row.edit" type = " success" icon = " el-icon-check" circle size = " small" @click = " confirmEdit(row)" > </ el-button> < el-buttonv-if = " row.edit" icon = " el-icon-close" circle size = " small" @click = " cancelEdit(row)" > </ el-button> < el-buttontype = " primary" icon = " el-icon-edit" circle v-if = " !row.edit" size = " small" @click = " row.edit=!row.edit" > </ el-button> < el-buttontype = " danger" icon = " el-icon-delete" circle size = " small" @click = " handleDelete($index)" v-if = " !row.edit" > </ el-button> </ template> </ el-table-column> </ el-table> </ div> < divstyle = " display :  flex; margin-top :  28px; justify-content :  center; " > < el-button@click = " addSon" size = " small" icon = " el-icon-plus" > </ el-button> </ div> cancelEdit ( row )  { row. name =  row. oldNamerow. leaderList =  row. oldLeaderListrow. timeEnd =  row. oldTimeEndrow. leaderName =  row. oldLeaderNamerow. edit =  false this . $message ( { message :  '已恢复原值' , type :  'warning' } ) } , confirmEdit ( row )  { row. edit =  false row. oldName =  row. namerow. oldLeaderList =  row. leaderListrow. oldTimeEnd =  row. timeEndlet  arr =  [ ] row. leaderList. forEach ( i  =>  { let  userName =  this . userList. find ( ( { userId} )  =>  userId ===  i) . nicknamearr. push ( userName) } ) row. leaderName =  arr. join ( ) row. oldLeaderName =  row. leaderNamethis . $message ( { message :  '修改成功' , type :  'success' } ) } , handleDelete ( index )  { this . items. splice ( index,  1 ) } , addSon ( )  { this . items. push ( { name :  null , timeEnd :  null , leaderList :  [ ] , leaderName :  null , edit :  true } ) } ,