update topo配置bug

This commit is contained in:
default
2018-11-21 15:57:37 +08:00
parent 963dc1f56c
commit cd418ea458
2 changed files with 11 additions and 10 deletions

View File

@@ -30,17 +30,18 @@
<script type="text/javascript">
//页面初始化 回显节点对应信息
// type 1 为节点组 2 为节点 3为 空 4为 topo图
$(function(){
$("input[name^='topoNodeType']:checked").each(function(index,data){
var radioValue=$(data).val();
if(radioValue==1){
if(radioValue==2){
$("#topoInfo"+index).hide();
$("#chooseGroupNode"+index).show();
$("#topoNodeOne"+index).show();
$("#topoNodeTwo"+index).show();
$("#chooseType").val(1);
$('#chooseIndex').val(index);
}else if(radioValue==2){
}else if(radioValue==1){
$("#topoInfo"+index).hide();
$("#chooseGroupNode"+index).show();
$("#topoNodeOne"+index).hide();
@@ -68,7 +69,7 @@
function selectNodeAndNodeGroup(index) {
$('#chooseIndex').val(index);
var nodeType = $('input[name="topoNodeType'+index+'"]:checked').val();
if(nodeType==1){
if(nodeType==2){
$("#chooseType").val(1);
}else{
$("#chooseType").val(0);
@@ -116,7 +117,7 @@
$("#topoNodeTwo"+index).hide();
$("#chooseType").val(0);
$('#chooseIndex').val(index);
}else if(value==2){
}else if(value==1){
$("#topoInfo"+index).hide();
$("#chooseGroupNode"+index).show();
$("#topoNodeOne"+index).hide();
@@ -147,7 +148,7 @@
var data={};
topoManageInfo.nodeId=$('#topoNodeInfoId'+index).val();
topoManageInfo.nodeType=radioValue;
if(radioValue==1){
if(radioValue==2){
if(nodeIds==null||nodeIds==undefined||nodeIds==''){
alert("i18n_topoManage.topoNodeError1_n81i");
flag=false;
@@ -158,7 +159,7 @@
return;
}
topoManageInfo.nodeTypeId=nodeIds;
}else if(radioValue==2){
}else if(radioValue==1){
if(groupIds==null||groupIds==undefined||groupIds==''){
alert("i18n_topoManage.topoNodeGroupError1_n81i");
flag=false;
@@ -306,10 +307,10 @@
<c:forEach items="${typeList}" var="type">
<c:choose>
<c:when test='${type==topoManageInfo.topoNodeInfo.type}'>
<input type='radio' status='${status.index}' value='${type}' name='topoNodeType${status.index}' checked='checked' onchange="chooseTopoNodeType(this)"/><c:if test='${type==1}'>i18n_topoManage.topoNode_n81i</c:if><c:if test='${type==2}'>i18n_topoManage.topoNodeGroup_n81i</c:if><c:if test='${type==3}'>i18n_topoManage.topoNone_n81i</c:if><c:if test='${type==4}'>i18n_topoManage.topoPicture_n81i</c:if>
<input type='radio' status='${status.index}' value='${type}' name='topoNodeType${status.index}' checked='checked' onchange="chooseTopoNodeType(this)"/><c:if test='${type==2}'>i18n_topoManage.topoNode_n81i</c:if><c:if test='${type==1}'>i18n_topoManage.topoNodeGroup_n81i</c:if><c:if test='${type==3}'>i18n_topoManage.topoNone_n81i</c:if><c:if test='${type==4}'>i18n_topoManage.topoPicture_n81i</c:if>
</c:when>
<c:otherwise>
<input type='radio' status='${status.index}' name='topoNodeType${status.index}' value='${type}' onchange="chooseTopoNodeType(this)"/><c:if test='${type==1}'>i18n_topoManage.topoNode_n81i</c:if><c:if test='${type==2}'>i18n_topoManage.topoNodeGroup_n81i</c:if><c:if test='${type==3}'>i18n_topoManage.topoNone_n81i</c:if><c:if test='${type==4}'>i18n_topoManage.topoPicture_n81i</c:if>
<input type='radio' status='${status.index}' name='topoNodeType${status.index}' value='${type}' onchange="chooseTopoNodeType(this)"/><c:if test='${type==2}'>i18n_topoManage.topoNode_n81i</c:if><c:if test='${type==1}'>i18n_topoManage.topoNodeGroup_n81i</c:if><c:if test='${type==3}'>i18n_topoManage.topoNone_n81i</c:if><c:if test='${type==4}'>i18n_topoManage.topoPicture_n81i</c:if>
</c:otherwise>
</c:choose>
</c:forEach>

View File

@@ -100,7 +100,7 @@ public class TopoManageAction extends BaseAction{
for (TopoNodeInfo topoInfo : topoNodeList) {
topoManageInfo=new TopoManageInfo();
topoManageInfo.setTopoNodeInfo(topoInfo);
if(topoInfo.getType()==1L){
if(topoInfo.getType()==2L){
List nodeTables = this.commonService.find("from NodeTable where 1=1 and id=?",topoInfo.getTypeId());
nodeTable = (NodeTable)nodeTables.get(0);
List find = this.commonService.find("from NodegroupTable where 1=1 and id=?",nodeTable.getGroupId());
@@ -109,7 +109,7 @@ public class TopoManageAction extends BaseAction{
topoManageInfo.setNodeGroupId(nodeTable.getGroupId());
topoManageInfo.setNodeId(nodeTable.getNodeId());
topoManageInfo.setNodeName(nodeTable.getNodeIp());
}else if(topoInfo.getType()==2L){
}else if(topoInfo.getType()==1L){
List find = this.commonService.find("from NodegroupTable where 1=1 and id=?",topoInfo.getTypeId());
nodegroupTable = (NodegroupTable) find.get(0);
topoManageInfo.setNodeGroupName(nodegroupTable.getGroupName());