zoukankan      html  css  js  c++  java
  • 三选下拉菜单

    1.<head>
    	<title>运维平台</title>
    	<link rel="stylesheet" type="text/css" href="/static/Css/Monitor/readmq.css">
    	<link rel="stylesheet" type="text/css" href="/static/Css/Public/header.css">
    	<link rel="stylesheet" type="text/css" href="/static/Css/Public/menu.css">
    </head>
    <body>
    	<include file="Public:header"/>
    	<div class="content">
    		<include file="Public:menu"/>
    		<div class="con fl">
    			<label class="condition">应用</label>
    			<select name="app" class="monitor">
    				
    			</select>
    			<label class="condition">队列管理器</label>
    			<select name="qmgr" class="monitor">
    				
    			</select>
                            <label class="condition">队列</label>
                            <select name="queue" class="monitor">
                            </select>
    			<!--<input type="submit" value="read_mq_message" class="monitor_add">-->
    			<input type="submit" value="read_mq_message" class="readmq">
    			<!--<input type="submit" value="get_mq_message" class="monitor_start">-->
    			<input type="submit" value="get_mq_message" class="getmq">
    		</div>
                    	<table class="gridtable fr">
    			<tr><th>应用</th><th>队列管理器</th><th>队列</th></tr>
    		</table>
    	</div>
    </body>
    <script type="text/javascript" src="/static/Js/jquery-2.2.2.min.js"></script>
    <script type="text/javascript" src="/static/Js/Monitor/readmq.js"></script>
    <!script type="text/javascript" src="/static/Js/Public/menu.js"><!/script>
    <script type="text/javascript" src="/static/Js/Public/ajax.js"></script>
    </html>
    <html>
    
    
    
    
    2.
    $(function(){
    	var _env_select = $("select[name='env']");
    	var _app_select = $("select[name='app']");
    	var _qmgr_select = $("select[name='qmgr']");
    	var _queue_select = $("select[name='queue']");
    	var _sub_btn = $(".readmq");
    	var _qmgr_btn = $(".getmq");
    	
    	
    	getapp("pro");
    	getqmgr("pro");
    	getqueue("pro")
    	
    	function getapp(env){
    		var data = {};
    		var successfn = function(jdata){
    			var _HTML = "";
    			_app_select.html("");
    			$.each(jdata,function(i,val){
    				_HTML = _HTML + "<option value="+jdata[i][0]+">"+jdata[i][0]+"</option>";
    			});
    			_app_select.html(_HTML);
    		};
    		var errorfn = function(jdata){
    			alert("数据返回出错");
    		};
    		
    		$.ajax({
                type: "get",
                data: data,
                url: "/api/getmqapp",
    			dataType: "json",
                success: function(d){
                    successfn(d);
                },
                error: function(e){
                    errorfn(e);
                }
            });
    
    	}
    	
    	function getqmgr(env){
    		var data = {};
    		var successfn = function(jdata){
    			console.log(jdata);
    			var _HTML = "";
    			_qmgr_select.html("");
    			$.each(jdata,function(i,val){
                                    if (jdata[i][0] == 'QMEMBFE'){
    				_HTML = _HTML + "<option value="+jdata[i][0]+">"+jdata[i][0]+"</option>";
                              };
    			});
    			_qmgr_select.html(_HTML);
    		};
    		var errorfn = function(jdata){
    			alert("数据返回出错");
    		};
    		
    		$.ajax({
                type: "get",
                data: data,
                url: "/api/getqmgrlist",
    			dataType: "json",
                success: function(d){
                    successfn(d);
                },
                error: function(e){
                    errorfn(e);
                }
            });
    
    	}
    	
    	
    	
    		function getqueue(env){
    		var data = {};
    		var successfn = function(jdata){
    			console.log(jdata);
    			var _HTML = "";
    			_queue_select.html("");
    			$.each(jdata,function(i,val){
                                    
    				_HTML = _HTML + "<option value="+jdata[i]+">"+jdata[i]+"</option>";
                              
    			});
    			_queue_select.html(_HTML);
    		};
    		var errorfn = function(jdata){
    			alert("数据返回出错");
    		};
    		
    		$.ajax({
                type: "get",
                data: data,
                url: "/api/getmqqueue",
    			dataType: "json",
                success: function(d){
                    successfn(d);
                },
                error: function(e){
                    errorfn(e);
                }
            });
    
    	}
    	
    	
    	
    	_env_select.on("change",function(){
    		env = _env_select.val();
    		getapp(env);
    	});
    	
    	
    	_env_select.on("change",function(){
    		env = _env_select.val();
    		getqmgr(env);
    	});
    	
    	_env_select.on("change",function(){
    		env = _env_select.val();
    		getqueue(env);
    	});
    	
    	
    	_sub_btn.on("click",function(){
    		var env = _queue_select.val();
    		var app = _app_select.val();
    		var qmgr = _qmgr_select.val();
    		
    		var data = {};
    		data.env = env;
    		data.app = app;
    		data.qmgr = qmgr;
    		var successfn = function(jdata){
               alter('read message'+jdata)
    		};
    		var errorfn = function(jdata){
    			alert("数据返回出错");
    		};
    		$.ajax({
                type: "get",
                data: data,
                url: "/api/readmqmessage",
                dataType: "json",
                success: function(d){
                    successfn(d);
                },
                error: function(e){
                    errorfn(e);
                }
            });
    	});
    	
    		_qmgr_btn.on("click",function(){
    		var env = _queue_select.val();
    		var app = _app_select.val();
    		var qmgr = _qmgr_select.val();
    		
    		var data = {};
    		data.env = env;
    		data.app = app;
    		data.qmgr = qmgr;
    		var successfn = function(jdata){
                 alter('get message'+jdata)
    		};
    		var errorfn = function(jdata){
    			alert("数据返回出错");
    		};
    		$.ajax({
                type: "get",
                data: data,
                url: "/api/getmqmessage",
                dataType: "json",
                success: function(d){
                    successfn(d);
                },
                error: function(e){
                    errorfn(e);
                }
            });
    	});
    	
    });

  • 相关阅读:
    Android Service组件在新进程绑定(bindService)过程
    第二章:创建框架和窗体
    ZOJ 2859 二维RMQ(模板)
    POJ 2828 Buy Tickets
    管理案例:怎样提高项目周例会的效率和效果?
    hdu4416 Good Article Good sentence (后缀数组)
    购买DigtalOcean VPS 安装Wordpress 攻略
    Asteroids!-裸的BFS
    hdu3015 Disharmony Trees
    iOS开发-自己定义后台显示图片(iOS7-Background Fetch的应用)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349340.html
Copyright © 2011-2022 走看看