PageSourceSearch

https://www.mingshui.gov.cn/ms/xhtml/js/listpage.js

js mingshui.gov.cn collected 2026-10-02 17:07:40 UTC 7,370 bytes, 244 lines download raw bytes

1var cName = '';
2channelId = $('meta[name=channelId]').attr('content');
3code1 = $('meta[name=code]').attr('content');
4var channelId = $('meta[name=channelId]').attr('content');
5var winWidth = $(window).width();
6//var ip = "http://192.1.109.76:8009";
7(function(){
8	$("#page_div").bindEvent({});
9	table_ajax(1);
10	isMore();
11})()
12
13// 分页
14function table_page(totalHits) {
15	var totalHits = parseInt(totalHits);
16	
17	var pageSize = parseInt($("#pageSize").val());
18	var page = parseInt($("#page").val());
19	var pageNum = Math.floor((totalHits + pageSize - 1) / pageSize);
20	var options = {
21		pageNum: pageNum,
22		current: page,
23		backfun: function(e) {
24			$("#page").val(e.current);
25			table_ajax();
26		}
27	}
28	$("#page_div").createPage(options);
29}
30
31// type 1-初始化
32function table_ajax(type) {
33	$.ajax({
34		url: '/common/search/' + channelId + '?_isAgg=false&_isJson=true&_pageSize=' + parseInt($("#pageSize").val()) + '&_template=index&_rangeTimeGte=&_channelName=&page=' + parseInt($("#page").val()) + '',
35		type: 'get',
36		cache: 'false',
37		success: function(data) {;
38			if(channelId.indexOf("12311231321123213123123")!=-1){
39				if(type && type == 1){
40					var total = data.data.total;
41					if( total <= parseInt($("#pageSize").val()) ){
42						$('#moreList').hide();
43					}
44					table_each_zc("list-content", ajax_success_zc(data));
45				}else{
46					table_page(data.data.total);
47					table_each_zc("list-content", ajax_success_zc(data));
48				}
49			}else if(channelId.indexOf("6f8091f09da54d18b83d5d02360f2029")!=-1||channelId.indexOf("5cb653e7803e4571bd8469c02b4d4ed3")!=-1||channelId.indexOf("bead4aa845294038840f6a0c6fa3a6a3")!=-1||channelId.indexOf("9d9eb9edee0f47049a5cffe042a2eb48")!=-1){
50				$(".TwoList01").addClass("LeadIntro_list");
51				$(".LeadIntro_list").removeClass("TwoList01");
52				if(type && type == 1){
53					var total = data.data.total;
54					if( total <= parseInt($("#pageSize").val()) ){
55						$('#moreList').hide();
56					}
57					table_zwft("LeadIntro_list", ajax_success_zwft(data));
58				}else{
59					table_page(data.data.total);
60					table_zwft("LeadIntro_list", ajax_success_zwft(data));
61				}
62			}else{
63				if(type && type == 1){
64					var total = data.data.total;
65					if( total <= parseInt($("#pageSize").val()) ){
66						$('#moreList').hide();
67					}
68					table_each("TwoList01", ajax_success(data));
69					
70				}else{
71					table_page(data.data.total);
72					table_each("TwoList01", ajax_success(data));
73				}
74			}
75		},
76		error: function(err) {
77			console.log(err)
78		}
79	})
80}
81
82function ajax_success(json) {
83	var list = [];
84	var resutList = json.data.results;
85	if(resutList.length <= 10) {
86		$(".page_num").css("display", "none")
87	} else {
88		$(".page_num").css("display", "block")
89	}
90	$.each(resutList, function(name, val) {
91		var myValues = val;
92		var json = {
93			"title": myValues.title,
94			"url": myValues.url.replace("http://www.mingshui.gov.cn/", ""),
95			"publishedTimeStr": val.publishedTimeStr
96		}
97		list.push(json);
98	});
99	return list;
100}
101function ajax_success_zc(json) {
102	var list = [];
103	var resutList = json.data.results;
104	var total = json.data.total;
105	var _wh = '';
106	var _cwrq = '';
107	if (total <= 10) {
108		$("#page_div").css("display", "none");
109	} else {
110		$("#page_div").css("display", "block");
111	}
112	$.each(resutList, function (name, val) {
113		var myValues = val;
114		if (myValues.domainMetaList.length > 0) {
115			for (var i = 0; i < myValues.domainMetaList.length; i++) {
116				//if (myValues.domainMetaList[i].domainMetadataName == '政策文件勿改') {
117					for (var j = 0; j < myValues.domainMetaList[i].resultList.length; j++) {
118						if (myValues.domainMetaList[i].resultList[j].name == '文号') {
119							_wh = (!myValues.domainMetaList[i].resultList[j].value || myValues.domainMetaList[i].resultList[j].value == 'null') ? '' : myValues.domainMetaList[i].resultList[j].value;
120						} else if (myValues.domainMetaList[i].resultList[j].name == '成文日期') {
121							_cwrq = (!myValues.domainMetaList[i].resultList[j].value || myValues.domainMetaList[i].resultList[j].value == 'null') ? '' : myValues.domainMetaList[i].resultList[j].value;
122						}
123					}
124				//}
125			}
126		}
127		var json = {
128			"title": myValues.title,
129			"url": myValues.url.replace("http://www.mingshui.gov.cn/", ""),
130			'wh': _wh,
131			'cwrq': _cwrq,
132			"publishedTimeStr": val.publishedTimeStr
133		};
134		list.push(json);
135	});
136	return list;
137}
138function ajax_success_zwft(json) {
139	var list = [];
140	var resutList = json.data.results;
141	if(resutList.length <= 10) {
142		$(".page_num").css("display", "none")
143	} else {
144		$(".page_num").css("display", "block")
145	}
146	$.each(resutList, function(name, val) {
147		var myValues = val;
148		var json = {
149			"title": myValues.title,
150			"url": myValues.url.replace("http://www.mingshui.gov.cn/", ""),
151			"publishedTimeStr": myValues.publishedTimeStr,
152			"picsrc" : myValues.resList[0].filePathNew,
153			"fbt" : myValues.subTitle,
154			"memo" : myValues.memo,
155			"content":myValues.content,
156		}
157		list.push(json);
158	});
159	return list;
160}
161
162
163function isMore(){
164	table_ajax(1);
165	$('#moreList').click(function(){
166		$("#page").val(2);
167		$('#moreList').hide();
168		table_ajax();
169	})
170	
171}
172
173
174// 处理列表页数据
175function table_each(id, json) {
176	var tab = $("." + id);
177	tab.empty();
178	$.each(json, function(name, val) {
179		var _li = '';
180		_li += '<li><a target="_blank" href="' + val.url + '" title="' + val.title + '" >' + val.title + '</a><span>' + (val.publishedTimeStr).substr(0, 10) + '</span></li>';
181		tab.append(_li);
182	});
183
184}
185
186function table_each_zc(id, json) {
187	
188	var tab = $("#" + id);
189	tab.empty();
190	var _html = '';
191	$.each(json, function (index, val) {
192		var title = val.title.replace(/[\r\n]/g, "").replace(/<br>/g, "");
193		_html += '<tr><td align="center">' + (index + 1) + '</td>' +
194			'<td class="info"><a target="_blank" href="' + val.url + '">' + title + '</a></td>' +
195			'<td>' + val.wh + '</td>' +
196			'<td>' + val.publishedTimeStr.substr(0, 10) + '</td>' +
197			'</tr>';
198	});
199	tab.append(_html);
200}
201function table_zwft(id, json) {
202	
203	var tab = $("." + id);
204	tab.empty();
205	var _html = '';
206	$.each(json, function (index, val) {
207		var title = val.title.replace(/[\r\n]/g, "").replace(/<br>/g, "");
208		
209		if(title.length>40){
210			title = title.substring(0,40)+"...";	
211		}
212		
213//		_html += '<a target="_blank" href="' + val.url + '"  class="interview_list">'+
214//      '<div class="interview_list_pic">'+
215//       '<img src="' + val.picsrc + '" width="320" height="240" >'+
216//      '</div>'+
217//      '<div class="interview_list_ri">'+
218//       ' <div class="interview_list_ri_tit">'+
219//       '   <p> '+title+'</p>'+
220//       ' </div>'+
221//       ' <div class="interview_list_ri_time">'+
222//       '   <img src="/bl/xhtml/images/title_06.png">'+
223//       '   <p>访谈时间:'+val.publishedTimeStr+'</p>'+
224//       '   <img src="/bl/xhtml/images/title_07.png">'+
225//       '   <p>嘉宾:'+val.fbt+'</p>'+
226//       ' </div>'+
227//       ' <div class="interview_list_ri_xq">'+
228//       '   <p>'+val.memo+'</p>'+
229//      '  </div>'+
230//     ' </div>'+
231//    '</a>';
232	_html +='<li>'+
233            '<div class="LeadIntro_list_pic">'+
234            '  <img src="' + val.picsrc + '">'+
235            '</div>'+
236            '<div class="LeadIntro_list_txt">'+
237            '  <p>'+title+'</p>'+
238            '  <span>'+val.content+'</span>'+
239            '</div>'+
240           ' <a href="' + val.url + '"  class="LeadIntro_list_btn">查看详情</a>'+
241          '</li>';
242	});
243	tab.append(_html);
244}

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.