12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- function goBack(params) {
- //获取iframe中的元素值
- var iframe =parent.document.getElementsByName("frmright")[0];
- iframe.src = $.pathname()+"/page/system/externalSystem/intelligence.jsp"+params;
- }
- /**
- * 解析查询条件
- * @returns {___anonymous229_230}
- */
- function resolveUrl(){
- var encondeCondition=window.location.search;
- var condition= decodeURI(encondeCondition.substring(1,encondeCondition.length));
- var conditionArr=condition.split("&");
- var condJson={};
- for(var item in conditionArr){
- var temArr=conditionArr[item].split("=");
- condJson[temArr[0]]=temArr[1];
- }
- return condJson;
- }
- /**
- * 重置
- * @param id
- */
- function reset(){
- $("#content").val("");
- $("#date").val("");
-
- }
- /**
- * 保存
- */
- function save(id){
- $.post($.pathname() + "/ws/IntelligenceService/IntelligenceService/update",{content:$("#content").val(),date:$("#date").val(),id:id},function(result){
- if(result.state=="SUCCESS"){
- top.Dialog.alert("增加成功",function(){});
- }else{
- top.Dialog.alert("增加失败",function(){});
- }
- })
- }
- /*
- * 初始化
- */
- function init(id){
- $.post($.pathname() + "/ws/IntelligenceService/IntelligenceService/getInfo",{id:id},function(result){
- if(result.state=="FAILURE") throw new Error("查询失败");
- if(result.rows.length>0){
- $("#content").val(result.rows[0].PLANKINFO);
- $("#date").val(result.rows[0].PLANKDATE);
- }
- },"json");
- }
- /*
- * 加载
- */
- $(function(){
- $("#back").on("click",function(){
- goBack(window.location.search);
- });
- init(resolveUrl().id);
- $("#save").on("click",function(){
- save(resolveUrl().id);
- });
- $("#reset").on("click",function(){
- reset();
- });
-
- });
|