layui吧 关注:390贴子:1,032
  • 2回复贴,共1

新人求组。这是为什么一直报错

只看楼主收藏回复

<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="utf-8">
<title>测试</title>
</head>
<body>
<# include ../common/link >
<div>
<form action="" class="parent">
<input type="text" class="search" placeholder="搜索">
<input type="button" name="" id="" class="btn">
<button type="button" autofocus="autofocus">搜索</button>
</form>
</div>
<table class="layui-hide" id="record" lay-filter="test"></table>
<# include ../common/footer >
<script >
layui.use('table', function (){
var table = layui.table;
// 初始化表格
table.render({
id:record,
elem:'#record',
url: baseServer+"/baobiao/RecordInit",
filter: { cache: true },
method:"post",
autoRowHeight: true,
queryParams: function (data) {
// 这里会把你收集的表单数据作为查询条件,适用于表格的查询,不仅仅导出excel适用
nebula.form.toObject('form-query', data);
},
cols: [[
{field: 'id', width: 150, title: 'ID'}
, {field: 'data', width: 300, title: '日期'}
, {field: 'quality_assurance_id', width: 140, title: 'QA工号'}
, {field: 'quality_assurance_name', title: 'QA姓名', templet: function (obj) {
if (obj.status === STATUS_ENABLE) {
return '<span class="color-green">启用</span>';
} else {
return '<span class="color-grey">停用</span>';
}
},
}
, {templet: '#operationTpl', width: 110, align: 'center', title: '操作', fixed: 'right'}
]]
});
})
</script>
</body>
</html>


IP属地:湖南1楼2021-10-28 15:38回复


    IP属地:湖南2楼2021-10-28 15:40
    回复
      接口调用成功了。date里面有数据,但是一直报这个错。数据也显示不出来


      IP属地:湖南3楼2021-10-28 15:42
      回复