网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /**
  2. * Created by Administrator on 2021/4/5.
  3. */
  4. define(['jquery', "template", "Tools", "echarts", 'swiper'], function ($, template, Tools, echarts, swiper) {
  5. //数据存储
  6. var module = {
  7. data: {
  8. //服务器地址
  9. serverApi:'',
  10. //焦点图数据
  11. focusList: [],
  12. communicateList: [],
  13. },
  14. };
  15. var tools = new Tools();
  16. module.init = function (page) {
  17. //新闻管理列表
  18. // tools.doGet(news + '/003//7', {}, module.focusNews , true);
  19. tools.doGet(getTopDeptId, {}, module.getInformation , true);
  20. };
  21. module.getInformation = function (data) {
  22. console.log(data)
  23. tools.doGet(news + '/003/'+data.data+'/7', {}, module.newList , true);
  24. tools.doGet(news + '/001/'+data.data+'/7', {}, module.noticeList , true);
  25. tools.doGet(news + '/002/'+data.data+'/7', {}, module.enforcementList , true);
  26. tools.doGet(getScheme + '/'+data.data+'/7', {}, module.schemeList , true);
  27. }
  28. //新闻列表
  29. module.newList = function (data) {
  30. if (data.code == 200) {
  31. var content = data.data;
  32. var focusList = [];
  33. for (var i = 0; i < content.length; i++) {
  34. var imgStrs = content[i].content.match(/<img.*?>/g)
  35. var title = content[i].title;
  36. var id = content[i].id;
  37. if (imgStrs != null && imgStrs != '') {
  38. focusList.push({img:imgStrs[0],title:title,id:id})
  39. }
  40. }
  41. module.data.focusList = focusList;
  42. var bannerFocusData = template('bannerFocusData', module.data);
  43. $("#bannerFocusContent").html(bannerFocusData);
  44. new Swiper('#bannerFocusWrap', {
  45. pagination: '.page-pagination',
  46. paginationClickable: true,
  47. autoplay : 2000,
  48. loop:true
  49. })
  50. console.log(focusList)
  51. module.data.newList = content;
  52. var newData = template('newData', module.data);
  53. $("#newContent").html(newData);
  54. }
  55. }
  56. //公告列表
  57. module.noticeList = function (data) {
  58. if (data.code == 200) {
  59. var content = data.data;
  60. module.data.noticeList = content;
  61. var noticeData = template('noticeData', module.data);
  62. $("#noticeContent").html(noticeData);
  63. }
  64. }
  65. //执法依据
  66. module.enforcementList = function (data) {
  67. if (data.code == 200) {
  68. var content = data.data;
  69. module.data.enforcementList = content;
  70. var enforcementData = template('enforcementData', module.data);
  71. $("#enforcementContent").html(enforcementData);
  72. }
  73. }
  74. //方案公开
  75. module.schemeList = function (data) {
  76. if (data.code == 200) {
  77. var content = data.data;
  78. module.data.schemeList = content;
  79. var schemeData = template('schemeData', module.data);
  80. $("#schemeContent").html(schemeData);
  81. }
  82. }
  83. //焦点图数据
  84. module.focusNews = function (data) {
  85. if (data.code == 200) {
  86. var content = data.data;
  87. var focusList = [];
  88. for (var i = 0; i < content.length; i++) {
  89. var imgStrs = content[i].content.match(/<img.*?>/g)
  90. var title = content[i].title;
  91. var id = content[i].id;
  92. if (imgStrs != null && imgStrs != '') {
  93. focusList.push({img:imgStrs[0],title:title,id:id})
  94. }
  95. }
  96. //console.log(focusList)
  97. module.data.focusList = focusList;
  98. var bannerFocusData = template('bannerFocusData', module.data);
  99. $("#bannerFocusContent").html(bannerFocusData);
  100. new Swiper('#bannerFocusWrap', {
  101. pagination: '.page-pagination',
  102. paginationClickable: true,
  103. autoplay : 2000,
  104. loop:true
  105. })
  106. }
  107. }
  108. goDetail = function(id){
  109. tools.skip('/agriculturalLawEnforcement/view/workDynamics/workDetail.html?id='+id);
  110. }
  111. goNotice = function(id){
  112. tools.skip('/agriculturalLawEnforcement/view/noticeAnnouncement/noticeDetail.html?id='+id);
  113. }
  114. goScheme = function(id){
  115. tools.skip('/agriculturalLawEnforcement/view/schemeDisclosure/schemeDetail.html?id='+id);
  116. }
  117. goEnforcement = function(id){
  118. tools.skip('/agriculturalLawEnforcement/view/basis/basisDetail.html?id='+id);
  119. }
  120. goInteractSearch = function(){
  121. tools.skip('view/interact/interactList.html?keyWord='+$('#interactInput').val());
  122. }
  123. return module;
  124. });