道路小页面js
主页面中--打开小页面
小页面向主页面传值
基本信息js(主页面)
小页面添加内容显示到主页面上成list
主页面提交
打开主页面的初始化 判断
查询主页面
主页面中--打开小页面
function AddRoad(){ art.dialog.data("road_data",{ roads:group_road, callbackData:function(road){ group_road.push(road); getSnowClearRoadList(); } }); art.dialog.open('page/basedata_manage/group_road_dialog.html', { title : '负责范围录入页面', lock : true, width : 500, height : 350 }); }
小页面向主页面传值
var road_data;
function toSave(){ var groupInfoRoad = $('#select_road').val(); var startStake = $('#STAKE_START').val(); var endStake = $('#STAKE_END').val(); if(isNaN(startStake)){ alert("起始桩号错误"); return; } if(isNaN(endStake)){ alert("终止桩号错误"); return; } //add by guanhao 增加基本信息分组管理中设置分组范围起止桩号判断 if(Number(startStake) >= Number(endStake)){ alert("起始桩号不能小于终止桩号!"); return; } if(groupInfoRoad==0||groupInfoRoad==""){ alert("请选择道路名称!"); return; } road_data.callbackData({ groupAreaID:YMDHMS, //roadNumber:$("#groupInfoRoad").val(), deptID : $('#select_orgName').val(), orgName : $('#select_orgName').find("option:selected").text(), roadCode : $("#groupInfoRoadCode").val(), direction : $("#direction").val(), roadName: $("#select_road").find("option:selected").text(), startStake:$("#STAKE_START").val(), endStake:$("#STAKE_END").val(), main_mileage:$("#main_mileage").val(),//主线里程数 ramp_mileage:$("#ramp_mileage").val(),//匝道里程数 road_acreage:$("#road_acreage").val(),//路面面积 lane:$("#lane").val()//车道数 }); art.dialog.close(); }
基本信息js(主页面)
小页面添加内容显示到主页面上成list
function getSnowClearRoadList(){ var tab='<table style="width:100%;" cellpadding="0" cellspacing="0" class="table_two">'; tab+= "<tbody>" + "<tr>"+ "<th>序号</th>" + "<th>管理处</th>" + "<th>道路名称</th>" + "<th>道路编号</th>" + "<th>行驶方向</th>" + "<th>起始桩号</th>" + "<th>终止桩号</th>" + "<th>主线里程数</th>" + "<th>匝道里程数</th>" + "<th>路面面积</th>" + "<th>车道数</th>"; if(type!="query") { tab+="<th nowrap=\"nowrap\">"; //tab+="<input type=\"button\" value=\"添加\" onclick='AddRoad()' style=\"margin-right:5px;width:46px; height:24px\" class=\"table_butonstyle\">"; tab += "<span class='table1-a'><a href='#' style='margin-top:2px; float:right;' onclick='AddRoad()'><p><img src='../../images/ico1-4.png' width='16' height='16'/></p>添加</a></span>"; } "</th>" + "</tr>"; for(var i=0;i<group_road.length;i++){ value = i+1; if(i%2 == 0){ tab+="<tr class=\"table1-tr1 \" align=\"center\">"; }else{ tab+="<tr class=\"table1-tr2 \" align=\"center\">"; } tab+="<td>"+value+"</td>"; tab+="<td>"+group_road[i].orgName+"</td>"; tab+="<td>"+group_road[i].roadName+"</td>"; tab+="<td>"+group_road[i].roadCode+"</td>"; var strdirection = group_road[i].direction; if(group_road[i].direction=="0") { strdirection = "上行"; } else if(group_road[i].direction=="1") { strdirection = "下行"; } else if(group_road[i].direction=="2") { strdirection = "双向"; } tab+="<td>"+strdirection+"</td>"; tab+="<td>"+group_road[i].startStake+"</td>"; tab+="<td>"+group_road[i].endStake+"</td>"; tab+="<td>"+group_road[i].main_mileage+"</td>"; tab+="<td>"+group_road[i].ramp_mileage+"</td>"; tab+="<td>"+group_road[i].road_acreage+"</td>"; tab+="<td>"+group_road[i].lane+"</td>"; if(type!="query") { tab+="<td class='table1-a' width='80px' style='padding-left:0px;' nowrap=\"nowrap\">"; tab+='<a href=\"#\" onclick=\"delRoad(\''+group_road[i].groupAreaID+'\');\"><p><img src=\"../../images/ico1-3.png\" width=\"16\" height=\"16\"/></p>删除</a>'; //tab+="<input type=\"button\" value=\"删除\" style=\"margin-right:5px;width:46px; height:24px\" onclick='delRoad(\""+group_road[i].groupAreaID+"\");' class=\"table_butonstyle\">"; } tab+="</td>"; tab+="</tr>"; } tab+="</tbody>"; tab+="</table>"; $("#snowclearroadtable").html(tab); }
主页面提交
var group_info;
function makeSure(){ var groupleader = $("#GROUP_LEADER_ID").val(); // var groupleadertel = $("#GROUP_LEADER_PHONE").val(); var deputyleader = $("#deputyleader_id").val(); // var deputyleadertel = $("#deputyleader_phone").val(); var carleader = $("#carleader_id").val(); var carleadertel = $("#carleader_phone").val(); var bindingTel = $("#bindingTel").val();//绑定手机号 var phoneName = $("#phoneName").val();//手机登录名 var bindingCar = $("#bindingCar").val();//指挥车 var CLEAR_CAR =$("#CLEAR_CAR").val(); var FLAT_GROUND =$("#FLAT_GROUND").val(); var DREDGE_MID =$("#DREDGE_MID").val(); var ROLLING_BRUSH =$("#ROLLING_BRUSH").val(); var DREDGE_DRAG =$("#DREDGE_DRAG").val(); var LOAD_CAR =$("#LOAD_CAR").val(); var DREDGE_LIQUID =$("#DREDGE_LIQUID").val(); var THROW_SNOW_B =$("#THROW_SNOW_B").val(); var groupName =$("#GROUP_NAME").val(); if(groupName.length==0){ alert("请输入组名!"); return; } if(groupName.length > 2){ alert("组名最多输入2个字,不能过长"); return; } if(bindingTel == ""){ alert("绑定手机号不能为空!"); $("#bindingTel")[0].focus(); return; } if(phoneName == ""){ alert("手机登录名不能为空!"); $("#phoneName")[0].focus(); return; } if(bindingCar == ""){ alert("指挥车牌号不能为空!"); $("#bindingCar")[0].focus(); return; } if(groupleader.length==0) { alert("请选择组长!"); return; } if(group_person.length<1){ alert("请添加组内成员"); return; } /*if(group_car.length==0){ alert("请添加车辆"); return; }*/ if(group_road.length==0){ alert("请添加负责范围"); return; } var groupType =$("#groupInfoType").val(); if(groupType==0) { alert("请选择所属组!"); return; } var clumpId =$("#select_clump_item_type_name").val(); if(clumpId.length==0) { alert("请输入集合地!"); return; } /*if(group_car==null||group_car.length==0) { alert("请添加除雪车辆!"); return; }*/ if(group_road==null||group_road.length==0) { alert("请添加负责范围!"); return; } /* checkCommandCar(); if(carNoflag!=true) { alert("未找到指挥车!"); return false; } */ var personId=[]; var bindingTel = $("#bindingTel").val(); var phoneName = $("#phoneName").val(); var bindingCar = $("#bindingCar").val(); var year =$("#groupInfoYear").val(); var groupLeaderId = ""; var cmdStr=(type=="add"?"addGroupInfo":"updateGroupInfo"); if(group_leader[0] != undefined){ groupLeaderId = group_leader[0].personID; }else{ groupLeaderId = groupleader_id; } if(type=="add") { var opts = { cmd : "addGroupInfo", groupInfo : { groupType : groupType, clumpID : clumpId, groupName : groupName, year : year, deptID : $('#deptID', parent.parent.document).val(),//add by guanhao 增加默认管理处过滤 bindingTel : bindingTel, bindingUser: phoneName, // groupLeaderTel : groupleadertel, deputyGroupLeaderID :deputygroupleaderid, // deputyGroupLeaderTel :deputyleadertel, CLEAR_CAR :CLEAR_CAR, FLAT_GROUND :FLAT_GROUND, DREDGE_MID :DREDGE_MID, ROLLING_BRUSH :ROLLING_BRUSH, DREDGE_DRAG :DREDGE_DRAG, LOAD_CAR :LOAD_CAR, DREDGE_LIQUID :DREDGE_LIQUID, THROW_SNOW_B :THROW_SNOW_B, leadingCadres :carleader, leadingCadresTel :carleadertel, commandCarNo : bindingCar, groupLeaderID : groupLeaderId,//需追加判断,否则修改时该字段为非对象 personList : [], /*carList : [],*/ areaList : [] } }; } else{ var opts = { cmd : "updateGroupInfo", groupInfo : { groupID : group_info.itemID, groupType : groupType, clumpID : clumpId, groupName : groupName, year : year, deptID : $('#deptID', parent.parent.document).val(),//add by guanhao 增加默认管理处过滤 bindingTel : bindingTel, bindingUser: phoneName, commandCarNo : bindingCar, groupLeaderID : groupLeaderId, // groupLeaderTel : groupleadertel, deputyGroupLeaderID :deputygroupleaderid, // deputyGroupLeaderTel :deputyleadertel, CLEAR_CAR :CLEAR_CAR, FLAT_GROUND :FLAT_GROUND, DREDGE_MID :DREDGE_MID, ROLLING_BRUSH :ROLLING_BRUSH, DREDGE_DRAG :DREDGE_DRAG, LOAD_CAR :LOAD_CAR, DREDGE_LIQUID :DREDGE_LIQUID, THROW_SNOW_B :THROW_SNOW_B, leadingCadres :carleader, leadingCadresTel :carleadertel, commandCarNo : bindingCar, personList : [], /*carList : [],*/ areaList : [] } }; } for(var i=0;i<group_person.length;i++){ opts.groupInfo.personList.push({ personID:group_person[i].personID }); } /* for(var i=0;i<group_car.length;i++){ opts.groupInfo.carList.push({ carID:group_car[i].carID }); }*/ for(var i=0;i<group_road.length;i++){ opts.groupInfo.areaList.push({ groupAreaID:group_road[i].groupAreaID, // roadNumber:group_road[i].roadNumber, roadCode : group_road[i].roadCode, direction :group_road[i].direction, roadName:group_road[i].roadName, startStake:group_road[i].startStake, endStake:group_road[i].endStake, /**add by yuml start**/ main_mileage:group_road[i].main_mileage, ramp_mileage:group_road[i].ramp_mileage, road_acreage:group_road[i].road_acreage, deptID:group_road[i].deptID, orgName:group_road[i].orgName, lane:group_road[i].lane /**add by yuml end**/ }); } $.ajax({ url:"../../snowBasicinfo", // data: JSON.stringify(opts), data: $.toJSON(opts), type:"post", dataType:"json", success:function(data) { var result = data.result; var reason = data.reason; if("OK"==result){ alert(type=="add"?"添加成功!":"修改成功!"); group_info.flashList(); art.dialog.close(); }else{ alert(reason); return; } }, error:function(msg){ alert(msg); } }); }
打开主页面的初始化 判断
var type; var carNoflag = false; function init(){ //封装好的下拉框,自动查询YRPT_CODING自检表,参数(SCOPE,页面控件ID) type=art.dialog.data("type"); if(type=="add"){ initLoad("group_type","#groupInfoType"); initLoad("year","#groupInfoYear"); group_info=art.dialog.data("flashList"); getGroupPersonList();//获得组内成员的list /*getSnowClearCarList();//获得除雪车辆的list */ getSnowClearRoadList();//获得负责范围的list }else if(type=="query"){ initLoad("group_type","#groupInfoType"); initLoad("year","#groupInfoYear"); var groupId=art.dialog.data("itemID"); getGroupId(groupId); $("#add").css("display","none"); $("#cancel").css("display","none"); $("#personadd").css("display","none"); $("#selectleader").css("display","none"); $("#selectleader2").css("display","none"); $("#selectleader3").css("display","none"); $("#groupInfoType").attr({disabled : "disabled"}); $("#GROUP_NAME").attr({disabled : "disabled"}); $("#select_clump_item_type_name").attr({disabled : "disabled"}); $("#groupInfoYear").attr({disabled : "disabled"}); $("#group_leader_txt").attr({disabled : "disabled"}); $("#bindingTel").attr({disabled : "disabled"}); $("#phoneName").attr({disabled : "disabled"}); $("#bindingCar").attr({disabled : "disabled"}); $("#GROUP_LEADER_PHONE").attr({disabled : "disabled"}); $("#deputyleader_id").attr({disabled : "disabled"}); $("#deputyleader_phone").attr({disabled : "disabled"}); $("#carleader_id").attr({disabled : "disabled"}); $("#carleader_phone").attr({disabled : "disabled"}); $("#GROUP_LEADER_ID").attr({disabled : "disabled"}); $("#CLEAR_CAR").attr({disabled : "disabled"}); $("#FLAT_GROUND").attr({disabled : "disabled"}); $("#DREDGE_MID").attr({disabled : "disabled"}); $("#ROLLING_BRUSH").attr({disabled : "disabled"}); $("#LOAD_CAR").attr({disabled : "disabled"}); $("#DREDGE_DRAG").attr({disabled : "disabled"}); $("#DREDGE_LIQUID").attr({disabled : "disabled"}); $("#THROW_SNOW_B").attr({disabled : "disabled"}); } else if(type=="update") { initLoad("group_type","#groupInfoType"); initLoad("year","#groupInfoYear"); group_info=art.dialog.data("flashList"); var groupId=group_info.itemID; getGroupId(groupId); } }
查询主页面
function getGroupId(groupId){ var opts = {cmd : "queryGroupInfoNow", groupInfo : { groupID : groupId, pos:0 } }; $.ajax({ url:"../../snowBasicinfo", data: $.toJSON(opts), type:"post", dataType:"json", success:function(data) { var result = data.result; var reason = data.reason; if("OK"==result){ if(data.groupInfoList!=null){ if(data.groupInfoList.length>0){ group_person=data.groupInfoList[0].personList; group_car=data.groupInfoList[0].carList; group_road=data.groupInfoList[0].areaList; groupleader_id=data.groupInfoList[0].groupLeaderID; deputygroupleaderid=data.groupInfoList[0].deputyGroupLeaderID; leadingCadres=data.groupInfoList[0].leadingCadres; groupleader_name = data.groupInfoList[0].groupLeaderName; getGroupPersonList();//获得组内成员的list /*getSnowClearCarList();//获得除雪车辆的list */ getSnowClearRoadList();//获得负责范围的list $("#groupInfoType").val(data.groupInfoList[0].groupType); $("#GROUP_NAME").val(data.groupInfoList[0].groupName); $("#select_clump_item_type_name").val(data.groupInfoList[0].clumpName); $("#groupInfoYear").val(data.groupInfoList[0].year); $("#GROUP_LEADER_ID").val(data.groupInfoList[0].groupLeaderName); // $("#GROUP_LEADER_PHONE").val(data.groupInfoList[0].groupLeaderTel); $("#deputyleader_id").val(data.groupInfoList[0].deputyGroupLeaderName); // $("#deputyleader_phone").val(data.groupInfoList[0].deputyGroupLeaderTel); $("#carleader_id").val(data.groupInfoList[0].leadingCadres); $("#carleader_phone").val(data.groupInfoList[0].leadingCadresTel); $("#bindingTel").val(data.groupInfoList[0].bindingTel); $("#phoneName").val(data.groupInfoList[0].bindingUser); $("#bindingCar").val(data.groupInfoList[0].commandCarNo); $("#CLEAR_CAR").val(data.groupInfoList[0].CLEAR_CAR); $("#FLAT_GROUND").val(data.groupInfoList[0].FLAT_GROUND); $("#DREDGE_MID").val(data.groupInfoList[0].DREDGE_MID); $("#ROLLING_BRUSH").val(data.groupInfoList[0].ROLLING_BRUSH); $("#DREDGE_DRAG").val(data.groupInfoList[0].DREDGE_DRAG); $("#LOAD_CAR").val(data.groupInfoList[0].LOAD_CAR); $("#DREDGE_LIQUID").val(data.groupInfoList[0].DREDGE_LIQUID); $("#THROW_SNOW_B").val(data.groupInfoList[0].THROW_SNOW_B); } } }else{ alert(reason); } }, error:function(msg){ alert(msg); } }); }
发表评论
-
dataView 工具栏
2016-08-02 10:13 685http://echarts.baidu.com/echart ... -
js对字符串进行编码方法总结
2016-07-18 16:38 581在用javascript对URL字符串进行编码中,虽然esca ... -
==与===区别(两个等号与三个等号)
2016-06-17 16:55 10111、对于string,number等基础类型,==和===是有 ... -
jquery select取值,赋值操作
2016-03-31 17:24 561jquery select取值,赋值操作一、获取Select获 ... -
时间js
2016-02-16 16:48 613function DateUtil(){ this.url ... -
Spring+Websocket实现消息的推送
2016-01-31 15:59 2537本文主要有三个步骤 1、用户登录后建立websocket连接, ... -
jqgrid
2016-01-28 13:54 390待补待补待补待补 -
HTML5的WebSocket(待补)
2016-01-19 17:30 560认识HTML5的WebSocket 在HTML5规范中,我最喜 ... -
网站cookie.js
2016-01-19 09:34 455cookie.js jQuery.cookie = funct ... -
SVG--(待补)
2016-01-18 10:49 526SVG--(待补) -
prototype---(待补)
2016-01-15 14:58 464<html> <body> & ... -
template
2015-11-17 14:16 350(function(){ template = { ... -
jQuery的deferred对象详解
2015-11-17 09:15 438function getDatas(layerId){ v ... -
jQuery 阻止事件冒泡
2015-11-17 09:12 452http://www.cnblogs.com/jiqing90 ... -
typeof
2015-11-10 15:26 541JS中的变量是松散类型(即弱类型)的,可以用来保存任何类型的数 ... -
hashMap.js
2015-11-04 09:57 437function HashMap() { /** Map大 ... -
分页处理
2015-11-01 09:21 747select * from (SELECT rownum as ... -
前台传字符串导出word
2015-10-29 13:43 696package com.yunfengtech.common; ... -
隐藏,前台
2015-10-27 10:51 480$.ajax({ url:"../../s ... -
js对象定义
2015-10-23 17:18 569一,基本概念 1,自定 ...
相关推荐
关键代码在于 `yes` 回调函数内部,通过 `window["layui-layer-iframe" + index].callbackdata()` 获取弹出层返回的数据。这里的 `callbackdata` 是弹出层内部定义的一个函数,它负责返回我们需要的数据。例如: ``...
这里,`window["layui-layer-iframe" + index]` 指向弹出层内的iframe,而`callbackdata()` 是弹出层页面中定义的一个函数,用于返回所需的数据。`res` 变量则保存了这个函数的返回值。 弹出层中的JavaScript代码...
void *callbackData, int eventData1, int eventData2) { switch (event) { case EVENT_COMMIT: QuitUserInterface (0); break; } return 0; } int CVICALLBACK GRAPHCallback (int panel, int control, ...
如下所示: layer.open({ type: 2, title: "设置围栏", shadeClose: true, shade: 0.4, area: ['90%', '90%'], content: "/ElectronicFence/Map?id=" + id + "&shapeType=" + shapeType, ...
void *callbackData, int eventData1, int eventData2) { switch (event) { case EVENT_COMMIT: QuitUserInterface (0); break; } return 0; } int CVICALLBACK START_WRT (int panel, int ...
1.多增加js 回调函数参数 picUrl,callbackdata picUrl:后端图片路径 callbackdata:后端返回数据 2.新增加后端 保留图片路径 savePath (默认当前路径) 3.新增加后端 保存图片名称 savePicName(默认是时间戳) ...
如下所示: layer.open({ type : 2, title : '重命名', maxmin : true, ... area : [ '200px', '150px' ], content : getContext() + /node/torenamenode?.../callbackdata是弹出层的方法,返回参数 var node
Delphi编写的万年历,单就万年历来说,功能已经相当...其中 callback 为回调函数,以检查是否根据应用程序确定的条件停止绘图,callbackData 回调函数附加数据指针。程序作者:湖北省公安县统计局,毛泽发,于大连。
其中,thumbWidth 和 thumbHeight 分别是缩略图的宽度和高度,callback 是一个 Image.GetThumbnailImageAbort 委托,callbackData 是一个 IntPtr 类型的参数。 如果前两个参数(即宽度和高度)都为 0,那么,GDI+ ...
`CmtInstallTSQCallback (CmtTSQHandle queueHandle, unsigned int event, int thresholdValue, CmtTSQCallbackPtr callback, void *callbackData)` 其中,`queueHandle` 是队列的句柄,`event` 是事件类型,`...
base.DrawImage(image, destRect, srcX, srcY, srcWidth, srcHeight, srcUnit, imageAttr, callback, callbackData); } } } ``` 步骤三:动画处理 创建一个Timer控件,用于定时更新小鱼的位置,从而实现动态效果...
public Mono<String> uploadCallback(@RequestParam("callbackData") String callbackData) { // 这里可以实现自定义的回调逻辑,例如存储文件元数据到数据库 // ... return Mono.just("Callback received"); }...
- cnpapi_CallbackData是回调函数的数据结构,用于传递事件或数据给用户定义的回调函数。 这些数据类型的定义使得开发者能够正确地构造和解析CNPAPI的调用,以获取所需的性能数据。 总之,寒武纪CNPAPI开发者指南...
int CVICALLBACK JISUAN (int panel, int control, int event,void *callbackData, int eventData1, int eventData2) { switch (event) { case EVENT_COMMIT: SetCtrlVal(panelHandle, PANEL_NUMERIC, add(3, 5)...
`window["layui-layer-iframe" + index]`是获取弹出层iframe的引用,`callbackdata()`则是调用弹出层内部定义的返回值函数。 在弹出层的HTML页面中,我们需要定义这个`callbackdata`函数,例如: ```html var ...
int CVICALLBACK MainProc(int panelHandle, int event, void* callbackData, int eventData1, int eventData2); HWND ExecProcess(const char* szProcessName, char* CommandLine, int ShowMode); ``` 这两个...
String callbackData = url.substring("javascript:".length()); // 这里处理数据,例如解析JSON等 return true; // 阻止默认处理 } else { // 其他URL处理,可能需要跳转到其他页面 return super....
- `addAccount(String authTokenType, String accountType, boolean expectActivity, AccountAuthenticatorResponse response, Bundle options, Activity activity, Handler handler, Bundle callbackData, ...