夏邑12345_前端

zhengce.js 1.6KB

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