Question: The data format returned in the background in layui is not the default format, how to set the table table

$.ajax({
    url: '/attend/getByEmp?month='+data.field.month+'&empid='+data.field.id,method: 'get',
}).done(function (result) {
    var list;
if (result.code == 0) {    //result是返回的数据
        
        list = result.data.attrstList;}
    
    
    // -----------------table start----------------
     // table data, header
 var tableContent = {
         id : 'tableId' , data : list , cols : [[    
        
        
            {field: 'date', width: 140, title: '打卡日期', sort: true,
templet:function(d){
                    return '<span>'+ utcTodate(new Date(d.date)) +'</span>'
}                                
            }]]}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325483565&siteId=291194637