header.jsp 35.1 KB
Newer Older
afe's avatar
afe committed
1 2
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3 4
<%@ page
        import="com.hp.cmsz.commons.utils.PropertiesUtil,com.hp.cmsz.commons.utils.OSinfo,com.hp.cmsz.commons.utils.EPlatform" %>
afe's avatar
afe committed
5 6 7
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page import="com.hp.cmsz.entity.UserInfo" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
<div id="sticky-wrap">
    <div id="header">
        <div class="container">
            <div class="row">
                <div class="col-xs-10">
                    <div id="top-bar">
                        <img src="${ctx}/static/images/top_bar.png" alt="全网监控智能分析系统" title="全网监控智能分析系统"/>
                        <span style="font-size:14px;color:rgb(23,138,234);">专业的监控数据分析平台</span>
                    </div>
                </div>
                <div class="col-xs-2">
                    <div id="login">
                        <shiro:user>
                            <div style='margin-top:0px;margin-right:5%;'>
                                <div style="width:20%;height:40%;float:left"><img src="${ctx}/static/images/user.PNG"
                                                                                  width="90%" height="5%" alt=""
                                                                                  title=""/></div>
                                <div id="userdiv" style="margin-top:15px;">
                                    <a href="#">
                                        <span id='userName' style="font-size:15px;"></span><span
                                            class='glyphicon glyphicon-chevron-down'></span>
                                    </a>
                                </div>
                                <div id="showuser" style="position: absolute;display:none;">
                                    <ul class="menu" style="margin-left:40px;">
                                        <a href="javascript:;" onclick="modifyPassword()">修改密码</a><br>
                                            <%--  <a href="${ctx}/logout">退出</a> --%>
                                        <a href="#">
                                            <div id="logout">退出</div>
                                        </a>
                                    </ul>
                                </div>
                            </div>


                        </shiro:user>
                    </div>
                </div>
            </div>
afe's avatar
afe committed
47 48
        </div>
    </div>
49 50 51 52
    <div class="navbar navbar-static-top">
        <div class="navbar-inner">
            <div class="container">
                <ul class="nav navbar-nav">
afe's avatar
afe committed
53

54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
                    <shiro:user>
                        <li class="titleLine"></li>
                        <li class="dropdown">
                            <a class="dropdonw-toggle" role="button" href="${ctx}/index"><span class="menu-icon"><img
                                    alt="" src="${ctx}/static/images/1.png"/></span>首页</a>
                        </li>
                    </shiro:user>

                    <shiro:hasPermission name="社交媒体:数据查询  or 社交媒体:系统配置 ">
                        <li class="titleLine"></li>
                        <li class="dropdown">
                            <a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
                                    class="menu-icon"><img alt="" src="${ctx}/static/images/2.png"/></span>社交媒体</a>
                            <ul class="dropdown-menu" aria-labelledby="drop" role="menu">
                                <shiro:hasPermission name="社交媒体:数据查询 ">
                                    <li class="dropdown-submenu">
                                        <a href="#">数据查询</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataApp">APP数据查询</a>
                                            </li>
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataForum">论坛类数据查询</a>
                                            </li>
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataMall">电子商城类数据查询</a>
                                            </li>
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataSearch">搜索引擎类数据查询</a>
                                            </li>
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataMobile">电商手机类数据查询</a>
                                            </li>
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataTwitter">微博类数据查询</a>
                                            </li>
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/home?selectTab=a_dataAlexa">网站排名类数据查询</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="社交媒体:系统配置 ">
                                    <li class="dropdown-submenu">
                                        <a href="#">系统配置</a>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="${ctx}/CrawlDataManage/ViewData/config?selectTab=a_configKeyWord">关键字</a>
                                            </li>
                                            <li><a href="${ctx}/CrawlDataManage/ViewData/config?selectTab=a_configUrl">URL配置</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
afe's avatar
afe committed
101 102 103
                            </ul>
                        </li>
                    </shiro:hasPermission>
104

胡斌's avatar
胡斌 committed
105
                    <shiro:hasPermission name="预分析与建模:数据预分析  or 预分析与建模:数据模型管理    or 预分析与建模:数据模型验证 or 预分析与建模:数据沙盒 or  预分析与建模:数据质量核查  ">
106 107 108 109 110 111 112 113 114 115 116
                        <li class="titleLine"></li>
                        <li class="dropdown">
                            <a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
                                    class="menu-icon"><img alt="" src="${ctx}/static/images/2.png"/></span>预分析与建模</a>
                            <ul class="dropdown-menu" aria-labelledby="drop" role="menu">
                                <shiro:hasPermission name="预分析与建模:数据预分析">
                                    <li class="dropdown-submenu">
                                        <a href="#">数据预分析</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/MonitorOperation/RegularityAnalysis">数据特征探查</a></li>
                                            <li><a href="${ctx}/MonitorOperation/KeyLinkProcessAnalysis">业务环节分析</a></li>
117
                                            <%--<li><a href="${ctx}/MonitorOperation/FlowMonitor">实体厅流量监测分析</a></li>--%>
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="预分析与建模:数据模型管理">
                                    <li class="dropdown-submenu">
                                        <a href="#">数据模型管理</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/ModelManage/ModelResult">模型维护</a></li>
                                            <li><a href="${ctx}/BaseManage/TaskManage/modelMonitorHome">模型监控</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="预分析与建模:数据模型验证">
                                    <li class="dropdown-submenu">
                                        <a href="#">数据模型验证</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/MonitorOperation/FailureForcast">预警结果验证</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="预分析与建模:数据沙盒">
                                    <li class="dropdown-submenu">
                                        <a href="#">数据沙盒</a>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="${ctx}/BaseManage/TaskManage/sandboxHome?selectTab=a_taskDetail">沙盒数据配置</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/BaseManage/TaskManage/sandboxHome?selectTab=a_taskManage">沙盒任务配置</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
胡斌's avatar
胡斌 committed
151 152 153 154 155 156 157 158 159 160 161
                                <shiro:hasPermission name="预分析与建模:数据质量核查">
                                    <li class="dropdown-submenu">
                                        <a href="#">数据质量核查</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/AnalysisSupport/QualityRuleResult">数据质量规则维护</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/QualityRuleOperation/home?selectTab=focus">数据质量运营</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/QualityRuleReport">数据质量报告</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/FilterRuleResult">过滤规则维护</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
162 163
                            </ul>
                        </li>
afe's avatar
afe committed
164
                    </shiro:hasPermission>
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214

                    <shiro:hasPermission name="监控运营:告警监控  or 监控运营:协查单分析  or 监控运营:故障管理  or 监控运营:协查单管理 or 监控运营:告警关联诊断">
                        <li class="titleLine"></li>
                        <li class="dropdown">
                            <a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
                                    class="menu-icon"><img alt="" src="${ctx}/static/images/3.png"/></span>监控运营</a>
                            <ul class="dropdown-menu" aria-labelledby="drop" role="menu">
                                <shiro:hasPermission name="监控运营:告警监控">
                                    <li class="dropdown-submenu">
                                        <a href="#">告警监控</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/MonitorOperation/WorkingOrderManage">预警和隐患维护</a></li>
                                            <li><a href="${ctx}/MonitorOperation/WarnAnalysis">告警统计</a></li>
                                            <li><a href="${ctx}/MonitorOperation/WarnAnalysisDetail">告警明细</a></li>
                                                <%--create by hubin 2017-10-26  --%>
                                            <li><a href="${ctx}/MonitorOperation/InsideXcd">内部协查单管理</a></li>

                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="监控运营:协查单管理">
                                    <li class="dropdown-submenu">
                                        <a href="#">协查单管理</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/MonitorOperation/WorkingOrderAnalysis">协查单统计</a></li>
                                            <li><a href="${ctx}/MonitorOperation/WorkingOrderReasult">协查单明细</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="监控运营:故障管理">
                                    <li class="dropdown-submenu">
                                        <a href="#">故障管理</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/MonitorOperation/FailureAnalysis">故障统计</a></li>
                                            <li><a href="${ctx}/MonitorOperation/FailureAnalysisDetail">故障明细</a></li>
                                            <li><a href="${ctx}/MonitorOperation/FailureAnalysisXcd">故障维护</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="监控运营:告警关联诊断">
                                    <li class="dropdown-submenu">
                                        <a href="#">告警关联诊断</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/MonitorOperation/AssociateDiagosisConfiguration">关联诊断配置</a></li>
                                            <li><a href="${ctx}/MonitorOperation/AssociateDiagosisDetail">关联诊断明细</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                            </ul>
                        </li>
afe's avatar
afe committed
215
                    </shiro:hasPermission>
216

胡斌's avatar
胡斌 committed
217
                    <shiro:hasPermission name="运营支撑:配置项分析  or 运营支撑:集成商分析  or 运营支撑:竞品分析  or 运营支撑:业务热点分析 or 运营支撑:投诉文本分析   ">
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
                        <li class="titleLine"></li>
                        <li class="dropdown">
                            <a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
                                    class="menu-icon"><img alt="" src="${ctx}/static/images/4.png"/></span>运营支撑</a>
                            <ul class="dropdown-menu" aria-labelledby="drop" role="menu">
                                <shiro:hasPermission name="运营支撑:配置项分析">
                                    <li class="dropdown-submenu">
                                        <a href="#">配置项分析</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/AnalysisSupport/PzxAnalysis">总领</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/PzxNumCount">配置数量统计</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/PzxDetail">配置明细分析</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/PzxAttribute">配置属性统计</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/PzxAttributeDetail">属性明细分析</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/PzxAnalysisLifeCycle">生命周期统计</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="运营支撑:业务热点分析">
                                    <li class="dropdown-submenu">
                                        <a href="#">业务热点分析</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/AnalysisSupport/ServiceFeature">地市热点分析</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/ChannelAnalysis">渠道热点分析</a></li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="运营支撑:集成商分析">
                                    <li class="dropdown-submenu">
                                        <a href="#">集成商分析</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/AnalysisSupport/ProviderAnalysis">隐患按集成商分析</a></li>
                                            <li><a href="${ctx}/AnalysisSupport/ProviderEWarningAnalysis">预警按集成商分析</a>
                                            </li>
                                            <li><a href="${ctx}/AnalysisSupport/ProviderFailureAnalysis">故障按集成商分析</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="运营支撑:竞品分析">
                                    <li><a href="${ctx}/AnalysisSupport/JpfxAnalysis">竞品分析</a></li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="运营支撑:投诉文本分析">
                                    <li class="dropdown-submenu">
                                        <a href="#">投诉文本分析</a>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=focus">焦点投诉</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_detail">业支-明细数据</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_focus">业支-焦点投诉</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_liability">业支-责任原因</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/AnalysisSupport/TSWBAnalysisHomeView/home?selectTab=yz_template">业支-下发模板</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
胡斌's avatar
胡斌 committed
282

283 284
                            </ul>
                        </li>
afe's avatar
afe committed
285
                    </shiro:hasPermission>
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
                    <shiro:hasPermission name="即席查询:明细查询  or 即席查询:知识管理">
                        <li class="titleLine"></li>
                        <li class="dropdown">
                            <a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
                                    class="menu-icon"><img alt="" src="${ctx}/static/images/5.png"/></span>即席查询</a>
                            <ul class="dropdown-menu" aria-labelledby="drop" role="menu">
                                <shiro:hasPermission name="即席查询:明细查询">
                                    <%--Commented by huach on 20140731 begin  <%
                                       EPlatform osn = OSinfo.getOSname();
                                       if (osn.toString().startsWith("Windows")) {%>
                                             <li><a href="http://localhost:8080/pentaho/adhoc/waqr.html">明细查询</a></li>
                                       <%} else {%>
                                             <li><a href='<%= "http://" + PropertiesUtil.readValue("/home/pentaho/conf" + System.getProperty("file.separator") + "application.properties", "linux_server_ip") + ":8080/pentaho/adhoc/waqr.html?&userid=joe&password=password" %>' target="_blank">明细查询</a></li>

                                      <%}
                                     %>    Commented by huach on 20140731 end --%>
                                    <li>
                                        <a href='<%= request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/pentaho/adhoc/waqr.html?&userid=joe&password=password" %>'
                                           target="_blank">明细查询</a></li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="即席查询:知识管理">
                                    <li><a href="${ctx}/DataManage/KnowledgeShare">知识管理</a></li>
                                </shiro:hasPermission>
                            </ul>
                        </li>
afe's avatar
afe committed
311
                    </shiro:hasPermission>
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402


                    <shiro:hasPermission
                            name="基础管理:配置管理  or 基础管理:系统自监控  or 基础管理:系统数据备份和恢复  or 基础管理:元数据管理  or 基础管理:告警规则管理  or 基础管理:任务管理 ">
                        <li class="titleLine"></li>
                        <li class="dropdown">
                            <a class="dropdonw-toggle" data-toggle="dropdown" role="button" href="#"><span
                                    class="menu-icon"><img alt="" src="${ctx}/static/images/6.png"/></span>基础管理</a>
                            <ul class="dropdown-menu" aria-labelledby="drop" role="menu">
                                <shiro:hasPermission name="基础管理:告警规则管理">
                                    <li class="dropdown-submenu">
                                        <a href="#">告警规则管理</a>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_eWarningDropRule">预警消除规则维护</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_eWarningRule">预警生成规则维护</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/BaseManage/ParameterManage/ruleHome?selectTab=a_hWarningRule">隐患生成规则维护</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="基础管理:系统数据备份和恢复">
                                    <li class="dropdown-submenu">
                                        <a href="#">系统数据备份和恢复</a>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="${ctx}/BaseManage/DataBackup/dataBackupHome?selectTab=a_dataBackup">系统数据备份</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/BaseManage/DataBackup/dataBackupHome?selectTab=a_taskDetail">系统数据恢复</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="基础管理:任务管理">
                                    <li class="dropdown-submenu">
                                        <a href="#">任务管理</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/BaseManage/TaskManage/taskHome?selectTab=a_taskManage">自定义任务维护</a>
                                            </li>
                                            <li><a href="${ctx}/BaseManage/TaskManage/taskHome?selectTab=a_taskLog">任务运行日志查询</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="基础管理:配置管理">
                                    <li class="dropdown-submenu">
                                        <a href="#">配置管理</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_dataBackup">前台系统参数维护</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_analysysType">数据分析参数维护</a>
                                            </li>
                                            <li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_taskGroup">任务组维护</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_deployedServer">部署服务器维护</a>
                                            </li>
                                            <li>
                                                <a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_dataModelType">隐患预警类型维护</a>
                                            </li>
                                            <li><a href="${ctx}/BaseManage/SystemParameter/home?selectTab=a_baseData">后台系统参数维护</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="基础管理:系统自监控">
                                    <li><a href="${ctx}/BaseManage/SelfMonitor/monitorHome">系统自监控</a></li>
                                </shiro:hasPermission>
                                <shiro:hasPermission name="基础管理:元数据管理">
                                    <li><a href="${ctx}/BaseManage/ParameterManage/parameterHome">元数据管理</a></li>
                                </shiro:hasPermission>
                                <shiro:hasRole name="admin">
                                    <li class="dropdown-submenu">
                                        <a href="#">权限管理</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="${ctx}/BaseManage/AuthorityManage">用户管理</a></li>
                                            <li><a id="roleManage" href="${ctx}/BaseManage/AuthorityManage/roleManage">角色管理</a>
                                            </li>
                                        </ul>
                                    </li>
                                </shiro:hasRole>

                            </ul>
                        </li>
                        <li class="titleLine"></li>
afe's avatar
afe committed
403
                    </shiro:hasPermission>
404

afe's avatar
afe committed
405
                </ul>
406
            </div>
afe's avatar
afe committed
407 408 409 410 411
        </div>
    </div>

</div>
<script type="text/javascript">
412 413 414 415 416 417 418 419 420 421 422 423 424 425
    $(document).ready(function () {
        $("#logout").click(function () {
            var href = "${ctx}/index/logoutCreateLog";
            $.ajax({
                type: 'GET',
                contentType: 'application/json',
                url: href,
                dataType: 'text',
                beforeSend: function (data) {
                },
                success: function (data) {
                    location.href = "${ctx}/logout";
                }
            });
afe's avatar
afe committed
426 427

        });
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
        $("#login").mouseover(function () {
            $("#showuser").show();
        });
        $("#login").mouseout(function () {
            $("#showuser").hide();
        });
        var userName;
        <% if(session.getAttribute("CURRENT_USER_SESSION")!=null){ %>
        userName = '<%= ((UserInfo)(session.getAttribute("CURRENT_USER_SESSION"))).getStaffname()%>';
        $("#userName").html(userName);
        console.log("userName:" + userName);
        <%    } %>
    });

    function modifyPassword() {
        $.dialog({
            id: "modifyPassword",
            title: "修改密码",
            content: "<div style='width:290px;height:129px'><div class='form-horizontal' id='modifyPassword'>"
            + "<div class='form-group'><div class='col-xs-4'><label class='control-label'>旧密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='oldPassword' name='oldPassword' class='form-control' type='password' value='' /></div></div>"
            + "<div class='form-group'><div class='col-xs-4'><label class='control-label'>新密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='newPassword' name='newPassword' class='form-control' type='password' value='' /></div></div>"
            + "<div class='form-group'><div class='col-xs-4'><label class='control-label'>确认新密码(<font color='red'>*</font>):</label></div><div class='col-xs-7' style='margin:0 -17px'><input id='reNewPassword' name='reNewPassword' class='form-control' type='password' value='' /></div></div>"
            + "<div class='form-group'><div  style='margin-left:10px;'><font color='red'><p></p></font></div></div>"
            + "</div></div>",
            initialize: function () {
                $(".d-buttons input:first").css({
                    "color": "#ffffff",
                    "background": "#428bca",
                    "border-color": "#357ebd"
                });
            },
            button: [{
                value: "提交",
                callback: function () {
                    if ($.trim($("#oldPassword").val()) == "") {
                        //$.alert("输入的旧密码不能为空!");
                        $('p').html("输入的旧密码不能为空!");
                        return false;
                    } else if ($.trim($("#oldPassword").val()).length < 6) {
                        //$.alert("输入旧密码的长度至少为6位!");
                        $("#oldPassword").focus();
                        $('p').html("输入旧密码的长度至少为6位!");
                        return false;
                    }
afe's avatar
afe committed
472

473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
                    if ($.trim($("#newPassword").val()) == "" || $.trim($("#reNewPassword").val()) == "") {
                        //$.alert("输入的新密码不能为空!");
                        $('p').html("输入的新密码不能为空!");
                        return false;
                    } else if ($.trim($("#newPassword").val()).length < 6) {
                        //$.alert("输入新密码的长度至少为6位!");
                        $('p').html("输入新密码的长度至少为6位!");
                        $("#newPassword").focus();
                        return false;
                    } else {
                        if ($.trim($("#newPassword").val()) != $.trim($("#reNewPassword").val())) {//前后两次输入的新密码不一致
                            //$.alert("前后两次输入的新密码不一致!");
                            $('p').html("前后两次输入的新密码不一致!");
                            return false;
                        } else {
                            var userinfo = '?oldPassword=' + $.trim($("#oldPassword").val()) + '&newPassword=' + $.trim($("#newPassword").val()) + '&random=' + Math.random();
                            $.ajax({
                                type: 'GET',
afe's avatar
afe committed
491
                                contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
492 493 494
                                url: encodeURI(encodeURI('${ctx}/BaseManage/AuthorityManage/modifyPassword' + userinfo)),
                                dataType: 'text',
                                beforeSend: function (data) {
afe's avatar
afe committed
495
                                },
496
                                success: function (data) {
afe's avatar
afe committed
497
                                    data = JSON.parse(data);
498 499 500 501 502 503 504 505 506
                                    if (data == "oldPasswordError") {
                                        //    $.alert("旧密码输入有误,请重新登录!");
                                        modifyPassword();
                                        $('p').html("旧密码输入有误,请重新输入!");
                                        //     window.location.href = "${ctx}/logout";
                                    } else if (data == "success") {
                                        $.alert("修改密码成功!");
                                    } else {
                                        $.alert("修改密码失败!");
afe's avatar
afe committed
507
                                    }
508

afe's avatar
afe committed
509 510 511
                                }
                            });

512 513 514 515 516 517 518 519 520 521 522 523 524 525
                        }
                    }

                }
            },
                {
                    value: "取消",
                    callback: function () {
                    }
                }],
            lock: false
        });

    }
afe's avatar
afe committed
526
</script>