layui的复杂表头

在这里插入图片描述

   table.render({
    id: "rowId",
    elem: '#declaration-table',
    where: {
     projectName: $("input[name='projectName']").val() == "" ? null : $("input[name='projectName']").val(),
     govName: $("input[name='govName']").val() == "" ? null : $("input[name='govName']").val(),
     year: $("#declare-year").val() == "" ? null : $("#declare-year").val(),
     scoreStart: $("input[name='scoreStart']").val() == "" ? null : $("input[name='scoreStart']").val(),
     scoreEnd: $("input[name='scoreEnd']").val() == "" ? null : $("input[name='scoreEnd']").val()
    },
    url: url,
    size: 'sm',
    page: {
     limit: 10,
     limits: [10, 10, 20, 30, 40, 50],
     curr: localStorage.getItem("moduleCode") == self.moduleCode ? parseInt(localStorage.getItem("page")) : 1,// 设定初始在第一页
    },
    method: 'post',
    defaultToolbar: ['filter'],
    contentType: 'application/json',
    cols: [
     [{
      field: 'GOV_NAME',
      // width: 150,
      title: '建设单位',
      rowspan: 3,
      sort: 'true',
      align: 'center'
     },
     {
      field: 'PROJECT_NAME',
      // width: 150,
      title: '项目名称',
      rowspan: 3,
      sort: 'true',
      align: 'center'
     },
     {
      field: 'SORE',
      // width: 120,
      title: '总分',
      rowspan: 3,
      sort: 'true',
      align: 'center'
     },
     {
      title: '得分情况',
      colspan: 13,
      align: 'center'
     },
     {
      title: '扣分项',
      fixed: 'right',
      // minWidth: '100',
      rowspan: 3,
      align: 'center',
      templet: function (data) {
       return self.renderFormBar(data);
      }
     }],
     [{
      title: '建设计划填报',
      colspan: 2,
      align: 'center'
     },
     {
      title: '项目备案',
      colspan: 3,
      align: 'center'
     },
     {
      title: '验收材料',
      colspan: 5,
      align: 'center'
     },
     {
      title: '运维文档',
      colspan: 3,
      align: 'center'
     }],
     [{
      field: 'CONSTRUCATION_PLAN_FILLING',
      // width: 120,
      title: '建设计划填报',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'CONSTRUCATION_PLAN_CONFIRM',
      // width: 120,
      title: '建设计划确认',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'DEMAND_FOR_RECORD',
      // width: 120,
      title: '需求分析报告备案',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'TENDER_FOR_RECORD',
      // width: 120,
      title: '标书备案',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'CONTRACT_FOR_RECORD',
      // width: 120,
      title: '合同备案',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'ONLINE',
      // width: 120,
      title: '上线',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'BEGINNINGTES',
      // width: 120,
      title: '初验',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'INSURANCE',
      // width: 120,
      title: '等保',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'MEASUREMENT',
      // width: 120,
      title: '测评',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'FNALTEST',
      // width: 120,
      title: '终验',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'MAINTENANCE_PAN',
      // width: 120,
      title: '维护方案',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'MAINTENANCE_SYSTEM',
      // width: 120,
      title: '维护制度',
      sort: 'true',
      align: 'center'
     },
     {
      field: 'OPERATIONAL_CONDITIONS',
      // width: 120,
      title: '项目运维情况报告',
      sort: 'true',
      align: 'center'
     }]
    ],
    done: function (res, curr, count) {
     // 设置当前页数
     localStorage.setItem("page", curr);
     localStorage.setItem("moduleCode", self.moduleCode);
    }
   });
   // 查询
   $('#queryDeclaration').on('click', function () {
    table.reload('rowId', {
     page: {
      curr: 1
     },
     where: {
      projectName: $("input[name='projectName']").val() == "" ? null : $("input[name='projectName']").val(),
      govName: $("input[name='govName']").val() == "" ? null : $("input[name='govName']").val(),
      year: $("#declare-year").val() == "" ? null : $("#declare-year").val(),
      scoreStart: $("input[name='scoreStart']").val() == "" ? null : $("input[name='scoreStart']").val(),
      scoreEnd: $("input[name='scoreEnd']").val() == "" ? null : $("input[name='scoreEnd']").val()
     },
    })
   });
 

附加:
1.colspan:单元格所占列数(默认:1)
2.rowspan:单元格所占行数(默认:1)
3.cols[[第一行],[第二行],[第三行]]

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值