Commit dfab6eb47926ba58a503cec3d5e0fd1220fec337
1 parent
3c08b97c
1.
Showing
3 changed files
with
1258 additions
and
1239 deletions
src/main/resources/static/index.html
| 1 | -<!DOCTYPE html> | |
| 2 | -<html lang="zh"> | |
| 3 | -<head> | |
| 4 | - <meta name="renderer" content="webkit" /> | |
| 5 | - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| 6 | - <meta charset="UTF-8"> | |
| 7 | - <title>调度系统</title> | |
| 8 | - | |
| 9 | - <meta http-equiv="Pragma" content="no-cache"> | |
| 10 | - <meta http-equiv="Cache-control" content="no-cache"> | |
| 11 | - <meta http-equiv="Cache" content="no-cache"> | |
| 12 | - | |
| 13 | - <!-- Font Awesome 图标字体 --> | |
| 14 | - <link | |
| 15 | - href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | |
| 16 | - rel="stylesheet" type="text/css" /> | |
| 17 | - <!-- Bootstrap style --> | |
| 18 | - <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | |
| 19 | - rel="stylesheet" type="text/css" /> | |
| 20 | - <!-- jsTree 数插件 --> | |
| 21 | - <link | |
| 22 | - href="/metronic_v4.5.4/plugins/jstree/dist/themes/default/style.min.css" | |
| 23 | - rel="stylesheet" type="text/css" /> | |
| 24 | - <!-- MULTI-select 多选下拉框美化 --> | |
| 25 | - <link | |
| 26 | - href="/metronic_v4.5.4/plugins/jquery-multi-select/css/multi-select.css" | |
| 27 | - rel="stylesheet" type="text/css" /> | |
| 28 | - | |
| 29 | - <!-- editable --> | |
| 30 | - <link | |
| 31 | - href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" | |
| 32 | - rel="stylesheet" type="text/css" /> | |
| 33 | - <!-- METRONIC style --> | |
| 34 | - <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" | |
| 35 | - rel="stylesheet" type="text/css" id="style_color" /> | |
| 36 | - <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | |
| 37 | - type="text/css" /> | |
| 38 | - <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" | |
| 39 | - type="text/css" /> | |
| 40 | - <link href="/metronic_v4.5.4/layout4/css/layout.min.css" | |
| 41 | - rel="stylesheet" type="text/css" /> | |
| 42 | - <link href="/metronic_v4.5.4/layout4/css/custom.min.css" | |
| 43 | - rel="stylesheet" type="text/css" /> | |
| 44 | - <!-- select2 下拉框插件 --> | |
| 45 | - <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" | |
| 46 | - rel="stylesheet" type="text/css" /> | |
| 47 | - <link | |
| 48 | - href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" | |
| 49 | - rel="stylesheet" type="text/css" /> | |
| 50 | - <!-- layer 弹层 插件 --> | |
| 51 | - <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | |
| 52 | - rel="stylesheet" type="text/css" /> | |
| 53 | - <!-- fileinput 上传 插件 --> | |
| 54 | - <link href="/assets/plugins/fileinput/css/fileinput.min.css" | |
| 55 | - rel="stylesheet" type="text/css" /> | |
| 56 | - <!-- iCheck 单选框和复选框 --> | |
| 57 | - <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" | |
| 58 | - rel="stylesheet" type="text/css" /> | |
| 59 | - <!-- 日期控件 --> | |
| 60 | - <link | |
| 61 | - href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | |
| 62 | - rel="stylesheet" type="text/css" /> | |
| 63 | - <!-- table 表格控件 --> | |
| 64 | - <!--<link rel="stylesheet"--> | |
| 65 | - <!--href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"--> | |
| 66 | - <!--type="text/css" />--> | |
| 67 | - <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/> | |
| 68 | - <!-- handsontable样式 --> | |
| 69 | - <link rel="stylesheet" | |
| 70 | - href="/assets/bower_components/handsontable/dist/handsontable.full.css" /> | |
| 71 | - <!-- sweetalert样式 --> | |
| 72 | - <link rel="stylesheet" | |
| 73 | - href="/assets/bower_components/sweetalert/dist/sweetalert.css" /> | |
| 74 | - <!-- schedule计划调度AngularJS模块主css --> | |
| 75 | - <link rel="stylesheet" href="/pages/scheduleApp/module/common/main.css" | |
| 76 | - type="text/css" /> | |
| 77 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | |
| 78 | - | |
| 79 | - <!-- CSS动画 --> | |
| 80 | - <link | |
| 81 | - href="/metronic_v4.5.4/plugins/tipso/css/animate.css" | |
| 82 | - rel="stylesheet" type="text/css" /> | |
| 83 | - | |
| 84 | - <!-- 提示工具样式 --> | |
| 85 | - <link | |
| 86 | - href="/metronic_v4.5.4/plugins/tipso/css/tipso.css" | |
| 87 | - rel="stylesheet" type="text/css" /> | |
| 88 | - | |
| 89 | - <style type="text/css"> | |
| 90 | - .searchForm { | |
| 91 | - | |
| 92 | - } | |
| 93 | - | |
| 94 | - .searchForm .form-group .control-label { | |
| 95 | - padding-right: 0px; | |
| 96 | - text-align: right; | |
| 97 | - margin-top: 7px; | |
| 98 | - } | |
| 99 | - | |
| 100 | - .searchForm .form-group>div { | |
| 101 | - padding-left: 10px; | |
| 102 | - padding-right: 0px; | |
| 103 | - } | |
| 104 | - | |
| 105 | - .searchForm .row>div { | |
| 106 | - padding-left: 0px; | |
| 107 | - padding-right: 0px; | |
| 108 | - padding: 5px 0 5px 0; | |
| 109 | - width: 270px; | |
| 110 | - display: inline-block; | |
| 111 | - } | |
| 112 | - | |
| 113 | - .searchForm .form-actions { | |
| 114 | - | |
| 115 | - } | |
| 116 | - | |
| 117 | - tr.row-active td { | |
| 118 | - border-bottom: 1px solid blue !important; | |
| 119 | - color: blue; | |
| 120 | - } | |
| 121 | - | |
| 122 | - .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | |
| 123 | - { | |
| 124 | - font-size: 14px; | |
| 125 | - } | |
| 126 | - | |
| 127 | - .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | |
| 128 | - { | |
| 129 | - padding: 6px 26px; | |
| 130 | - } | |
| 131 | - | |
| 132 | - .ms-container .ms-list { | |
| 133 | - height: 306px; | |
| 134 | - } | |
| 135 | - | |
| 136 | - .ms-container .ms-selectable,.ms-container .ms-selection { | |
| 137 | - width: 47%; | |
| 138 | - } | |
| 139 | - | |
| 140 | - .ms-container { | |
| 141 | - width: 470px; | |
| 142 | - margin: auto; | |
| 143 | - } | |
| 144 | - | |
| 145 | - .multi-custom-header-left { | |
| 146 | - text-align: center; | |
| 147 | - padding: 7px; | |
| 148 | - color: #3B3F51; | |
| 149 | - } | |
| 150 | - | |
| 151 | - .multi-custom-header-right { | |
| 152 | - text-align: center; | |
| 153 | - padding: 7px; | |
| 154 | - font-weight: bold; | |
| 155 | - color: #36C6D3; | |
| 156 | - } | |
| 157 | - | |
| 158 | - .mt-element-list .list-simple.mt-list-container ul>.mt-list-item>.list-item-content | |
| 159 | - { | |
| 160 | - padding: 0 55px 0 0px; | |
| 161 | - } | |
| 162 | - | |
| 163 | - .mt-element-list .list-simple.mt-list-container ul>.mt-list-item { | |
| 164 | - padding: 3.3px 0; | |
| 165 | - } | |
| 166 | - | |
| 167 | - #route-container { | |
| 168 | - display: none; | |
| 169 | - } | |
| 170 | - | |
| 171 | - .page-content.active { | |
| 172 | - display: block !important; | |
| 173 | - } | |
| 174 | - | |
| 175 | - .page-header.navbar .page-logo .logo-default { | |
| 176 | - margin: 0; | |
| 177 | - } | |
| 178 | - | |
| 179 | - .page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle | |
| 180 | - { | |
| 181 | - background-color: #284a99; | |
| 182 | - } | |
| 183 | - | |
| 184 | - .page-header.navbar .page-logo { | |
| 185 | - padding-right: 10px; | |
| 186 | - } | |
| 187 | - | |
| 188 | - .page-logo .logo-default.logo-default-text { | |
| 189 | - font-weight: 600; | |
| 190 | - color: white !important; | |
| 191 | - margin-top: 19px !important; | |
| 192 | - font-size: 24px; | |
| 193 | - text-decoration: none; | |
| 194 | - } | |
| 195 | - | |
| 196 | - .page-logo .logo-default.logo-default-text:HOVER { | |
| 197 | - color: #dedede !important; | |
| 198 | - } | |
| 199 | - | |
| 200 | - body,.page-content-wrapper,#pjax-container{ | |
| 201 | - height: 100%; | |
| 202 | - } | |
| 203 | - html{ | |
| 204 | - height: 90%; | |
| 205 | - } | |
| 206 | - .page-container{ | |
| 207 | - height: 100%; | |
| 208 | - } | |
| 209 | - </style> | |
| 210 | - | |
| 211 | - <!-- ocLazyLoading载入文件的位置 --> | |
| 212 | - <link id="ng_load_plugins_before" /> | |
| 213 | - | |
| 214 | -</head> | |
| 215 | -<body | |
| 216 | - class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed"> | |
| 217 | -<div class="page-header navbar navbar-fixed-top" | |
| 218 | - style="background: linear-gradient(to bottom, #124e78, #125688);"> | |
| 219 | - <div class="page-header-inner "> | |
| 220 | - <!-- LOGO --> | |
| 221 | - <div class="page-logo"> | |
| 222 | - <a href="index.html" class="logo-default logo-default-text"> | |
| 223 | - 闵行公交调度系统 </a> | |
| 224 | - <div class="menu-toggler sidebar-toggler"></div> | |
| 225 | - </div> | |
| 226 | - <!-- END LOGO --> | |
| 227 | - <a href="javascript:;" class="menu-toggler responsive-toggler" | |
| 228 | - data-toggle="collapse" data-target=".navbar-collapse"> </a> | |
| 229 | - <div class="page-top"> | |
| 230 | - <div class="top-menu"> | |
| 231 | - <ul class="nav navbar-nav pull-right"> | |
| 232 | - <!-- 信息通知区 --> | |
| 233 | - <li | |
| 234 | - class="dropdown dropdown-extended dropdown-notification dropdown-dark" | |
| 235 | - id="header_notification_bar"><a href="javascript:;" | |
| 236 | - class="dropdown-toggle" data-toggle="dropdown" | |
| 237 | - data-hover="dropdown" data-close-others="true"> <i | |
| 238 | - class="fa fa-bell"></i> <span class="badge badge-success"> | |
| 239 | - 0 </span> | |
| 240 | - </a> | |
| 241 | - <ul class="dropdown-menu" style="max-width: 345px; width: 345px;"> | |
| 242 | - <li class="external"> | |
| 243 | - <h3> | |
| 244 | - 今日 <span class="bold">0 条</span> 通知 | |
| 245 | - </h3> <a href="javascript:;">查看全部</a> | |
| 246 | - </li> | |
| 247 | - <li> | |
| 248 | - <ul class="dropdown-menu-list scroller" style="height: 250px;" | |
| 249 | - data-handle-color="#637283"> | |
| 250 | - </ul> | |
| 251 | - </li> | |
| 252 | - </ul></li> | |
| 253 | - <li class="dropdown dropdown-user dropdown-dark"><a | |
| 254 | - href="javascript:;" class="dropdown-toggle" | |
| 255 | - data-toggle="dropdown" data-hover="dropdown" | |
| 256 | - data-close-others="true"> <span id="indexTopUName" | |
| 257 | - class="username username-hide-on-mobile" | |
| 258 | - style="vertical-align: middle;"> <i class="fa fa-user"></i></span> | |
| 259 | - </a> | |
| 260 | - <ul class="dropdown-menu dropdown-menu-default"> | |
| 261 | - <li><a href="javascript:;"> <i class="fa fa-user"></i> | |
| 262 | - 我的信息 | |
| 263 | - </a></li> | |
| 264 | - <li><a href="javascript:;" id="changePWD"> <i | |
| 265 | - class="fa fa-unlock-alt"></i> 修改密码 | |
| 266 | - </a></li> | |
| 267 | - <li class="divider"></li> | |
| 268 | - <li><a href="javascript:;"> <i class="fa fa-lock"></i> | |
| 269 | - 锁屏 | |
| 270 | - </a></li> | |
| 271 | - <li><a href="/logout"> <i class="fa fa-key"></i> 注销登陆 | |
| 272 | - </a></li> | |
| 273 | - </ul></li> | |
| 274 | - </ul> | |
| 275 | - </div> | |
| 276 | - </div> | |
| 277 | - </div> | |
| 278 | -</div> | |
| 279 | -<div class="page-container"> | |
| 280 | - <div class="page-sidebar-wrapper"> | |
| 281 | - <div class="page-sidebar navbar-collapse collapse"> | |
| 282 | - <ul class="page-sidebar-menu page-sidebar-menu-fixed" | |
| 283 | - data-keep-expanded="false" data-auto-scroll="true" | |
| 284 | - data-slide-speed="200" id="leftMenuSidebar"> | |
| 285 | - </ul> | |
| 286 | - </div> | |
| 287 | - </div> | |
| 288 | - <div class="page-content-wrapper"> | |
| 289 | - <div id="pjax-container" class="page-content"></div> | |
| 290 | - <a name="xd_position"></a> | |
| 291 | - <div id="route-container"> | |
| 292 | - <div ng-app="ScheduleApp"> | |
| 293 | - <div ng-controller="ScheduleAppController"> | |
| 294 | - | |
| 295 | - <!-- loading widget --> | |
| 296 | - <div id="loadingWidget" class="flyover mask" loading-widget> | |
| 297 | - <div class="alert alert-info"> | |
| 298 | - <strong>载入中......</strong> | |
| 299 | - </div> | |
| 300 | - </div> | |
| 301 | - | |
| 302 | - <div ui-view class="uv"></div> | |
| 303 | - </div> | |
| 304 | - </div> | |
| 305 | - </div> | |
| 306 | - </div> | |
| 307 | -</div> | |
| 308 | - | |
| 309 | -<script id="menu_list_temp" type="text/html"> | |
| 310 | - {{each list as group i}} | |
| 311 | - <li class="heading"> | |
| 312 | - <h3 class="uppercase">{{group.name}}</h3> | |
| 313 | - </li> | |
| 314 | - {{each group.children as dir j}} | |
| 315 | - <li class="nav-item"> | |
| 316 | - <a href="javascript:;" class="nav-link nav-toggle "> | |
| 317 | - <i class="{{dir.icon}}"></i> | |
| 318 | - <span class="title">{{dir.name}}</span> | |
| 319 | - <span class="arrow"></span> | |
| 320 | - </a> | |
| 321 | - <ul class="sub-menu"> | |
| 322 | - {{each dir.children as module s}} | |
| 323 | - <li class="nav-item "> | |
| 324 | - {{if module.container=="pjax-container"}} | |
| 325 | - <a href="/pages/{{module.path}}" class="nav-link " data-pjax> | |
| 326 | - <span class="title">{{module.name}}</span> | |
| 327 | - </a> | |
| 328 | - {{else}} | |
| 329 | - <a href="{{module.path}}" class="nav-link " data-angularjs> | |
| 330 | - <span class="title">{{module.name}}</span> | |
| 331 | - </a> | |
| 332 | - {{/if}} | |
| 333 | - </li> | |
| 334 | - {{/each}} | |
| 335 | - </ul> | |
| 336 | - </li> | |
| 337 | - {{/each}} | |
| 338 | - {{/each}} | |
| 339 | - | |
| 340 | -</script> | |
| 341 | -<script> | |
| 342 | - delete window.require; | |
| 343 | - delete window.exports; | |
| 344 | - delete window.module; | |
| 345 | -</script> | |
| 346 | -<!-- jQuery --> | |
| 347 | -<script src="/metronic_v4.5.4/plugins/jquery.min.js" data-exclude=1></script> | |
| 348 | -<!-- bootstrap --> | |
| 349 | -<script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" | |
| 350 | - data-exclude=1></script> | |
| 351 | -<script src="/pages/forms/statement/js/jquery.autocompleter.js"></script> | |
| 352 | -<script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | |
| 353 | -<!-- MTRONIC JS --> | |
| 354 | -<script src="/metronic_v4.5.4/scripts/app.min.js" data-exclude=1></script> | |
| 355 | -<script src="/metronic_v4.5.4/layout4/scripts/layout.min.js" | |
| 356 | - data-exclude=1></script> | |
| 357 | -<!-- 虚拟滚动条 --> | |
| 358 | -<script | |
| 359 | - src="/metronic_v4.5.4/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script> | |
| 360 | -<!-- jsTree 树插件 --> | |
| 361 | -<script src="/metronic_v4.5.4/plugins/jstree/dist/jstree.min.js"></script> | |
| 362 | -<!-- bootstrap-hover-dropDown --> | |
| 363 | -<script | |
| 364 | - src="/metronic_v4.5.4/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script> | |
| 365 | -<!-- jquery.validate 表单验证 --> | |
| 366 | -<script | |
| 367 | - src="/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.min.js"></script> | |
| 368 | -<script | |
| 369 | - src="/metronic_v4.5.4/plugins/jquery-validation/js/localization/messages_zh.js"></script> | |
| 370 | -<!-- 向导式插件 --> | |
| 371 | -<script | |
| 372 | - src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script> | |
| 373 | -<!-- iCheck 单选框和复选框 --> | |
| 374 | -<script src="/metronic_v4.5.4/plugins/icheck/icheck.min.js"></script> | |
| 375 | -<!-- select2 下拉框 --> | |
| 376 | -<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | |
| 377 | -<!-- MULTI SELECT 多选下拉框 --> | |
| 378 | -<script | |
| 379 | - src="/metronic_v4.5.4/plugins/jquery-multi-select/js/jquery.multi-select.js"></script> | |
| 380 | -<!-- editable.js --> | |
| 381 | -<script | |
| 382 | - src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script> | |
| 383 | -<!-- PJAX --> | |
| 384 | -<script src="/assets/plugins/jquery.pjax.js"></script> | |
| 385 | -<!-- layer 弹层 --> | |
| 386 | -<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script> | |
| 387 | -<!-- fileinput 上传 --> | |
| 388 | -<script src="/assets/plugins/fileinput/canvas-to-blob.min.js"></script> | |
| 389 | -<script src="/assets/plugins/fileinput/purify.min.js"></script> | |
| 390 | -<script src="/assets/plugins/fileinput/sortable.min.js"></script> | |
| 391 | -<script src="/assets/plugins/fileinput/fileinput.min.js"></script> | |
| 392 | -<script src="/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | |
| 393 | -<!-- jquery.purl URL解析 --> | |
| 394 | -<script src="/assets/plugins/purl.js"></script> | |
| 395 | -<!-- jquery.serializejson JSON序列化插件 --> | |
| 396 | -<script src="/assets/plugins/jquery.serializejson.js"></script> | |
| 397 | -<!-- art-template 模版引擎 --> | |
| 398 | -<script src="/assets/plugins/template.js"></script> | |
| 399 | -<!-- jquery.pageinator 分页 --> | |
| 400 | -<script src="/assets/plugins/jqPaginator.min.js"></script> | |
| 401 | -<!-- moment.js 日期处理类库 --> | |
| 402 | -<script src="/assets/plugins/moment-with-locales.js"></script> | |
| 403 | - | |
| 404 | -<script src="/assets/plugins/pinyin.js"></script> | |
| 405 | -<!-- 日期控件 --> | |
| 406 | -<script | |
| 407 | - src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | |
| 408 | -<!-- 表格控件 --> | |
| 409 | -<script src="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script> | |
| 410 | -<!-- 统计图控件 --> | |
| 411 | -<!--<script src="/assets/global/getEchart.js"></script> | |
| 412 | -<script src="/assets/global/echarts.js"></script> --> | |
| 413 | -<script src="/assets/js/common.js"></script> | |
| 414 | -<script src="/assets/js/dictionary.js"></script> | |
| 415 | -<!-- tipso JS --> | |
| 416 | -<script src="/metronic_v4.5.4/plugins/tipso/js/tipso.js"></script> | |
| 417 | -<script data-exclude=1> | |
| 418 | - //初始打开的片段地址 | |
| 419 | - var initFragment = "^_^initFragment^_^"; | |
| 420 | - //静态文件目录 | |
| 421 | - var dir = '/pages/'; | |
| 422 | - //片段容器 | |
| 423 | - var pjaxContainer = '#pjax-container' | |
| 424 | - , angJsContainer = '#route-container'; | |
| 425 | - | |
| 426 | - $(document).ajaxError(function (event, jqxhr, settings, thrownError) { | |
| 427 | - if(jqxhr.status == 403){ | |
| 428 | - layer.closeAll(); | |
| 429 | - layer.alert(jqxhr.message?jqxhr.message:'访问被拒绝', {icon: 2, title: '操作失败'}); | |
| 430 | - } | |
| 431 | - }); | |
| 432 | - | |
| 433 | - $(function () { | |
| 434 | - $.get('/user/currentUser', function (user) { | |
| 435 | - $('#indexTopUName').text(user.userName); | |
| 436 | - }); | |
| 437 | - | |
| 438 | - //带 data-pjax 的链接由pjax加载 | |
| 439 | - $(document).pjax('a[data-pjax]', pjaxContainer); | |
| 440 | - | |
| 441 | - //pjax左菜单点击事件 | |
| 442 | - $(document).on('click', '#leftMenuSidebar a[data-pjax]', function () { | |
| 443 | - setTitle(this); | |
| 444 | - | |
| 445 | - $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | |
| 446 | - $(this).parent().addClass('active'); | |
| 447 | - showPjax(); | |
| 448 | - }); | |
| 449 | - | |
| 450 | - //angularjs左菜单点击事件 | |
| 451 | - $(document).on('click', '#leftMenuSidebar a[data-angularjs]', function () { | |
| 452 | - setTitle(this); | |
| 453 | - | |
| 454 | - $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | |
| 455 | - $(this).parent().addClass('active'); | |
| 456 | - showAngJs(); | |
| 457 | - }); | |
| 458 | - | |
| 459 | - //加载左菜单栏 | |
| 460 | - $get('/module/findByCurrentUser', null, | |
| 461 | - function (ms) { | |
| 462 | - var treeArray = createTreeData(ms); | |
| 463 | - treeArray.sort(function (a, b) { | |
| 464 | - return a.createDate - b.createDate; | |
| 465 | - }); | |
| 466 | - var menuHtml = template('menu_list_temp', {list: treeArray}); | |
| 467 | - $('#leftMenuSidebar').html(menuHtml); | |
| 468 | - | |
| 469 | - //----------- 检查URL ---------------- | |
| 470 | - var h = location.hash; | |
| 471 | - if (initFragment && initFragment != '') { | |
| 472 | - showPjax(); | |
| 473 | - //普通片段 | |
| 474 | - loadPage(initFragment); | |
| 475 | - //选中菜单 | |
| 476 | - $.each($('#leftMenuSidebar a'), function (i, item) { | |
| 477 | - if (urlPattern($(item).attr('href'), initFragment)) { | |
| 478 | - activeLeftMenu(item); | |
| 479 | - } | |
| 480 | - }); | |
| 481 | - } else if (h) { | |
| 482 | - //angularjs片段 | |
| 483 | - showAngJs(); | |
| 484 | - //选中菜单 | |
| 485 | - $.each($('#leftMenuSidebar a'), function (i, item) { | |
| 486 | - if ($(item).attr('href') == h) { | |
| 487 | - activeLeftMenu(item); | |
| 488 | - } | |
| 489 | - }); | |
| 490 | - } | |
| 491 | - else { | |
| 492 | - //加载主页 | |
| 493 | - loadPage('/pages/home.html'); | |
| 494 | - } | |
| 495 | - }); | |
| 496 | - | |
| 497 | - //修改密码 | |
| 498 | - $('#changePWD').on('click', function () { | |
| 499 | - $.get('/pages/permission/user/changePWD.html', function (content) { | |
| 500 | - layer.open({ | |
| 501 | - type: 1, | |
| 502 | - area: ['600px', '360px'], | |
| 503 | - content: content, | |
| 504 | - title: '修改密码', | |
| 505 | - shift: 5, | |
| 506 | - scrollbar: false, | |
| 507 | - success: function () { | |
| 508 | - } | |
| 509 | - }); | |
| 510 | - }); | |
| 511 | - }); | |
| 512 | - }); | |
| 513 | - | |
| 514 | - //modal关闭时销毁dom | |
| 515 | - $(document).on('hidden.bs.modal', '.modal', function () { | |
| 516 | - $(this).remove(); | |
| 517 | - }); | |
| 518 | - | |
| 519 | - //pjax加载完成事件 | |
| 520 | - $(document).on('pjax:success', function () { | |
| 521 | - var dicts = $(pjaxContainer).find('.nt-dictionary'); | |
| 522 | - dictionaryUtils.transformDom(dicts); | |
| 523 | - }); | |
| 524 | - | |
| 525 | - function loadPage(url) { | |
| 526 | - $.pjax({url: url, container: pjaxContainer}) | |
| 527 | - } | |
| 528 | - | |
| 529 | - function urlPattern(a, b) { | |
| 530 | - var r; | |
| 531 | - try { | |
| 532 | - r = a.substring(0, a.lastIndexOf('/')) == b.substring(0, b.lastIndexOf('/')); | |
| 533 | - } catch (e) { | |
| 534 | - r = false; | |
| 535 | - } | |
| 536 | - return r; | |
| 537 | - } | |
| 538 | - | |
| 539 | - function showPjax() { | |
| 540 | - $(angJsContainer).removeClass('page-content active').hide(); | |
| 541 | - $(pjaxContainer).addClass('page-content active'); | |
| 542 | - } | |
| 543 | - | |
| 544 | - function showAngJs() { | |
| 545 | - $(pjaxContainer).html('').removeClass('page-content active').hide(); | |
| 546 | - $(angJsContainer).addClass('page-content active'); | |
| 547 | - } | |
| 548 | - | |
| 549 | - function activeLeftMenu(item) { | |
| 550 | - $(item).parent('.nav-item').addClass('active').parent('.sub-menu').show().parent().addClass('open'); | |
| 551 | - setTitle(item); | |
| 552 | - } | |
| 553 | - | |
| 554 | - function setTitle(menuItem){ | |
| 555 | - document.title = $('span.title', menuItem).text(); | |
| 556 | - } | |
| 557 | - | |
| 558 | -</script> | |
| 559 | -<!-- d3 --> | |
| 560 | -<script src="/assets/js/d3.min.js" data-exclude=1></script> | |
| 561 | -<!-- webSocket JS --> | |
| 562 | -<script src="/assets/js/sockjs.min.js"></script> | |
| 563 | - | |
| 564 | -<!-- TODO:angularJS相关库 --> | |
| 565 | - | |
| 566 | -<!-- angularJS相关库 --> | |
| 567 | -<!-- 这个是基于angularjs 1.4.10修改的版本,主要是修改了history控制部分,用于兼容route和pjax的同时操作history的冲突 --> | |
| 568 | -<script src="/assets/js/angular.js" data-autocephaly=1></script> | |
| 569 | -<script src="/assets/bower_components/angular-i18n/angular-locale_zh-cn.js" data-autocephaly=1></script> | |
| 570 | -<script | |
| 571 | - src="/assets/bower_components/angular-resource/angular-resource.min.js" | |
| 572 | - data-exclude=1></script> | |
| 573 | -<script | |
| 574 | - src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" | |
| 575 | - data-exclude=1></script> | |
| 576 | -<script | |
| 577 | - src="/assets/bower_components/angular-animate/angular-animate.min.js" | |
| 578 | - data-exclude=1></script> | |
| 579 | -<script | |
| 580 | - src="/assets/bower_components/angular-touch/angular-touch.min.js" | |
| 581 | - data-exclude=1></script> | |
| 582 | -<script | |
| 583 | - src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" | |
| 584 | - data-exclude=1></script> | |
| 585 | -<script | |
| 586 | - src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" | |
| 587 | - data-exclude=1></script> | |
| 588 | -<script | |
| 589 | - src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" | |
| 590 | - data-exclude=1></script> | |
| 591 | -<!-- handsontable相关js --> | |
| 592 | -<script | |
| 593 | - src="/assets/bower_components/handsontable/dist/handsontable.full.js"></script> | |
| 594 | -<script | |
| 595 | - src="/assets/bower_components/ngHandsontable/dist/ngHandsontable.js"></script> | |
| 596 | -<!-- sweetalert相关js --> | |
| 597 | -<script src="/assets/bower_components/sweetalert/dist/sweetalert.min.js"></script> | |
| 598 | -<script src="/assets/bower_components/ng-sweet-alert/ng-sweet-alert.js"></script> | |
| 599 | - | |
| 600 | -<!-- schedule计划调度AngularJS模块主JS --> | |
| 601 | -<script src="/pages/scheduleApp/module/common/main.js" data-exclude=1></script> | |
| 602 | -<script | |
| 603 | - src="/pages/scheduleApp/module/common/prj-common-globalservice.js" | |
| 604 | - data-exclude=1></script> | |
| 605 | -<script src="/pages/scheduleApp/module/common/prj-common-filter.js" | |
| 606 | - data-exclude=1></script> | |
| 607 | -<script src="/pages/scheduleApp/module/common/prj-common-directive.js" | |
| 608 | - data-exclude=1></script> | |
| 609 | -<script | |
| 610 | - src="/pages/scheduleApp/module/common/prj-common-ui-route-state.js" | |
| 611 | - data-exclude=1></script> | |
| 612 | - | |
| 613 | -<!-- 地图相关 --> | |
| 614 | -<!-- 百度 --> | |
| 615 | -<script | |
| 616 | - src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" | |
| 617 | - data-exclude=1></script> | |
| 618 | -<script | |
| 619 | - src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js" | |
| 620 | - data-exclude=1></script> | |
| 621 | -<script type="text/javascript" | |
| 622 | - src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js" | |
| 623 | - data-exclude=1></script> | |
| 624 | -<script type="text/javascript" | |
| 625 | - src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js " | |
| 626 | - data-exclude=1></script> | |
| 627 | -<script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script> | |
| 628 | -<script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script> | |
| 629 | -<!-- 高德 --> | |
| 630 | -<script | |
| 631 | - src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" | |
| 632 | - data-exclude=1></script> | |
| 633 | -<!-- echarts4 误删 --> | |
| 634 | -<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> | |
| 635 | - | |
| 636 | -</body> | |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh"> | |
| 3 | +<head> | |
| 4 | + <meta name="renderer" content="webkit" /> | |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| 6 | + <meta charset="UTF-8"> | |
| 7 | + <title>调度系统</title> | |
| 8 | + | |
| 9 | + <meta http-equiv="Pragma" content="no-cache"> | |
| 10 | + <meta http-equiv="Cache-control" content="no-cache"> | |
| 11 | + <meta http-equiv="Cache" content="no-cache"> | |
| 12 | + | |
| 13 | + <!-- Font Awesome 图标字体 --> | |
| 14 | + <link | |
| 15 | + href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | |
| 16 | + rel="stylesheet" type="text/css" /> | |
| 17 | + <!-- Bootstrap style --> | |
| 18 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | |
| 19 | + rel="stylesheet" type="text/css" /> | |
| 20 | + <!-- jsTree 数插件 --> | |
| 21 | + <link | |
| 22 | + href="/metronic_v4.5.4/plugins/jstree/dist/themes/default/style.min.css" | |
| 23 | + rel="stylesheet" type="text/css" /> | |
| 24 | + <!-- MULTI-select 多选下拉框美化 --> | |
| 25 | + <link | |
| 26 | + href="/metronic_v4.5.4/plugins/jquery-multi-select/css/multi-select.css" | |
| 27 | + rel="stylesheet" type="text/css" /> | |
| 28 | + | |
| 29 | + <!-- editable --> | |
| 30 | + <link | |
| 31 | + href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" | |
| 32 | + rel="stylesheet" type="text/css" /> | |
| 33 | + <!-- METRONIC style --> | |
| 34 | + <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" | |
| 35 | + rel="stylesheet" type="text/css" id="style_color" /> | |
| 36 | + <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | |
| 37 | + type="text/css" /> | |
| 38 | + <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" | |
| 39 | + type="text/css" /> | |
| 40 | + <link href="/metronic_v4.5.4/layout4/css/layout.min.css" | |
| 41 | + rel="stylesheet" type="text/css" /> | |
| 42 | + <link href="/metronic_v4.5.4/layout4/css/custom.min.css" | |
| 43 | + rel="stylesheet" type="text/css" /> | |
| 44 | + <!-- select2 下拉框插件 --> | |
| 45 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" | |
| 46 | + rel="stylesheet" type="text/css" /> | |
| 47 | + <link | |
| 48 | + href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" | |
| 49 | + rel="stylesheet" type="text/css" /> | |
| 50 | + <!-- layer 弹层 插件 --> | |
| 51 | + <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | |
| 52 | + rel="stylesheet" type="text/css" /> | |
| 53 | + <!-- fileinput 上传 插件 --> | |
| 54 | + <link href="/assets/plugins/fileinput/css/fileinput.min.css" | |
| 55 | + rel="stylesheet" type="text/css" /> | |
| 56 | + <!-- iCheck 单选框和复选框 --> | |
| 57 | + <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" | |
| 58 | + rel="stylesheet" type="text/css" /> | |
| 59 | + <!-- 日期控件 --> | |
| 60 | + <link | |
| 61 | + href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | |
| 62 | + rel="stylesheet" type="text/css" /> | |
| 63 | + <!-- table 表格控件 --> | |
| 64 | + <!--<link rel="stylesheet"--> | |
| 65 | + <!--href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"--> | |
| 66 | + <!--type="text/css" />--> | |
| 67 | + <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/> | |
| 68 | + <!-- handsontable样式 --> | |
| 69 | + <link rel="stylesheet" | |
| 70 | + href="/assets/bower_components/handsontable/dist/handsontable.full.css" /> | |
| 71 | + <!-- sweetalert样式 --> | |
| 72 | + <link rel="stylesheet" | |
| 73 | + href="/assets/bower_components/sweetalert/dist/sweetalert.css" /> | |
| 74 | + <!-- schedule计划调度AngularJS模块主css --> | |
| 75 | + <link rel="stylesheet" href="/pages/scheduleApp/module/common/main.css" | |
| 76 | + type="text/css" /> | |
| 77 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | |
| 78 | + | |
| 79 | + <!-- CSS动画 --> | |
| 80 | + <link | |
| 81 | + href="/metronic_v4.5.4/plugins/tipso/css/animate.css" | |
| 82 | + rel="stylesheet" type="text/css" /> | |
| 83 | + | |
| 84 | + <!-- 提示工具样式 --> | |
| 85 | + <link | |
| 86 | + href="/metronic_v4.5.4/plugins/tipso/css/tipso.css" | |
| 87 | + rel="stylesheet" type="text/css" /> | |
| 88 | + | |
| 89 | + <style type="text/css"> | |
| 90 | + .searchForm { | |
| 91 | + | |
| 92 | + } | |
| 93 | + | |
| 94 | + .searchForm .form-group .control-label { | |
| 95 | + padding-right: 0px; | |
| 96 | + text-align: right; | |
| 97 | + margin-top: 7px; | |
| 98 | + } | |
| 99 | + | |
| 100 | + .searchForm .form-group>div { | |
| 101 | + padding-left: 10px; | |
| 102 | + padding-right: 0px; | |
| 103 | + } | |
| 104 | + | |
| 105 | + .searchForm .row>div { | |
| 106 | + padding-left: 0px; | |
| 107 | + padding-right: 0px; | |
| 108 | + padding: 5px 0 5px 0; | |
| 109 | + width: 270px; | |
| 110 | + display: inline-block; | |
| 111 | + } | |
| 112 | + | |
| 113 | + .searchForm .form-actions { | |
| 114 | + | |
| 115 | + } | |
| 116 | + | |
| 117 | + tr.row-active td { | |
| 118 | + border-bottom: 1px solid blue !important; | |
| 119 | + color: blue; | |
| 120 | + } | |
| 121 | + | |
| 122 | + .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | |
| 123 | + { | |
| 124 | + font-size: 14px; | |
| 125 | + } | |
| 126 | + | |
| 127 | + .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | |
| 128 | + { | |
| 129 | + padding: 6px 26px; | |
| 130 | + } | |
| 131 | + | |
| 132 | + .ms-container .ms-list { | |
| 133 | + height: 306px; | |
| 134 | + } | |
| 135 | + | |
| 136 | + .ms-container .ms-selectable,.ms-container .ms-selection { | |
| 137 | + width: 47%; | |
| 138 | + } | |
| 139 | + | |
| 140 | + .ms-container { | |
| 141 | + width: 470px; | |
| 142 | + margin: auto; | |
| 143 | + } | |
| 144 | + | |
| 145 | + .multi-custom-header-left { | |
| 146 | + text-align: center; | |
| 147 | + padding: 7px; | |
| 148 | + color: #3B3F51; | |
| 149 | + } | |
| 150 | + | |
| 151 | + .multi-custom-header-right { | |
| 152 | + text-align: center; | |
| 153 | + padding: 7px; | |
| 154 | + font-weight: bold; | |
| 155 | + color: #36C6D3; | |
| 156 | + } | |
| 157 | + | |
| 158 | + .mt-element-list .list-simple.mt-list-container ul>.mt-list-item>.list-item-content | |
| 159 | + { | |
| 160 | + padding: 0 55px 0 0px; | |
| 161 | + } | |
| 162 | + | |
| 163 | + .mt-element-list .list-simple.mt-list-container ul>.mt-list-item { | |
| 164 | + padding: 3.3px 0; | |
| 165 | + } | |
| 166 | + | |
| 167 | + #route-container { | |
| 168 | + display: none; | |
| 169 | + } | |
| 170 | + | |
| 171 | + .page-content.active { | |
| 172 | + display: block !important; | |
| 173 | + } | |
| 174 | + | |
| 175 | + .page-header.navbar .page-logo .logo-default { | |
| 176 | + margin: 0; | |
| 177 | + } | |
| 178 | + | |
| 179 | + .page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle | |
| 180 | + { | |
| 181 | + background-color: #284a99; | |
| 182 | + } | |
| 183 | + | |
| 184 | + .page-header.navbar .page-logo { | |
| 185 | + padding-right: 10px; | |
| 186 | + } | |
| 187 | + | |
| 188 | + .page-logo .logo-default.logo-default-text { | |
| 189 | + font-weight: 600; | |
| 190 | + color: white !important; | |
| 191 | + margin-top: 19px !important; | |
| 192 | + font-size: 24px; | |
| 193 | + text-decoration: none; | |
| 194 | + } | |
| 195 | + | |
| 196 | + .page-logo .logo-default.logo-default-text:HOVER { | |
| 197 | + color: #dedede !important; | |
| 198 | + } | |
| 199 | + | |
| 200 | + body,.page-content-wrapper,#pjax-container{ | |
| 201 | + height: 100%; | |
| 202 | + } | |
| 203 | + html{ | |
| 204 | + height: 90%; | |
| 205 | + } | |
| 206 | + .page-container{ | |
| 207 | + height: 100%; | |
| 208 | + } | |
| 209 | + </style> | |
| 210 | + | |
| 211 | + <!-- ocLazyLoading载入文件的位置 --> | |
| 212 | + <link id="ng_load_plugins_before" /> | |
| 213 | + | |
| 214 | +</head> | |
| 215 | +<body | |
| 216 | + class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed"> | |
| 217 | +<div class="page-header navbar navbar-fixed-top" | |
| 218 | + style="background: linear-gradient(to bottom, #124e78, #125688);"> | |
| 219 | + <div class="page-header-inner "> | |
| 220 | + <!-- LOGO --> | |
| 221 | + <div class="page-logo"> | |
| 222 | + <a href="index.html" class="logo-default logo-default-text"> | |
| 223 | + 闵行公交调度系统 </a> | |
| 224 | + <div class="menu-toggler sidebar-toggler"></div> | |
| 225 | + </div> | |
| 226 | + <!-- END LOGO --> | |
| 227 | + <a href="javascript:;" class="menu-toggler responsive-toggler" | |
| 228 | + data-toggle="collapse" data-target=".navbar-collapse"> </a> | |
| 229 | + <div class="page-top"> | |
| 230 | + <div class="top-menu"> | |
| 231 | + <ul class="nav navbar-nav pull-right"> | |
| 232 | + <!-- 信息通知区 --> | |
| 233 | + <li | |
| 234 | + class="dropdown dropdown-extended dropdown-notification dropdown-dark" | |
| 235 | + id="header_notification_bar"><a href="javascript:;" | |
| 236 | + class="dropdown-toggle" data-toggle="dropdown" | |
| 237 | + data-hover="dropdown" data-close-others="true"> <i | |
| 238 | + class="fa fa-bell"></i> <span class="badge badge-success"> | |
| 239 | + 0 </span> | |
| 240 | + </a> | |
| 241 | + <ul class="dropdown-menu" style="max-width: 345px; width: 345px;"> | |
| 242 | + <li class="external"> | |
| 243 | + <h3> | |
| 244 | + 今日 <span class="bold">0 条</span> 通知 | |
| 245 | + </h3> <a href="javascript:;">查看全部</a> | |
| 246 | + </li> | |
| 247 | + <li> | |
| 248 | + <ul class="dropdown-menu-list scroller" style="height: 250px;" | |
| 249 | + data-handle-color="#637283"> | |
| 250 | + </ul> | |
| 251 | + </li> | |
| 252 | + </ul></li> | |
| 253 | + <li class="dropdown dropdown-user dropdown-dark"><a | |
| 254 | + href="javascript:;" class="dropdown-toggle" | |
| 255 | + data-toggle="dropdown" data-hover="dropdown" | |
| 256 | + data-close-others="true"> <span id="indexTopUName" | |
| 257 | + class="username username-hide-on-mobile" | |
| 258 | + style="vertical-align: middle;"> <i class="fa fa-user"></i></span> | |
| 259 | + </a> | |
| 260 | + <ul class="dropdown-menu dropdown-menu-default"> | |
| 261 | + <li><a href="javascript:;"> <i class="fa fa-user"></i> | |
| 262 | + 我的信息 | |
| 263 | + </a></li> | |
| 264 | + <li><a href="javascript:;" id="changePWD"> <i | |
| 265 | + class="fa fa-unlock-alt"></i> 修改密码 | |
| 266 | + </a></li> | |
| 267 | + <li class="divider"></li> | |
| 268 | + <li><a href="javascript:;"> <i class="fa fa-lock"></i> | |
| 269 | + 锁屏 | |
| 270 | + </a></li> | |
| 271 | + <li><a href="/logout"> <i class="fa fa-key"></i> 注销登陆 | |
| 272 | + </a></li> | |
| 273 | + </ul></li> | |
| 274 | + </ul> | |
| 275 | + </div> | |
| 276 | + </div> | |
| 277 | + </div> | |
| 278 | +</div> | |
| 279 | +<div class="page-container"> | |
| 280 | + <div class="page-sidebar-wrapper"> | |
| 281 | + <div class="page-sidebar navbar-collapse collapse"> | |
| 282 | + <ul class="page-sidebar-menu page-sidebar-menu-fixed" | |
| 283 | + data-keep-expanded="false" data-auto-scroll="true" | |
| 284 | + data-slide-speed="200" id="leftMenuSidebar"> | |
| 285 | + </ul> | |
| 286 | + </div> | |
| 287 | + </div> | |
| 288 | + <div class="page-content-wrapper"> | |
| 289 | + <div id="pjax-container" class="page-content"></div> | |
| 290 | + <a name="xd_position"></a> | |
| 291 | + <div id="route-container"> | |
| 292 | + <div ng-app="ScheduleApp"> | |
| 293 | + <div ng-controller="ScheduleAppController"> | |
| 294 | + | |
| 295 | + <!-- loading widget --> | |
| 296 | + <div id="loadingWidget" class="flyover mask" loading-widget> | |
| 297 | + <div class="alert alert-info"> | |
| 298 | + <strong>载入中......</strong> | |
| 299 | + </div> | |
| 300 | + </div> | |
| 301 | + | |
| 302 | + <div ui-view class="uv"></div> | |
| 303 | + </div> | |
| 304 | + </div> | |
| 305 | + </div> | |
| 306 | + </div> | |
| 307 | +</div> | |
| 308 | + | |
| 309 | +<script id="menu_list_temp" type="text/html"> | |
| 310 | + {{each list as group i}} | |
| 311 | + <li class="heading"> | |
| 312 | + <h3 class="uppercase">{{group.name}}</h3> | |
| 313 | + </li> | |
| 314 | + {{each group.children as dir j}} | |
| 315 | + <li class="nav-item"> | |
| 316 | + <a href="javascript:;" class="nav-link nav-toggle "> | |
| 317 | + <i class="{{dir.icon}}"></i> | |
| 318 | + <span class="title">{{dir.name}}</span> | |
| 319 | + <span class="arrow"></span> | |
| 320 | + </a> | |
| 321 | + <ul class="sub-menu"> | |
| 322 | + {{each dir.children as module s}} | |
| 323 | + <li class="nav-item "> | |
| 324 | + {{if module.container=="pjax-container"}} | |
| 325 | + <a href="/pages/{{module.path}}" class="nav-link " data-pjax> | |
| 326 | + <span class="title">{{module.name}}</span> | |
| 327 | + </a> | |
| 328 | + {{else if module.container == "route-container"}} | |
| 329 | + <a href="{{module.path}}" class="nav-link " data-angularjs> | |
| 330 | + <span class="title">{{module.name}}</span> | |
| 331 | + </a> | |
| 332 | + {{else}} | |
| 333 | + <a href="javascript:void(0)" data-url="{{module.path}}" class="nav-link " data-link> | |
| 334 | + <span class="title">{{module.name}}</span> | |
| 335 | + </a> | |
| 336 | + {{/if}} | |
| 337 | + </li> | |
| 338 | + {{/each}} | |
| 339 | + </ul> | |
| 340 | + </li> | |
| 341 | + {{/each}} | |
| 342 | + {{/each}} | |
| 343 | + | |
| 344 | +</script> | |
| 345 | +<script> | |
| 346 | + delete window.require; | |
| 347 | + delete window.exports; | |
| 348 | + delete window.module; | |
| 349 | +</script> | |
| 350 | +<!-- jQuery --> | |
| 351 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js" data-exclude=1></script> | |
| 352 | +<!-- bootstrap --> | |
| 353 | +<script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" | |
| 354 | + data-exclude=1></script> | |
| 355 | +<script src="/pages/forms/statement/js/jquery.autocompleter.js"></script> | |
| 356 | +<script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | |
| 357 | +<!-- MTRONIC JS --> | |
| 358 | +<script src="/metronic_v4.5.4/scripts/app.min.js" data-exclude=1></script> | |
| 359 | +<script src="/metronic_v4.5.4/layout4/scripts/layout.min.js" | |
| 360 | + data-exclude=1></script> | |
| 361 | +<!-- 虚拟滚动条 --> | |
| 362 | +<script | |
| 363 | + src="/metronic_v4.5.4/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script> | |
| 364 | +<!-- jsTree 树插件 --> | |
| 365 | +<script src="/metronic_v4.5.4/plugins/jstree/dist/jstree.min.js"></script> | |
| 366 | +<!-- bootstrap-hover-dropDown --> | |
| 367 | +<script | |
| 368 | + src="/metronic_v4.5.4/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script> | |
| 369 | +<!-- jquery.validate 表单验证 --> | |
| 370 | +<script | |
| 371 | + src="/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.min.js"></script> | |
| 372 | +<script | |
| 373 | + src="/metronic_v4.5.4/plugins/jquery-validation/js/localization/messages_zh.js"></script> | |
| 374 | +<!-- 向导式插件 --> | |
| 375 | +<script | |
| 376 | + src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script> | |
| 377 | +<!-- iCheck 单选框和复选框 --> | |
| 378 | +<script src="/metronic_v4.5.4/plugins/icheck/icheck.min.js"></script> | |
| 379 | +<!-- select2 下拉框 --> | |
| 380 | +<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | |
| 381 | +<!-- MULTI SELECT 多选下拉框 --> | |
| 382 | +<script | |
| 383 | + src="/metronic_v4.5.4/plugins/jquery-multi-select/js/jquery.multi-select.js"></script> | |
| 384 | +<!-- editable.js --> | |
| 385 | +<script | |
| 386 | + src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script> | |
| 387 | +<!-- PJAX --> | |
| 388 | +<script src="/assets/plugins/jquery.pjax.js"></script> | |
| 389 | +<!-- layer 弹层 --> | |
| 390 | +<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script> | |
| 391 | +<!-- fileinput 上传 --> | |
| 392 | +<script src="/assets/plugins/fileinput/canvas-to-blob.min.js"></script> | |
| 393 | +<script src="/assets/plugins/fileinput/purify.min.js"></script> | |
| 394 | +<script src="/assets/plugins/fileinput/sortable.min.js"></script> | |
| 395 | +<script src="/assets/plugins/fileinput/fileinput.min.js"></script> | |
| 396 | +<script src="/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | |
| 397 | +<!-- jquery.purl URL解析 --> | |
| 398 | +<script src="/assets/plugins/purl.js"></script> | |
| 399 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 400 | +<script src="/assets/plugins/jquery.serializejson.js"></script> | |
| 401 | +<!-- art-template 模版引擎 --> | |
| 402 | +<script src="/assets/plugins/template.js"></script> | |
| 403 | +<!-- jquery.pageinator 分页 --> | |
| 404 | +<script src="/assets/plugins/jqPaginator.min.js"></script> | |
| 405 | +<!-- moment.js 日期处理类库 --> | |
| 406 | +<script src="/assets/plugins/moment-with-locales.js"></script> | |
| 407 | + | |
| 408 | +<script src="/assets/plugins/pinyin.js"></script> | |
| 409 | +<!-- 日期控件 --> | |
| 410 | +<script | |
| 411 | + src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | |
| 412 | +<!-- 表格控件 --> | |
| 413 | +<script src="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script> | |
| 414 | +<!-- 统计图控件 --> | |
| 415 | +<!--<script src="/assets/global/getEchart.js"></script> | |
| 416 | +<script src="/assets/global/echarts.js"></script> --> | |
| 417 | +<script src="/assets/js/common.js"></script> | |
| 418 | +<script src="/assets/js/dictionary.js"></script> | |
| 419 | +<!-- tipso JS --> | |
| 420 | +<script src="/metronic_v4.5.4/plugins/tipso/js/tipso.js"></script> | |
| 421 | +<script data-exclude=1> | |
| 422 | + //初始打开的片段地址 | |
| 423 | + var initFragment = "^_^initFragment^_^"; | |
| 424 | + //静态文件目录 | |
| 425 | + var dir = '/pages/'; | |
| 426 | + //片段容器 | |
| 427 | + var pjaxContainer = '#pjax-container' | |
| 428 | + , angJsContainer = '#route-container'; | |
| 429 | + | |
| 430 | + $(document).ajaxError(function (event, jqxhr, settings, thrownError) { | |
| 431 | + if(jqxhr.status == 403){ | |
| 432 | + layer.closeAll(); | |
| 433 | + layer.alert(jqxhr.message?jqxhr.message:'访问被拒绝', {icon: 2, title: '操作失败'}); | |
| 434 | + } | |
| 435 | + }); | |
| 436 | + | |
| 437 | + $(function () { | |
| 438 | + $.get('/user/currentUser', function (user) { | |
| 439 | + $('#indexTopUName').text(user.userName); | |
| 440 | + }); | |
| 441 | + | |
| 442 | + //带 data-pjax 的链接由pjax加载 | |
| 443 | + $(document).pjax('a[data-pjax]', pjaxContainer); | |
| 444 | + | |
| 445 | + //pjax左菜单点击事件 | |
| 446 | + $(document).on('click', '#leftMenuSidebar a[data-pjax]', function () { | |
| 447 | + setTitle(this); | |
| 448 | + | |
| 449 | + $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | |
| 450 | + $(this).parent().addClass('active'); | |
| 451 | + showPjax(); | |
| 452 | + }); | |
| 453 | + | |
| 454 | + //外链左菜单点击事件 | |
| 455 | + $(document).on('click', '#leftMenuSidebar a[data-link]', function (e) { | |
| 456 | + setTitle(this); | |
| 457 | + | |
| 458 | + $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | |
| 459 | + $(this).parent().addClass('active'); | |
| 460 | + showLink($(this).data('url')); | |
| 461 | + }); | |
| 462 | + | |
| 463 | + //angularjs左菜单点击事件 | |
| 464 | + $(document).on('click', '#leftMenuSidebar a[data-angularjs]', function () { | |
| 465 | + setTitle(this); | |
| 466 | + | |
| 467 | + $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | |
| 468 | + $(this).parent().addClass('active'); | |
| 469 | + showAngJs(); | |
| 470 | + }); | |
| 471 | + | |
| 472 | + //加载左菜单栏 | |
| 473 | + $get('/module/findByCurrentUser', null, | |
| 474 | + function (ms) { | |
| 475 | + var treeArray = createTreeData(ms); | |
| 476 | + treeArray.sort(function (a, b) { | |
| 477 | + return a.createDate - b.createDate; | |
| 478 | + }); | |
| 479 | + var menuHtml = template('menu_list_temp', {list: treeArray}); | |
| 480 | + $('#leftMenuSidebar').html(menuHtml); | |
| 481 | + | |
| 482 | + //----------- 检查URL ---------------- | |
| 483 | + var h = location.hash; | |
| 484 | + if (initFragment && initFragment != '') { | |
| 485 | + showPjax(); | |
| 486 | + //普通片段 | |
| 487 | + loadPage(initFragment); | |
| 488 | + //选中菜单 | |
| 489 | + $.each($('#leftMenuSidebar a'), function (i, item) { | |
| 490 | + if (urlPattern($(item).attr('href'), initFragment)) { | |
| 491 | + activeLeftMenu(item); | |
| 492 | + } | |
| 493 | + }); | |
| 494 | + } else if (h) { | |
| 495 | + //angularjs片段 | |
| 496 | + showAngJs(); | |
| 497 | + //选中菜单 | |
| 498 | + $.each($('#leftMenuSidebar a'), function (i, item) { | |
| 499 | + if ($(item).attr('href') == h) { | |
| 500 | + activeLeftMenu(item); | |
| 501 | + } | |
| 502 | + }); | |
| 503 | + } | |
| 504 | + else { | |
| 505 | + //加载主页 | |
| 506 | + loadPage('/pages/home.html'); | |
| 507 | + } | |
| 508 | + }); | |
| 509 | + | |
| 510 | + //修改密码 | |
| 511 | + $('#changePWD').on('click', function () { | |
| 512 | + $.get('/pages/permission/user/changePWD.html', function (content) { | |
| 513 | + layer.open({ | |
| 514 | + type: 1, | |
| 515 | + area: ['600px', '360px'], | |
| 516 | + content: content, | |
| 517 | + title: '修改密码', | |
| 518 | + shift: 5, | |
| 519 | + scrollbar: false, | |
| 520 | + success: function () { | |
| 521 | + } | |
| 522 | + }); | |
| 523 | + }); | |
| 524 | + }); | |
| 525 | + }); | |
| 526 | + | |
| 527 | + //modal关闭时销毁dom | |
| 528 | + $(document).on('hidden.bs.modal', '.modal', function () { | |
| 529 | + $(this).remove(); | |
| 530 | + }); | |
| 531 | + | |
| 532 | + //pjax加载完成事件 | |
| 533 | + $(document).on('pjax:success', function () { | |
| 534 | + var dicts = $(pjaxContainer).find('.nt-dictionary'); | |
| 535 | + dictionaryUtils.transformDom(dicts); | |
| 536 | + }); | |
| 537 | + | |
| 538 | + function loadPage(url) { | |
| 539 | + $.pjax({url: url, container: pjaxContainer}) | |
| 540 | + } | |
| 541 | + | |
| 542 | + function urlPattern(a, b) { | |
| 543 | + var r; | |
| 544 | + try { | |
| 545 | + r = a.substring(0, a.lastIndexOf('/')) == b.substring(0, b.lastIndexOf('/')); | |
| 546 | + } catch (e) { | |
| 547 | + r = false; | |
| 548 | + } | |
| 549 | + return r; | |
| 550 | + } | |
| 551 | + | |
| 552 | + function showPjax() { | |
| 553 | + $(angJsContainer).removeClass('page-content active').hide(); | |
| 554 | + $(pjaxContainer).addClass('page-content active'); | |
| 555 | + } | |
| 556 | + | |
| 557 | + function showLink(url) { | |
| 558 | + window.open(url, '_blank'); | |
| 559 | + } | |
| 560 | + | |
| 561 | + function showAngJs() { | |
| 562 | + $(pjaxContainer).html('').removeClass('page-content active').hide(); | |
| 563 | + $(angJsContainer).addClass('page-content active'); | |
| 564 | + } | |
| 565 | + | |
| 566 | + function activeLeftMenu(item) { | |
| 567 | + $(item).parent('.nav-item').addClass('active').parent('.sub-menu').show().parent().addClass('open'); | |
| 568 | + setTitle(item); | |
| 569 | + } | |
| 570 | + | |
| 571 | + function setTitle(menuItem){ | |
| 572 | + document.title = $('span.title', menuItem).text(); | |
| 573 | + } | |
| 574 | + | |
| 575 | +</script> | |
| 576 | +<!-- d3 --> | |
| 577 | +<script src="/assets/js/d3.min.js" data-exclude=1></script> | |
| 578 | +<!-- webSocket JS --> | |
| 579 | +<script src="/assets/js/sockjs.min.js"></script> | |
| 580 | + | |
| 581 | +<!-- TODO:angularJS相关库 --> | |
| 582 | + | |
| 583 | +<!-- angularJS相关库 --> | |
| 584 | +<!-- 这个是基于angularjs 1.4.10修改的版本,主要是修改了history控制部分,用于兼容route和pjax的同时操作history的冲突 --> | |
| 585 | +<script src="/assets/js/angular.js" data-autocephaly=1></script> | |
| 586 | +<script src="/assets/bower_components/angular-i18n/angular-locale_zh-cn.js" data-autocephaly=1></script> | |
| 587 | +<script | |
| 588 | + src="/assets/bower_components/angular-resource/angular-resource.min.js" | |
| 589 | + data-exclude=1></script> | |
| 590 | +<script | |
| 591 | + src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" | |
| 592 | + data-exclude=1></script> | |
| 593 | +<script | |
| 594 | + src="/assets/bower_components/angular-animate/angular-animate.min.js" | |
| 595 | + data-exclude=1></script> | |
| 596 | +<script | |
| 597 | + src="/assets/bower_components/angular-touch/angular-touch.min.js" | |
| 598 | + data-exclude=1></script> | |
| 599 | +<script | |
| 600 | + src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" | |
| 601 | + data-exclude=1></script> | |
| 602 | +<script | |
| 603 | + src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" | |
| 604 | + data-exclude=1></script> | |
| 605 | +<script | |
| 606 | + src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" | |
| 607 | + data-exclude=1></script> | |
| 608 | +<!-- handsontable相关js --> | |
| 609 | +<script | |
| 610 | + src="/assets/bower_components/handsontable/dist/handsontable.full.js"></script> | |
| 611 | +<script | |
| 612 | + src="/assets/bower_components/ngHandsontable/dist/ngHandsontable.js"></script> | |
| 613 | +<!-- sweetalert相关js --> | |
| 614 | +<script src="/assets/bower_components/sweetalert/dist/sweetalert.min.js"></script> | |
| 615 | +<script src="/assets/bower_components/ng-sweet-alert/ng-sweet-alert.js"></script> | |
| 616 | + | |
| 617 | +<!-- schedule计划调度AngularJS模块主JS --> | |
| 618 | +<script src="/pages/scheduleApp/module/common/main.js" data-exclude=1></script> | |
| 619 | +<script | |
| 620 | + src="/pages/scheduleApp/module/common/prj-common-globalservice.js" | |
| 621 | + data-exclude=1></script> | |
| 622 | +<script src="/pages/scheduleApp/module/common/prj-common-filter.js" | |
| 623 | + data-exclude=1></script> | |
| 624 | +<script src="/pages/scheduleApp/module/common/prj-common-directive.js" | |
| 625 | + data-exclude=1></script> | |
| 626 | +<script | |
| 627 | + src="/pages/scheduleApp/module/common/prj-common-ui-route-state.js" | |
| 628 | + data-exclude=1></script> | |
| 629 | + | |
| 630 | +<!-- 地图相关 --> | |
| 631 | +<!-- 百度 --> | |
| 632 | +<script | |
| 633 | + src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" | |
| 634 | + data-exclude=1></script> | |
| 635 | +<script | |
| 636 | + src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js" | |
| 637 | + data-exclude=1></script> | |
| 638 | +<script type="text/javascript" | |
| 639 | + src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js" | |
| 640 | + data-exclude=1></script> | |
| 641 | +<script type="text/javascript" | |
| 642 | + src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js " | |
| 643 | + data-exclude=1></script> | |
| 644 | +<script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script> | |
| 645 | +<script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script> | |
| 646 | +<!-- 高德 --> | |
| 647 | +<script | |
| 648 | + src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" | |
| 649 | + data-exclude=1></script> | |
| 650 | +<!-- echarts4 误删 --> | |
| 651 | +<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> | |
| 652 | + | |
| 653 | +</body> | |
| 637 | 654 | </html> |
| 638 | 655 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/permission/module/add_modal.html
| 1 | -<div class="modal fade" id="add_modal" tabindex="-1" role="basic" | |
| 2 | - aria-hidden="true"> | |
| 3 | - <div class="modal-dialog"> | |
| 4 | - <div class="modal-content"> | |
| 5 | - <div class="modal-header"> | |
| 6 | - <button type="button" class="close" data-dismiss="modal" | |
| 7 | - aria-hidden="true"></button> | |
| 8 | - <h4 class="modal-title">新增功能模块</h4> | |
| 9 | - </div> | |
| 10 | - <div class="modal-body"> | |
| 11 | - <form class="form-horizontal" role="form" id="module_add_form" | |
| 12 | - action="/module" method="post"> | |
| 13 | - <input type="hidden" name="groupType" value="3"> | |
| 14 | - <div class="alert alert-danger display-hide"> | |
| 15 | - <button class="close" data-close="alert"></button> | |
| 16 | - 您的输入有误,请检查下面的输入项 | |
| 17 | - </div> | |
| 18 | - <div class="form-body"> | |
| 19 | - <div class="form-group"> | |
| 20 | - <label class="col-md-3 control-label">所属组</label> | |
| 21 | - <div class="col-md-9"> | |
| 22 | - <select class="form-control input-medium " name="" id="groupSelect"></select> | |
| 23 | - </div> | |
| 24 | - </div> | |
| 25 | - <div class="form-group"> | |
| 26 | - <label class="col-md-3 control-label">所属目录</label> | |
| 27 | - <div class="col-md-9"> | |
| 28 | - <select class="form-control input-medium " name="pId" id="dirSelect"></select> | |
| 29 | - </div> | |
| 30 | - </div> | |
| 31 | - <div class="form-group"> | |
| 32 | - <label class="col-md-3 control-label">模块名</label> | |
| 33 | - <div class="col-md-9"> | |
| 34 | - <input type="text" class="form-control input-medium" name="name" > <span class="help-inline"> | |
| 35 | - 不要超过10个汉字长度 </span> | |
| 36 | - </div> | |
| 37 | - </div> | |
| 38 | - <div class="form-group"> | |
| 39 | - <label class="col-md-3 control-label">片段路径</label> | |
| 40 | - <div class="col-md-9"> | |
| 41 | - <input type="text" class="form-control input-medium" name="path" autocomplete="off"> | |
| 42 | - <span class="help-inline"> 片段,如:permission/module/list.html </span> | |
| 43 | - </div> | |
| 44 | - </div> | |
| 45 | - <div class="form-group"> | |
| 46 | - <label class="col-md-3 control-label">片段渲染容器</label> | |
| 47 | - <div class="col-md-9"> | |
| 48 | - <select class="form-control input-medium" name="container"> | |
| 49 | - <option value="pjax-container">pjax-container</option> | |
| 50 | - <option value="route-container">route-container</option> | |
| 51 | - </select> | |
| 52 | - </div> | |
| 53 | - </div> | |
| 54 | - <div class="form-group"> | |
| 55 | - <label class="col-md-3 control-label">映射地址</label> | |
| 56 | - <div class="col-md-9"> | |
| 57 | - <input type="text" class="form-control input-medium" | |
| 58 | - name="mappSymbol"> | |
| 59 | - <span class="help-inline"> Controller对应的映射地址,如: /module </span> | |
| 60 | - </div> | |
| 61 | - </div> | |
| 62 | - <div class="form-group"> | |
| 63 | - <label class="col-md-3 control-label">是否可用</label> | |
| 64 | - <div class="col-md-9"> | |
| 65 | - <select class="form-control input-medium" name="enable"> | |
| 66 | - <option value="1">可用</option> | |
| 67 | - <option value="0">禁用</option> | |
| 68 | - </select> | |
| 69 | - </div> | |
| 70 | - </div> | |
| 71 | - <div class="form-group"> | |
| 72 | - <label class="col-md-3 control-label">描述</label> | |
| 73 | - <div class="col-md-9"> | |
| 74 | - <input type="text" class="form-control input-medium" name="descriptions"> | |
| 75 | - </div> | |
| 76 | - </div> | |
| 77 | - <hr> | |
| 78 | - <div class="form-group"> | |
| 79 | - <label class="col-md-3 control-label">基础资源</label> | |
| 80 | - <div class="col-md-9"> | |
| 81 | - <div class="icheck-list"> | |
| 82 | - <label > | |
| 83 | - <input type="radio" class="icheck" name="baseRes" value=1 > 继承BaseController 的基础接口</label> | |
| 84 | - <label> | |
| 85 | - <input type="radio" class="icheck" name="baseRes" value=0 checked> 不需要 </label> | |
| 86 | - </div> | |
| 87 | - </div> | |
| 88 | - </div> | |
| 89 | - <div class="form-group defaultRes" style="display: none;" > | |
| 90 | - <div class="portlet-body"> | |
| 91 | - <div class="table-scrollable"> | |
| 92 | - <table class="table table-bordered table-advance"> | |
| 93 | - <thead> | |
| 94 | - <tr> | |
| 95 | - <th style="width: 13%;text-align: center;"> # </th> | |
| 96 | - <th style="width: 29%;"> 映射 </th> | |
| 97 | - <th style="width: 29%;"> 请求方式 </th> | |
| 98 | - <th style="width: 29%;"> 资源名 </th> | |
| 99 | - </tr> | |
| 100 | - </thead> | |
| 101 | - <tbody> | |
| 102 | - <tr class=""> | |
| 103 | - <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 104 | - <td> <span class="mappSymbol_sync"></span> </td> | |
| 105 | - <td> get </td> | |
| 106 | - <td> 分页查询 </td> | |
| 107 | - </tr> | |
| 108 | - <tr class=""> | |
| 109 | - <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 110 | - <td> <span class="mappSymbol_sync"></span> </td> | |
| 111 | - <td> post </td> | |
| 112 | - <td> 新增/编辑 </td> | |
| 113 | - </tr> | |
| 114 | - <tr class=""> | |
| 115 | - <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 116 | - <td> <span class="mappSymbol_sync"></span> </td> | |
| 117 | - <td> delete </td> | |
| 118 | - <td> 删除 </td> | |
| 119 | - </tr> | |
| 120 | - <tr class=""> | |
| 121 | - <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 122 | - <td> <span class="mappSymbol_sync"></span>/{id} </td> | |
| 123 | - <td> get </td> | |
| 124 | - <td> 主键查询 </td> | |
| 125 | - </tr> | |
| 126 | - <tr class=""> | |
| 127 | - <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 128 | - <td> <span class="mappSymbol_sync"></span>/all </td> | |
| 129 | - <td> get </td> | |
| 130 | - <td> 查询所有 </td> | |
| 131 | - </tr> | |
| 132 | - </tbody> | |
| 133 | - </table> | |
| 134 | - </div> | |
| 135 | - </div> | |
| 136 | - </div> | |
| 137 | - </div> | |
| 138 | - </form> | |
| 139 | - </div> | |
| 140 | - <div class="modal-footer"> | |
| 141 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 142 | - <button type="button" class="btn btn-primary" id="addModuleButton">提交数据</button> | |
| 143 | - </div> | |
| 144 | - </div> | |
| 145 | - </div> | |
| 146 | -</div> | |
| 147 | -<script id="res_tbody_temp" type="text/html"> | |
| 148 | - | |
| 149 | -</script> | |
| 150 | -<script data-exclude=1> | |
| 151 | - $(function() { | |
| 152 | - var groupData = [] | |
| 153 | - ,dirGroupMapp = {};//目录到组的映射 | |
| 154 | - | |
| 155 | - var form = $('#module_add_form'); | |
| 156 | - var error = $('.alert-danger', form); | |
| 157 | - | |
| 158 | - //icheck | |
| 159 | - $('.icheck').iCheck({ | |
| 160 | - checkboxClass: 'icheckbox_flat-green', | |
| 161 | - radioClass: 'iradio_flat-green', | |
| 162 | - increaseArea: '20%' // optional | |
| 163 | - }); | |
| 164 | - | |
| 165 | - //modal 显示事件 | |
| 166 | - $('#add_modal').on('show.bs.modal', function(){ | |
| 167 | - refreshFormData(function(){ | |
| 168 | - var sel = getCurrSelNode(); | |
| 169 | - if(sel.length > 0){ | |
| 170 | - var orig = sel[0].original; | |
| 171 | - //选中的是目录(二级) | |
| 172 | - if(orig.groupType == '2'){ | |
| 173 | - $('#groupSelect').val(orig.pId).change(); | |
| 174 | - $('select[name=pId]').val(orig.id).change(); | |
| 175 | - } | |
| 176 | - else if(orig.groupType == '1'){ | |
| 177 | - $('#groupSelect').val(orig.id).change(); | |
| 178 | - } | |
| 179 | - } | |
| 180 | - }); | |
| 181 | - }) | |
| 182 | - .modal('show'); | |
| 183 | - | |
| 184 | - $('input[name=mappSymbol]').on('keyup change', function(){ | |
| 185 | - $('.mappSymbol_sync').text($(this).val()); | |
| 186 | - }); | |
| 187 | - | |
| 188 | - $('input[name=baseRes]').on('ifChanged', function(){ | |
| 189 | - var v = $(this).val(); | |
| 190 | - if(v == 1 && this.checked){ | |
| 191 | - if($.trim($('input[name=mappSymbol]').val()) == ''){ | |
| 192 | - layer.msg('请先输入Controler映射地址'); | |
| 193 | - | |
| 194 | - var wrap = $(this).iCheck('uncheck').parent(); | |
| 195 | - setTimeout(function(){ | |
| 196 | - wrap.removeClass('checked'); | |
| 197 | - $('input[name=baseRes]:eq(1)').iCheck('check'); | |
| 198 | - }, 100); | |
| 199 | - return false; | |
| 200 | - } | |
| 201 | - else{ | |
| 202 | - $('.defaultRes').slideDown(500, function(){ | |
| 203 | - $('#add_modal').animate({ | |
| 204 | - scrollTop: $('#add_modal')[0].scrollHeight | |
| 205 | - }, 1100); | |
| 206 | - | |
| 207 | - }); | |
| 208 | - } | |
| 209 | - } | |
| 210 | - else | |
| 211 | - $('.defaultRes').slideUp(); | |
| 212 | - }); | |
| 213 | - | |
| 214 | -/* $('select[name=pId]').on('change', function() { | |
| 215 | - var objs = $('input[name=path],input[name=mappSymbol]') | |
| 216 | - ,dr = $('.defaultRes'); | |
| 217 | - if (this.value == '-2') { | |
| 218 | - objs.attr('readonly', 'readonly'); | |
| 219 | - dr.hide(); | |
| 220 | - } else { | |
| 221 | - objs.removeAttr('readonly'); | |
| 222 | - dr.show(); | |
| 223 | - } | |
| 224 | - }); */ | |
| 225 | - | |
| 226 | - $('#groupSelect').on('change', function(){ | |
| 227 | - var id = $(this).val(); | |
| 228 | - $.each(groupData, function(i, obj){ | |
| 229 | - if(obj.id == id){ | |
| 230 | - var option = ''; | |
| 231 | - $.each(obj.dirs, function(i, dir){ | |
| 232 | - option += '<option value="'+dir.id+'">'+dir.name+'</option>'; | |
| 233 | - }); | |
| 234 | - $('#dirSelect').html(option); | |
| 235 | - return false; | |
| 236 | - } | |
| 237 | - }); | |
| 238 | - }); | |
| 239 | - | |
| 240 | - //提交 | |
| 241 | - $('#addModuleButton').on('click', function() { | |
| 242 | - form.submit(); | |
| 243 | - }); | |
| 244 | - //form validate | |
| 245 | - form.validate({ | |
| 246 | - errorElement : 'span', | |
| 247 | - errorClass : 'help-block help-block-error', | |
| 248 | - focusInvalid : false, | |
| 249 | - rules : { | |
| 250 | - name : { | |
| 251 | - minlength : 2, | |
| 252 | - required : true, | |
| 253 | - maxlength : 10 | |
| 254 | - }, | |
| 255 | - path : { | |
| 256 | - required : true | |
| 257 | - }/* , | |
| 258 | - mappSymbol: { | |
| 259 | - required : true | |
| 260 | - } */ | |
| 261 | - }, | |
| 262 | - invalidHandler : function(event, validator) { | |
| 263 | - error.show(); | |
| 264 | - App.scrollTo(error, -200); | |
| 265 | - }, | |
| 266 | - | |
| 267 | - highlight : function(element) { | |
| 268 | - $(element).closest('.form-group').addClass('has-error'); | |
| 269 | - }, | |
| 270 | - | |
| 271 | - unhighlight : function(element) { | |
| 272 | - $(element).closest('.form-group').removeClass('has-error'); | |
| 273 | - }, | |
| 274 | - | |
| 275 | - success : function(label) { | |
| 276 | - label.closest('.form-group').removeClass('has-error'); | |
| 277 | - }, | |
| 278 | - | |
| 279 | - submitHandler : function(f) { | |
| 280 | - var params = form.serializeJSON(); | |
| 281 | - error.hide(); | |
| 282 | - $post('/module', params, function(res){ | |
| 283 | - layer.msg('新增模块成功.'); | |
| 284 | - | |
| 285 | - //添加资源 | |
| 286 | - if($('input[name=baseRes]:checked').val() == 1){ | |
| 287 | - submitBaseResource(res.t.id); | |
| 288 | - } | |
| 289 | - else{ | |
| 290 | - refreshJsTree(); | |
| 291 | - $('#add_modal').modal('hide'); | |
| 292 | - } | |
| 293 | - }); | |
| 294 | - } | |
| 295 | - }); | |
| 296 | - | |
| 297 | - | |
| 298 | - //提交默认资源 | |
| 299 | - function submitBaseResource(moduleId){ | |
| 300 | - var rows = $('.defaultRes table tbody')[0].rows | |
| 301 | - ,rsArray = []; | |
| 302 | - $.each(rows, function(i, r){ | |
| 303 | - var cells = r.cells | |
| 304 | - ,c = $(cells[0]).find(':checkbox') | |
| 305 | - ,resObj = {name: $.trim($(cells[3]).text()), url: $.trim($(cells[1]).text()) | |
| 306 | - ,method: $.trim($(cells[2]).text()),enable: c[0].checked,module: {id: moduleId}, descriptions: 'extends base' }; | |
| 307 | - | |
| 308 | - rsArray.push(resObj); | |
| 309 | - }); | |
| 310 | - | |
| 311 | - if(rsArray.length > 0){ | |
| 312 | - $post('/resource/batch', {array: JSON.stringify(rsArray)}, function(){ | |
| 313 | - layer.msg('添加资源成功.'); | |
| 314 | - | |
| 315 | - setTimeout(function(){ | |
| 316 | - refreshJsTree(); | |
| 317 | - $('#add_modal').modal('hide'); | |
| 318 | - }, 500); | |
| 319 | - }); | |
| 320 | - } | |
| 321 | - } | |
| 322 | - | |
| 323 | - //默认的BaseController接口 | |
| 324 | - /* function saveDefaultResource(t, rs){ | |
| 325 | - if(rs){ | |
| 326 | - var rsArray = []; | |
| 327 | - for(var n in rs) | |
| 328 | - rsArray = rsArray.concat(getDefaultRes(n, t.mappSymbol, t.id)); | |
| 329 | - | |
| 330 | - if(rsArray.length == 0) | |
| 331 | - return; | |
| 332 | - | |
| 333 | - $post('/resource/batch', {array: JSON.stringify(rsArray)}, function(){ | |
| 334 | - layer.msg('添加资源成功.'); | |
| 335 | - }); | |
| 336 | - } | |
| 337 | - } */ | |
| 338 | - | |
| 339 | - | |
| 340 | - function refreshFormData(cb){ | |
| 341 | - groupData = []; | |
| 342 | - $get('/module/findByGroupType',{group: '1,2'}, function(array){ | |
| 343 | - for(var i = 0,item; item=array[i++];){ | |
| 344 | - if(item.groupType == '1'){ | |
| 345 | - groupData.push(item); | |
| 346 | - } | |
| 347 | - | |
| 348 | - for(var j = 0,item2;item2=array[j++];){ | |
| 349 | - if(item2.pId == item.id){ | |
| 350 | - if(!item.dirs) | |
| 351 | - item.dirs = []; | |
| 352 | - item.dirs.push(item2); | |
| 353 | - | |
| 354 | - dirGroupMapp[item2.id] = item.id; | |
| 355 | - } | |
| 356 | - } | |
| 357 | - } | |
| 358 | - | |
| 359 | - var options = ''; | |
| 360 | - $.each(groupData, function(i, obj){ | |
| 361 | - options += '<option value="'+obj.id+'">'+obj.name+'</option>'; | |
| 362 | - }); | |
| 363 | - $('#groupSelect').html(options).change(); | |
| 364 | - | |
| 365 | - cb && cb(); | |
| 366 | - }); | |
| 367 | - } | |
| 368 | - | |
| 369 | - function getCurrSelNode(){ | |
| 370 | - return $.jstree.reference("#modules_tree").get_selected(true); | |
| 371 | - } | |
| 372 | - }); | |
| 1 | +<div class="modal fade" id="add_modal" tabindex="-1" role="basic" | |
| 2 | + aria-hidden="true"> | |
| 3 | + <div class="modal-dialog"> | |
| 4 | + <div class="modal-content"> | |
| 5 | + <div class="modal-header"> | |
| 6 | + <button type="button" class="close" data-dismiss="modal" | |
| 7 | + aria-hidden="true"></button> | |
| 8 | + <h4 class="modal-title">新增功能模块</h4> | |
| 9 | + </div> | |
| 10 | + <div class="modal-body"> | |
| 11 | + <form class="form-horizontal" role="form" id="module_add_form" | |
| 12 | + action="/module" method="post"> | |
| 13 | + <input type="hidden" name="groupType" value="3"> | |
| 14 | + <div class="alert alert-danger display-hide"> | |
| 15 | + <button class="close" data-close="alert"></button> | |
| 16 | + 您的输入有误,请检查下面的输入项 | |
| 17 | + </div> | |
| 18 | + <div class="form-body"> | |
| 19 | + <div class="form-group"> | |
| 20 | + <label class="col-md-3 control-label">所属组</label> | |
| 21 | + <div class="col-md-9"> | |
| 22 | + <select class="form-control input-medium " name="" id="groupSelect"></select> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + <div class="form-group"> | |
| 26 | + <label class="col-md-3 control-label">所属目录</label> | |
| 27 | + <div class="col-md-9"> | |
| 28 | + <select class="form-control input-medium " name="pId" id="dirSelect"></select> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + <div class="form-group"> | |
| 32 | + <label class="col-md-3 control-label">模块名</label> | |
| 33 | + <div class="col-md-9"> | |
| 34 | + <input type="text" class="form-control input-medium" name="name" > <span class="help-inline"> | |
| 35 | + 不要超过10个汉字长度 </span> | |
| 36 | + </div> | |
| 37 | + </div> | |
| 38 | + <div class="form-group"> | |
| 39 | + <label class="col-md-3 control-label">片段路径</label> | |
| 40 | + <div class="col-md-9"> | |
| 41 | + <input type="text" class="form-control input-medium" name="path" autocomplete="off"> | |
| 42 | + <span class="help-inline"> 片段,如:permission/module/list.html </span> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + <div class="form-group"> | |
| 46 | + <label class="col-md-3 control-label">片段渲染容器</label> | |
| 47 | + <div class="col-md-9"> | |
| 48 | + <select class="form-control input-medium" name="container"> | |
| 49 | + <option value="pjax-container">pjax-container</option> | |
| 50 | + <option value="route-container">route-container</option> | |
| 51 | + <option value="route-link">route-link</option> | |
| 52 | + </select> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + <div class="form-group"> | |
| 56 | + <label class="col-md-3 control-label">映射地址</label> | |
| 57 | + <div class="col-md-9"> | |
| 58 | + <input type="text" class="form-control input-medium" | |
| 59 | + name="mappSymbol"> | |
| 60 | + <span class="help-inline"> Controller对应的映射地址,如: /module </span> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + <div class="form-group"> | |
| 64 | + <label class="col-md-3 control-label">是否可用</label> | |
| 65 | + <div class="col-md-9"> | |
| 66 | + <select class="form-control input-medium" name="enable"> | |
| 67 | + <option value="1">可用</option> | |
| 68 | + <option value="0">禁用</option> | |
| 69 | + </select> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + <div class="form-group"> | |
| 73 | + <label class="col-md-3 control-label">描述</label> | |
| 74 | + <div class="col-md-9"> | |
| 75 | + <input type="text" class="form-control input-medium" name="descriptions"> | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + <hr> | |
| 79 | + <div class="form-group"> | |
| 80 | + <label class="col-md-3 control-label">基础资源</label> | |
| 81 | + <div class="col-md-9"> | |
| 82 | + <div class="icheck-list"> | |
| 83 | + <label > | |
| 84 | + <input type="radio" class="icheck" name="baseRes" value=1 > 继承BaseController 的基础接口</label> | |
| 85 | + <label> | |
| 86 | + <input type="radio" class="icheck" name="baseRes" value=0 checked> 不需要 </label> | |
| 87 | + </div> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + <div class="form-group defaultRes" style="display: none;" > | |
| 91 | + <div class="portlet-body"> | |
| 92 | + <div class="table-scrollable"> | |
| 93 | + <table class="table table-bordered table-advance"> | |
| 94 | + <thead> | |
| 95 | + <tr> | |
| 96 | + <th style="width: 13%;text-align: center;"> # </th> | |
| 97 | + <th style="width: 29%;"> 映射 </th> | |
| 98 | + <th style="width: 29%;"> 请求方式 </th> | |
| 99 | + <th style="width: 29%;"> 资源名 </th> | |
| 100 | + </tr> | |
| 101 | + </thead> | |
| 102 | + <tbody> | |
| 103 | + <tr class=""> | |
| 104 | + <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 105 | + <td> <span class="mappSymbol_sync"></span> </td> | |
| 106 | + <td> get </td> | |
| 107 | + <td> 分页查询 </td> | |
| 108 | + </tr> | |
| 109 | + <tr class=""> | |
| 110 | + <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 111 | + <td> <span class="mappSymbol_sync"></span> </td> | |
| 112 | + <td> post </td> | |
| 113 | + <td> 新增/编辑 </td> | |
| 114 | + </tr> | |
| 115 | + <tr class=""> | |
| 116 | + <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 117 | + <td> <span class="mappSymbol_sync"></span> </td> | |
| 118 | + <td> delete </td> | |
| 119 | + <td> 删除 </td> | |
| 120 | + </tr> | |
| 121 | + <tr class=""> | |
| 122 | + <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 123 | + <td> <span class="mappSymbol_sync"></span>/{id} </td> | |
| 124 | + <td> get </td> | |
| 125 | + <td> 主键查询 </td> | |
| 126 | + </tr> | |
| 127 | + <tr class=""> | |
| 128 | + <td style="text-align: center;"> <input type="checkbox" checked class="icheck"> </td> | |
| 129 | + <td> <span class="mappSymbol_sync"></span>/all </td> | |
| 130 | + <td> get </td> | |
| 131 | + <td> 查询所有 </td> | |
| 132 | + </tr> | |
| 133 | + </tbody> | |
| 134 | + </table> | |
| 135 | + </div> | |
| 136 | + </div> | |
| 137 | + </div> | |
| 138 | + </div> | |
| 139 | + </form> | |
| 140 | + </div> | |
| 141 | + <div class="modal-footer"> | |
| 142 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 143 | + <button type="button" class="btn btn-primary" id="addModuleButton">提交数据</button> | |
| 144 | + </div> | |
| 145 | + </div> | |
| 146 | + </div> | |
| 147 | +</div> | |
| 148 | +<script id="res_tbody_temp" type="text/html"> | |
| 149 | + | |
| 150 | +</script> | |
| 151 | +<script data-exclude=1> | |
| 152 | + $(function() { | |
| 153 | + var groupData = [] | |
| 154 | + ,dirGroupMapp = {};//目录到组的映射 | |
| 155 | + | |
| 156 | + var form = $('#module_add_form'); | |
| 157 | + var error = $('.alert-danger', form); | |
| 158 | + | |
| 159 | + //icheck | |
| 160 | + $('.icheck').iCheck({ | |
| 161 | + checkboxClass: 'icheckbox_flat-green', | |
| 162 | + radioClass: 'iradio_flat-green', | |
| 163 | + increaseArea: '20%' // optional | |
| 164 | + }); | |
| 165 | + | |
| 166 | + //modal 显示事件 | |
| 167 | + $('#add_modal').on('show.bs.modal', function(){ | |
| 168 | + refreshFormData(function(){ | |
| 169 | + var sel = getCurrSelNode(); | |
| 170 | + if(sel.length > 0){ | |
| 171 | + var orig = sel[0].original; | |
| 172 | + //选中的是目录(二级) | |
| 173 | + if(orig.groupType == '2'){ | |
| 174 | + $('#groupSelect').val(orig.pId).change(); | |
| 175 | + $('select[name=pId]').val(orig.id).change(); | |
| 176 | + } | |
| 177 | + else if(orig.groupType == '1'){ | |
| 178 | + $('#groupSelect').val(orig.id).change(); | |
| 179 | + } | |
| 180 | + } | |
| 181 | + }); | |
| 182 | + }) | |
| 183 | + .modal('show'); | |
| 184 | + | |
| 185 | + $('input[name=mappSymbol]').on('keyup change', function(){ | |
| 186 | + $('.mappSymbol_sync').text($(this).val()); | |
| 187 | + }); | |
| 188 | + | |
| 189 | + $('input[name=baseRes]').on('ifChanged', function(){ | |
| 190 | + var v = $(this).val(); | |
| 191 | + if(v == 1 && this.checked){ | |
| 192 | + if($.trim($('input[name=mappSymbol]').val()) == ''){ | |
| 193 | + layer.msg('请先输入Controler映射地址'); | |
| 194 | + | |
| 195 | + var wrap = $(this).iCheck('uncheck').parent(); | |
| 196 | + setTimeout(function(){ | |
| 197 | + wrap.removeClass('checked'); | |
| 198 | + $('input[name=baseRes]:eq(1)').iCheck('check'); | |
| 199 | + }, 100); | |
| 200 | + return false; | |
| 201 | + } | |
| 202 | + else{ | |
| 203 | + $('.defaultRes').slideDown(500, function(){ | |
| 204 | + $('#add_modal').animate({ | |
| 205 | + scrollTop: $('#add_modal')[0].scrollHeight | |
| 206 | + }, 1100); | |
| 207 | + | |
| 208 | + }); | |
| 209 | + } | |
| 210 | + } | |
| 211 | + else | |
| 212 | + $('.defaultRes').slideUp(); | |
| 213 | + }); | |
| 214 | + | |
| 215 | +/* $('select[name=pId]').on('change', function() { | |
| 216 | + var objs = $('input[name=path],input[name=mappSymbol]') | |
| 217 | + ,dr = $('.defaultRes'); | |
| 218 | + if (this.value == '-2') { | |
| 219 | + objs.attr('readonly', 'readonly'); | |
| 220 | + dr.hide(); | |
| 221 | + } else { | |
| 222 | + objs.removeAttr('readonly'); | |
| 223 | + dr.show(); | |
| 224 | + } | |
| 225 | + }); */ | |
| 226 | + | |
| 227 | + $('#groupSelect').on('change', function(){ | |
| 228 | + var id = $(this).val(); | |
| 229 | + $.each(groupData, function(i, obj){ | |
| 230 | + if(obj.id == id){ | |
| 231 | + var option = ''; | |
| 232 | + $.each(obj.dirs, function(i, dir){ | |
| 233 | + option += '<option value="'+dir.id+'">'+dir.name+'</option>'; | |
| 234 | + }); | |
| 235 | + $('#dirSelect').html(option); | |
| 236 | + return false; | |
| 237 | + } | |
| 238 | + }); | |
| 239 | + }); | |
| 240 | + | |
| 241 | + //提交 | |
| 242 | + $('#addModuleButton').on('click', function() { | |
| 243 | + form.submit(); | |
| 244 | + }); | |
| 245 | + //form validate | |
| 246 | + form.validate({ | |
| 247 | + errorElement : 'span', | |
| 248 | + errorClass : 'help-block help-block-error', | |
| 249 | + focusInvalid : false, | |
| 250 | + rules : { | |
| 251 | + name : { | |
| 252 | + minlength : 2, | |
| 253 | + required : true, | |
| 254 | + maxlength : 10 | |
| 255 | + }, | |
| 256 | + path : { | |
| 257 | + required : true | |
| 258 | + }/* , | |
| 259 | + mappSymbol: { | |
| 260 | + required : true | |
| 261 | + } */ | |
| 262 | + }, | |
| 263 | + invalidHandler : function(event, validator) { | |
| 264 | + error.show(); | |
| 265 | + App.scrollTo(error, -200); | |
| 266 | + }, | |
| 267 | + | |
| 268 | + highlight : function(element) { | |
| 269 | + $(element).closest('.form-group').addClass('has-error'); | |
| 270 | + }, | |
| 271 | + | |
| 272 | + unhighlight : function(element) { | |
| 273 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 274 | + }, | |
| 275 | + | |
| 276 | + success : function(label) { | |
| 277 | + label.closest('.form-group').removeClass('has-error'); | |
| 278 | + }, | |
| 279 | + | |
| 280 | + submitHandler : function(f) { | |
| 281 | + var params = form.serializeJSON(); | |
| 282 | + error.hide(); | |
| 283 | + $post('/module', params, function(res){ | |
| 284 | + layer.msg('新增模块成功.'); | |
| 285 | + | |
| 286 | + //添加资源 | |
| 287 | + if($('input[name=baseRes]:checked').val() == 1){ | |
| 288 | + submitBaseResource(res.t.id); | |
| 289 | + } | |
| 290 | + else{ | |
| 291 | + refreshJsTree(); | |
| 292 | + $('#add_modal').modal('hide'); | |
| 293 | + } | |
| 294 | + }); | |
| 295 | + } | |
| 296 | + }); | |
| 297 | + | |
| 298 | + | |
| 299 | + //提交默认资源 | |
| 300 | + function submitBaseResource(moduleId){ | |
| 301 | + var rows = $('.defaultRes table tbody')[0].rows | |
| 302 | + ,rsArray = []; | |
| 303 | + $.each(rows, function(i, r){ | |
| 304 | + var cells = r.cells | |
| 305 | + ,c = $(cells[0]).find(':checkbox') | |
| 306 | + ,resObj = {name: $.trim($(cells[3]).text()), url: $.trim($(cells[1]).text()) | |
| 307 | + ,method: $.trim($(cells[2]).text()),enable: c[0].checked,module: {id: moduleId}, descriptions: 'extends base' }; | |
| 308 | + | |
| 309 | + rsArray.push(resObj); | |
| 310 | + }); | |
| 311 | + | |
| 312 | + if(rsArray.length > 0){ | |
| 313 | + $post('/resource/batch', {array: JSON.stringify(rsArray)}, function(){ | |
| 314 | + layer.msg('添加资源成功.'); | |
| 315 | + | |
| 316 | + setTimeout(function(){ | |
| 317 | + refreshJsTree(); | |
| 318 | + $('#add_modal').modal('hide'); | |
| 319 | + }, 500); | |
| 320 | + }); | |
| 321 | + } | |
| 322 | + } | |
| 323 | + | |
| 324 | + //默认的BaseController接口 | |
| 325 | + /* function saveDefaultResource(t, rs){ | |
| 326 | + if(rs){ | |
| 327 | + var rsArray = []; | |
| 328 | + for(var n in rs) | |
| 329 | + rsArray = rsArray.concat(getDefaultRes(n, t.mappSymbol, t.id)); | |
| 330 | + | |
| 331 | + if(rsArray.length == 0) | |
| 332 | + return; | |
| 333 | + | |
| 334 | + $post('/resource/batch', {array: JSON.stringify(rsArray)}, function(){ | |
| 335 | + layer.msg('添加资源成功.'); | |
| 336 | + }); | |
| 337 | + } | |
| 338 | + } */ | |
| 339 | + | |
| 340 | + | |
| 341 | + function refreshFormData(cb){ | |
| 342 | + groupData = []; | |
| 343 | + $get('/module/findByGroupType',{group: '1,2'}, function(array){ | |
| 344 | + for(var i = 0,item; item=array[i++];){ | |
| 345 | + if(item.groupType == '1'){ | |
| 346 | + groupData.push(item); | |
| 347 | + } | |
| 348 | + | |
| 349 | + for(var j = 0,item2;item2=array[j++];){ | |
| 350 | + if(item2.pId == item.id){ | |
| 351 | + if(!item.dirs) | |
| 352 | + item.dirs = []; | |
| 353 | + item.dirs.push(item2); | |
| 354 | + | |
| 355 | + dirGroupMapp[item2.id] = item.id; | |
| 356 | + } | |
| 357 | + } | |
| 358 | + } | |
| 359 | + | |
| 360 | + var options = ''; | |
| 361 | + $.each(groupData, function(i, obj){ | |
| 362 | + options += '<option value="'+obj.id+'">'+obj.name+'</option>'; | |
| 363 | + }); | |
| 364 | + $('#groupSelect').html(options).change(); | |
| 365 | + | |
| 366 | + cb && cb(); | |
| 367 | + }); | |
| 368 | + } | |
| 369 | + | |
| 370 | + function getCurrSelNode(){ | |
| 371 | + return $.jstree.reference("#modules_tree").get_selected(true); | |
| 372 | + } | |
| 373 | + }); | |
| 373 | 374 | </script> |
| 374 | 375 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/permission/module/edit_modal.html
| 1 | -<!-- 编辑Modal --> | |
| 2 | -<div class="modal fade" id="edit_modal" tabindex="-1" role="basic" | |
| 3 | - aria-hidden="true"> | |
| 4 | - <div class="modal-dialog"> | |
| 5 | - <div class="modal-content"> | |
| 6 | - <div class="modal-header"> | |
| 7 | - <button type="button" class="close" data-dismiss="modal" | |
| 8 | - aria-hidden="true"></button> | |
| 9 | - <h4 class="modal-title">编辑模块</h4> | |
| 10 | - </div> | |
| 11 | - <div class="modal-body"> | |
| 12 | - <form class="form-horizontal" role="form" id="module_edit_form" | |
| 13 | - action="/module" method="post"> | |
| 14 | - <input type="hidden" name="groupType" value="3"> | |
| 15 | - <div class="alert alert-danger display-hide"> | |
| 16 | - <button class="close" data-close="alert"></button> | |
| 17 | - 您的输入有误,请检查下面的输入项 | |
| 18 | - </div> | |
| 19 | - <div class="form-body"> | |
| 20 | - <input name="id" type="hidden"> | |
| 21 | - <div class="form-group"> | |
| 22 | - <label class="col-md-3 control-label">所属组</label> | |
| 23 | - <div class="col-md-9"> | |
| 24 | - <select class="form-control input-medium " name="" id="groupSelect"></select> | |
| 25 | - </div> | |
| 26 | - </div> | |
| 27 | - <div class="form-group"> | |
| 28 | - <label class="col-md-3 control-label">所属目录</label> | |
| 29 | - <div class="col-md-9"> | |
| 30 | - <select class="form-control input-medium " name="pId" id="dirSelect"></select> | |
| 31 | - </div> | |
| 32 | - </div> | |
| 33 | - <div class="form-group"> | |
| 34 | - <label class="col-md-3 control-label">模块名</label> | |
| 35 | - <div class="col-md-9"> | |
| 36 | - <input type="text" class="form-control input-medium" name="name" > <span class="help-inline"> | |
| 37 | - 不要超过10个汉字长度 </span> | |
| 38 | - </div> | |
| 39 | - </div> | |
| 40 | - <div class="form-group"> | |
| 41 | - <label class="col-md-3 control-label">片段路径</label> | |
| 42 | - <div class="col-md-9"> | |
| 43 | - <input type="text" class="form-control input-medium" name="path" autocomplete="off"> | |
| 44 | - <span class="help-inline"> 片段,如:permission/module/list.html </span> | |
| 45 | - </div> | |
| 46 | - </div> | |
| 47 | - <div class="form-group"> | |
| 48 | - <label class="col-md-3 control-label">片段渲染容器</label> | |
| 49 | - <div class="col-md-9"> | |
| 50 | - <select class="form-control input-medium" name="container"> | |
| 51 | - <option value="pjax-container">pjax-container</option> | |
| 52 | - <option value="route-container">route-container</option> | |
| 53 | - </select> | |
| 54 | - </div> | |
| 55 | - </div> | |
| 56 | - <div class="form-group"> | |
| 57 | - <label class="col-md-3 control-label">映射</label> | |
| 58 | - <div class="col-md-9"> | |
| 59 | - <input type="text" class="form-control input-medium" | |
| 60 | - name="mappSymbol"> | |
| 61 | - <span class="help-inline"> Controller对应的映射符,如: /module </span> | |
| 62 | - </div> | |
| 63 | - </div> | |
| 64 | - <div class="form-group"> | |
| 65 | - <label class="col-md-3 control-label">是否可用</label> | |
| 66 | - <div class="col-md-9"> | |
| 67 | - <select class="form-control input-medium" name="enable"> | |
| 68 | - <option value="1">可用</option> | |
| 69 | - <option value="0">禁用</option> | |
| 70 | - </select> | |
| 71 | - </div> | |
| 72 | - </div> | |
| 73 | - <div class="form-group"> | |
| 74 | - <label class="col-md-3 control-label">描述</label> | |
| 75 | - <div class="col-md-9"> | |
| 76 | - <input type="text" class="form-control input-medium" name="descriptions"> | |
| 77 | - </div> | |
| 78 | - </div> | |
| 79 | - </div> | |
| 80 | - </form> | |
| 81 | - </div> | |
| 82 | - <div class="modal-footer"> | |
| 83 | - <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 84 | - <button type="button" class="btn btn-primary" id="editModuleButton">保存修改</button> | |
| 85 | - </div> | |
| 86 | - </div> | |
| 87 | - </div> | |
| 88 | -</div> | |
| 89 | -<script data-exclude=1> | |
| 90 | -$(function() { | |
| 91 | - | |
| 92 | - var groupData = [] | |
| 93 | - ,dirGroupMapp = {};//目录到组的映射 | |
| 94 | - | |
| 95 | - var form = $('#module_edit_form'); | |
| 96 | - var error = $('.alert-danger', form); | |
| 97 | - | |
| 98 | - //icheck | |
| 99 | - $('.icheck').iCheck({ | |
| 100 | - checkboxClass: 'icheckbox_flat-green', | |
| 101 | - radioClass: 'iradio_flat-green', | |
| 102 | - increaseArea: '20%' // optional | |
| 103 | - }); | |
| 104 | - | |
| 105 | - //modal 显示事件 | |
| 106 | - $('#edit_modal').on('show.bs.modal', function(){ | |
| 107 | - refreshFormData(function(){ | |
| 108 | - var sel = getCurrSelNode(); | |
| 109 | - if(sel.length > 0){ | |
| 110 | - var tree = $.jstree.reference('#modules_tree') | |
| 111 | - ,m = sel[0] | |
| 112 | - , d = tree.get_node(m.parent) | |
| 113 | - , g = tree.get_node(d.parent); | |
| 114 | - | |
| 115 | - drawFormData(m.original, '#module_edit_form');//写入表单数据 | |
| 116 | - $('#groupSelect').val(g.id).change(); | |
| 117 | - $('select[name=pId]').val(d.id).change(); | |
| 118 | - } | |
| 119 | - }); | |
| 120 | - }) | |
| 121 | - .modal('show'); | |
| 122 | - | |
| 123 | - $('#groupSelect').on('change', function(){ | |
| 124 | - var id = $(this).val(); | |
| 125 | - $.each(groupData, function(i, obj){ | |
| 126 | - if(obj.id == id){ | |
| 127 | - var option = ''; | |
| 128 | - $.each(obj.dirs, function(i, dir){ | |
| 129 | - option += '<option value="'+dir.id+'">'+dir.name+'</option>'; | |
| 130 | - }); | |
| 131 | - $('#dirSelect').html(option); | |
| 132 | - return false; | |
| 133 | - } | |
| 134 | - }); | |
| 135 | - }); | |
| 136 | - | |
| 137 | - //提交 | |
| 138 | - $('#editModuleButton').on('click', function() { | |
| 139 | - form.submit(); | |
| 140 | - }); | |
| 141 | - //form validate | |
| 142 | - form.validate({ | |
| 143 | - errorElement : 'span', | |
| 144 | - errorClass : 'help-block help-block-error', | |
| 145 | - focusInvalid : false, | |
| 146 | - rules : { | |
| 147 | - name : { | |
| 148 | - minlength : 2, | |
| 149 | - required : true, | |
| 150 | - maxlength : 10 | |
| 151 | - }, | |
| 152 | - path : { | |
| 153 | - required : true | |
| 154 | - }/* , | |
| 155 | - mappSymbol: { | |
| 156 | - required : true | |
| 157 | - } */ | |
| 158 | - }, | |
| 159 | - invalidHandler : function(event, validator) { | |
| 160 | - error.show(); | |
| 161 | - App.scrollTo(error, -200); | |
| 162 | - }, | |
| 163 | - | |
| 164 | - highlight : function(element) { | |
| 165 | - $(element).closest('.form-group').addClass('has-error'); | |
| 166 | - }, | |
| 167 | - | |
| 168 | - unhighlight : function(element) { | |
| 169 | - $(element).closest('.form-group').removeClass('has-error'); | |
| 170 | - }, | |
| 171 | - | |
| 172 | - success : function(label) { | |
| 173 | - label.closest('.form-group').removeClass('has-error'); | |
| 174 | - }, | |
| 175 | - | |
| 176 | - submitHandler : function(f) { | |
| 177 | - var params = form.serializeJSON(); | |
| 178 | - error.hide(); | |
| 179 | - $post('/module', params, function(res){ | |
| 180 | - layer.msg('修改模块成功.'); | |
| 181 | - refreshJsTree(); | |
| 182 | - $('#edit_modal').modal('hide'); | |
| 183 | - }); | |
| 184 | - } | |
| 185 | - }); | |
| 186 | - | |
| 187 | - function refreshFormData(cb){ | |
| 188 | - groupData = []; | |
| 189 | - $get('/module/findByGroupType',{group: '1,2'}, function(array){ | |
| 190 | - for(var i = 0,item; item=array[i++];){ | |
| 191 | - if(item.groupType == '1'){ | |
| 192 | - groupData.push(item); | |
| 193 | - } | |
| 194 | - | |
| 195 | - for(var j = 0,item2;item2=array[j++];){ | |
| 196 | - if(item2.pId == item.id){ | |
| 197 | - if(!item.dirs) | |
| 198 | - item.dirs = []; | |
| 199 | - item.dirs.push(item2); | |
| 200 | - | |
| 201 | - dirGroupMapp[item2.id] = item.id; | |
| 202 | - } | |
| 203 | - } | |
| 204 | - } | |
| 205 | - | |
| 206 | - var options = ''; | |
| 207 | - $.each(groupData, function(i, obj){ | |
| 208 | - options += '<option value="'+obj.id+'">'+obj.name+'</option>'; | |
| 209 | - }); | |
| 210 | - $('#groupSelect').html(options).change(); | |
| 211 | - | |
| 212 | - cb && cb(); | |
| 213 | - }); | |
| 214 | - } | |
| 215 | - | |
| 216 | - //将数据写入表单 | |
| 217 | - function drawFormData(json, fId){ | |
| 218 | - json.enable = json.enable==true? 1 : 0; | |
| 219 | - for(var att in json){ | |
| 220 | - var f = 'name=' +att | |
| 221 | - ,elem = $('input['+f+'],select['+f+']', fId); | |
| 222 | - if(elem.length > 0){ | |
| 223 | - elem.val(json[att]).change(); | |
| 224 | - } | |
| 225 | - } | |
| 226 | - } | |
| 227 | - | |
| 228 | - function getCurrSelNode(){ | |
| 229 | - return $.jstree.reference("#modules_tree").get_selected(true); | |
| 230 | - } | |
| 231 | -}); | |
| 1 | +<!-- 编辑Modal --> | |
| 2 | +<div class="modal fade" id="edit_modal" tabindex="-1" role="basic" | |
| 3 | + aria-hidden="true"> | |
| 4 | + <div class="modal-dialog"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + <div class="modal-header"> | |
| 7 | + <button type="button" class="close" data-dismiss="modal" | |
| 8 | + aria-hidden="true"></button> | |
| 9 | + <h4 class="modal-title">编辑模块</h4> | |
| 10 | + </div> | |
| 11 | + <div class="modal-body"> | |
| 12 | + <form class="form-horizontal" role="form" id="module_edit_form" | |
| 13 | + action="/module" method="post"> | |
| 14 | + <input type="hidden" name="groupType" value="3"> | |
| 15 | + <div class="alert alert-danger display-hide"> | |
| 16 | + <button class="close" data-close="alert"></button> | |
| 17 | + 您的输入有误,请检查下面的输入项 | |
| 18 | + </div> | |
| 19 | + <div class="form-body"> | |
| 20 | + <input name="id" type="hidden"> | |
| 21 | + <div class="form-group"> | |
| 22 | + <label class="col-md-3 control-label">所属组</label> | |
| 23 | + <div class="col-md-9"> | |
| 24 | + <select class="form-control input-medium " name="" id="groupSelect"></select> | |
| 25 | + </div> | |
| 26 | + </div> | |
| 27 | + <div class="form-group"> | |
| 28 | + <label class="col-md-3 control-label">所属目录</label> | |
| 29 | + <div class="col-md-9"> | |
| 30 | + <select class="form-control input-medium " name="pId" id="dirSelect"></select> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + <div class="form-group"> | |
| 34 | + <label class="col-md-3 control-label">模块名</label> | |
| 35 | + <div class="col-md-9"> | |
| 36 | + <input type="text" class="form-control input-medium" name="name" > <span class="help-inline"> | |
| 37 | + 不要超过10个汉字长度 </span> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + <div class="form-group"> | |
| 41 | + <label class="col-md-3 control-label">片段路径</label> | |
| 42 | + <div class="col-md-9"> | |
| 43 | + <input type="text" class="form-control input-medium" name="path" autocomplete="off"> | |
| 44 | + <span class="help-inline"> 片段,如:permission/module/list.html </span> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + <div class="form-group"> | |
| 48 | + <label class="col-md-3 control-label">片段渲染容器</label> | |
| 49 | + <div class="col-md-9"> | |
| 50 | + <select class="form-control input-medium" name="container"> | |
| 51 | + <option value="pjax-container">pjax-container</option> | |
| 52 | + <option value="route-container">route-container</option> | |
| 53 | + <option value="route-link">route-link</option> | |
| 54 | + </select> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + <div class="form-group"> | |
| 58 | + <label class="col-md-3 control-label">映射</label> | |
| 59 | + <div class="col-md-9"> | |
| 60 | + <input type="text" class="form-control input-medium" | |
| 61 | + name="mappSymbol"> | |
| 62 | + <span class="help-inline"> Controller对应的映射符,如: /module </span> | |
| 63 | + </div> | |
| 64 | + </div> | |
| 65 | + <div class="form-group"> | |
| 66 | + <label class="col-md-3 control-label">是否可用</label> | |
| 67 | + <div class="col-md-9"> | |
| 68 | + <select class="form-control input-medium" name="enable"> | |
| 69 | + <option value="1">可用</option> | |
| 70 | + <option value="0">禁用</option> | |
| 71 | + </select> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + <div class="form-group"> | |
| 75 | + <label class="col-md-3 control-label">描述</label> | |
| 76 | + <div class="col-md-9"> | |
| 77 | + <input type="text" class="form-control input-medium" name="descriptions"> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 81 | + </form> | |
| 82 | + </div> | |
| 83 | + <div class="modal-footer"> | |
| 84 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 85 | + <button type="button" class="btn btn-primary" id="editModuleButton">保存修改</button> | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + </div> | |
| 89 | +</div> | |
| 90 | +<script data-exclude=1> | |
| 91 | +$(function() { | |
| 92 | + | |
| 93 | + var groupData = [] | |
| 94 | + ,dirGroupMapp = {};//目录到组的映射 | |
| 95 | + | |
| 96 | + var form = $('#module_edit_form'); | |
| 97 | + var error = $('.alert-danger', form); | |
| 98 | + | |
| 99 | + //icheck | |
| 100 | + $('.icheck').iCheck({ | |
| 101 | + checkboxClass: 'icheckbox_flat-green', | |
| 102 | + radioClass: 'iradio_flat-green', | |
| 103 | + increaseArea: '20%' // optional | |
| 104 | + }); | |
| 105 | + | |
| 106 | + //modal 显示事件 | |
| 107 | + $('#edit_modal').on('show.bs.modal', function(){ | |
| 108 | + refreshFormData(function(){ | |
| 109 | + var sel = getCurrSelNode(); | |
| 110 | + if(sel.length > 0){ | |
| 111 | + var tree = $.jstree.reference('#modules_tree') | |
| 112 | + ,m = sel[0] | |
| 113 | + , d = tree.get_node(m.parent) | |
| 114 | + , g = tree.get_node(d.parent); | |
| 115 | + | |
| 116 | + drawFormData(m.original, '#module_edit_form');//写入表单数据 | |
| 117 | + $('#groupSelect').val(g.id).change(); | |
| 118 | + $('select[name=pId]').val(d.id).change(); | |
| 119 | + } | |
| 120 | + }); | |
| 121 | + }) | |
| 122 | + .modal('show'); | |
| 123 | + | |
| 124 | + $('#groupSelect').on('change', function(){ | |
| 125 | + var id = $(this).val(); | |
| 126 | + $.each(groupData, function(i, obj){ | |
| 127 | + if(obj.id == id){ | |
| 128 | + var option = ''; | |
| 129 | + $.each(obj.dirs, function(i, dir){ | |
| 130 | + option += '<option value="'+dir.id+'">'+dir.name+'</option>'; | |
| 131 | + }); | |
| 132 | + $('#dirSelect').html(option); | |
| 133 | + return false; | |
| 134 | + } | |
| 135 | + }); | |
| 136 | + }); | |
| 137 | + | |
| 138 | + //提交 | |
| 139 | + $('#editModuleButton').on('click', function() { | |
| 140 | + form.submit(); | |
| 141 | + }); | |
| 142 | + //form validate | |
| 143 | + form.validate({ | |
| 144 | + errorElement : 'span', | |
| 145 | + errorClass : 'help-block help-block-error', | |
| 146 | + focusInvalid : false, | |
| 147 | + rules : { | |
| 148 | + name : { | |
| 149 | + minlength : 2, | |
| 150 | + required : true, | |
| 151 | + maxlength : 10 | |
| 152 | + }, | |
| 153 | + path : { | |
| 154 | + required : true | |
| 155 | + }/* , | |
| 156 | + mappSymbol: { | |
| 157 | + required : true | |
| 158 | + } */ | |
| 159 | + }, | |
| 160 | + invalidHandler : function(event, validator) { | |
| 161 | + error.show(); | |
| 162 | + App.scrollTo(error, -200); | |
| 163 | + }, | |
| 164 | + | |
| 165 | + highlight : function(element) { | |
| 166 | + $(element).closest('.form-group').addClass('has-error'); | |
| 167 | + }, | |
| 168 | + | |
| 169 | + unhighlight : function(element) { | |
| 170 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 171 | + }, | |
| 172 | + | |
| 173 | + success : function(label) { | |
| 174 | + label.closest('.form-group').removeClass('has-error'); | |
| 175 | + }, | |
| 176 | + | |
| 177 | + submitHandler : function(f) { | |
| 178 | + var params = form.serializeJSON(); | |
| 179 | + error.hide(); | |
| 180 | + $post('/module', params, function(res){ | |
| 181 | + layer.msg('修改模块成功.'); | |
| 182 | + refreshJsTree(); | |
| 183 | + $('#edit_modal').modal('hide'); | |
| 184 | + }); | |
| 185 | + } | |
| 186 | + }); | |
| 187 | + | |
| 188 | + function refreshFormData(cb){ | |
| 189 | + groupData = []; | |
| 190 | + $get('/module/findByGroupType',{group: '1,2'}, function(array){ | |
| 191 | + for(var i = 0,item; item=array[i++];){ | |
| 192 | + if(item.groupType == '1'){ | |
| 193 | + groupData.push(item); | |
| 194 | + } | |
| 195 | + | |
| 196 | + for(var j = 0,item2;item2=array[j++];){ | |
| 197 | + if(item2.pId == item.id){ | |
| 198 | + if(!item.dirs) | |
| 199 | + item.dirs = []; | |
| 200 | + item.dirs.push(item2); | |
| 201 | + | |
| 202 | + dirGroupMapp[item2.id] = item.id; | |
| 203 | + } | |
| 204 | + } | |
| 205 | + } | |
| 206 | + | |
| 207 | + var options = ''; | |
| 208 | + $.each(groupData, function(i, obj){ | |
| 209 | + options += '<option value="'+obj.id+'">'+obj.name+'</option>'; | |
| 210 | + }); | |
| 211 | + $('#groupSelect').html(options).change(); | |
| 212 | + | |
| 213 | + cb && cb(); | |
| 214 | + }); | |
| 215 | + } | |
| 216 | + | |
| 217 | + //将数据写入表单 | |
| 218 | + function drawFormData(json, fId){ | |
| 219 | + json.enable = json.enable==true? 1 : 0; | |
| 220 | + for(var att in json){ | |
| 221 | + var f = 'name=' +att | |
| 222 | + ,elem = $('input['+f+'],select['+f+']', fId); | |
| 223 | + if(elem.length > 0){ | |
| 224 | + elem.val(json[att]).change(); | |
| 225 | + } | |
| 226 | + } | |
| 227 | + } | |
| 228 | + | |
| 229 | + function getCurrSelNode(){ | |
| 230 | + return $.jstree.reference("#modules_tree").get_selected(true); | |
| 231 | + } | |
| 232 | +}); | |
| 232 | 233 | </script> |
| 233 | 234 | \ No newline at end of file | ... | ... |