/*
* 名称:puyuetianUI前端框架 js驱动
* 版本:4.2.1
* 发布:2015-10-10
* 更新:2021-08-05
* 作者:蒲乐天
* 官网:https://www.hadsky.com
*/
var K={version:"4.2.1.20210805",basePath:"/",WWW_DIR:"/",uploadURL:"/general/upload",URL(e,t=!1){return e=(K.WWW_DIR+"/"+(e||"")).replace(/[\/]+/g,"/"),t&&(e=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")+e),e},L(e){var t=K.language_dictionary||!1;if(t)for(var a in t)if(K.in_array(e,a,!1,"|"))return t[a];return e},require(e,t){if(!e)return console.log("K.require() urls\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A"),!1;if("string"==typeof e){var a=e.split(",");for(var n in e={js:[],css:[]},a){var o=a[n].split(".");o=o[o.length-1],K.in_array(o,"js,css")&&e[o].push(a[n])}e.js.length||(e.js=!1),e.css.length||(e.css=!1)}if(!e.js&&!e.css)return!1;var p=function(){"function"==typeof t&&setTimeout(function(){t()},0)},s=function(){"string"==typeof e.js&&(e.js=e.js.split(","));var t=0,a=e.js.length,n=function(){var o=e.js[t],d="_"+K.md5(o);$("head").append([""].join("")),$.getScript(o,function(e,l){"success"!=l&&console.log("js\u52A0\u8F7D\u5931\u8D25\uFF1Aid:"+d+",url:"+o),t++,t>=a?p():n()})};n()};if(e.css){"string"==typeof e.css&&(e.css=e.css.split(","));for(var d,l=0;l"].join(""))}return e.js&&s(),!0},require_once(e,t,a){if("string"==typeof e)var e=e.split(",");if("undefined"!=typeof a)return console.log("\u5BF9\u8C61\u5B58\u5728\u5DF2\u5FFD\u7565\u52A0\u8F7D\uFF1Aurls:"+e.join(",")),"function"==typeof t&&t(),!0;for(var n=[],o=0;oo&&(o="0"+o);var p=a.getDate();10>p&&(p="0"+p);var s=a.getHours();10>s&&(s="0"+s);var d=a.getMinutes();10>d&&(d="0"+d);var l=a.getSeconds();10>l&&(l="0"+l);var r="";return r=e.replace(/Y/ig,n),r=r.replace(/m/ig,o),r=r.replace(/d/ig,p),r=r.replace(/H/ig,s),r=r.replace(/i/ig,d),r=r.replace(/s/ig,l),r},strip_tags(e,t=""){if(e+="",t){t=-1<"):t.split(",");var a="";for(var n in t)a+="|"+t[n]+" |"+t[n]+">",a+="|/"+t[n]+" |/"+t[n]+">";a=a.substr(1),t=a}var o="<"+(t?"(?!"+t+")":"")+"[\\W\\w]+?>";return e.replace(new RegExp(o,"ig"),"")},str_replace(e,t,a){K.in_array(typeof a,"string,number")||(a=""),a+="",K.in_array(typeof e,"string,number")&&(e+="",e=[e]),K.in_array(typeof t,"string,number")&&(t+="");for(var n,o=0;o","\""],n=["&","<",">","""];if(!t){var o=a;a=n,n=o}return K.str_replace(a,n,e)},json_data($data={},$key=null,$value=null){if("object"!=typeof $data&&($data=JSON.parse($data)),!$key)return $data;var $keys=$key.split("."),$_d=$data,$str="";for($k in $keys){var $v=$keys[$k];if($str+="['"+$v+"']",!$_d[$v]){if(null==$value)return null;$_d[$v]=[],eval("$data"+$str+"=[];")}$_d=$_d[$v]}return null==$value?$_d:(eval("$data"+$str+"=$value;"),$data)},select_selected(e){e||(e="body");for(var t,a=$(e).find("select[data-value]"),n=0;n";for(var a in e){var n=e[a].name,o=e[a].title,p=e[a].content||"",s=e[a].type,d=K.htmlspecialchars(e[a].value||"");if("id"==n){t+="";continue}if(t+=["",o].join(""),p&&(t+=["'+$(this).data('content')+'
',false)\">"].join("")),t+="
",K.in_array(s,"text,number,email,label,password,checkbox,checkboxs"))t+=["
"].join("");else if(K.in_array(s,"textarea,code,nav,json,editor"))t+=["
"].join("");else if(K.in_array(s,"switch,toggle"))t+=["
"].join("");else if(K.in_array(s,"upload,uploads")){var l="_"+K.random_string();t+=["
"].join(""),"upload"==s&&(t+=["",K.L("\u9884\u89C8"),""].join("")),t+=["",K.L("\u4E0A\u4F20"),""].join(""),"uploads"==s&&(t+="
",setTimeout(function(){$("#"+l).on("input propertychange change",function(){var e=$(this),t=e.val();if(!t)return!1;var n=t.split(",");$("#"+l+"_div").html("");for(var o=0;o
",d?"":a,"",K.L("\u5220\u9664"),"
"].join("")).find(">div:last a._del").on("click",function(){e.val(e.val().replace($(this).data("url"),"")),$(this).parent().parent().remove(),e.val(K.trim(e.val().replace(/[\,]+/g,","),","))})}}).change()},1e3))}else t+=K.in_array(s,"time")?[""].join(""):K.str_replace(["{$name}","{$value}"],[n,d],s);t+="",t+=""}return t+="",t},setup_window(e){return K.P({type:0,title:e.title||"\u8BBE\u7F6E\u9875",content:K.return_set_html(e.data),area:K.is_small_screen()?["100%","100%"]:["70%","80%"],noclose:1,submit:function(t){var a=K.p_o(t),n=K.formdata2array(a.find(".pk-popup-body"));return"function"==typeof e.submit?(e.submit(n,t),!0):void $.post(e.submit||"",n,function(e){return e.code?void K.msg(e.msg,1):(K.alert(e.msg,2),!1)},"json")},complete:function(t){var a=K.p_o(t);if(K.input_beautify(a),a.find(".pk-popup-submit").html(K.L("\u4FDD\u5B58")),"function"==typeof e.complete)return e.complete(a),!0}})},random_string(e=7,t=""){t||(t="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789"),t+="",e=parseInt(e)||7;var a=t,n=a.length,o="";for(i=0;io&&(e=p?o:t),e},in_arrays(e,t,a=!0,n=","){return K.in_array(e,t,a,n)},in_array(e,t,a=!0,n=","){if(-1<["string","number"].indexOf(typeof e))e+="",e=n?e.split(n):[e];else for(var o in e)e[o]+="";if(-1<["string","number"].indexOf(typeof t))t+="",t=n?t.split(n):[t];else for(var o in t)t[o]+="";for(var p in e)if(-1").find("input[type=\"file\"]:last").on("change",function(){e.object=this,K.image2base64(e),$(this).remove()}).click(),!1;var t=e.object,a=e.width||null,n=e.height||null,o=e.success||null,p=e.error||null,s="_"+K.random_string();$("body").append("");var d=$("#"+s),l=d.find("img");"string"==typeof t?l.attr("src",t):"img"==($(t)[0].tagName||"").toLowerCase()?l.attr("src",$(t).attr("src")):l.attr("src",K.createObjectURL(t));var r=function(e){var t=d.find("canvas"),o=t[0].getContext("2d"),p=e.width(),s=e.height();return a||n?(!a&&(a=n/s*p),!n&&(n=a/p*s)):(a=p,n=s),t.attr({width:a,height:n}),o.drawImage(e[0],0,0,a,n),t[0].toDataURL("image/png")};l.on({load:function(){var e=r(l);"function"==typeof o&&o(e),d.remove()},error:function(t){"function"==typeof p&&p(t),console.log(t),d.remove()}})},createObjectURL(e){return(window.URL||window.webkitURL).createObjectURL($(e)[0].files[0])||null},table(e){if(!e)return!1;if(!e.elem)return!1;if(e.data||(e.data=[]),!e.where){e.where=[];var t=e.where}e.nocheckbox&&(e.checkbox=!1),"undefined"==typeof e.checkbox&&(e.checkbox=!0);var a=$(e.elem);if(a.hasClass("pk-autotable"))return!1;var n=e.id||"_"+K.random_string(7),o="",p=!1;if(e.cols){for(var s in p=[],o+="",e.checkbox&&(o+=" | "),e.cols){var d=e.cols[s];p.push({field:d.field}),o+=["",d.title," | "].join("")}if(e.tool){var l=$(e.tool).attr("width")||!1;o+=""+K.L("\u64CD\u4F5C")+" | "}o+="
"}if(o+="",e.page&&"object"!=typeof e.data){var r=K.cnum(e.page.page,!1,!0,1)||1,c=K.cnum(e.page.limit,!1,!0,1)||10,u=[10,20,50,100,200,500];o+="","",r,""," |
"].join("")}o+="
",a.addClass("pk-autotable").hide().after(o);var m=$("#"+n);m.find(">tfoot select._limit").val(c);var f=e,h=function(e,t,a,n,o){if(iscomplete=1,"object"==typeof e){if(!e.length)return m.find(">tbody").html(""+K.L("\u65E0\u6570\u636E")+" |
"),!0;var s="";for(var d in e){for(var l in s+="",f.checkbox&&(s+=[""," | "].join("")),p){var r=[];for(var c in e[d])if(c==p[l].field){r=e[d];break}r.key=d;var u=f.cols[l];s+=[""].join(""),s+="function"==typeof u.format?u.format(r[c],r):"undefined"==typeof r[c]?"":r[c],s+=" | "}if(f.tool){var k=$(f.tool).html();s+=""+k+" | "}s+="
"}m.find(">tbody").html(s),g(f,e)}else iscomplete=0,t=t||1,a=a||10,n=n||[],n=JSON.stringify(n),$.getJSON(e,{page:t,limit:a,where:n},function(e){if(e.code||m.find(">tbody").html(["",e.msg?e.msg:"error"," |
"].join("")),h(e.data.list,t,a,n,o),m.find(">tfoot").show().find("._prev,._page,._next,._go").data("limit",a).show(),m.find(">tfoot").find("._page,._go").data("page",t),m.find(">tfoot ._prev").data("page",t-1),m.find(">tfoot ._next").data("page",t+1),K.cnum(e.data.count)){var p=Math.ceil(e.data.count/a);m.find(">tfoot ._go").data({page:t,pagecount:p}),(1==p||1==t)&&m.find(">tfoot").find("button._prev").hide(),3>p&&m.find(">tfoot").find("button._go").hide(),p<=t&&m.find(">tfoot").find("button._next").hide(),m.find(">tfoot").find("span._page").html(t+"/"+p)}else null===e.data.count?(1==t&&m.find(">tfoot").find("button._prev").hide(),m.find(">tfoot").find("span._page").html(t)):m.find(">tfoot").hide()});"function"==typeof o&&iscomplete&&o(e,m)},g=function(e,t){if(e.page){var a=e.where;m.find(">tfoot:not(._oned)").addClass("_oned").find("button._prev,button._next,button._go").on("click",function(){var t=K.cnum($(this).data("page")),n=K.cnum($(this).data("limit"))||10,o=K.cnum($(this).data("pagecount"))||0;return $(this).hasClass("_go")?void K.P({type:2,title:K.L("\u8BF7\u8F93\u5165\u9875\u7801"),noclose:1,submit:function(p,s){return K.cnum(s,!1,!0,1)?parseInt(s)==t?(K.msg(K.L("\u76EE\u6807\u9875\u4E3A\u672C\u9875"),0),!1):o&&parseInt(s)>o?(K.msg(K.L("\u8D85\u51FA\u4E86\u6700\u5927\u9875\u6570"),0),!1):void(K.close(p),h(e.data,s,n,a)):(K.msg(K.L("\u53EA\u80FD\u8F93\u5165\u6B63\u6574\u6570"),2),!1)},complete:function(e){K.p_o(e).find(".pk-popup-input").attr({type:"number",min:1}).val(t)}}):(h(e.data,t,n,a),!0)}).end().find("select._limit").on("change",function(){var t=K.cnum($(this).val(),10,!0,10,500);h(e.data,1,t,a)})}"function"==typeof e.tool_event&&m.find(">tbody").find("td.pk-table-tool-td .pk-table-tool-event").on("click",function(){e.tool_event($(this),t[$(this).parents("td.pk-table-tool-td:eq(0)").data("key")])})};return h(e.data,r,c,t,e.complete),m.reload=function(a,n,o,p){a||(a=r),n||(n=c),o||(o=t),p||(p=e.complete),h(e.data,a,n,o,p)},m},actionsheet(e){if(e.data||(e.data=e),"undefined"==typeof e.cancel&&(e.cancel=!0),"undefined"==typeof e.mask&&(e.mask=!0),"undefined"==typeof e.close&&(e.close=!0),!e.data)return!1;var t="_"+K.random_string(7),a=function(){p.animate({height:0},500),setTimeout(function(){$("#"+t+",#"+t+"_mask").remove()},500)};e.mask&&$("body").append(""),$("body").append("");for(var n,p=$("#"+t),o=0;o"+n.text+"").find(">div:last").data("click",n.click).on("click",function(){$(this).data("click")(),e.close&&a()});e.cancel&&p.append(""+K.L("\u53D6\u6D88")+"
").find(">div:last").on("click",function(){a()});var s=p.height();return p.height(0),p.animate({height:s},500),p.mask=$("#"+t+"_mask"),p},select2hintbox(selector,options=null){if(selector=$(selector),!selector.length)return!1;options||(options={}),options.data||(options.data=[]);for(var _do=function(o,os){if(o.data("pk-hintbox-object"))return!1;o.data("value")&&o.val(o.data("value"));var _id="_"+K.random_string(),html="";if(o.data("pk-hintbox-options")&&(os=o.data("pk-hintbox-options"),"object"!=typeof os))try{os=JSON.parse(os)}catch(t){os=[]}var d=os.data||[];if(!d.length&&"SELECT"==o.prop("tagName"))for(var _o,_s=o.find("option"),i=0;i<_s.length;i++)_o=$(_s[i]),d.push({name:(_o.attr("icon")?"":"")+_o.html(),value:_o.attr("value"),disabled:_o.prop("disabled"),selected:_o.prop("selected")});var ishtml=!1;if("object"==typeof d)for(var i=0;i",d[i].name,""].join("");else ishtml=!0,html=d;var _o=o.data("pk-hintbox-object",!0).after([""].join("")).parent().css("position","relative").end().next("#"+_id);if(_o.css(os.css||{}),o.on({click:function(){$(this).find("i").toggleClass("fa-caret-down fa-caret-up"),$("#"+_id).toggleClass("pk-hide")}}),"SELECT"==o.prop("tagName")){var _span_width=o.outerWidth(),_span_height=o.outerHeight(),_span=o.addClass("pk-hide").before("").prev("span").on({click:function(){$(this).find("i").toggleClass("fa-caret-down fa-caret-up"),$("#"+_id).toggleClass("pk-hide")}}).attr({class:os.spanclass||o.attr("class"),style:os.spanstyle||o.attr("style")}).removeClass("pk-hide").html(os.spanhtml||["",o.find("option[selected]").html()||o.find("option:eq(0)").html(),""].join(""));_span.find(">span").css({maxWidth:"100%"}).end().find(">i").css({position:"absolute",right:0,top:0,height:_span.outerHeight()+"px",lineHeight:_span.outerHeight()+"px"}),_span.css({minWidth:_span.find(">span").outerWidth()+_span.find(">i").outerWidth()}),_o.css({left:K.cnum(_span.offset().left-o.parent().offset().left+(_span.outerWidth()-_o.outerWidth())/2,0,!1,0),top:_span.offset().top-o.parent().offset().top+_span.outerHeight()})}else _o.css({left:K.cnum(o.offset().left-o.parent().offset().left+(o.outerWidth()-_o.outerWidth())/2,0,!1,0),top:o.offset().top-o.parent().offset().top+o.outerHeight()});_o.offset().left+_o.outerWidth()>$(window).width()&&_o.css("left",$(window).width()-o.parent().offset().left-_o.outerWidth());var _left=(_o.outerWidth()-22)/2;return(os.arrowcenteratobject&&(_left=K.cnum(o.offset().left-_o.offset().left+(o.outerWidth()-22)/2,0,!1,0)),$("head").append([""].join("")),_o.addClass("pk-hide"),ishtml||_o.find(".pk-hint-content>div").on("click",function(){var value=$(this).data("value")||"",html=$(this).html()||"",index=$(this).data("index")||0,_typeof=typeof d[index].click;if("SELECT"==o.prop("tagName")){if($(this).hasClass("_selected")||$(this).hasClass("_disabled"))return!1;$(this).siblings().removeClass("_selected"),$(this).addClass("_selected"),_span.find("span").html(html),o.val(value).change(),_span.click()}else o.click();return"undefined"==_typeof?(_typeof=typeof os.click,"undefined"!=_typeof)?("function"==_typeof?os.click(value,os):eval(os.click),!0):void 0:("function"==_typeof?d[index].click(value,os):eval(d[index].click),!0)}),"SELECT"==o.prop("tagName")&&_o.find(".pk-hint-content>div").each(function(){if($(this).data("value")==o.val())return $(this).siblings().removeClass("_selected"),$(this).addClass("_selected"),_span.find("span").html($(this).html()||""),!0}),!os.hover||K.is_small_screen())?_o:($(o).add(_o).on({mouseover:function(){_o.hasClass("pk-hide")&&($(o).find("i").toggleClass("fa-caret-down fa-caret-up"),_o.removeClass("pk-hide"))}}),$("body").on({mousemove:function(t){var e=_o;if(e.hasClass("pk-hide"))return!0;var a=o.offset().top,n=e.offset().left,p=e.offset().top+e.outerHeight(),s=n+e.outerWidth(),d=t.clientX+$(window).scrollLeft(),l=t.clientY+$(window).scrollTop();(ds||lp)&&($(o).find("i").toggleClass("fa-caret-down fa-caret-up"),e.addClass("pk-hide"))}}),_o)},__os=[],i=0;i"].join(""),submit:function(e){var a=K.p_o(e).find(".pk-popup-body input[type=\"color\"]").val();return"#"!=a[0]||7!=a.length?(K.msg(K.L("\u989C\u8272\u53C2\u6570\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165\u6216\u9009\u62E9"),2),!1):void(a=a.toUpperCase(),"function"==typeof t&&t(a),K.close(e))},complete:function(e){K.p_o(e).find(".pk-popup-body select option[value=\""+a+"\"]").prop({selected:!0})}});return!0},timePicker(e,t){e||(e=K.date()),"date"==e&&(e=K.date("Ymd")),"time"==e&&(e=K.date("H:i:s"));var a=!1,n=!1;if(e=e.split(" "),-1",a){s+=" - ",s+=" - ",s+=""}if(n){a&&(s+=" "),s+=" : ",s+=" : ",s+=""}s+="
";K.P({type:2,title:K.L("\u65E5\u671F\u65F6\u95F4"),submit:function(e,a){"function"==typeof t&&t(a)},complete:function(e){var t=K.p_o(e);t.find(".pk-popup-body .pk-popup-input").addClass("pk-hide").after(s),t.find(".pk-popup-body select").on("change propertychange",function(){var e="";if(a){var o=t.find("select._y_").val(),p=t.find("select._m_").val(),l=t.find("select._d_").val();e=o+"-"+p+"-"+l}if(n){e&&(e+=" ");var d=t.find("select._h_").val(),r=t.find("select._i_").val(),c=t.find("select._s_").val();e+=d+":"+r+":"+c}t.find(".pk-popup-body .pk-popup-input").val(e)}).change()}});return!0},viewer(e,t=null){return(e=$(e),!!e.length)&&(t||(t={}),t.button=t.button||!K.is_small_screen(),t.navbar=t.navbar||2,t.title=t.title||2,t.toolbar=t.toolbar||2,t.className=t.className||"pk-viewer",t.complete=t.complete||!1,t.filter=t.filter||function(e){return e.complete},K.require_once(K.basePath+"../css/viewer.min.css,"+K.basePath+"viewer.min.js",function(){e.find("img").css("cursor","pointer");for(var a=[],n=0;n>>32-t}function n(e,t){var a,n,o,p,s;return o=2147483648&e,p=2147483648&t,a=1073741824&e,n=1073741824&t,s=(1073741823&e)+(1073741823&t),a&n?2147483648^s^o^p:a|n?1073741824&s?3221225472^s^o^p:1073741824^s^o^p:s^o^p}function o(e,t,a){return e&t|~e&a}function p(e,t,a){return e&a|t&~a}function l(e,t,a){return e^t^a}function r(e,t,a){return t^(e|~a)}function s(e,p,l,r,d,c,s){return e=n(e,n(n(o(p,l,r),d),s)),n(t(e,c),p)}function u(e,o,l,r,d,c,s){return e=n(e,n(n(p(o,l,r),d),s)),n(t(e,c),o)}function h(e,o,p,r,d,c,s){return e=n(e,n(n(l(o,p,r),d),s)),n(t(e,c),o)}function m(e,o,p,l,d,c,s){return e=n(e,n(n(r(o,p,l),d),s)),n(t(e,c),o)}function f(e){for(var t,a=e.length,n=a+8,o=16*((n-n%64)/64+1),p=Array(o-1),s=0,d=0;d>>29,p}function g(e){var t,a,n="",o="";for(a=0;3>=a;a++)t=255&e>>>8*a,o="0"+t.toString(16),n+=o.substr(o.length-2,2);return n}function v(e){var t=String.fromCharCode;e=e.replace(/\r\n/g,"\n");for(var a,o="",p=0;pa?o+=t(a):127a?(o+=t(192|a>>6),o+=t(128|63&a)):(o+=t(224|a>>12),o+=t(128|63&a>>6),o+=t(128|63&a));return o}e+="";var _,y,w,j,A,C,L,H,W,B=[],S=7,q=12,O=17,P=22,E=5,N=9,G=14,I=20,T=4,F=11,Q=16,U=23,Y=6,X=10,R=15,M=21;for(e=v(e),B=f(e),C=1732584193,L=4023233417,H=2562383102,W=271733878,_=0;_"+html+""),s=h.find("else");if(s.length){for(var o,_html=html,i=0;i",html=K.str_replace(string,replace,html)}return marksdo(html)}s=h.find("if");for(var i=0;i",complete(e){a(K.p_o(e).find("._qrcode")),"function"==typeof t.complete&&t.complete(e)},submit(e,a){"function"==typeof t.submit&&t.submit(e,a)}})},canvas2image(e){$(e).after(""),$(e).remove()},input2checkboxs(e,t=null){if(!e)return!1;t||(t={}),t.data=t.data||!1,t.hidden=!("undefined"!=typeof t.hidden)||t.hidden,t.readonly=!("undefined"!=typeof t.readonly)||t.readonly;for(var a=$(e),n=function(e){if(e.data("pk-checkboxs-object"))return!1;var a=t.data;if(a||(a=e.data("data")||!1),a||(a=window._input2checkboxs_data||!1),!a)return!1;var n="_"+K.random_string(7);e.data("pk-checkboxs-object",!0).css("margin-bottom","10px").after(""),t.hidden&&e.addClass("pk-hide"),t.readonly&&e.prop("readonly",!0);var o=$("#"+n),p=e.val();for(var s in a)o.append([""].join(""));K.input2checkbox(o.find("input[type=\"checkbox\"]"));setInterval(function(){var t=e.val();for(var n in t=t.split(","),a)for(var d=0;d","","","
","","","
","","","
"].join("")),p.find("i.fa:last").on("click",function(){$(this).parents("div.pk-row:eq(0)").remove()})},n="_"+K.random_string(7);e.data("pk-json-object",!0).addClass("pk-hide").after(["","
","
",K.L("\u540D\u79F0"),"
","
",K.L("\u5185\u5BB9"),"
","
","
",""].join(""));var p=$("#"+n);for(var o in p.next().find("a").on("click",function(){a()}),t)a(o,t[o]);var l=setInterval(function(){if(!$("#"+n).length)return clearInterval(l),!1;for(var t={},a=p.find(">div.pk-row"),o=0;o",p,""].join("")).next("label").on("click",function(){$(this).prev("input[type=\"checkbox\"]").click();var e=$(this).prev("input[type=\"checkbox\"]").prop("checked");e?$(this).css("background-image","url("+l+")"):$(this).css("background-image","url("+d+")")});var r=t.next("label"),c=r.outerHeight();r.css({"padding-left":c+"px","background-size":c-4+"px "+(c-4)+"px"})}},select2toggle(e=null,t=null){e||(e="select"),t||(t={width:"auto",height:38,color_on:"#0c3",color_off:"#777"});var a=["\u5F00\u542F","\u5173\u95ED","\u542F\u7528","\u7981\u7528","\u6253\u5F00","\u663E\u793A","\u9690\u85CF","open","close","on","off"],o="\u5F00\u542F,\u542F\u7528,\u6253\u5F00,\u663E\u793A,open,on",p="\u5173\u95ED,\u7981\u7528,\u9690\u85CF,close,off",s=$(e);if(!s.length)return!1;for(var d=0,l=0;l","","",""].join("");r.addClass("pk-hide").data("pk-toggle-object",!0).after(k);var v=$("#"+u);v.css({height:m+"px",display:"inline-block"}),v.find(">i").css({height:m+"px",lineHeight:m+"px",fontSize:m/1.4+"px",cursor:"pointer"}),-1i").click(function(){for(var e,t=$(this).parent(),a=$(this).data("target").split(","),n=t.prev("select"),o=0;2>o;o++)if(e=n.find("option:eq("+o+")"),-1i").removeClass("pk-hide"),$(this).addClass("pk-hide"),!0})}}return d},input2number(e,t=null){if(!e)return!1;t||(t={}),t.return_value=t.return_value||"",t.min=t.min||!1,t.max=t.max||!1;for(var a,n=$(e),p=0;p"].join("")).next("input").removeClass("pk-hide").attr({placeholder:t.title||K.L("\u7559\u7A7A\u4E3A\u4E0D\u4FEE\u6539")}).on("input propertychange change",function(){var e=$(this).val();e=e&&(t.minlength&&K.length(e)>=t.minlength||!t.minlength)&&(t.maxlength&&K.length(e)<=t.maxlength||!t.maxlength)?K.md5(e):$(this).data("value"),$(this).prev("input").val(e)});return p},input2datetime(e,t=null){if(!e)return!1;t||(t={}),t.type=t.type||"Y-m-d H:i:s",t.return_time=!("undefined"!=typeof t.return_time)||t.return_time;for(var a,n=$(e),p=0;p"].join("")).next("input[readonly]").on("click",function(){var e=$(this);K.timePicker(e.val(),function(a){a=K.date(t.type,K.time(a)),e.val(a),t.return_time&&(a=K.time(a)),e.prev().val(a)})})}return p},input2label(e,t=null){if(!e)return!1;for(var a=function(e,t){$(e).data("pk-labelbox-object",!1).next("div.pk-labelbox").remove(),K.input2label(e,t)},o=function(e,t){t||(t={}),t.height=t.height||!1,t.select="undefined"!=typeof t.select&&t.select,t.add=t.add||!0,t.del=t.del||!0,t.move=t.move||!0,t.edit=t.edit||!0,t.delimiter=t.delimiter||",",t.str_start=t.str_start||"",t.str_end=t.str_end||"",t.number=t.number||!1,!1!==t.select&&(-1<["string","number"].indexOf(typeof t.select)&&(t.select+="",t.select=t.select.split(t.delimiter)),t.move=!1,t.edit=!1,t.del=!1);var n=t.delimiter||",",p=t.str_start||"",s=t.str_end||"";t.number=t.number||!1;var d=$(e);if(d.data("pk-labelbox-object"))return!1;d.data("labelbox-delimiter")&&(n=d.data("labelbox-delimiter")),d.data("labelbox-start")&&(p=d.data("labelbox-start")),d.data("labelbox-end")&&(s=d.data("labelbox-end")),d.data("labelbox-number")&&(t.number=d.data("labelbox-number"));var l,r=d.outerWidth();t.height?l=t.height:(l=K.cnum(d.outerHeight(),!1,!0,1)||38,t.height=l);var c="height:"+l+"px;line-height:"+(l-2)+"px",u="_"+K.random_string(32);d.addClass("pk-hide").data("pk-labelbox-object",!0).after([""].join(""));var h=$("#"+u),o=d.val()||"",m=d.attr("placeholder")||K.L("\u6DFB\u52A0");p&&(o=K.trim(o,p,"l")),s&&(o=K.trim(o,s,"r"));for(var f=o.split(n),g=[],k=0;k";b+="",h.append(b).find(">div:last>span:eq(0)").text(t.select[k]).prepend([""].join(""))}h.find("._text").on("click",function(){$(this).find(">i").toggleClass("fa-square-o fa-check-square-o");for(var e=h.find(".fa-check-square-o"),t="",a=0;a";t.move&&(b+="〈"),b+="",t.del&&(b+=""),t.move&&(b+="〉"),h.append(b);var x=h.find(">div:last");x.find(">span:eq(0)").text(f[k]),t.move&&x.find(">i[data-ud]").on("click",function(){var l=$(this).parent().data("index");if("up"==$(this).data("ud")){if(0==l)return!1;f[l]=f.splice(l-1,1,f[l])[0]}else{if(l==f.length-1)return!1;f[l]=f.splice(l+1,1,f[l])[0]}o="";for(var r=0;rspan:eq(0)").on("click",function(){var l=$(this).parent().data("index"),r=$(this).parent().find("span").text();K.P({type:2,title:K.L("\u7F16\u8F91"),noclose:1,submit:function(r,c){if(!K.trim(c))return K.p_o(r).find(".pk-popup-input").focus(),!1;for(var u=0;u"+K.L("\u6DFB\u52A0")+""),t.add&&h.find(">div:last").on("click",function(){K.P({type:2,title:m,noclose:1,submit:function(l,r){if(!K.trim(r))return K.p_o(l).find(".pk-popup-input").focus(),!1;for(var c=0;c"].join("")),$("#"+a).on("change",function(){e.file=this,K.upload(e)}).click(),!1}e.url||(e.url=K.uploadURL);var o=new FormData,p="_"+K.random_string();e.upload_rdata_format&&(o.append("upload_rdata_format",e.upload_rdata_format),e.upload_rdata_start&&o.append("upload_rdata_start",e.upload_rdata_start),e.upload_rdata_delimiter&&o.append("upload_rdata_delimiter",e.upload_rdata_delimiter),e.upload_rdata_end&&o.append("upload_rdata_end",e.upload_rdata_end)),o.append("upload_input_name",p);for(var s=0;s<$(e.file)[0].files.length;s++)o.append(p+"["+s+"]",$(e.file)[0].files[s]);var d=0;return $.ajax({type:"POST",url:e.url,data:o,cache:!1,processData:!1,timeout:3e4,contentType:!1,beforeSend:function(t){"function"==typeof e.beforeSend?e.beforeSend(t):d=K.loading(K.L("\u4E0A\u4F20\u4E2D")+"...")},success:function(t){if("function"==typeof e.success)return e.success(t),!0;if(1!=t.length){for(var a="",n="",p=0;p",K.L("\u7B2C"),p+1,K.L("\u4E2A\u6587\u4EF6"),":",t[p].code?K.L("\u4E0A\u4F20\u6210\u529F"):t[p].msg,"
"].join(""),t[p].code&&(n+=","+t[p].data.filepath);if(e.return_object){var s=$(e.return_object);"img"==s[0].tagName.toLowerCase()?s.attr("src",n.substr(1)):s.val(n.substr(1))}K.alert(a)}else if(!t[0].code)K.alert(t[0].msg,2);else if(K.msg(K.L("\u4E0A\u4F20\u6210\u529F"),1),e.return_object){var s=$(e.return_object);"img"==s[0].tagName.toLowerCase()?s.attr("src",t[0].data.filepath):s.val(t[0].data.filepath)}return!0},error:function(t,a,n){"function"==typeof e.error&&e.error(t,a,n),console.log(t,a,n)},complete:function(t,a){"function"==typeof e.complete&&e.complete(t,a),d&&K.close(d)}}),!0},keditor(e,t=null){if(!$(e).length)return!1;t||(t={image:!0,maxLength:1e3,uploadCount:9,height:0});var a=$($(e)[0]),n="_"+K.random_string(32),o=["","
","",K.cnum(t.maxLength)?"0 / "+t.maxLength+"":"0","
","
","
"].join("");a.addClass("pk-hide").after(o);var p=$("#"+n),s=K.viewer(p.find("div.pk-keditor-images")),d=p.find("div.pk-keditor-images>div:eq(0)").outerWidth();return p.find("div.pk-keditor-images>div").outerHeight(d),p.find(".pk-keditor-image-addbtn>div").on("click",function(){$(this).next("input").click()}),p.find(".pk-keditor-image-addbtn>input").on("change",function(){K.upload({file:this,success:function(e){for(var t=0;t","×"].join("")),s.destroy(),setTimeout(function(){s=K.viewer(p.find("div.pk-keditor-images"))},200),$("#"+a).find("span").on("click",function(){var e=$(this);K.confirm(K.L("\u786E\u8BA4\u5220\u9664\u8BE5\u56FE\u7247")+"?",function(){e.parent().remove()})}),p.find(".pk-keditor-content textarea").change()}}})}),p.find(".pk-keditor-content textarea").on({"input change propertychange":function(){var e=$(this).val(),n=p.find(".pk-keditor-content>span>i");n.parent().css("color","#777"),K.cnum(t.maxLength)&&e.length>t.maxLength&&(e=e.substring(0,t.maxLength),$(this).val(e),n.parent().css("color","#f00")),p.find(".pk-keditor-content>span>i").html(e.length),e=""+e+"
";for(var o=p.find("div.pk-keditor-images>div>img"),s=0;s";a.val(e)}}),p},playvideo(e={},t=!1){if("string"==typeof e&&(e={src:e}),!e.src)return console.log("\u51FA\u9519\uFF1A\u89C6\u9891\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A"),!1;if("undefined"==typeof e.controls&&(e.controls=!0),e.controls||delete e.controls,"undefined"==typeof e.autoplay||e.autoplay||delete e.autoplay,e.width||(e.width=$(t).width()||"100%"),e.height||(e.height=$(t).height()||"100%"),e.preload=e.preload||"metadata",e.style=e.style||"background-color:#333",!t){var a="_"+K.random_string(32),n=$("html").css("overflow-y"),o=$("body").css("overflow-y");return K.P({area:["100%","100%"],nomove:1,title:e.title||e.src,content:[""].join(""),complete:function(t,n){n.find(".pk-popup-body,body").css("overflow-y","hidden");var o=n.find(".pk-popup-foot").outerHeight(),p=n.find(".pk-popup-body").outerHeight();n.find(".pk-popup-foot").remove(),n.find(".pk-popup-body").css({height:o+p+"px",maxHeight:o+p+"px"}),e.preload="auto",K.playvideo(e,"#"+a)},close:function(){$("html").css("overflow-y",n),$("body").css("overflow-y",o)}}),!0}t=$(t);var p="",s="",d=["",""," ",K.L("\u51FA\u9519")," ","[currentSrc] ","[error] "," |
","
"].join("");for(var l in e)s+=" "+l+"=\""+e[l]+"\"";return p=[""].join(""),t.html(p).find("video").on({error:function(a){var e=a.target.currentSrc,n=["{code: ",a.target.error.code,", message: \"",a.target.error.message,"\"}"].join("");t.html(K.str_replace(["[currentSrc]","[error]"],[e,n],d))}})},codemirror(e,t={}){if(!$(e).length)return!1;t.width=t.width||!1,t.height=t.height||!1,t.mode=t.mode||"php",t.lineWrapping=t.lineWrapping||!0,t.lineNumbers=t.lineNumbers||!0,t.firstLineNumber=t.firstLineNumber||1,t.indentWithTabs=t.indentWithTabs||4,t.smartIndent=t.smartIndent||!0,t.matchBrackets=t.matchBrackets||!0,t.autofocus=t.autofocus||!1,t.readOnly=t.readOnly||!1,t.showCursorWhenSelecting=t.showCursorWhenSelecting||!0;var a=function(e,t){for(var a=$(e),n=[],o=0;o",s=0;for(var d in n){if(s>=t.level)break;p+=3>s?["
","","
"].join(""):["
","","
"].join(""),s++}p+="
",e.append(p);var l=K.SSX,r=$("#"+a),c=r.find("select._province"),u=r.find("select._city"),h=r.find("select._county"),m=r.find("select._address");for(s in c.append(""),u.append(""),h.append(""),l)c.append([""].join(""));for(var d in c.on("change",function(){var e=$(this),t=e.find("option[value=\""+e.val()+"\"]").data("data");for(s in u.html("").unbind("change"),h.html(""),t)u.append([""].join(""));u.on("change",function(){var e=$(this),t=e.find("option[value=\""+e.val()+"\"]").data("data");for(s in h.html(""),t)h.append([""].join(""))})}),n){var f=r.find("select._"+d);f.length?f.val(n[d].value).change():r.find("input._"+d).val(n[d].value)}return"function"==typeof t.complete&&t.complete(r),e};return K.require_once(K.basePath+"puyuetian.ssx.min.js",function(){n(e,a)},K.SSX),!0},popup:{pid:0,speed:300,popup(e){function t(e){var t=e.id;if(!$("#"+t).length)return!1;var a=$(window).outerWidth(),o=$(window).outerHeight(),p=$("#"+t).outerWidth(),s=$("#"+t).outerHeight(),d=$("#"+t+" .pk-popup-head").outerHeight()||0,l=$("#"+t+" .pk-popup-foot").outerHeight()||0,r=s-d-l,c=$("#"+t+" .pk-popup-body").outerHeight();e.minH?$("#"+t+" .pk-popup-body").css({minHeight:r+"px"}):r>c?$("#"+t+" .pk-popup-body").css({maxHeight:r+"px",height:r+"px"}):$("#"+t+" .pk-popup-body").css({maxHeight:o-s+c+"px"}),e.noAuto||(s=$("#"+t).outerHeight(),$("#"+t).css({top:n((o-s)/2,0,!1,0)+"px",left:n((a-p)/2,0,!1,0)+"px"}))}var a=function(e,t){return K.in_array(t,e)},n=function(e,t,a,n){return K.cnum(e,t,a,n)};this.pid++;var o="pkpopup_"+this.pid,p="",s="";if(-1<["string","number"].indexOf(typeof e)&&(e={content:e}),"object"!=typeof e)return!1;e.type=e.type||0,a("alert,0",e.type)?s="":a("confirm,input,1,2",e.type)?(a("input,2",e.type)&&("undefined"==typeof e.content&&(e.content=""),e.content="textarea"==e.inputtype?[""].join(""):""),s=[""].join("")):a("tip,load,3,4",e.type)?s="":s=e.btnshtml,(e.shade||e.mask)&&(p+=""),"function"==typeof e.submit&&(this.func["submit_"+this.pid]=e.submit),"function"==typeof e.close&&(this.func["close_"+this.pid]=e.close),"function"==typeof e.cancel&&(this.func["cancel_"+this.pid]=e.cancel),"function"==typeof e.complete&&(this.func["complete_"+this.pid]=e.complete),p+=[""].join(""),$("body").append(p);var d=this.pid,l=e;$("#"+o+" .pk-popup-cancel").on("click",function(){K.popup.cancel(d)}),$("#"+o+" .pk-popup-close").on("click",function(){K.popup.close(d)}),$("#"+o+" .pk-popup-submit").on("click",function(){K.popup.submit(d,!!a("input,2",l.type)&&$("#"+o+" .pk-popup-input").val(),l.noclose)}),a("tip,load,3,4",e.type)&&($("#"+o).css({paddingTop:"5px",paddingBottom:"5px"}).find(".pk-popup-head,.pk-popup-foot").addClass("pk-hide"),a("load,4",e.type)?$("#"+o+" .pk-popup-body").html(["","",e.content||K.L("\u6B63\u5728\u5904\u7406\u8BF7\u7A0D\u540E")+"...","
"].join("")):("number"!=typeof e.icon&&$("#"+o+" .pk-popup-body").css("min-height","0"),"number"!=typeof e.times&&(e.times=2e3),0r&&(r=0),r>u&&(r=u),0>c&&(c=0),c>h&&(c=h)),$(a).css({top:r,left:c})}),$(this).on("mouseup",function(){$(this).unbind("mousemove mouseup")})}).css("cursor","move"),$("#"+o).animate({opacity:1},this.speed),a("input,2",e.type)&&$("#"+o+" .pk-popup-body .pk-popup-input").focus(),K.popup.complete(d),this.pid},cancel(e){return"function"==typeof this.func["cancel_"+e]&&this.func["cancel_"+e](e,$("#pkpopup_"+e)),K.popup.close(e)},close(e,t){if(-1<["string","number"].indexOf(typeof e)){if($("#pkpopup_"+e+" .pk-popup-foot .pk-popup-close").hasClass("disabled"))return!1;$("#pkpopup_"+e).animate({opacity:0},this.speed);var a=this;setTimeout(function(){$("#pkpopup_"+e+"_shade,#pkpopup_"+e).remove(),"function"!=typeof a.func["close_"+e]||t||a.func["close_"+e](e)},this.speed)}else if("object"==typeof e){var n=$(e).parents(".pk-popup:eq(0)").attr("id");n?K.popup.close(n.split("_")[1]):K.popup.close()}else $(".pk-popup,.pk-popup-shade").remove();return!0},submit(e,t,a){return!$("#pkpopup_"+e+" .pk-popup-foot .pk-popup-submit").hasClass("disabled")&&(this.func["submit_"+e]&&this.func["submit_"+e](e,t,$("#pkpopup_"+e)),a||K.popup.close(e),!0)},complete(e){return-1<["string","number"].indexOf(typeof e)&&"function"==typeof this.func["complete_"+e]&&this.func["complete_"+e](e,$("#pkpopup_"+e)),!0},func:[]},P(e){return K.popup.popup(e)},alert(e,t=0,a){return"function"==typeof t&&(a=t,t=!1),K.P({type:0,icon:t,content:e,submit:function(e){"function"==typeof a&&a(e)}})},confirm(e,t){return K.P({type:1,icon:3,content:e,submit:function(e){"function"==typeof t&&t(e)}})},prompt(e,t){return K.P({type:2,title:e,submit:function(e,a){"function"==typeof t&&t(a)}})},msg(e,t=0,a=2e3){if("function"==typeof a){var n=a;a=2e3,setTimeout(function(){n()},2e3)}return K.P({type:3,icon:t,content:e,times:a})},loading(e,t=0){return K.P({type:4,content:e,shade:t})},iframe(e,t=null){var a=$("html").css("overflow-y"),n=$("body").css("overflow-y");return K.P({title:t||e,nomove:1,content:[""].join(""),area:["100%","100%","0","0","0","0"],complete:function(e){$("#pkpopup_"+e+" .pk-popup-body,body").css("overflow-y","hidden");var t=$("#pkpopup_"+e+" .pk-popup-foot").outerHeight(),a=$("#pkpopup_"+e+" .pk-popup-body").outerHeight();$("#pkpopup_"+e+" .pk-popup-foot").remove(),$("#pkpopup_"+e+" .pk-popup-body").css({height:t+a+"px",maxHeight:t+a+"px"})},close:function(){$("html").css("overflow-y",a),$("body").css("overflow-y",n)}})},p_o(e){return"object"==typeof e?e:$("#pkpopup_"+e)},close(e=!1){return K.popup.close(e)},kindeditor(e){return console.log("kindeditor\u8BE5\u65B9\u6CD5\u5DF2\u88AB\u79FB\u9664"),$(e)}};(function(){for(var e,t=document.getElementsByTagName("script"),a=0;a