123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- (function($j){$j.positionFixed=function(el){$j(el).each(function(){new fixed(this)});return el;};$j.fn.positionFixed=function(){return $j.positionFixed(this)}
- var fixed=$j.positionFixed.impl=function(el){var o=this;o.sts={target:$j(el).css('position','fixed'),container:$j(window)}
- o.sts.currentCss={top:o.sts.target.css('top'),right:o.sts.target.css('right'),bottom:o.sts.target.css('bottom'),left:o.sts.target.css('left')}
- if(!o.ie6)return;o.bindEvent();}
- $j.extend(fixed.prototype,{ie6:false,bindEvent:function(){var o=this;o.sts.target.css('position','absolute')
- o.overRelative().initBasePos();o.sts.target.css(o.sts.basePos)
- o.sts.container.scroll(o.scrollEvent()).resize(o.resizeEvent());o.setPos();},overRelative:function(){var o=this;var relative=o.sts.target.parents().filter(function(){if($j(this).css('position')=='relative')return this;})
- if(relative.size()>0)relative.after(o.sts.target)
- return o;},initBasePos:function(){var o=this;o.sts.basePos={top:o.sts.target.offset().top-(o.sts.currentCss.top=='auto'?o.sts.container.scrollTop():0),left:o.sts.target.offset().left-(o.sts.currentCss.left=='auto'?o.sts.container.scrollLeft():0)}
- return o;},setPos:function(){var o=this;o.sts.target.css({top:o.sts.container.scrollTop()+o.sts.basePos.top,left:o.sts.container.scrollLeft()+o.sts.basePos.left})},scrollEvent:function(){var o=this;return function(){o.setPos();}},resizeEvent:function(){var o=this;return function(){setTimeout(function(){o.sts.target.css(o.sts.currentCss)
- o.initBasePos();o.setPos()},1)}}})})(jQuery);(function($){$.fn.popWin=function(options){var def={PopSelector:"",CloseSelector:"",slideTime:600};var options=$.extend(def,options);
- var noie6=!(false&&!$.support.style);
- var PopSelector=options.PopSelector,CloseSelector=options.CloseSelector,slideTime=options.slideTime;
- if(noie6){$(PopSelector).slideDown(slideTime)}
- else{$(PopSelector).fadeIn(slideTime);var thisPop=$(PopSelector);jQuery(function($j){$j(thisPop).positionFixed()})}
- if(noie6){$(CloseSelector).click(function(){$(PopSelector).slideUp(slideTime);});}
- else{$(CloseSelector).click(function(){$(PopSelector).fadeOut(slideTime);});}}})(jQuery);
- var basePath=contextPath;
-
- function changeBoatTab(n,m){
- for(var i=0;i<m;i++)
- {
- var boat_menu=document.getElementById('boat_menu_' + i);
- var boat_main=document.getElementById('boat_main_' + i);
- var boat_menu_img=boat_menu.getElementsByTagName('img');
- boat_menu.className=i==n?'boat_hover':'';
- for(var j=0;j<boat_menu_img.length;j++){
- boat_menu_img[j].src=i==n? '${basePath}/static/image/pop/tab_hover.png': '${basePath}/static/image/pop/tab.png';
- }
- boat_main.style.display=i==n?'block':'none';
- }
- }
-
- function changepopxkzTab(n,m){
- for(var i=0;i<m;i++)
- {
- var pop_xkz_menu=document.getElementById('pop_xkz_menu_' + i);
- var pop_xkz_main=document.getElementById('pop_xkz_main_' + i);
- var pop_xkz_menu_img=pop_xkz_menu.getElementsByTagName('img');
- pop_xkz_menu.className=i==n?'pop_xkz_hover':'';
- for(var j=0;j<pop_xkz_menu_img.length;j++){
- pop_xkz_menu_img[j].src=i==n? '../static/image/pop/tab_hover.png': '../static/image/pop/tab.png';
- }
- pop_xkz_main.style.display=i==n?'block':'none';
- }
- }
- function showMesg(id,action){
- $.ajax({
- url : basePath + "/zygl/"+action,
- data : [{"name":"id","value":id},
- {"name":"pagerows","value":!$("#pagerows").val()?5:$("#pagerows").val()},
- {"name":"currentpage","value":!$("#currentpage").val()?1:$("#currentpage").val()}
- ],
- type : "post",
- dataType : "json",
- success : function(data) {// ajax返回的数据
- if (data.success) {
- var popBody = '';
- if(data.attrs.Entity){
- var listEntity = data.attrs.Entity;
- var listTitleName = data.attrs.BodyTitleName.split(",");
- popBody += '<table style="margin-top: 5px;font-size:13px;max-width:1000px" class="table table-striped table-bordered">';
- popBody += '<tr class="fisrtTr">';
- for(var i =0;i<listTitleName.length;i++){
- popBody += '<th >'+ listTitleName[i] +'</th>';
- }
- popBody += '</tr>';
-
- for(var i in listEntity){
- popBody += '<tr>';
- for(var j=0;j<listEntity[i].length;j++){
- popBody += '<td >'+ listEntity[i][j] +'</td>';
- }
- popBody += '</tr>';
- }
- var page = data.attrs.page;
- popBody += "<tr><td colspan='"+listTitleName.length+"'>" +
- "<div class='tab_footer'>"+
- "<select class='' name='pagerows' id='pagerows' style='width: 50px;margin-top:3px;'>" +
- "<option value='5' >5</option>" +
- "<option value='10' >10</option>" +
- "<option value='15' >15</option>" +
- "</select>" +
- "<div class='pageprev' style='margin-top:3px;'>" +
- " <a href='#' class='prev_all' id='pagefirst'></a>" +
- "<a href='#' class='prev_one' id='pageprev'></a>" +
- "</div>" +
- "<div>" +
- "第 <input type='text' id='currentpage' value='"+page.currentpage +"' name='currentpage' style='width: 40px;height:22px;margin-top:3px;'/> 页 共"+page.totalpages+"页" +
- "</div>" +
- "<div class='pagenext' style='margin-top:3px;'>" +
- "<a class='next_one' href='#' id='pagenext'></a>" +
- "<a class='next_all' href='#' id='pagelast'></a>" +
- "</div>" +
- "<div>" +
- "<a class='refresh' id='refresh' style='margin-top:3px;'></a>" +
- "</div>" +
- "<div class='p-record' style='margin-top:3px;'>当前显示<span>"+page.datafrom+"-"+page.dataend+"</span>条记录,共<span>"+page.totalRows+"</span>条记录</div>" +
- "<input type='hidden' value='"+ page.totalpages+"' id='pagetotal'>" +
- "</div></td></tr>";
-
- popBody += '</table>'
-
- }
- else {
- popBody = data.attrs.Html;
- }
- document.getElementById('popTitle').innerHTML=data.attrs.Title;
- document.getElementById('popHtml').innerHTML=popBody;
- $.fn.popWin({
- PopSelector:".popupRightD", //弹出的窗体
- CloseSelector:".popupRightD .close", //关闭窗体的触发开关
- lideTime:600 //窗体出场入场动画的时间
- });
- pageinfo(id,action);
-
- } else {
- $.alert({
- title : '提示',
- content : data.message,
- confirm : function() {
- }
- });
- }
- }
- });
- }
-
-
-
-
- function pageinfo(id,action){
- $("#pagefirst").click(function() {
- if ($("#currentpage").val() == 1) {
- $.alert({
- title : '提示',
- content : '已到第一页',
- confirm : function() {
- }
- });
- return;
- }
- else {
- $("#currentpage").val(1);
- showMesg(id,action);
- }
- });
- $("#pageprev").click(function() {
- if ($("#currentpage").val() == 1) {
- $.alert({
- title : '提示',
- content : '已到第一页',
- confirm : function() {
- }
- });
- return;
- }
- else {
- if($("#currentpage").val()!=''){
- $("#currentpage").val(parseInt($("#currentpage").val()) - 1);
- showMesg(id,action);
- }else{
- $("#currentpage").val(1);
- showMesg(id,action);
- }
- }
- });
- $("#pagenext").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title : '提示',
- content : '已到最后一页',
- confirm : function() {
- }
- });
- return;
- }
- if ($("#currentpage").val() == $("#pagetotal").val()) {
- $.alert({
- title : '提示',
- content : '已到最后一页',
- confirm : function() {
- }
- });
- return;
- }
- else {
- if($("#currentpage").val()!=''){
- $("#currentpage").val(parseInt($("#currentpage").val()) + 1);
- showMesg(id,action);
- }else{
- $("#currentpage").val(1);
- showMesg(id,action);
- }
- }
- });
- $("#pagelast").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title : '提示',
- content : '已到最后一页',
- confirm : function() {
- }
- });
- return;
- }
- if ($("#currentpage").val() == $("#pagetotal").val()) {
- $.alert({
- title : '提示',
- content : '已到最后一页',
- confirm : function() {
- }
- });
- return;
- }
- else {
- $("#currentpage").val($("#pagetotal").val());
- showMesg(id,action);
- }
- });
- $("#refresh").click(function() {
- if($("#currentpage").val()==''){
- $("#currentpage").val(1);
- showMesg(id,action);
- }else{
- showMesg(id,action);
- }
-
- });
- $("#pagerows").change(function() {
- showMesg(id,action);
- });
- $("#currentpage").keydown(
- function(event, p) {
- if (event.keyCode == 13) {
- if ($.isNumeric($("#currentpage").val()) && (parseInt($("#currentpage").val()) >= 1)
- && (parseInt($("#currentpage").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- showMesg(id,action);
- }
- });
- }
- function showall() {
- $('div').css("display", "block");
- }
- function hideexcel(that) {
- $(that).parent().parent().css("display", "none");
- }
- function changeBoatTab(n, m) {
- for ( var i = 0; i < m; i++) {
- var boat_menu = document.getElementById("boat_menu_" + i);
- var boat_main = document.getElementById("boat_main_" + i);
- var boat_menu_img = boat_menu.getElementsByTagName("img");
- boat_menu.className = i == n ? "boat_hover" : "";
- for ( var j = 0; j < boat_menu_img.length; j++) {
- boat_menu_img[j].src = i == n ?contextPath+'/theme/images/tab_hover.png' : contextPath+'/theme/images/tab.png';
- }
- boat_main.style.display = i == n ? "block" : "none";
- }
- }
- function changePopTab(n, m) {
- for ( var i = 0; i < m; i++) {
- var pop_menu = document.getElementById("pop_menu_" + i);
- var pop_main = document.getElementById("pop_main_" + i);
- var pop_menu_img = document.getElementById("pop_ul")
- .getElementsByTagName("img");
- pop_menu.className = i == n ? "pop_hover" : "";
- pop_menu_img[i].src = i == n ? "img/pop_tab_hover.png"
- : "img/pop_tab.png";
- //
- // alert(pop_menu.style.zIndex);
- pop_main.style.display = i == n ? "block" : "none";
- }
- }
- function move_img(that) {
- var y_axis = parseInt($(that).css('height')) / 2;
- if ($(that).css('bottom') == "0px")
- $(that).css('bottom', y_axis + "px");
- else
- $(that).css('bottom', '0px');
- }
|