锘縱ar jumpType; $(document).ready(function () { replaceTagTarget() }); function replaceTagTarget() { jumpType = getUrlVar("target"); //榛樿灏辨槸_blank锛屽鏋渏umpType == "_parent"灏变笉鐢ㄥ鐞 if (jumpType == "_parent" || jumpType == "_self" || jumpType == "_top") { $("a").each(function () { var url = $(this).attr("href"); var target = $(this).attr("target"); if (target == jumpType) return; if (url.indexOf("?") > 0) { $(this).attr("href", url + "&target=" + jumpType); } else { $(this).attr("href", url + "?target=" + jumpType); } $(this).attr("target", jumpType); }); $("area").each(function () { var url = $(this).attr("href"); var target = $(this).attr("target"); if (target == jumpType) return; if (url.indexOf("?") > 0) { $(this).attr("href", url + "&target=" + jumpType); } else { $(this).attr("href", url + "?target=" + jumpType); } $(this).attr("target", jumpType); }); } } function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } function getUrlVar(name) { return getUrlVars()[name]; } // 鍏ㄥ眬鍙橀噺瀹氫箟 var islayer = false, //鏄惁涓哄脊鍑哄眰 msgIndex, //鎻愮ず灞傜储寮 config = { session_LayerData: "TempData_", laytable: { elem: '#dataTable' , id: 'TempData' // 瀹瑰櫒鍞竴 id , method: 'GET' , toolbar: '#toolbarDemo' // 琛ㄦ牸澶撮儴宸ュ叿鏍 , defaultToolbar: ['filter', 'print', 'exports'] // 鑷敱閰嶇疆澶撮儴宸ュ叿鏍忓彸渚х殑鍥炬爣 , height: 'full' , cellMinWidth: 90 // 鍗曞厓鏍肩殑鏈€灏忓搴 , page: true // 寮€鍚垎椤 , limit: 15 // 姣忛〉鏄剧ず鐨勬潯鏁 , limits: [5, 10, 15, 20, 30, 50, 100, 150, 200] // 姣忛〉鏉℃暟鐨勯€夋嫨椤 //, loading: true // 鏄惁鏄剧ず鍔犺浇鏉★紝榛樿锛歵rue //, skin: 'line' // 琛岃竟妗嗛鏍 //, even: true // 寮€鍚殧琛岃儗鏅 //, size: 'sm' // 灏忓昂瀵哥殑琛ㄦ牸 , text: { none: '鏆傛棤鐩稿叧鏁版嵁' // 榛樿锛氭棤鏁版嵁 } } }; // 閰嶇疆 // 鍥炬爣鍙傛暟锛?锛氭劅鍙瑰彿锛?锛氬嬀锛?锛氬弶锛?锛氶棶濂斤紱4锛氶攣锛?锛氬摥鑴革紱6锛氱瑧鑴革級 var ShowMsg = { //鏃犻槾褰辨彁绀虹獥锛岀敤浜庝竴鑸彁绀 Normal: function (content, iconum, timer) { var usertimer = arguments.length == 3 ? timer : 1500; if (!islayer) msgIndex = layer.msg(content, { icon: iconum, time: usertimer }); else msgIndex = parent.layer.msg(content, { icon: iconum, time: usertimer }); }, //鏈夐槾褰辨彁绀虹獥锛岀敤浜庢暟鎹彁浜 Shadow: function (content, iconum, timer) { var usertimer = arguments.length == 3 ? timer : 2000; if (!islayer) msgIndex = layer.msg(content, { icon: iconum, shade: [0.5, '#393D49'], time: usertimer }); else msgIndex = parent.layer.msg(content, { icon: iconum, shade: [0.5, '#393D49'], time: usertimer }); }, //鍏抽棴寮圭獥 Closed: function () { if (!islayer) layer.close(msgIndex); else parent.layer.close(msgIndex); } }; // LayDate鍒濆鍖栵紙鏃堕棿鑼冨洿绾︽潫锛 var LayDateInit = { MinDateObj: { year: 2019, month: 1, date: 1, hours: 0, minutes: 0, seconds: 0 }, MaxDateObj: { year: 2099, month: 12, date: 31, hours: 23, minutes: 59, seconds: 59 }, MinDate: function () { return this.MinDateObj.year + "-" + this.MinDateObj.month + "-" + this.MinDateObj.date + " " + this.MinDateObj.hours + ":" + this.MinDateObj.minutes + ":" + this.MinDateObj.seconds }, MaxDate: function () { return this.MaxDateObj.year + "-" + this.MaxDateObj.month + "-" + this.MaxDateObj.date + " " + this.MaxDateObj.hours + ":" + this.MaxDateObj.minutes + ":" + this.MaxDateObj.seconds }, CustFun: null, //鑷畾涔夌殑鍥炶皟鏂规硶 Year: function (startId, endId, laydate) { this.Init(startId, endId, laydate, 'year'); }, Month: function (startId, endId, laydate) { this.Init(startId, endId, laydate, 'month'); }, Date: function (startId, endId, laydate) { this.Init(startId, endId, laydate, 'date'); }, DateTime: function (startId, endId, laydate) { this.Init(startId, endId, laydate, 'datetime'); }, Init: function (startId, endId, laydate, type, showBottom = true) { var startDate = laydate.render({ elem: startId , type: type , showBottom: showBottom , btns: ['clear', 'confirm'] , min: this.MinDate() , max: $(endId).val() == "" ? this.MaxDate() : $(endId).val() , done: function (value, date) { if (value != "") { endDate.config.min.year = date.year; endDate.config.min.month = date.month - 1; endDate.config.min.date = date.date; endDate.config.min.hours = date.hours; endDate.config.min.minutes = date.minutes; endDate.config.min.seconds = date.seconds; } else { endDate.config.min.year = LayDateInit.MinDateObj.year; endDate.config.min.month = LayDateInit.MinDateObj.month - 1; endDate.config.min.date = LayDateInit.MinDateObj.date; endDate.config.min.hours = LayDateInit.MinDateObj.hours; endDate.config.min.minutes = LayDateInit.MinDateObj.minutes; endDate.config.min.seconds = LayDateInit.MinDateObj.seconds; } if (LayDateInit.CustFun != null) { LayDateInit.CustFun(value, this.elem.selector.substring(1)); } } }); var endDate = laydate.render({ elem: endId , type: type , showBottom: showBottom , btns: ['clear', 'confirm'] , min: $(startId).val() == "" ? this.MinDate() : $(startId).val() , max: this.MaxDate() , done: function (value, date) { if (value != '') { startDate.config.max.year = date.year; startDate.config.max.month = date.month - 1; startDate.config.max.date = date.date; startDate.config.max.hours = date.hours; startDate.config.max.minutes = date.minutes; startDate.config.max.seconds = date.seconds; } else { startDate.config.max.year = LayDateInit.MaxDateObj.year; startDate.config.max.month = LayDateInit.MaxDateObj.month - 1; startDate.config.max.date = LayDateInit.MaxDateObj.date; startDate.config.max.hours = LayDateInit.MaxDateObj.hours; startDate.config.max.minutes = LayDateInit.MaxDateObj.minutes; startDate.config.max.seconds = LayDateInit.MaxDateObj.seconds; } if (LayDateInit.CustFun != null) { LayDateInit.CustFun(value, this.elem.selector.substring(1)); } } }); } }; // ajax閿欒淇℃伅鎻愮ず鏂规硶 function ajaxError(data, XMLHttpRequest, textStatus, errorThrown) { //alert(JSON.stringify(data)); //alert(XMLHttpRequest.status); //alert(XMLHttpRequest.readyState); //alert(textStatus); ShowMsg.Closed(); ShowMsg.Normal(JSON.stringify(data), 2, 2000); }; // 鏁版嵁浼犺緭瀹屾瘯鍚庢柟娉 function ajaxComplete() { ShowMsg.Closed(); }; // Layui寮圭獥 function open_layer(urlval, datalist, widthval, heighval, titleval, flag, sessionStorageKey) { //濡傛灉灏忕獥鍙i〉闈㈤珮搴﹀ぇ浜庨〉闈紝榛樿椤甸潰楂樺害 if (document.documentElement.clientWidth < widthval + 10) { widthval = document.documentElement.clientWidth - 10; } if (document.documentElement.clientHeight < heighval + 10) { heighval = document.documentElement.clientHeight - 10; } //鎵撳紑寮圭獥 if (flag == 1) { layer.open({ type: 2, title: titleval, shadeClose: false, //鐐瑰嚮闃村奖鍏抽棴 //shade: false, maxmin: true, //寮€鍚渶澶у寲鏈€灏忓寲鎸夐挳 area: [widthval + 'px', heighval + 'px'], content: urlval + '?' + datalist, scrollbar: false, end: function () { sessionStorage.removeItem(sessionStorageKey); } }); } //鎵撳紑甯﹀洖璋冨嚱鏁扮殑绐楀彛 else if (flag == 2) { layer.open({ type: 2, title: titleval, shadeClose: false, //鐐瑰嚮闃村奖鍏抽棴 //shade: false, maxmin: true, //寮€鍚渶澶у寲鏈€灏忓寲鎸夐挳 area: [widthval + 'px', heighval + 'px'], content: urlval + '?' + datalist, scrollbar: false, end: function () { sessionStorage.removeItem(sessionStorageKey); layercolse(); } }); } return false; }; // Layui鍏抽棴寮圭獥 function close_layer() { var index = parent.layer.getFrameIndex(window.name); parent.layer.close(index); return false; }; // 淇濆瓨鎴愬姛鍒锋柊 function succ() { close_layer(); parent.document.getElementById("btn_search").click(); }; //鑾峰彇閾炬帴鍦板潃浼犻€掔殑鍙傛暟 var Request = { //鑾峰彇url涓??"绗﹀悗鐨勫瓧涓?鍚??"鍙? ParamStr: function () { return unescape(window.location.search); }, //鏍规嵁鍚嶇О鑾峰彇鍗曚釜鍙傛暟鍊 GetQuery: function (id) { var result = this.ParamStr().match(new RegExp("[\?\&]" + id + "=([^\&]+)", "i")); if (result == null || result.length < 1) { return ""; } return result[1]; }, //鑾峰彇鎵€鏈夊弬鏁伴泦鍚 GetQueryList: function () { var theRequest = new Object(); if (this.ParamStr().indexOf("?") != -1) { var str = this.ParamStr().substr(1); var strs = str.split("&"); for (var i = 0; i < strs.length; i++) { theRequest[strs[i].split("=")[0]] = strs[i].split("=")[1]; } } return theRequest; } }; //鍘婚櫎绌烘牸 String.prototype.Trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ""); }; //鍘婚櫎鏈€鍚庝竴涓€楀彿 String.prototype.Trim = function (str) { return this.replace(/,$/gi, ""); }; //鏃ユ湡鏍煎紡鍖 Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, //鏈堜唤 "d+": this.getDate(), //鏃 "h+": this.getHours(), //灏忔椂 "m+": this.getMinutes(), //鍒 "s+": this.getSeconds(), //绉 "q+": Math.floor((this.getMonth() + 3) / 3), //瀛e害 "S": this.getMilliseconds() //姣 }; fmt = fmt || "yyyy-MM-dd"; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; }; Date.prototype.addDays = function (d) { this.setDate(this.getDate() + d); }; Date.prototype.addWeeks = function (w) { this.addDays(w * 7); }; Date.prototype.addMonths = function (m) { var d = this.getDate(); this.setMonth(this.getMonth() + m); if (this.getDate() < d) this.setDate(0); }; Date.prototype.addYears = function (y) { var m = this.getMonth(); this.setFullYear(this.getFullYear() + y); if (m < this.getMonth()) { this.setDate(0); } }; //鏃堕棿鎴宠浆鎹 function formatDate(data, fmt) { if (data != null && data != "") { if (!fmt) { fmt = 'yyyy-MM-dd hh:mm:ss'; } var r = eval(data.replace(/\/Date\((\d+)\)\//gi, "new Date($1)")).Format(fmt); return r; } }; //鍚玊鏃堕棿杞崲 function formatDateT(data, fmt) { try { if (!fmt) { fmt = 'yyyy-MM-dd hh:mm:ss'; } if (data == null || data == "") return ""; data = data.replace("T", " "); //瑙e喅閮ㄥ垎娴忚鍣ㄦ椂闂村揩8H闂 return new Date(data).Format(fmt); } catch (e) { return ""; } }; //鍙暀鏈堜唤 function formatDateM(data, fmt) { try { if (!fmt) { fmt = 'MM'; } if (data == null || data == "") return ""; data = data.replace("T", " "); //瑙e喅閮ㄥ垎娴忚鍣ㄦ椂闂村揩8H闂 return new Date(data).Format(fmt); } catch (e) { return ""; } }; $(function () { $(".img-list-left ul li a:last").css("background-image", "none");//鍏抽敭鍑芥暟锛屾敞鎰忓鍣╥d"#test"瑕佸拰html浠g爜涓竴鏍 })