multiRoute.jsp 10.1 KB
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="com.api.integration.esb.bean.RouteBean" %>
<%@ page import="com.api.integration.esb.service.PublishService" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%
    String publishId = Util.null2String(request.getParameter("publishId"));
    String routeIds = "," + Util.null2String(request.getParameter("selectedids")) + ",";

    PublishService service = new PublishService(user);

    List<RouteBean> list = service.getRouteNoAsyncList(publishId);

    String titlename = SystemEnv.getHtmlLabelNames("132143",user.getLanguage());
%>

<HTML>
<HEAD>
    <LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
    <SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
</HEAD>


<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
    <%
RCMenu += "{"+SystemEnv.getHtmlLabelName(826,user.getLanguage())+",javascript:doSubmit(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;

RCMenu += "{"+SystemEnv.getHtmlLabelName(311,user.getLanguage())+",javascript:onClear(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;

RCMenu += "{"+SystemEnv.getHtmlLabelName(201,user.getLanguage())+",javascript:btn_cancle(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>

<jsp:include page="/systeminfo/commonTabHead.jsp">
    <jsp:param name="mouldID" value="esb"/>
    <jsp:param name="navName" value="<%=SystemEnv.getHtmlLabelName(132143,user.getLanguage()) %>"/>
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
    <tr>
        <td>
        </td>
        <td class="rightSearchSpan" style="text-align:right; ">
            <span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage()) %>" class="cornerMenu middle"></span>
        </td>
    </tr>
</table>
<div id="tabDiv">
	<span id="hoverBtnSpan" class="hoverBtnSpan">

	</span>
</div>


<FORM id=weaver name=weaver action="" method=post>
    <TABLE class=Shadow>
        <tr>
            <td valign="top">
                <wea:layout type="2col" attributes="{'expandAllGroup':'true'}">
                    <wea:group context="" attributes="{'groupDisplay':'none'}">
                        <wea:item attributes="{'isTableList':'true'}">
                            <TABLE CLASS="ListStyle" valign="top" cellspacing=1
                                   style="position:fixed;z-index:99!important;">
                                <COLGROUP>
                                    <COL width="5%">
                                    <COL width="15%">
                                    <COL width="30%">
                                    <COL width="10%">
                                    <COL width="40%">
                                </COLGROUP>
                                <TR class="header" noDelete="true">
                                    <TD align="center" style="word-break:keep-all;white-space:nowrap;">
                                        <INPUT type="checkbox" name="chkAll" id="chkAll"
                                               onClick="chkAllClick(this);">
                                    </TD>
                                    <!-- 路由标识 -->
                                    <TD align="center" style="word-break:keep-all;white-space:nowrap;">
                                        <%=SystemEnv.getHtmlLabelName(84, user.getLanguage())%>
                                    </TD>
                                        <%-- 注册服务 --%>
                                    <TD align="center" style="word-break:keep-all;white-space:nowrap;">
                                        <%=SystemEnv.getHtmlLabelName(31693, user.getLanguage())%>
                                    </TD>
                                        <%-- 运行级别 --%>
                                    <TD align="center" style="word-break:keep-all;white-space:nowrap;">
                                        <%=SystemEnv.getHtmlLabelNames("131308,139", user.getLanguage())%>
                                    </TD>
                                        <%-- 说明 --%>
                                    <TD align="center" style="word-break:keep-all;white-space:nowrap;">
                                        <%=SystemEnv.getHtmlLabelName(25734, user.getLanguage())%>
                                    </TD>
                                </TR>
                                <TR style="height:1px;" class=line noDelete="true">
                                    <TD ColSpan=5 style="height:1px;"></TD>
                                </TR>
                                <%
                                    for(int i=0;i<list.size();i++){
                                        RouteBean routeBean = list.get(i);
                                %>
                                <tr class="" style="vertical-align: middle;">
                                    <td style='word-break:keep-all;white-space:nowrap;'>
                                        <INPUT id="checkbox_<%=i%>" type="checkbox" name="routeId" serviceName="<%=routeBean.getServiceName()%>"
                                               value="<%=routeBean.getRouteId() %>" <%if(routeIds.indexOf("," + routeBean.getRouteId()+ ",")!=-1){%>checked<%}%> />
                                    </td>
                                    <td style='word-break:keep-all;white-space:nowrap;' onclick="ChkTr('<%=i%>')">
                                            <%=routeBean.getRouteId()%>
                                    </td>
                                    <td style='word-break:keep-all;white-space:nowrap;' onclick="ChkTr('<%=i%>')">
                                        <%=routeBean.getServiceName()%>
                                    </td>
                                    <td style='word-break:keep-all;white-space:nowrap;' onclick="ChkTr('<%=i%>')">
                                        <%=routeBean.getRunLevel()%>
                                    </td>
                                    <td style='word-break:keep-all;white-space:nowrap;' onclick="ChkTr('<%=i%>')">
                                        <%=routeBean.getDescription()%>
                                    </td>
                                </TR>
                                <tr class="Spacing" style="height:1px!important;">
                                    <td colspan="5" class="paddingLeft0Table">
                                        <div class="intervalDivClass"></div>
                                    </td>
                                </tr>
                                <%
                                    }
						        %>
                            </TABLE>
                        </wea:item>
                    </wea:group>
                </wea:layout>
            </td>
        </tr>
    </table>
</FORM>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
    <wea:layout needImportDefaultJsAndCss="false">
        <wea:group context="" attributes='{\"groupDisplay\":\"none\"}'>
            <wea:item type="toolbar">
                <input type="button" class="zd_btn_submit" accessKey=O id=btnok
                       value="O-<%=SystemEnv.getHtmlLabelName(826,user.getLanguage())%>" onclick="doSubmit()"></input>
                <input type="button" class="zd_btn_submit" accessKey=2 id=btnclear
                       value="2-<%=SystemEnv.getHtmlLabelName(311,user.getLanguage())%>" onclick="onClear()"></input>
                <input type="button" class="zd_btn_cancle" accessKey=T id=btncancel
                       value="T-<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>" onclick="onClose()"></input>
            </wea:item>
        </wea:group>
    </wea:layout>
</div>
<jsp:include page="/systeminfo/commonTabFoot.jsp"></jsp:include>

<script type="text/javascript">
    var dialog;
    jQuery(document).ready(function () {
        try {
            dialog = parent.getDialog(window);
        } catch (e) {
        }
        if (!dialog) {
            try {
                dialog = parent.parent.getDialog(parent);
            } catch (e) {
            }
        }
    });

    function onClose() {
        if (dialog) {
            dialog.close()
        } else {
            window.parent.close();
        }
    }

    function ChkTr(id) {
        $("#checkbox_" + id).trigger("checked",!$("#checkbox_" + id).attr("checked"));
    }

    /**
     * 全选、取消全选
     * @param obj 触发元素
     * @param checkboxName  待选选择框名称
     */
    function chkAllClick(obj) {
        try {
            $("input[name='routeId']").each(function () {
                var bool = obj.checked;
                $(this).trigger("checked", bool);
            });
        } catch (e) {
            console.log(e);
        }
    }

    function btn_cancle() {
        onClose();
    }

    function onClear() {
        returnjson = {id: "", name: ""};
        if (dialog) {
            try {
                dialog.callback(returnjson);
            } catch (e) {
            }

            try {
                dialog.close(returnjson)
            } catch (e) {
            }
        } else {
            window.parent.returnValue = returnjson;
            window.parent.close();
        }
    }

    function doSubmit() {
        checkids = "";
        checknames = "";

        $("input[name='routeId']:checked").each(function () {
            id = $(this).val();
            if (checkids == "") {
                checkids = id;
                checknames = $(this).attr("serviceName");
            } else {
                checkids += "," + id;
                checknames += "," + $(this).attr("serviceName");
            }
        });

        returnjson = {id: checkids, name: checknames};
        if (dialog) {
            try {
                dialog.callback(returnjson);
            } catch (e) {
            }

            try {
                dialog.close(returnjson)
            } catch (e) {
            }
        } else {
            window.parent.returnValue = returnjson;
            window.parent.close();
        }
    }

</script>
</HTML>