PageSourceSearch

https://www.tianmen.gov.cn/isr/znwd/js/MarkRed.js

js tianmen.gov.cn collected 2026-10-02 14:54:53 UTC 8,178 bytes, 243 lines download raw bytes

1var fillMap = {};
2var fillIsVoice = true;
3
4function getChineseFirstLetter(str) {
5    var pinyin = '';
6    for (var i = 0; i < str.length; i++) {
7        var char = str.charAt(i);
8        var charCode = char.charCodeAt(0);
9        if (charCode >= 0 && charCode <= 128) {
10            pinyin += char;
11        } else {
12            pinyin += convertToFirstLetter(char);
13        }
14    }
15    return pinyin;
16}
17
18function convertToFirstLetter(char) {
19    var firstLetter = '';
20    var pinyin = new Pinyin();
21    if (pinyinDict[char]) {
22        firstLetter = pinyinDict[char].substring(0, 1);
23    }
24    return firstLetter;
25}
26function redKeyWord(data) {
27    console.log(data);
28    var html = "";
29    var keyWord = $("#keyWord").val().trim();
30    keyWord = keyWord.replace(/\s/g, "");
31    var fillMapTemp = {};
32    jQuery.each(data.result.fillQuestions, function (i, item) {
33        var _questionAll = item.knTitle.replace(/\n/g, "<br>").replace(/\r/g, "<br>");
34        fillMapTemp[_questionAll] = item;
35        var text = _questionAll;
36        var outStr = "";
37        for (var j = 0; j < text.length; j++) {
38            var each = text.substr(j, 1);
39            var isCharInKeyword = keyWord.indexOf(each) != -1;
40            if (isCharInKeyword) {
41                outStr += "<span style='color: #2e89e1;'>" + each + "</span>"
42            } else {
43                if (data.result.matchSentence.indexOf(each)!=-1) {
44                    outStr += "<span style='color: #2e89e1;'>" + each + "</span>"
45                }else{
46                    outStr += each;
47                }
48            }
49        }
50
51        if(braceMatch(item.content))
52        {
53            html += " <li onclick=\"fillToIframe(\'" + _questionAll + "\',1)\" style='cursor: pointer;' > " + outStr + "</li>"
54        }else{
55            html += " <li onclick=\"fillToTextarea(\'" + _questionAll + "\')\" style='cursor: pointer;' > " + outStr + "</li>"
56        }
57    });
58    // fillMap = Object.assign({}, fillMapTemp);
59    fillMap = JSON.parse(JSON.stringify(fillMapTemp));
60
61    if ($("#keyWord").val()) {
62        $("#completionQues").html(html);
63        index = -1;
64        size = $("#completionQues").find("li").length;
65        if (size > 0) {
66            $("#tc_Big_box").show();
67            $("#textTag").show();
68        } else {
69            $("#tc_Big_box").hide();
70            $("#textTag").hide();
71        }
72    }
73}
74
75//省政府补全问题(包含普通问答、疫情问答)
76function redKeyWord2(data, windowNum) {
77    var html = "";
78    var keyWord = $("#keyWord"+windowNum).val().trim();
79    keyWord = keyWord.replace(/\s/g, "");
80    var fillMapTemp = {};
81    jQuery.each(data.result.fillQuestions, function (i, item) {
82        var _questionAll = item.knTitle.replace(/\n/g, "<br>").replace(/\r/g, "<br>");
83        fillMapTemp[_questionAll] = item;
84        var text = _questionAll;
85        var outStr = "";
86        for (var j = 0; j < text.length; j++) {
87            var each = text.substr(j, 1);
88            if (keyWord.indexOf(each) != -1) {
89                outStr += "<span style='color: #2e89e1;'>" + each + "</span>"
90            } else {
91                outStr += each;
92            }
93        }
94        if(braceMatch(item.content))
95        {
96            html += " <li onclick=\"fillToIframe(\'" + _questionAll + "\',1)\" style='cursor: pointer;' > " + outStr + "</li>"
97        }else{
98            html += " <li onclick=\"fillToTextarea(\'" + _questionAll + "\')\" style='cursor: pointer;' > " + outStr + "</li>"
99        }
100
101
102    });
103    // fillMap = Object.assign({}, fillMapTemp);
104    fillMap = JSON.parse(JSON.stringify(fillMapTemp));
105
106    if ($("#keyWord"+windowNum).val()) {
107        $("#completionQues"+windowNum).html(html);
108        index = -1;
109        size = $("#completionQues"+windowNum).find("li").length;
110        if (size > 0) {
111            // $("#tc_Big_box").show();
112            $("#textTag"+windowNum).show();
113        } else {
114            // $("#tc_Big_box").hide();
115            $("#textTag"+windowNum).hide();
116        }
117    }
118}
119
120
121/**
122 *  匹配 iframe标签  存在iframeUuid值
123 *
124 *  return @Parame true  匹配到  false 未通过匹配
125 */
126 function braceMatch(result)
127 {
128     var str1=false;
129
130     if(result!="" && result.indexOf("iframeUuid")!=-1 && result.indexOf("iframe")!=-1)
131     {
132         str1= true;
133     }
134     return str1;
135 }
136//重设iframe 高度
137function setIframeHeight(iframe) {
138    if (iframe) {
139        // 跨域请求
140        var iframeSrc = iframe.src;
141        var iframeDomain = iframeSrc.split(/\/+/);
142        var domain = window.location.host;
143        var iframeWin = iframe.contentWindow;
144        // 跨域判断
145        if(iframeDomain[1] && domain != iframeDomain[1] || (iframeDomain[0] != window.location.protocol && domain == iframeDomain[1])) {
146            iframeWin.postMessage('getHeight', '*')
147            window.onmessage = function(e) {
148                var obj = e.data;
149                iframe.height = obj.height;
150            }
151        } else {
152            if (iframeWin && iframeWin.document && iframeWin.document.body) {
153                // iframe.height = iframeWin.document.body.scrollHeight+10;
154                iframe.height = iframeWin.document.body.scrollHeight;
155            }
156        }
157
158    }
159    };
160// iframe 定时任务
161function  setIframeCheck(iframe){
162        (function () {
163            setInterval(function () {
164                setIframeHeight(iframe);
165            }, 200)
166        })(iframe)
167}
168function  setCheck(){
169    $(".flexiframe").each(function (index) {//iframe公用类名:flexiframe
170        var that = $(this);
171        (function () {
172            setInterval(function () {
173                setIframeHeight(that[0])
174            }, 200)
175        })(that)
176    });
177}
178// 对Date的扩展,将 Date 转化为指定格式的String
179// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
180// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
181// 例子:
182// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
183// (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18
184/**
185 * 实例
186 *
187//使用方法
188var now = new Date();
189var nowStr = now.format("yyyy-MM-dd hh:mm:ss");
190//使用方法2:
191var testDate = new Date();
192var testStr = testDate.format("YYYY年MM月dd日hh小时mm分ss秒");
193alert(testStr);
194//示例:
195alert(new Date().format("yyyy年MM月dd日"));
196alert(new Date().format("MM/dd/yyyy"));
197alert(new Date().format("yyyyMMdd"));
198alert(new Date().format("yyyy-MM-dd hh:mm:ss"));
199 */
200Date.prototype.Format = function(fmt)
201{ //author: meizz
202  var o = {
203    "M+" : this.getMonth()+1,                 //月份
204    "d+" : this.getDate(),                    //日
205    "h+" : this.getHours(),                   //小时
206    "m+" : this.getMinutes(),                 //分
207    "s+" : this.getSeconds(),                 //秒
208    "q+" : Math.floor((this.getMonth()+3)/3), //季度
209    "S"  : this.getMilliseconds()             //毫秒
210  };
211  if(/(y+)/.test(fmt))
212    fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
213  for(var k in o)
214    if(new RegExp("("+ k +")").test(fmt))
215  fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
216  return fmt;
217}
218
219function videoShow(uu)
220{
221    var vcls=$("#"+uu).closest(".znwd_con3").find(".vclsplay");
222
223    if(vcls.length>0)
224    {
225        var vsource=vcls.find("source").attr("src");
226        //自动播放
227        vcls[0].play();
228        vcls.unbind("ended").bind("ended",function(){
229            //重新加载资源,达到封面的效果
230            $(this).css("display","block");
231            $(this).attr("src",vsource);
232        })
233    }
234
235
236}
237//获取url参数
238function getUrlParams(name) {
239    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
240    var r = window.location.search.substr(1).match(reg);
241    if (r != null) return unescape(r[2]);
242    return null;
243}

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.