网站
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.

complaintDetail.js 2.0 KiB

3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. tools.doGet(communicateDetail + '/' + getQueryVariable('id'), {}, module.newList , true);
  21. };
  22. //获取地址栏参数
  23. function getQueryVariable(variable){
  24. var query = window.location.search.substring(1);
  25. var vars = query.split("&");
  26. for (var i=0;i<vars.length;i++) {
  27. var pair = vars[i].split("=");
  28. if(pair[0] == variable){return pair[1];}
  29. }
  30. return(false);
  31. }
  32. module.dictType = function (data) {
  33. module.data.communicateOptions = data.data;
  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. }
  45. }
  46. module.selectDictLabel = function (datas, value) {
  47. var actions = [];
  48. Object.keys(datas).some((key) => {
  49. if (datas[key].dictValue == ('' + value)) {
  50. actions.push(datas[key].dictLabel);
  51. return true;
  52. }
  53. })
  54. return actions.join('');
  55. }
  56. goDetail = function(id){
  57. tools.skip('/agriculturalLawEnforcement/view/workDynamics/workDetail.html?id='+id);
  58. }
  59. return module;
  60. });