<vue-como-table ref="table_szjcomo" :config="config" @size-change="sizeChange" @page-current-change="pageCurrentChange" @cell-edit="inputEditHandle" @switch-change="switchChangeHadle" @tag-click="tagClickHandle">
<el-table-column fixed="right" label="操作" align="center" width="170" slot="actions">
<template slot-scope="scope">
<el-button size="mini" type="warning">编辑</el-button>
<el-button type="danger" size="mini">删除</el-button>
</template>
</el-table-column>
</vue-como-table>
export default {
data() {
let that = this;
return {
currPage:1,
pageLimit:30,
config:{
cols:that.getCols(),
defaultToolbar:['export','print'],
//特别说明 除了导出和打印功能外,还可以自定义默认工具
//示例如下 ['export','print',{icon:'xxx',title:'提示说明',event:'cusEvent'}]
//温馨提示:icon图标只支持element ui的图标库
page:{currentPage:that.currPage,pageSize:that.pageLimit,total:0},
data:[],
attr:{border:true},
width:'100%'
},
};
},
methods:{
/**
* [inputEditHandle 表单编辑]
* @author szjcomo
* @date 2020-10-26
* @param {[type]} value [description]
* @param {[type]} field [description]
* @param {[type]} row [description]
* @return {[type]} [description]
*/
inputEditHandle:function(value,field,row) {
console.log(value,field,row);
},
/**
* [switchChangeHadle 开关事件]
* @author szjcomo
* @date 2020-10-26
* @param {[type]} value [description]
* @param {[type]} field [description]
* @param {[type]} row [description]
* @return {[type]} [description]
*/
switchChangeHadle:function(value,field,row) {
console.log(value,field,row);
},
/**
* [tagClickHandle 标签事件]
* @author szjcomo
* @date 2020-10-26
* @param {[type]} value [description]
* @param {[type]} field [description]
* @param {[type]} row [description]
* @return {[type]} [description]
*/
tagClickHandle:function(value,field,row) {
console.log(value,field,row);
},
getCols:function() {
return [
{label:'序号',type:'selection',align:'center',fixed:'left'},
{label:'头像',prop:'head_image',align:'center',type:'image',options:{
alt:'用户头像',formatter:function(value,row){
return value;
}
}},
{label:'姓名',prop:'uname',align:'center',width:80,showOverflowTooltip:true,edit:true},
{label:'性别',prop:'gender',align:'center',width:80,showOverflowTooltip:true,edit:true},
{label:'手机号码',prop:'call_phone',align:'center',width:120,
showOverflowTooltip:true,edit:true},
{label:'身份证号',prop:'idcardno',align:'center',width:150,showOverflowTooltip:true},
{label:'是否付费',prop:'is_pay',align:'center',width:80,showOverflowTooltip:true,type:'icon',
options:{
formatter:function(value,row) {
if(value) return 'el-icon-success';
return 'el-icon-error';
},
style:function(value,row) {
if(value) return {color:'#02c367',fontSize:'20px'};
return {color:'red',fontSize:'20px'};
}
}},
{label:'学生类型',prop:'student_type',align:'center',width:150,showOverflowTooltip:true,
formatter:function(row, column, cellValue, index){
if(row.student_type == 0 && row.midden_exam == 0) {
return '应届生(未参加)';
} else if(row.student_type == 0 && row.midden_exam == 1) {
return '应届生(参加)';
} else {
return '往届生';
}
}},
{label:'第一志愿',prop:'specialty_name',align:'center',width:100,showOverflowTooltip:true},
{label:'第二志愿',prop:'specialty_second_name',align:'center',width:100,
showOverflowTooltip:true},
{label:'报名进度',prop:'status_id',align:'center',width:120,showOverflowTooltip:true,
type:'progress',options:{
attr:function(value,row) {
if(value == 1) {
return {percentage:30,showText:false};
} else if(value == 2) {
return {percentage:40,status:'warning',showText:false};
} else if(value == 3) {
return {percentage:80,status:'exception',showText:false};
} else if(value == 4) {
return {percentage:100,status:'success',showText:false};
} else if(value == 5) {
return {percentage:40,status:'warning',showText:false};
} else {
return {percentage:0,showText:false};
}
}
}},
{label:'报名状态',prop:'status_desc',align:'center',width:120,showOverflowTooltip:true,type:'tag',options:{
attr:function(value,row) {
if(row.status_id == 4) {
return {size:'small',type:'success',effect:'dark'};
} else if(row.status_id == 6) {
return {size:'small',type:'info'};
}
return {size:'small',type:'warning',effect:'dark'};
}
}
},
{label:'服从调剂',prop:'is_deploy',align:'center',width:100,showOverflowTooltip:true,type:'switch'},
{label:'所在地址',prop:'address',showOverflowTooltip:true,minWidth:300},
{label:'家长姓名',prop:'parent_uname',showOverflowTooltip:true,width:80,align:'center'},
{label:'家长电话',prop:'parent_phone',showOverflowTooltip:true,width:120,align:'center'},
{label:'报名时间',prop:'delete_time',showOverflowTooltip:true,width:160,align:'center'},
{slot:'actions',label:'操作'}
];
}
}
}