网站
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. communicateOptions:[]
  14. },
  15. };
  16. var tools = new Tools();
  17. module.init = function (page) {
  18. //新闻管理列表
  19. tools.doGet(dictType + '/communicate_type', {}, module.dictType , true);
  20. };
  21. //获取地址栏参数
  22. function getQueryVariable(variable){
  23. var query = window.location.search.substring(1);
  24. var vars = query.split("&");
  25. for (var i=0;i<vars.length;i++) {
  26. var pair = vars[i].split("=");
  27. if(pair[0] == variable){return pair[1];}
  28. }
  29. return(false);
  30. }
  31. module.dictType = function (data) {
  32. module.data.communicateOptions = data.data;
  33. tools.doGet(communicateDetail + '/' + getQueryVariable('id'), {}, module.newList , true);
  34. }
  35. //新闻列表
  36. module.newList = function (data) {
  37. console.log(data)
  38. if (data.code == 200) {
  39. var content = data.data;
  40. content.communicateType = module.selectDictLabel(module.data.communicateOptions,content.communicateType)
  41. module.data.newList = content;
  42. var newData = template('newData', module.data);
  43. $("#newContent").html(newData);
  44. if (document.body.scrollHeight > document.body.offsetHeight){
  45. document.getElementById('bottomInformation').style.position = 'relative';
  46. }
  47. }
  48. }
  49. module.selectDictLabel = function (datas, value) {
  50. var actions = [];
  51. Object.keys(datas).some((key) => {
  52. if (datas[key].dictValue == ('' + value)) {
  53. actions.push(datas[key].dictLabel);
  54. return true;
  55. }
  56. })
  57. return actions.join('');
  58. }
  59. goDetail = function(id){
  60. tools.skip('/agriculturalLawEnforcement/view/workDynamics/workDetail.html?id='+id);
  61. }
  62. return module;
  63. });