123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964 |
- /**
- * 增加命名空间方法<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');
- }
- });
-
- }
|