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.