IM12345_Web demo - 代码源于 商丘市12345项目

zhengce.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. $(document).ready(function() {
  2. $.support.cors = true;
  3. GetWebReleaseList();
  4. //顶部hover
  5. $('.topbarWx').hover(function() {
  6. $('.topbarWx .topbarWx-box').css('left', $(this).offset().left);
  7. });
  8. $('.topbarClient').hover(function() {
  9. $('.topbarClient .topbarClient-box').css('left', $(this).offset().left);
  10. });
  11. });
  12. function GetWebReleaseList() {
  13. layui.use('table', function() {
  14. var table = layui.table;
  15. //方法级渲染
  16. table.render({
  17. elem: '#list',
  18. url: huayi.config.callcenter_url + "Web/GetWebNewsList",
  19. method: 'get', //如果无需自定义HTTP类型,可不加该参数
  20. skin: 'row', //line (行边框风格) row (列边框风格) nob (无边框风格)
  21. even: true, //开启隔行背景
  22. where: {
  23. type: 4
  24. },
  25. limit: 10,
  26. limits: [10],
  27. request: {
  28. pageName: 'page' //页码的参数名称,默认:page
  29. ,
  30. limitName: 'pagesize' //每页数据量的参数名,默认:limit
  31. },
  32. response: {
  33. statusName: 'state', //状态字段名称
  34. statusCode: 'success', //状态字段成功值
  35. countName: 'total' //数据总数的字段名称,默认:count
  36. ,
  37. dataName: 'rows' //数据列表的字段名称,默认:data
  38. },
  39. cols: [
  40. [{
  41. field: 'bt',
  42. minWidth: 150,
  43. title: '主题',
  44. templet: '#switchTpl'
  45. }, {
  46. field: 'sj',
  47. width: 220,
  48. title: '发布时间'
  49. }]
  50. ],
  51. page: true
  52. });
  53. });
  54. }
  55. function ComContent(val, row) {
  56. return '<div class="imgs" >' +
  57. '<a href="zhengce-con.html?id=' + row.id + '"> ' + val + '</a>' +
  58. '</div>';
  59. }