PageSourceSearch

https://www.jms.gov.cn/jms/xhtml/static/js/zmhd.js

js jms.gov.cn collected 2026-10-02 14:51:23 UTC 9,699 bytes, 326 lines download raw bytes

1'use strict';
2var _depId = '38befaa4ae764fa3b2546f4d6d5e2916';//部门id用于查在线访谈数据
3var _siteId = '9afd5c53b065432dab81f251a9911102';//部门id下无数据,所以改取站点id
4var last = 0;
5var winWid = $(window).width();
6var slidesPerView = 3;
7var _total = 0,_slTotal = 0;
8//过滤HTML标签
9function filterHTMLTag(str) {
10  if (str == "" || str == null) {
11    return "";
12  } else {
13    var msg = str.replace(/<\/?[^>]*>/g, ''); //去除HTML Tag
14    msg = msg.replace(/[|]*\n/, ''); //去除行尾空格
15    msg = msg.replace(/ /ig, ''); //去掉npsp
16    return msg;
17  }
18}
19$(function () {
20  if (winWid < 768) {
21    slidesPerView = 1;
22  } else if (winWid < 1200) {
23    slidesPerView = 2;
24  }
25  mailList();
26  //回复排行
27  replySort();
28  myzj();
29  zxft();
30  zxfdSwiper();
31  //receiveMailNum();
32  // 调用示例
33  var firstDays = getFirstDaysOfQuarter();
34  $.each(firstDays,function(i,v){
35    receiveMailNum(v);
36    handleMailNum(v);
37    $('#jdTotal li').eq(0).find('.time').html(_slTotal);
38    $('#jdTotal li').eq(1).find('.time').html(_total);
39  })
40  $('.ly .hd .t a').hover(function () {
41    $(this).addClass('active').siblings().removeClass('active');
42    $(this).parent().siblings('.more').find('a').eq($(this).index()).addClass('block').siblings().removeClass('block');
43    $(this).parents('.hd').siblings('.lyLists').find('.list').eq($(this).index()).addClass('block').siblings().removeClass('block');
44  });
45  $('.fouritem li:not(:last-child) a').click(function () {
46    if( typeof getCookie == 'function' && !getCookie('username') ){
47      isLoginSign();
48      return false;
49    }
50  })
51});
52function zxfdSwiper() {
53  var zwftSwiper = new Swiper('.zwftswiper.swiper-container', {
54    autoplay: 5000, //可选选项,自动滑动
55    loop: true, //可选选项,开启循环
56    pagination: '.paginationzwdt',
57    paginationClickable: true,
58    slidesPerView: slidesPerView,
59    preventLinksPropagation: true
60  });
61}
62//留言回复list
63function mailList() {
64  var _data = {
65    "pageNum": 1,
66    "pageSize": 6,
67    "sortMap": {
68      "replyTime": "desc"
69    },
70    "params": {
71      //"deptId": _depId,
72      "siteId": _siteId
73    }
74  };
75  var d = getKeyVal(_data);
76  _data.sign = d.sign;
77  _data.timestamp = d.timestamp;
78  ajaxFun.getData('/communication/api-mailbox/frontMail/mailList', JSON.stringify(_data), renderList, 'application/json');
79}
80function renderList(json) {
81  var htm = '';
82  $.each(json.rows, function (i, e) {
83    //var url = "/" + websiteCode + "/c100195/hd_detail.shtml?id=" + e.id;
84    var url = '/hd/hd_xjxq?site='+websiteCode+'&siteCode='+$("meta[name=SiteIDCode]").attr("content")+'&url=/'+websiteCode+'/c100195/xj_detail.shtml&id=' + e.id;
85    htm += '<li><a href="' + url + '" target="_blank" title="' + e.title.replace(/<p.*?>|<\/p>/g, '') + '">' + e.title.replace(/<p.*?>|<\/p>/g, '') + '</a>\
86    <span class="dept-name">'+e.deptName+'</span>\
87    <span class="time">' + e.replyTime.substr(0, 10) + '</span>\
88  </li>';
89  });
90  $('#mailList').html(htm);
91}
92//意见征集
93function myzj(deptIndex) {
94  var _data = {
95    "pageNum": 1,
96    "pageSize": 6,
97    "sortMap": {
98      'startTime': "desc"
99    },
100    "params": {
101      //"siteId": _siteId
102        'siteNo': '2308000047'
103    }
104  };
105  var d = getKeyVal(_data);
106  _data.sign = d.sign;
107  _data.timestamp = d.timestamp;
108  $.ajax({
109    url: '/communication/api-collect/frontArticle/pageList',
110    data: JSON.stringify(_data),
111    type: 'post',
112    dataType: 'json',
113    async: false,
114    contentType: 'application/json',
115    success: function success(data) {
116      renderMyzj(data.data)
117    },
118    error: function (err) {
119      console.log(err);
120    }
121  })
122}
123function renderMyzj(json) {
124  var fstdata = json.rows;
125 // console.log(fstdata);
126  var htm = '';
127  if (fstdata.length > 0) {
128    $.each(fstdata, function (i, e) {
129      var url = fstdata[i].outJoin ? fstdata[i].outJoin : '/' + websiteCode + '/c100196/yjzj_tj.shtml?id=' + fstdata[i].id;
130      if (fstdata[i].isSurvey == 2) {
131        htm += '<li class="on"><a href="' + url + '" target="_blank">' + fstdata[i].title + '</a>\
132      <p class="time"><span>征集时间:</span>' + fstdata[i].startTime + '至' + fstdata[i].endTime + '</p></li>';
133      } else {
134        htm += '<li><a href="' + url + '" target="_blank" class="title">' + fstdata[i].title + '</a>\
135      <p class="time"><span>征集时间:</span>' + fstdata[i].startTime + '至' + fstdata[i].endTime + '</p></li>';
136      }
137    });
138    $('#zjList').html(htm);
139  }
140
141}
142
143//在线访谈
144function zxft() {
145
146  var _data = {
147    "pageNum": 1,
148    "pageSize": 6,
149    "sortMap": {},
150    "params": {
151      "deptId": _depId,
152      "siteId": _siteId
153    }
154  };
155  var d = getKeyVal(_data);
156  _data.sign = d.sign;
157  _data.timestamp = d.timestamp;
158  var zxfdall = {
159    data: [],
160    total: 0
161  };
162  function zxfd(type) {
163    $.ajax({
164      url: '/communication/api-inter/frontInterview/' + type,
165      data: JSON.stringify(_data),
166      type: 'post',
167      dataType: 'json',
168      async: false,
169      contentType: 'application/json',
170      success: function success(data) {
171        zxfdall.data = zxfdall.data.concat(data.data.rows);
172        zxfdall.total = zxfdall.total + data.data.total;
173      }
174    });
175  }
176  zxfd('getOverList');
177  renderZxftall(zxfdall);
178}
179
180function renderZxftall(json, type) {
181  var htm = '';
182  var fstdata = json.data;
183  if (json.total > 0) {
184
185    $.each(fstdata, function (i, e) {
186      var url = e.entity.recordOutUrl ? e.entity.recordOutUrl : '/' + websiteCode + '/c100197/zwft_detail.shtml?id=' + e.entity.id;
187      htm += '<div class="swiper-slide"><div class="box">' +
188        '<div class="imgbox"><a href="' + url + '"><img src="/' + e.entity.recordPic + '" alt="' + e.entity.title + '">' +
189        '</a></div>' +
190        '<div class="txtbox"><p class="title"><a href="' + url + '">' + e.entity.title + '</a></p>' +
191        '<p class="desc">' + filterHTMLTag(e.entity.introduction) + '</p>' +
192        '<p class="other"><span class="time">' + e.entity.liveStartTime.substr(0, 10) + '</span><a class="detail" href="' + url + '" target="_blank">详情</a>' +
193        '</p></div>' +
194        '</div></div>'
195    });
196    $('.zwft-list .swiper-wrapper').empty().html(htm);
197  }
198}
199//回复排行
200function replySort() {
201  $.ajax({
202    url: '/communication/api-mailbox/frontMail/deptHandleRanking?deptId=' + _depId,
203    type: 'get',
204    async: false,
205    success: function(res){
206      if(res.data.length > 0){
207        var _li = '';
208        $.each(res.data,function(i,v){
209          if(i < 4){
210            _li += '<li>' +
211              '<a>' + v.deptName + '</a>'+
212              '<span class="time">' + v.num + '</span>' +
213              '</li>'
214          }
215        })
216        $('#rankPh').empty().html(_li);
217      }
218    },
219    error: function(err){
220      console.log(err);
221    }
222  })
223}
224//回复排行更多
225function replySortMore(){
226  var siteCode=$('meta[name="SiteIDCode"]').attr('content')
227  if(siteCode=='2311820003'){
228    $('.question .common_hd .more').show();
229    //$('.question .common_hd .more a').attr('href','/wdlc/lyph/lyphlist.shtml?deptId='+deptId[0])
230  }
231}
232//获取部门
233function requestDepId(flag) {
234  var _params = {
235    parentId: ''
236  };
237  $.ajax({
238    url: '/communication/api-base/department/deptTree',
239    type: 'POST',
240    data: JSON.stringify(_params),
241    dataType: 'json',
242    contentType: 'application/json',
243    async: false,
244    success: function (res) {
245      if (res.data.length > 0) {
246        $.each(res.data, function (i, v) {
247          var _txt = $.trim($('meta[name="SiteName"]').attr('content')).replace(/\d/g, '');
248          if (_txt == v.label) {
249            deptId[0] = v.value;
250          }
251          if (v.label == '省政府') {
252            deptId[1] = v.value;
253          }
254        })
255      }
256    },
257    error: function (err) {
258      console.log(err);
259    }
260  })
261}
262//季度留言接收数
263function receiveMailNum(date) {
264  $.ajax({
265    url: '/communication/api-mailbox/frontMail/statusMailStatisticBy?date='+date+'&siteId='+ _siteId+'&status=',
266    type: 'get',
267    async: false,
268    success: function(res){
269      _slTotal += res.data;
270    },
271    error: function(err){
272      console.log(err);
273    }
274  })
275}
276//季度留言处理数
277function handleMailNum(date) {
278  $.ajax({
279    url: '/communication/api-mailbox/frontMail/statusMailStatisticBy?date='+date+'&siteId='+ _siteId+'&status=1002',
280    type: 'get',
281    async: false,
282    success: function(res){
283      _total += res.data;
284    },
285    error: function(err){
286      console.log(err);
287    }
288  })
289}
290/**
291 * 获取当前季度的三个月第一天
292 * @returns {Array} 返回当前季度三个月的第一天日期数组,格式为 YYYY-MM-DD
293 */
294function getFirstDaysOfQuarter() {
295  var now = new Date();
296  var currentYear = now.getFullYear();
297  var currentMonth = now.getMonth(); // 0~11
298  var quarter = Math.floor(currentMonth / 3); // 0~3 对应 Q1~Q4
299
300  // 计算当前季度的起始月份(0, 3, 6, 9)
301  var startMonth = quarter * 3;
302  
303  // 生成三个月的第一天
304  return [0, 1, 2].map(function(offset) {
305    var month = startMonth + offset;
306    var  date = new Date(currentYear, month, 1);
307    return date.getFullYear() + "-" + 
308           ("0" + (date.getMonth() + 1)).slice(-2) + 
309           "-01";
310  });
311}
312function isLoginSign() {
313  var _params = '';
314	if (getCookie('username') == "" || getCookie('username') == undefined||getCookie('username') == null) {
315		 var r = confirm('您还未登录,请先登录!');
316	}
317	$.each(_siteObj, function (i, v) {
318    if (v.name == $('meta[name=SiteName]').attr('content')) {
319        _params = v.uuid[2]
320    }
321  })
322  if (r) {
323    window.location.href='/unified-sso/user/sendLogin?paramKey='+ _params;
324  }
325  return false;
326}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.