PageSourceSearch

https://bjyayy.com.cn/Scripts/Common/control.js

js bjyayy.com.cn collected 2026-10-09 22:39:46 UTC 32,985 bytes, 856 lines download raw bytes

1// 通用Js方法汇总
2// 1、单选方法
3// 2、复选框改变时 显示或者隐藏控件(同时反控制另一个控件controlId2,无反控则只传3个参数即可)
4// 3、“是否组合”复选框改变时 显示或者隐藏控件(同时反控制另一个控件controlId2,无反控则只传3个参数即可)
5// 4  下拉列表改变时 显示或者隐藏控件
6// 5、针对Awesome弹出框的loading状态*******(不需要考虑调用的问题 在通用插件中已自动调用)*******
7// 6、Ajax获取页面信息 并赋值到对应id元素中
8// 7、文本框发生改变时 同步将值赋值到另一个元素内(都必须为value属性)
9// 8、通用的单选方法
10// 9、文本框获得焦点和失去焦点变化
11// 10、鼠标浮上显示与隐藏
12// 11、针对百度编辑器的分页,现在应用与文章页面
13// 12、
14// 13、静态页分页页面跳转
15///15 “是否组合”复选框改变时 显示或者隐藏控件集合
16
17
18// 1、单选方法
19// 2011-11-2 zhx
20function onRadio(chk) {
21    if (chk.checked) {
22        $('input[type=checkbox][name="' + chk.name + '"]').each(function () {
23            if (this.value != chk.value) {
24                $(this).prop('checked', false);
25                $(this).change();
26            }
27        });
28    }
29}
30
31/*2 复选框改变时 显示或者隐藏控件(同时反控制另一个控件controlId2,无反控则只传3个参数即可)
32self            this自身
33showValue       当为自身选中value时 显示控件controlId 隐藏控件controlId2
34controlId       被操作的控件Id
35controlId2      被反操作的控件Id
36
37引用:onclick = "OnCheckShowOrHide(this,'" + (int)TestEnum.RuleType.Sql语句 + "','type1Div','type2Div');"
38*/
39function OnCheckShowOrHide(self, state, controlId, controlId2) {
40    //alert(self.id + " " + state + " " + controlId + " " + controlId2);
41    var divObj = $("#" + controlId);
42    var divObj2 = $("#" + controlId2);
43    if (self.checked == state) {
44        if (divObj) {
45            divObj.show();
46        }
47        if (divObj2) {
48            divObj2.hide();
49        }
50    } else {
51        if (divObj) {
52            divObj.hide();
53        }
54        if (divObj2) {
55            divObj2.show();
56        }
57    }
58}
59/*2-2 “是否组合”复选框改变时 显示或者隐藏控件集合
60self            this自身
61state           this本身状态
62controlArr2      被操作的控件集合Id
63
64引用:onclick = "OnCheckShowOrHideBatch(this,false,['sd','rrr'])" 
65*/
66function OnCheckShowOrHideBatch(self, state, controlArrId) {
67    var i;
68    var divObj;
69    if (self.checked == state && self.value == state.toString()) {
70        for (i = 0; i < controlArrId.length; i++) {
71            divObj = $("#" + controlArrId[i]);
72            divObj.show();
73        }
74    } else {
75        for (i = 0; i < controlArrId.length; i++) {
76            divObj = $("#" + controlArrId[i]);
77            divObj.hide();
78        }
79    }
80
81}
82
83/*3 “是否组合”复选框改变时 显示或者隐藏控件(同时反控制另一个控件controlId2,无反控则只传3个参数即可)
84self            this自身
85showValue       当为自身选中value时 显示控件controlId 隐藏控件controlId2
86controlId       被操作的控件Id
87controlId2      被反操作的控件Id
88
89引用:onclick = "OnCheckBooleanShowOrHide(this,'" + (int)TestEnum.RuleType.Sql语句 + "','type1Div','type2Div');"
90*/
91function OnCheckBooleanShowOrHide(self, state, controlId, controlId2) {
92    //alert(self.id + " " + state + " " + controlId + " " + controlId2);
93    var divObj = $("#" + controlId);
94    var divObj2 = $("#" + controlId2);
95    if (self.checked == state && self.value == state.toString()) {
96        if (divObj) {
97            divObj.show();
98        }
99        if (divObj2) {
100            divObj2.hide();
101        }
102    } else {
103        if (divObj) {
104            divObj.hide();
105        }
106        if (divObj2) {
107            divObj2.show();
108        }
109    }
110}
111
112/*4 下拉列表改变时 显示或者隐藏控件
113self            this自身
114controlName     备操作的控件的名称(通用部分) ä¾
114‹ï¼šï¼ˆdiv0,div1,div2 则传div)
115
116引用:onchange = "OnSelectShowOrHide(this,'divhaha');"
117单项设置:
118<tbody id="siteNavigationNodeType" to=",1,2,">
119</tbody>
120*/
121function OnSelectShowOrHide(self, controlName) {
122    var value = self.options[self.selectedIndex].value;
123    $("[id=" + controlName + "]").each(function () {
124        $(this).hide();
125    });
126
127    $("[id=" + controlName + "][to*='," + value + ",']").each(function () {
128        $(this).show();
129    });
130}
131
132/*5 针对Awesome弹出框的loading状态
133loadingShow为显示 loadingHide为隐藏
134不需要调用 因为调用的方法我已经写在了通用插件当中
135*/
136function loadingShow(id) {
137    if ($("#" + id).find("loading" + id).length == 0)
138        $("#" + id).append("<div id='loading" + id + "' class='loading' style='width:100%; height:100%; background-color:#fff; z-index:999'></div>");
139}
140function loadingHide(id) {
141    $("#loading" + id).hide("slow");
142}
143
144
145
146/*6 Ajax获取页面信息 并赋值到对应id元素中
147*/
148function GetAjaxContentByUrl(id, url) {
149    if ($("#" + id).html()) {
150        var addStr = "";
151        if (url.indexOf("?") > -1) {
152            addStr = '&r=' + new Date().getMilliseconds();
153        } else {
154            addStr = '?r=' + new Date().getMilliseconds();
155        }
156        while (url.indexOf('&amp;') >= 0)
157            url = url.replace('&amp;', '&');
158        $.get(url + addStr, function (d) {
159            $("#" + id).html(d);
160        });
161    }
162}
163
164
165/*7 文本框发生改变时 同步将值赋值到另一个元素内(都必须为value属性)
166*/
167function TextOnChangeToAnother(obj, anotherName) {
168    $("#" + anotherName).prop("value", obj.value);
169}
170
171/*7-1 文本框发生改变时 同步将值赋值到另一个富文本元素内(都必须为value属性)
172*/
173function TextOnChangeToCkeditorAnother(obj, anotherName) {
174    //    CKEDITOR.instances[anotherName].setData(CKEDITOR.instances[anotherName].getData() + obj.value);
175    //    $("#" + name).value = CKEDITOR.instances[anotherName].getData();
176    anotherName.setContent(obj.value);
177}
178
179/*7-2  公用的伪级联修改数据  2011-07-08
180self            this自身
181showValue       将自身的value赋值到 显示控件controlId
182isAdd           是增加还是修改
183
184引用:onchange = "TitleToText(this,'type1Div',true);"
185*/
186function TitleToText(self, controlId, isAdd) {
187    var value = self.title;
188    var divObj = $("#" + controlId);
189    if (isAdd) {
190        divObj[0].value += value;
191    } else {
192        divObj[0].value = value;
193    }
194}
195
196function MultiSelectOnChangeAddToAnother(id, anotherName) {
197    alert(id);
198    alert($("#ld" + id)[0].html());
199}
200
201/*7-3 文本框发生改变时 同步将值赋值到另一个TextArea内
202*/
203function TextOnChangeToAnotherTextArea(obj, anotherName) {
204    $('#' + anotherName).text(obj.value);
205}
206
207
208
209/*8-1.1  通用的单选方法                                            2011-12-30
210*/
211function onRadioForTree(chk, treeName, treeId, treeParentId) {
212    if (chk.checked) {
213        $('input[type=checkbox][treeName=' + treeName + '][treeParentId=' + treeParentId + ']').each(function () {
214            if (this.name != chk.name) {
215                $(this).prop('checked', false);
216            }
217        });
218    }
219}
220
221/*9-1.1  通用的文本框单击提示文字消失,失去焦点还原,带按钮联动样式                                            2012-5-25
222zhx
223onblur="keywordblur('Search','Search_Button','搜索你关注的文章或医生','text_search_gray','button_search_gray');" onfocus="keywordfocus('Search','Search_Button','搜索你关注的文章或医生','text_search','button_search');" value="搜索你关注的文章或医生"
224*/
225function keywordfocus(id, button, value, textClass, buttonClass) {
226    var text = $("#" + id);
227    if (text != null && text[0].value == value) {
228        text[0].value = '';
229    }
230    text[0].className = textClass;
231    if (button != '') {
232        var but = $("#" + button);
233        if (but) {
234            $("#" + button)[0].className = buttonClass;
235        }
236    }
237}
238
239function keywordblur(id, button, value, textClass, buttonClass) {
240    var text = $("#" + id);
241    if (text[0].value == '') {
242        text[0].value = value;
243        text[0].className = textClass;
244        if (button != '') {
245            var but = $("#" + button);
246            if (but) {
247                $("#" + button)[0].className = buttonClass;
248            }
249        }
250    }
251}
252/*9-1.2  通用的文本框单击提示文字消失,失去焦点还原                                            2012-5-28
253zhx
254onblur="textblur(this,'text_search_gray');" onfocus="textfocus(this,'text_search');"
255*/
256function textfocus(text, textClass) {
257    if (text != null) {
258        text.className = textClass;
259    }
260}
261
262function textblur(text, textClass) {
263    if (text.value == '') {
264        text.className = textClass;
265    }
266}
267// 如果文本框里有内容,默认不显示背景
268$(document).ready(function () {
269    $("textarea.ku").each(function (i) {
270        if ($(this).val() != "") $(this).removeClass("ku").addClass("ku_text");
271    });
272});
273
274
275/*10  鼠标浮上显示与隐藏                                            2012-7-6
276zhx
277*/
278// onmousemove="tatitleshow(@(o.SchedulingAppointmentId))" onmouseout="tatitlehide(@(o.SchedulingAppointmentId))"
279//    <div id="tatitle@(o.EmailId)" class="detail" style="display: none;">
280//        @Html.Raw(o.Content)
281//    </div>
282function tatitleshow(i) {
283    $('#tatitle' + i).show();
284}
285function tatitlehide(i) {
286    $('#tatitle' + i).hide();
287}
288
289/*11  针对百度编辑器的分页,现在应用与文章页面                                            2013-4-29
290*/
291function jquery_page_initialization() {
292    var content = $("#zoom").html();
293    var pageCount = 0;
294    var type = "";
295    if (content.indexOf("_page_break_tag_") > 0) {
296        if (content.split("_baidu_page_break_tag_").length > 1) {
297            type = "_baidu_page_break_tag_";
298        }
299        else if (content.split("_ueditor_page_break_tag_").length > 1) {
300            type = "_ueditor_page_break_tag_";
301        }
302        pageCount = content.split(type).length;
303        $("#zoom").html(content.split(type)[0]);
304    }
305    var pageIndex = "";
306    var pageCurrent = 1 / 1;
307    // 拼接页码,在JS增加在zoom元素后面
308    var pagehtml = "<div class='ae-pagination'><div id='old_content' style='display:none;'>" + content + "</div><p id='jquery_ajax_current_page' style='display:none;'>1</p><p id='jquery_ajax_max_page' style='display:none;'>" + pageCount + "</p><a class='pagination_firstpage' href='javascript:jquery_page_show(1,\"" + type + "\")'>首页</a>" +
309        "<a class='pagination_previouspage' href='javascript:jquery_page_show_next(-1,\"" + type + "\")'>上一页</a>";
310    for (var i = 1; i <= pageCount; i++) {
311        pageIndex = pageIndex + "<a id='page" + i + "' class='pagination_page' href='javascript:jquery_page_show(" + i + ",\"" + type + "\")'>" + i + "</a>";
312    }
313    pagehtml = pagehtml + pageIndex + "<a class='pagination_nextpage' href='javascript:jquery_page_show_next(1,\"" + type + "\")'>下一页</a>" +
314        "<a class='pagination_lastpage' href='javascript:jquery_page_show(" + pageCount + ",\"" + type + "\")'>末页</a></div>";
315    $("#zoom").after(pagehtml);
316    jquery_page_update_state(type);
317}
318
319function jquery_page_show(page, type) {
320    $("#zoom").html($("#old_content").html().split(type)[page - 1]);
321    $("#jquery_ajax_current_page").html(page);
322    jquery_page_update_state(type);
323}
324
325function jquery_page_show_next(difference, type) {
326    var pageCurrent = parseInt($("#jquery_ajax_current_page").html()) + difference;
327    jquery_page_show(pageCurrent, type);
328}
329
330function jquery_page_update_state(type) {
331    // 获取当前jquery_ajax_current_page,jquery_ajax_max_page
332    // 为1时,首页、上一页 删除Js事件,更改样式
333    var pageCurrent = parseInt($("#jquery_ajax_current_page").html());
334    var pageCount = parseInt($("#jquery_ajax_max_page").html());
335    if (pageCurrent == 1) {
336        $(".pagination_firstpage").prop("href", "javascript:void(0)");
337        $(".pagination_firstpage").prop("class", "pagination_firstpage disabled ui-state-default ui-corner-all");
338        $(".pagination_previouspage").prop("href", "javascript:void(0)");
339        $(".pagination_previouspage").prop("class", "pagination_previouspage disabled ui-state-default ui-corner-all");
340    }
341    else if ($(".pagination_firstpage").hasClass("disabled")) {
342        $(".pagination_firstpage").prop("href", "javascript:jquery_page_show(1,\"" + type + "\")");
343        $(".pagination_firstpage").prop("class", "pagination_firstpage ui-state-default ui-corner-all");
344        $(".pagination_previouspage").prop("href", "javascript:jquery_page_show_next(-1,\"" + type + "\")");
345        $(".pagination_previouspage").prop("class", "pagination_previouspage ui-state-default ui-corner-all");
346    }
347    // 与最大页码相等时,末页,下一页 删除Js事件,更改样式
348    if (pageCurrent == pageCount) {
349        $(".pagination_lastpage").prop("href", "javascript:void(0)");
350        $(".pagination_lastpage").prop("class", "pagination_lastpage disabled ui-state-default ui-corner-all");
351        $(".pagination_nextpage").prop("href", "javascript:void(0)");
352        $(".pagination_nextpage").prop("class", "pagination_nextpage disabled ui-state-default ui-corner-all");
353    }
354    else if ($(".pagination_lastpage").hasClass("disabled")) {
355        $(".pagination_lastpage").prop("href", "javascript:jquery_page_show(" + pageCount + ",\"" + type + "\")");
356        $(".pagination_lastpage").prop("class", "pagination_lastpage ui-state-default ui-corner-all");
357        $(".pagination_nextpage").prop("href", "javascript:jquery_page_show_next(1,\"" + type + "\")");
358        $(".pagination_nextpage").prop("class", "pagination_nextpage ui-state-default ui-corner-all");
359    }
360    // 更改页码,将所有页面的选中样式都删掉,没有事件的增加事件
361    $('[id^=page][class*=ae-pagination-current]').each(function () {
362        $(this).prop("href", "javascript:jquery_page_show(" + $(this).prop("id").replace(/[^0-9]/ig, "") + ",\"" + type + "\")");
363        $(this).prop("class", "pagination_page ui-state-default ui-corner-all");
364    });
365
366    // 更改当前页码的样式 删除事件
367    $("#page" + pageCurrent).prop("href", "javascript:void(0)");
368    $("#page" + pageCurrent).prop("class", "ae-pagination-current ui-state-highlight ui-state-default ui-corner-all");
369}
370
371/*12  通过Url动态获取内容弹出层展示                            2013-5-06
372*/
373
374function pop_upLayerByUrl_Load(thisA, url) {
375    var value = $(thisA).find(".msgbox").length;
376    if (value > 0) {
377        $(thisA).addClass("spanHover").find(".msgbox").show();
378    } else {
379        var floathtml = "<div class=\"msgbox\" style=\"display:none;\"><div class=\"msgbg\"></div></div>";
380        $(thisA).append(floathtml);
381        var floathtml = $.get(url);
382        $.get(url, function (d) {
383            $(thisA).find(".msgbox").html(d);
384        });
385        $(thisA).addClass("spanHover").find(".msgbox").show();
386    }
387}
388function pop_upLayerByUrl_Hide(thisA) {
389    $(thisA).removeClass("spanHover").find(".msgbox").hide();
390}
391
392String.prototype.changeQuery = function (name, value) {
393    /// <summary>修改网址中的参数,不存在则添加,存在则修改</summary>
394    var reg = new RegExp("(^|)" + name + "=([^&]*)(|$)");
395    var tmp = name + "=" + value;
396    if (this.match(reg) != null) {
397        return this.replace(eval(reg), tmp);
398    } else {
399        if (this.match("[\?]")) {
400            return this + "&" + tmp;
401        } else {
402            return this + "?" + tmp;
403        }
404    }
405}
406String.prototype.getQuery = function (name) {
407    /// <summary>获取网址中的参数,不存在返回空</summary>
408    var value = "";
409    var reg = new RegExp("(^|)" + name + "=([^&]*)(|$)");
410    if (this.match(reg) != null) {
411        value = reg.exec(this)[0].split('=')[1];
412    }
413    return value;
414}
415function getRandom(n) {
416    /// <summary>生成介于 0-n 之间的随即数</summary>
417    return Math.floor(Math.random() * n + 1);
418}
419//Iframe高度自适应(兼容IE/Firefox、同域/跨域)
420function SetCwinHeight() {
421    var iframeid = document.getElementById("iframeid"); //iframe id
422    if (document.getElementById) {
423        if (iframeid && !window.opera) {
424            if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight) {
425                iframeid.height = iframeid.contentDocument.body.offsetHeight;
426            } else if (iframeid.Document && iframeid.Document.body.scrollHeight) {
427                iframeid.height = iframeid.Document.body.scrollHeight;
428            }
429        }
430    }
431}
432
433
434///搜索跳转页面
435function pagesss(url) {
436
437    if (!isNaN($("#page").val())) {
438
439        if ($('#page').val() > 0 && $('#page').val() < $('#count').val()) {
440            url += "?page=" + $('#page').val();
441        } else {
442            alert("请输入正确的值");
443        }
444    } else {
445        alert("请输入数字!");
446    }
447    window.location.href = url;
448
449}
450///
451//var browser = {
452//    versions: function () {
453//        var u = navigator.userAgent, app = navigator.appVersion;
454//        return {//移动终端浏览器版本信息
455//            trident: u.indexOf('Trident') > -1, //IE内核
456//            presto: u.indexOf('Presto') > -1, //opera内核
457//            webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
458//            gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
459//            mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
460//            ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
461//            android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
462//            iPhone: u.indexOf('iPhone') > -1, //是否为iPhone (QQHD浏览器|| u.indexOf('Mac') > -1,,太特别,返回的是苹果版本,不考虑了)
463//            iPad: u.indexOf('iPad') > -1, //是否iPad
464//            webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部
465//        };
466//    }(),
467//    language: (navigator.browserLanguage || navigator.language).toLowerCase()
468//}
469
470//function isMobileBrowser(type) {
471//    if ((!browser.versions.webKit && browser.versions.mobile) || browser.versions.ios || browser.versions.android || browser.versions.iPhone || browser.versions.iPad) {
472
473//        var arr, reg = new RegExp("(^| )browser_type=([^;]*)(;|$)");
474
475//        if (!(arr = document.cookie.match(reg)) || (unescape(arr[2]) == type)) {
476//            return true;
477//        } else {
478//            return false;
479//        }
480//    }
481//}
482
483///检测是否是手机浏览器
484//function isMobileBrowser() {
485//    var userAgentInfo = navigator.userAgent;
486//    var Agents = ["Android", "iPhone",
487//        "SymbianOS", "Windows Phone",
488//        "iPad", "iPod"];
489//    var flag = false;
490//    for (var v = 0; v < Agents.length; v++) {
491//        if (userAgentInfo.indexOf(Agents[v]) > 0) {
492//            flag = true;
493//            break;
494//        }
495//    }
496//    return flag;
497//}
498
499function isMobileBrowser() {
500    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
501        || (window.innerWidth <= 768 && 'ontouchstart' in window);
502}
503
504
505/*13 分页页面跳转
506target     目标页码
507pageCount  总页数
508url        跳转url
509errorText1 错误提示1(请输入1-)
510errorText2 错误提示2(的页码)
511errorText3 错误提示3(请输入正确页码)
512
513引用: onclick='jumpPage(target," + pageCount + ",\"" + url + "\")'
514*/
515function jumpPage(target, pageCount, url, errorText1, errorText2, errorText3) {
516    //验证格式
517    var r = /^[1-9][0-9]*$/; //正整数
518    var isInt = r.test(target);
519    if (isInt) {
520        //若目标页大于零 且小于或等于总页数 执行跳转
521        if (parseInt(target) > 0 && parseInt(target) <= parseInt(pageCount)) {
522            if (url.indexOf(".html") > -1) {
523                jumpStaticPage(target, url);
524            }
525        }
526        else {
527            $("#jumpPageErrorMessage").text(errorText1 + pageCount + " " + errorText2);
528            return false;
529        }
530    }
531    //否则提示重新输入
532    else {
533        $("#jumpPageErrorMessage").text(errorText3);
534        return false;
535    }
536}
537//静态页面跳转
538//target     目标页码
539//url        跳转url
540
541function jumpStaticPage(target, url) {
542    var newUrl = url.substr(0, url.lastIndexOf("/") + 1);
543    newUrl = newUrl + target + ".html";
544    window.location.href = newUrl;
545}
546
547/*14 禁止按钮重复点击*/
548/*使用方法: onclick="return RSubmitLimit($(this));"*/
549function RSubmitLimit(curA) {
550    if ($('.inbusy').length == 0) {
551        $('[onclick*=RSubmitLimit]').css('color', '#999');
552        curA.append('<em class="inbusy" style="font-style:normal;">.</em>');
553        inbusyHtml($('.inbusy'));
554        return true;
555    }
556    else {
557        return false;
558    }
559}
560
561function inbusyHtml(p) {
562    setTimeout(function () {
563        p.html('..');
564        setTimeout(function () {
565            p.html('...');
566            setTimeout(function () {
567                p.html('.');
568                inbusyHtml(p);
569            }, 200);
570        }, 200);
571    }, 200);
572}
573/*15 “是否组合”复选框改变时 显示或者隐藏控件集合
574self            this自身
575controlId       check控件Id
576controlArr2      被操作的控件集合Id
577
578引用:onclick = "OnCheckBooleanShowOrHideArr(this,false,['sd','rrr'])" 
579*/
580function OnCheckBooleanShowOrHideArr(self, state, controlArrId) {
581    var i;
582    var divObj;
583    if (state) {
584        for (i = 0; i < controlArrId.length; i++) {
585            divObj = $("#" + controlArrId[i]);
586            divObj.show();
587        }
588    } else {
589        for (i = 0; i < controlArrId.length; i++) {
590            divObj = $("#" + controlArrId[i]);
591            divObj.hide();
592        }
593    }
594}
595
596
597//jQuery 1.8.3 -> 1.9.1 补充的内容:使可以兼容以前的脚本写法
598//恢复 toggle(func1,func2) 方法
599jQuery.fn.toggle = function (fn) {
600    // Save reference to arguments for access in closure
601    var args = arguments,
602        guid = fn.guid || jQuery.guid++,
603        i = 0,
604        toggler = function (event) {
605            // Figure out which function to execute
606            var lastToggle = (jQuery._data(this, "lastToggle" + fn.guid) || 0) % i;
607            jQuery._data(this, "lastToggle" + fn.guid, lastToggle + 1);
608
609            // Make sure that clicks stop
610            event.preventDefault();
611
612            // and execute the function
613            return args[lastToggle].apply(this, arguments) || false;
614        };
615
616    // link all the functions, so any of them can unbind this click handler
617    toggler.guid = guid;
618    while (i < args.length) {
619        args[i++].guid = guid;
620    }
621
622    return this.click(toggler);
623};
624
625//恢复 jQuery.browser 属性
626jQuery.uaMatch = function (ua) {
627    ua = ua.toLowerCase();
628
629    var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
630        /(webkit)[ \/]([\w.]+)/.exec(ua) ||
631        /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
632        /(msie) ([\w.]+)/.exec(ua) ||
633        ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
634        [];
635
636    return {
637        browser: match[1] || "",
638        version: match[2] || "0"
639    };
640};
641
642// Don't clobber any existing jQuery.browser in case it's different
643if (!jQuery.browser) {
644    matched = jQuery.uaMatch(navigator.userAgent);
645    browser = {};
646
647    if (matched.browser) {
648        browser[matched.browser] = true;
649        browser.version = matched.version;
650    }
651
652    // Chrome is Webkit, but Webkit is also Safari.
653    if (browser.chrome) {
654        browser.webkit = true;
655    } else if (browser.webkit) {
656        browser.safari = true;
657    }
658
659    jQuery.browser = browser;
660}
661
662//恢复 toggle() 方法
663eventsToggle = jQuery.fn.toggle;
664
665function isHidden(elem, el) {
666    elem = el || elem;
667    return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);
668}
669
670jQuery.fn.extend({
671    toggle: function (state, fn2) {
672        var bool = typeof state === "boolean";
673
674        if (jQuery.isFunction(state) && jQuery.isFunction(fn2)) {
675            return eventsToggle.apply(this, arguments);
676        }
677
678        return this.each(function () {
679            if (bool ? state : isHidden(this)) {
680                jQuery(this).show();
681            } else {
682                jQuery(this).hide();
683            }
684        });
685    }
686});
687
688//华为漏扫:不安全的第三方链接 (target="_blank")
689//需要给a标签添加属性 rel="noopener noreferrer"
690//再次漏扫发现这种做法不好使,但还是先保留
691//说明:a标签属性 rel="noopener noreferrer"当你浏览一个页面点击一个a标签连接 <a href="www.baidu.com" target="_blank"> 
692//跳转到另一个页面时,在新打开的页面(baidu)中可以通过 window.opener获取到源页面的部分控制权,即使新打开的页面是跨域的也照样可以(例如 location 就不存在跨域问题)。 
693$(function () {
694    $("a[target=_blank]").attr("rel", "noopener");
695});
696
697$(function () {
698    const _0x8d7d = ["\x66\x6F\x72\x6D", "\x64\x61\x74\x61\x2D\x61\x6A\x61\x78", "\x74\x72\x75\x65",
699        "\x23\x56\x65\x72\x69\x66\x69\x63\x61\x74\x69\x6F\x6E\x54\x6F\x6B\x65\x6E",
700        "\x23\x56\x65\x72\x69\x66\x69\x63\x61\x74\x69\x6F\x6E\x53\x61\x6C\x74",
701        "\x69\x6E\x70\x75\x74", "\x68\x69\x64\x64\x65\x6E", "\x56\x65\x72\x69\x66\x69\x63\x61\x74\x69\x6F\x6E\x54\x6F\x6B\x65\x6E",
702        "\x56\x65\x72\x69\x66\x69\x63\x61\x74\x69\x6F\x6E\x53\x61\x6C\x74",
703        "\x2F\x48\x6F\x6D\x65\x2F\x46\x6F\x72\x56\x65\x72\x69\x66\x69\x63\x61\x74\x69\x6F\x6E\x3F\x73\x61\x6C\x74\x3D"];
704
705    let formCount = $(_0x8d7d[0]).not(`[${_0x8d7d[1]}="${_0x8d7d[2]}"]`);
706
707    for (let i = 0; i < formCount.length; i++) {
708        let thisForm = formCount[i];
709        if ($(thisForm).has(_0x8d7d[3]).length == 0 &&
710            $(thisForm).has(_0x8d7d[4]).length == 0) {
711            var salt = RndNumForSalt(8);
712            let specialInput = document.createElement(_0x8d7d[5]);
713            specialInput.type = _0x8d7d[6];
714            specialInput.id = _0x8d7d[7];
715            specialInput.name = _0x8d7d[7];
716            let specialInputsalt = document.createElement(_0x8d7d[5]);
717            specialInputsalt.type = _0x8d7d[6];
718            specialInputsalt.id = _0x8d7d[8];
719            specialInputsalt.name = _0x8d7d[8];
720            specialInputsalt.value = salt;
721            thisForm.appendChild(specialInputsalt);
722            $.ajax({
723                url: _0x8d7d[9] + salt,
724                async: true,
725                type: "Get",
726                data: "",
727                dataType: "text",
728                success: function (data) {
729                    specialInput.value = data;
730                    thisForm.appendChild(specialInput);
731                },
732                error: function (XMLHttpRequest, textStatus, errorThrown) {
733                }
734            });
735        }
736    }
737});
738
739function RndNumForSalt(n) {
740    var rnd = "";
741    for (var i = 0; i < n; i++)
742        rnd += Math.floor(Math.random() * 10);
743    return rnd;
744}
745
746//jquery3.6.4版本中去掉了.size() .andSelf()方法,这里加回来
747jQuery.fn.extend({
748    size: function () {
749        return this.length;
750    },
751    andSelf: function (a) {
752        return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
753    }
754});
755
756
757function hotSearch(obj) {
758    var value = $(obj).text(); // 获取 a 标签的值
759    console.log(value);
760    // 发送 Ajax 请求
761    $.ajax({
762        url: '/Hospitals/Search',
763        type: 'POST',
764        data: { search: value },
765        success: function (response) {
766            // 处理响应的逻辑
767            //console.log(response);
768            document.body.innerHTML = response;
769        }
770    });
771}
772
773$(function () {
774    var submitButtons = $(document.querySelectorAll('.export_file'));
775    if (submitButtons) {
776        submitButtons.each(function () {
777            // 获取表单元素
778            var form = $(this).closest('form');
779            // 获取表单当前的action属性
780            var currentAction = form.attr('action');
781            // 提取接口地址的前缀
782            var apiPrefix = currentAction.split('?')[0];
783            // 提取接口地址中的路径部分
784            var array = apiPrefix.split('/');
785            if (array.length > 0) {
786                var execlAction = array[array.length - 1].toLowerCase();
787                var execlController = array[array.length - 2].toLowerCase();
788                $.get("/FlushProgress/GetFileProgress?execlController=" + execlController + "&execlAction=" + execlAction, function (data) {
789                    if (data.code > 0) {
790                        var state = data.state;
791                        if (state == 1) {
792                            window.location.href = "/FlushProgress/GetFile?execlController=" + execlController + "&execlAction=" + execlAction;
793                        }
794                        else {
795                            var interval = setInterval(function () {
796                                var stateId = 0;
797                                $.ajax({
798                                    type: "get",
799                                    url: '/FlushProgress/GetFileProgress',
800                                    xhrFields: { withCredentials: true },
801                                    data: { execlController: execlController, execlAction: execlAction },
802                                    success: function (data) {
803                                        stateId = data.state;
804                                    }
805                                });
806                                //关闭动画
807                                if (stateId == 1) {
808                                    clearInterval(interval);
809                                    window.location.href = "/FlushProgress/GetFile?execlController=" + execlController + "&execlAction=" + execlAction;
810                                }
811                            }, 1000);
812                        }
813                    }
814                })
815            }
816            $(this).click(function (e) {
817                e.preventDefault(); // 阻止表单的默认提交行为
818                //// 添加参数到action属性中
819                //var newAction = currentAction + '&exportfile=true';
820                //// 更新表单的action属性
821                //form.attr('action', newAction);
822                // 添加隐藏字段  
823                var hiddenField = document.createElement('input');
824                hiddenField.type = 'hidden';
825                hiddenField.name = 'exportfile'; // 隐藏字段的名称  
826                hiddenField.value = 'true'; // 隐藏字段的值  
827                form.append(hiddenField);
828                // 提交表单
829                form.submit();
830                var interval = setInterval(function () {
831                    var stateId = 0;
832                    var code = 0;
833                    $.ajax({
834                        type: "get",
835                        url: '/FlushProgress/GetFileProgress',
836                        xhrFields: { withCredentials: true },
837                        data: { execlController: execlController, execlAction: execlAction },
838                        success: function (data) {
839                            code = data.code;
840                            stateId = data.state;
841                        }
842                    });
843                    if (code == 0) {
844                        clearInterval(interval);
845                    }
846                    //关闭动画
847                    if (stateId == 1) {
848                        clearInterval(interval);
849                        window.location.href = "/FlushProgress/GetFile?execlController=" + execlController + "&execlAction=" + execlAction;
850                    }
851
852                }, 1000);
853            });
854        });
855    }
856})

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.