1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006 |
- /**
- * 增加命名空间方法<br>
- * <p>
- * 用法:$.namespace("a.b.c"); a.b.c.testFunction=function(...);
- */
- $.extend($, {
- namespace : function() {
- var o, d;
- for (var i = 0, len = arguments.length; i < len; i++) {
- d = arguments[i].split(".");
- o = window[d[0]] = window[d[0]] || {};
- var left = d.slice(1);
- for (var i = 0, len = left.length; i < len; i++) {
- o = o[left[i]] = o[left[i]] || {};
- }
- }
- return o;
- },
- SUCCESS : "success",
- ERROR : "error",
- BLANK_UUID : "00"
- });
- //供左侧菜单使用
- function iFrameHeight(){
-
- var screen =$(window).height()-59;
- var left = $('#sidebar').height();
- var main = $('#content').height();
- if(left<screen){
- left = screen;
- }
- if(main<screen){
- main=screen;
- }
- if(left>main){
- main=left;
- }else{
- left = main;
- }
- $('#mainContent').height(left);
- $('#sidebar').height(left);
- $('#content').height(main-5);
- }
- //供iframe使用
- function iFrameHeightIframe(menucode){
- var h = $(window.parent.document).find('#content').height();
- if(menucode!=null&&menucode!=''){
- $(window.parent.document).find('#'+menucode).height(h-36-30);
- }
- if($(window.parent.document).find('#_my97DP')){
- // $(window.parent.document).find('#_my97DP iframe').css("width","202px");
- // $(window.parent.document).find('#_my97DP iframe').css("height","217px");
- // alert("w");
- }
- }
- //供iframe内的iframe使用
- function tabiFrameHeightIframe(menucode){
- var h = $(window.document).find('#mycontent').height();
- $(window.parent.document).find('#'+menucode+'iframe').height(h-230);
- }
- //分页共通
- function pageinfo(form){
- $("#pagesize").change(function() {
- $("#pagejump").val(1);
- form.submit();
- });
- $("#pagesize").val($("#pagesize").attr("num"));
- $("#pagefirst").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(1);
- form.submit();
- }
- });
- $("#pageprev").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) - 1);
- form.submit();
- }
- });
- $("#pagejump").keydown(
- function(event, p) {
- if (event.keyCode == 13) {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- form.submit();
- }
- });
- $("#pagenext").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) + 1);
- form.submit();
- }
- });
- $("#pagelast").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val($("#pagetotal").val());
- form.submit();
- }
- });
-
- $("#pagenow").click(function() {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- form.submit();
- });
- }
- //构建所在地的下拉
- //参数说明依次,1(必须)存放下拉的div的id,2(非必须)下拉初始选中的值,没有传没有传空字符串,3(非必须)下拉change事件,根据需要添加4(必须)下拉框的长度
- //此下拉如果跟着form一起提交后台的话,对应的是szd属性,
- function initszdSelect(divid,existVal,changefunc,width,jyr){
- var jsonJyr = null;
- if(jyr!=null&&jyr!=''){
- jsonJyr = $.parseJSON(jyr);
- }
- $.post($.app + "/selectSzd", {
-
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='szdselectpicker' name='szdid' onchange='"+changefunc+"()' id='szdid'>";
- }else{
- str+="<select class='szdselectpicker' name='szdid' onchange='"+changefunc+"()' id='szdid'>";
- }
- }else{
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='szdselectpicker' name='szdid' id='szdid'>";
- }else{
- str+="<select class='szdselectpicker' name='szdid' id='szdid'>";
- }
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var szd = data[i];
- if(szd.val==existVal||szd.id==(jsonJyr!=null?jsonJyr.szd:'')){
- str+=" <option selected='selected' value='"+szd.id+"' >"+szd.text+"</option>";
- }else{
- str+=" <option value='"+szd.id+"' >"+szd.text+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.szdselectpicker').selectpicker({
- width:width
- });
-
- }, "json");
- }
- //构建港口的下拉
- //参数说明依次,1(必须)存放下拉的div的id,2(非必须)下拉初始选中的值,没有传空字符串,3(非必须)参数,根据所在地过滤结果,一般级联需要4(非必须)下拉change事件5(必须)下拉框的长度
- //此下拉如果跟着form一起提交后台的话,对应的是szd属性,
- function initgkSelect(divid,existVal,szd,changefunc,width,jyr){
- var jsonJyr = null;
- if(jyr!=null&&jyr!=''){
- jsonJyr = $.parseJSON(jyr);
- szd=jsonJyr.szd;
- }
- $.post($.app + "/selectGk", {
- szd:szd
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gkselectpicker' name='szgkid' onchange='"+changefunc+"()' id='szgkid'>";
- }else{
- str+="<select class='gkselectpicker' name='szgkid' onchange='"+changefunc+"()' id='szgkid'>";
- }
-
- }else{
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gkselectpicker' name='szgkid' id='szgkid'>";
- }else{
- str+="<select class='gkselectpicker' name='szgkid' id='szgkid'>";
- }
- }
-
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var gk = data[i];
- if(gk.id==existVal||gk.id==(jsonJyr!=null?jsonJyr.szgk:'')){
- str+=" <option id='"+gk.zyid+"' selected='selected' value='"+gk.id+"' >"+gk.gkmc+"</option>";
- }else{
- str+=" <option id='"+gk.zyid+"' value='"+gk.id+"' >"+gk.gkmc+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.gkselectpicker').selectpicker({
- width:width
- });
- //如果所在地选择为空,重置港区select;
- }, "json");
- }
- //构建港区的下拉
- //参数说明依次,1(必须)存放下拉的div的id,2(非必须)下拉初始选中的值,没有传空字符串,3(非必须)参数,根据所在地过滤结果,一般级联需要4(非必须)下拉change事件5(必须)下拉框的长度
- //此下拉如果跟着form一起提交后台的话,对应的是szd属性,
- function initgqSelect(divid,existVal,szd,gk,changefunc,width,jyr){
- var jsonJyr = null;
- if(jyr!=null&&jyr!=''){
- jsonJyr = $.parseJSON(jyr);
- szd=jsonJyr.szd;
- gk = jsonJyr.szgk;
- }
- $.post($.app + "/selectGq", {
- szd:szd,
- szgk:gk
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gqselectpicker' name='szgqid' onchange='"+changefunc+"()' id='szgqid'>";
- }else{
- str+="<select class='gqselectpicker' name='szgqid' onchange='"+changefunc+"()' id='szgqid'>";
- }
- }else{
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gqselectpicker' name='szgqid' id='szgqid'>";
- }else{
- str+="<select class='gqselectpicker' name='szgqid' id='szgqid'>";
- }
- }
-
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var gq = data[i];
- if(gq.id==existVal||gq.id==(jsonJyr!=null?jsonJyr.szgq:'')){
- str+=" <option id='"+gq.zyid+"' selected='selected' value='"+gq.id+"' >"+gq.gqmc+"</option>";
- }else{
- str+=" <option id='"+gq.zyid+"' value='"+gq.id+"' >"+gq.gqmc+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.gqselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //经营人共通选择,需要调用的页面必须引入jyrselect.jsp,
- //传入回调方法的名称
- function jyrselpop(selectFunc,flag){
- // if(isEmpty($('#szgqid').val())){
- // $.alert({
- // title: '提示',
- // content: '港区不能为空!',
- // });
- // return false;
- // }
- if(!isEmpty(flag)){
- $("#pagejump").val(1);
- }
- pageinfo2();
- $('#jyrselectmaskdiv').fadeIn(100);
- $('#jyrselectdiv').slideDown(0);
- var gkjyr=$('#gkjyrmc').val();
- var szd = $('.szdselectpicker').val();
- var szgk = $('.gkselectpicker').val();
- var szgq = $('.gqselectpicker').val();
-
- $.ajax({
- url:$.app+"/selectJyr",
- type:"post",
- data:{
- szd:szd,
- szgk:szgk,
- szgq:szgq,
- gkjyr:gkjyr,
- page:$('#pagejump').val()
- },
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data) {
- var str="";
- for(var i=0;i<data.attrs.list.length;i++){
- var jyr = data.attrs.list[i];
- str+="<tr>";
- str+="<td>"+(i+1)+"</td>";
- str+="<td>"+jyr.gkjyr+"</td>";
- str+="<td > " +
- "<a class='btn btn-default btn-xs' href='#' onclick=\""+selectFunc+"('"+jyr.id+"')\">"+
- "<i class='glyphicon glyphicon-wrench'></i>选择</a> "+
- "</td>";
- str+="</tr>";
- }
- $("#jyr").empty();
- $("#jyr").append(str);
-
- $("#pagejump").val(data.attrs.page);
- $("#gongpage").html(data.attrs.gongpage);
- $("#nowshow").html(data.attrs.nowshow);
- $("#gongsize").html(data.attrs.gongsize);
- $("#pagecur").val(data.attrs.page);
- $("#pagetotal").val(data.attrs.totalpage);
- $("#pagesort").val(data.attrs.sort);
- $("#pageorder").val(data.attrs.order);
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
- //流程历史
- function hisList(data,lx){
- $.ajax({
- url:$.app+"/hisList",
- type:"post",
- data:{
- id:data,
- lx:lx
- },
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data) {
- var str="";
- for(var i=0;i<data.length;i++){
- var task = data[i];
- str+="<tr>";
- str+="<td>"+(i+1)+"</td>";
- str+="<td >"+task.auditUsername +"</td>";
- str+="<td >"+task.auditTime +"</td>";
- str+="<td>"+task.currName+"</td>";
- if(task.auditResult =="true"){
- str+="<td>同意</td>";
- } else if(task.auditResult == "false"){
- str+="<td>退回</td>";
- }else{
- str+="<td></td>";
- }
-
- str+="<td>"+task.auditMsg+"</td>";
- str+="</tr>";
- }
- $("#hisList").empty();
- $("#hisList").append(str);
- $('.theme-popover-mask').fadeIn(100);
- $('.theme-popover').slideDown(0);
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
- //关闭选择经营人的弹出框
- function guanbipop(){
- $('#jyrselectmaskdiv').fadeOut(100);
- $('#jyrselectdiv').slideUp(0);
- }
- //关闭选择船名的弹出框
- function cbguanbipop(){
- $('#cbselectmaskdiv').fadeOut(100);
- $('#cbselectdiv').slideUp(0);
- }
- /**
- * 匹配中文 数字 字母 下划线
- */
- function checkInput(str) {
- var pattern = /^[\w\u4e00-\u9fa5]+$/gi;
- if (pattern.test(str)) { return false; }
- return true;
- }
- // 备注长度限制
- function limitTextArea(field) {
- var maxlimit = 250;
- if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
- }
- // 根据数据库中字段的长度要求截取文本输入框中输入的字符串
- function limitTextArea(field, maxLength) {
- if (field.value.length > maxLength) field.value = field.value.substring(0, maxLength);
- }
- // 判断页面中是否存在重复的ID的方法
- function checkDuplicate() {
- var i = 0;
- var duplicateIds = new Array();
- $("body [id]").each(function() {
- var id = $(this).attr("id");
- if (id != "" && $("body [id=" + id + "]").length >= 2) {
- // 判断是否已记录重复的值
- if (!contains(duplicateIds, id)) {
- duplicateIds[i] = id;
- $.messager.alert("提示", "id为" + id + "的重复了。");
- }
- }
- i++;
- });
- if (duplicateIds.length == 0) {
- $.messager.alert("提示", "HTML DOM中没有重复的ID");
- }
- return duplicateIds;
- }
- function scrolldate(){
- if($(window.parent.document).find('#_my97DP')){
- $(window.parent.document).find('#_my97DP').css("display","none");
- }
- }
- // 判断某个e元素是否存在于数组a中
- function contains(a, e) {
- for (var j = 0; j < a.length; j++)
- if (a[j] == e) return true;
- return false;
- }
- //作业区选择
- function initzyqSelect(divid,zyqid,gkid,changefunc,width){
- $.post($.app+"/zyq/selZyq",{
- gkid:gkid
- },function(data) {
- var str="";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='zyqselectpicker' name='zyqid' onchange='"+changefunc+"()' id='zyqid'>";
- }else{
- str+="<select class='zyqselectpicker' name='zyqid' id='zyqid' >";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var zyq = data[i];
- if(zyqid == zyq.id){
- str+=" <option id='"+zyq.zyid+"' selected value='"+zyq.id+"' >"+zyq.zyqmc+"</option>";
- }else{
- str+=" <option id='"+zyq.zyid+"' value='"+zyq.id+"' >"+zyq.zyqmc+"</option>";
- }
-
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.zyqselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //泊位选择
- function initbwSelect(divid,bwid,jyrid,changefunc,width){
- $.post($.app+"/bw/selBw",{
- jyrid:jyrid
- },function(data) {
- var str="";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='bwselectpicker' name='bwid' onchange='"+changefunc+"()' id='bwid'>";
- }else{
- str+="<select class='bwselectpicker' name='bwid' id='bwid' >";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var bw = data[i];
- if(bwid == bw.id){
- str+=" <option id='"+bw.zyid+"' selected value='"+bw.id+"' >"+bw.bwmc+"</option>";
- }else{
- str+=" <option id='"+bw.zyid+"' value='"+bw.id+"' >"+bw.bwmc+"</option>";
- }
-
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.bwselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //码头选择
- function initmtSelect(divid,mtid,jyrid,changefunc,width){
- $.post($.app+"/mt/selMt",{
- jyrid:jyrid
- },function(data) {
- var str="";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='mtselectpicker' name='mtid' onchange='"+changefunc+"()' id='mtid'>";
- }else{
- str+="<select class='mtselectpicker' name='mtid' id='mtid' >";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var mt = data[i];
- if(mtid == mt.id){
- str+=" <option id='"+mt.zyid+"' selected value='"+mt.id+"' >"+mt.mtmc+"</option>";
- }else{
- str+=" <option id='"+mt.zyid+"' value='"+mt.id+"' >"+mt.mtmc+"</option>";
- }
-
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.mtselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //让HTML元素的字符内容保留换行和添加滚动条
- function newLine(){
- var idname= arguments[0] ||'#bzhh';
- var elements = $(idname);
- for(var i=0;i<elements.length;i++){
- var userStr=elements.eq(i).text();
- //showEachCode(userStr);
- userStr=trimBoth(userStr);
- //showEachCode(userStr);
- userStr=userStr.replace(/\n/g,"<br> ");
- //showEachCode(userStr);
- elements.eq(i).html("<div style='height:80px;overflow:auto;padding:30px 0;'></div>");
- elements.eq(i).children('div').html(userStr);
- }
-
- };
- //显示每个字符
- function showEachCode(userStr){
- var temp="";
- for(var i=0;i<userStr.length;i++){
- temp+="第"+i+"个字符("+userStr[i]+")的编码是:"+userStr.charCodeAt(i)+"\n";
- }
- alert(temp);
- }
- //去除前后空白符(空白符:空格或者换行)
- function trimBoth(userStr){
- return userStr.replace(/(^\s*)|(\s*$)/g, "");
- }
- //提示
- ts = function(message,element){
- $.alert({
- title: '提示',
- content: message,
- confirm: function(){
-
- //如果元素是select,就获取其父元素的子元素button
- if(element){
- if(element[0].tagName=="SELECT"){
- element=element.parent().find("button");
- }
- }
-
- //让元素获取焦点
- element.focus();
- }
- });
- };
- function pageinfo2(){
- $("#pagesize").change(function() {
- $("#pagejump").val(1);
- jyrselpop('jyrSel');
- });
- $("#pagesize").val($("#pagesize").attr("num"));
- $("#pagefirst").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(1);
- jyrselpop('jyrSel');
- }
- });
- $("#pageprev").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) - 1);
- jyrselpop('jyrSel');
- }
- });
- $("#pagejump").keydown(
- function(event, p) {
- if (event.keyCode == 13) {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- jyrselpop('jyrSel');
- }
- });
- $("#pagenext").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) + 1);
- jyrselpop('jyrSel');
- }
- });
- $("#pagelast").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val($("#pagetotal").val());
- jyrselpop('jyrSel');
- }
- });
-
- }
- function mapApprove(zyid){
- // 保存审批意见及状态
- $('#mapiframe')[0].contentWindow.gis.edit.syncDataLayer();
- guanbipopmap();
- }
- function mapReject(zyid){
- // 保存审批意见及状态
- guanbipopmap();
- }
- function getValues(){
- var zyarray=[];
- zyarray.push({type:"gk",zyid:''});
- zyarray.push({type:"gq",zyid:''});
- zyarray.push({type:"jyr",zyid:''});
- var obj = document.getElementById("szgkid");
- if(!isEmpty(obj)){
- var m=obj.options[obj.selectedIndex].id;
- if(isEmpty(m)){
- m='';
- }
- zyarray[0].zyid = m;
- }
-
- var obj = document.getElementById("szgqid");
- if(!isEmpty(obj)){
- var m=obj.options[obj.selectedIndex].id;
- if(isEmpty(m)){
- m='';
- }
- zyarray[1].zyid = m;
- }
-
- if(!isEmpty($('#jyrzyid').val())){
- zyarray[2].zyid=$('#jyrzyid').val();
- }
- return zyarray;
- }
- function map(editType,zyid){
- var flag = $('#mapflag').val();
- $('#spDiv').css("display","none");
- $('#mapiframe').attr("width","100%");
- $('#mapdivmask').fadeIn(100);
- $('#mapdiv').slideDown(0);
- if(flag == 0){
- var url = $.app+"/editgis/gisiframe.html?model=gis&treeType=ty&editType="+editType+"&id="+zyid
- $("#mapiframe").attr("src",url);
- $('#mapflag').val("1");
- }
-
-
- }
- function auditMap(editType,zyid,sp){
- map(editType,zyid);
- if(sp){
- $('#spDiv').removeAttr("style");
- $('#spDiv').css("width","50%");
- $('#spDiv').css("float","left");
- $('#mapiframe').attr("width","50%");
- $('#audit').val("");
- $('#approve').attr("onclick","mapApprove('"+zyid+"')");
- $('#reject').attr("onclick","mapReject('"+zyid+"')");
- }
- }
- function guanbipopmap(){
-
- /*iframeObj=document.getElementById("mapiframe");
-
-
- iframeObj.contentWindow.gis.edit.submitToService();*/
- $('#mapdivmask').fadeOut(100);
- $('#mapdiv').slideUp(0);
- }
- function jyrhide(){
- if(($('.szdselectpicker').val()!='')&&($('.gkselectpicker').val()!='')&&($('.gqselectpicker').val()!='')){
- $('#ajyrselect').css('display','inline');
- }else{
- $('#ajyrselect').css('display','none');
- }
- }
- //传入回调方法的名称
- function cbselpop(selectFunc){
- pageinfo3();
- $('#cbselectmaskdiv').fadeIn(100);
- $('#cbselectdiv').slideDown(0);
- var zwcm=$('#zwcm').val();
- $.ajax({
- url:$.app+"/selectCb",
- type:"post",
- data:{
- zwcm:zwcm,
- page:$('#pagejump').val()
- },
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data) {
- var str="";
- for(var i=0;i<data.attrs.list.length;i++){
- var cb = data.attrs.list[i];
- str+="<tr>";
- str+="<td>"+(i+1)+"</td>";
- str+="<td>"+cb.zwcm+"</td>";
- str+="<td>"+cb.ywcm+"</td>";
- str+="<td > " +
- "<a class='btn btn-default btn-xs' href='#' onclick=\""+selectFunc+"('"+cb.id+"')\">"+
- "<i class='glyphicon glyphicon-wrench'></i>选择</a> "+
- "</td>";
- str+="</tr>";
- }
- $("#cb").empty();
- $("#cb").append(str);
-
- $("#pagejump").val(data.attrs.page);
- $("#gongpage").html(data.attrs.gongpage);
- $("#nowshow").html(data.attrs.nowshow);
- $("#gongsize").html(data.attrs.gongsize);
- $("#pagecur").val(data.attrs.page);
- $("#pagetotal").val(data.attrs.totalpage);
- $("#pagesort").val(data.attrs.sort);
- $("#pageorder").val(data.attrs.order);
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
- function pageinfo3(){
- $("#pagesize").change(function() {
- $("#pagejump").val(1);
- cbselpop('cbSel');
- });
- $("#pagesize").val($("#pagesize").attr("num"));
- $("#pagefirst").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(1);
- cbselpop('cbSel');
- }
- });
- $("#pageprev").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) - 1);
- cbselpop('cbSel');
- }
- });
- $("#pagejump").keydown(
- function(event, p) {
- if (event.keyCode == 13) {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- cbselpop('cbSel');
- }
- });
- $("#pagenext").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) + 1);
- cbselpop('cbSel');
- }
- });
- $("#pagelast").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val($("#pagetotal").val());
- cbselpop('cbSel');
- }
- });
-
- }
- //查询页面折叠收缩实现
- function expandSearch() {
- //$(".search_table").css("display") == "table"
- if(parent.expandFlg == true) {
- parent.expandFlg = false;
- $("#expandSearchLink").removeClass("collapselink");
- $("#expandSearchLink").addClass("expandlink");
- $(".search_table").css("display","none");
- } else {
- parent.expandFlg = true;
- $("#expandSearchLink").removeClass("expandlink");
- $("#expandSearchLink").addClass("collapselink");
- $(".search_table").css("display","table");
- }
- }
- //初始化查询页面折叠收缩
- function initExpandSearch() {
- //$(".search_table").css("display") == "table"
- if(parent.expandFlg == true) {
- $("#expandSearchLink").removeClass("expandlink");
- $("#expandSearchLink").addClass("collapselink");
- $(".search_table").css("display","table");
- } else {
- $("#expandSearchLink").removeClass("collapselink");
- $("#expandSearchLink").addClass("expandlink");
- $(".search_table").css("display","none");
- }
- }
- //重置查询表单
- function resetSrchForm() {
- $(".search_table").find(":input").not(":button,:submit,:reset,:hidden").val("").removeAttr("checked").removeAttr("selected");
- $(".search_table").find("select").each(function(){
- //$(this).find("option:first").attr("selected","true");
- //console.info($(this).find("option:first").val());
- $(this).selectpicker('val',$(this).find("option:first").val());
- });
- //$("#"+formId).find(":select").not(":button,:submit,:reset,:hidden").removeAttr("selected");
- //$("select").val().removeAttr("selected");
- //$("[name='checkbox']").attr("checked",'true');//全选
- }
|