Blame view

static/js/linkageplugin.js 875 Bytes
831eac332   zhuzhenchao   add file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  $(document).ready(function(){
  	//找到四个下拉框
  	var environment = $("#environment");
  	var module_name = $(".module_name").children("select");
  	$("input:radio[name='environment']").change(function(){
  		//1.需要获得当前下拉框的值
  		var environment_value = $("#environment").val();
  		$.post("/releasemanage/get_jenkins_jobs_by_environment$/",{environment: environment_value},function(data){
  			if (jQuery.isEmptyObject(data)) {
  				module_name.html("");
  				$('#modulelistalert').html("<div style='color:red'>获取模块列表失败,请确认所选环境并确认您有权操作该换</div>");
  			} else {
  				selecthost1.html("");
  				 //解析json数组
  				 $.each(data,function(key,value){
  					  $("<option value='" + key + "'>" + value + "</option>").appendTo(module_name);
  					  $('#modulelistalert').html("");
  				  })
  			}
  	    }, "json");
  	});
  })