<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8">
|
<title>添加配置关系</title>
|
[#include "/business/pages/include/static.html" /]
|
[#include "/component/popTree.html" /]
|
</head>
|
|
<body>
|
<div class="fs_main clearfix">
|
<div class="relationwrap" style="width:auto;">
|
<h2>
|
配置关系:
|
[#if links?? && links?size>0]
|
[#list links as link]
|
<span><input type="radio" name="radio" value="${link.id}" class="relation"/>${link.text}</span>
|
[/#list]
|
[/#if]
|
</h2>
|
</div>
|
|
<div class="event_fill list_common_select">
|
<table><tr><th width="75%">
|
|
<div class="fill_item">
|
<label>搜索码:</label>
|
<input class="general" type="text" name="searchCode" id="searchCode" />
|
</div>
|
|
<div class="fill_item">
|
<label>配置项名称:</label>
|
<input class="general" type="text" name="ciName" id="ciName" />
|
</div>
|
|
</th><td width="25%">
|
<a class="retrievebtn focus" onclick="query();">查询</a><a class="retrievebtn" id="reset">重置</a>
|
</td></tr></table>
|
</div>
|
</div>
|
|
<div class="fs_main clearfix">
|
<div id="main"></div>
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
var ci_id = '${RequestParameters.id}';
|
function query(){
|
var searchCode = $.trim($("#searchCode").val());
|
var ciName = $.trim($("#ciName").val());
|
var cate = $.trim($("#categoryId").val());
|
var params = {"searchCode":searchCode,"ciName":ciName,"cate":cate,"ci_id":ci_id};
|
loading($("#main"));
|
$.post("${base}/business/pages/cfg/selectrelationLink.html",params,function(data,textStatus) {
|
$("#main").html(data);
|
})
|
}
|
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
|
var $checkedRelation = $(".relation:checked");
|
var relationLen = $checkedRelation.length;
|
if(relationLen == 0) {
|
window.top.popupTips("请选择一个关联关系");
|
return;
|
}
|
|
var $checkedSelectProp = $(".selectProp:checked");
|
var checkedSelectPropLen = $checkedSelectProp.length;
|
if(checkedSelectPropLen == 0) {
|
window.top.popupTips("请至少选择一个选择配置项");
|
return;
|
}
|
|
|
if(!window.top.openConfirm("确定要选择吗?")) {
|
return;
|
}
|
|
var relation = $checkedRelation.val();
|
var idArray = new Array();
|
$checkedSelectProp.each(function() {
|
idArray.push($(this).val());
|
});
|
|
var ids = idArray.join(",");
|
var params = {"relation":relation,"ids":ids,"ci_id":ci_id};
|
$.post("${base}/business/pages/cfg/saveRelation.html",params,function(data,textStatus) {
|
if(data==1) {
|
window.top.popupTips("选择成功");
|
window.top.hideDialog(dialogID);
|
window.top.document.getElementById("dialogIframe0").contentWindow.query();
|
} else {
|
window.top.popupTips("选择失败");
|
}
|
})
|
}
|
}
|
|
|
$(function() {
|
query();
|
$("#reset").click(function() {
|
window.location.reload(true);
|
});
|
|
$("#selectAll").live("click",function() {
|
$(".selectProp").attr("checked",$(this).attr("checked"));
|
})
|
|
$(".selectProp").live("click",function() {
|
var checkedSelectPropLen = $(".selectProp:checked").length;
|
var allSelectPropLen = $(".selectProp").length;
|
|
$("#selectAll").attr("checked",(checkedSelectPropLen==allSelectPropLen));
|
|
})
|
|
})
|
</script>
|
|
</body>
|
</html>
|