Commit dd087e204c02069dd26d21faf1491516df16f499
1 parent
d5dca6f2
线调更新
Showing
4 changed files
with
1020 additions
and
0 deletions
src/main/resources/static/pages/permission/user/authorize.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="zh-cn"> | ||
| 3 | + | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/> | ||
| 7 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | ||
| 8 | + <link rel="stylesheet" href="/assets/plugins/ztree_v3/css/zTreeStyle/zTreeStyle.css" /> | ||
| 9 | + <style> | ||
| 10 | + html,body{ | ||
| 11 | + height: 100%; | ||
| 12 | + } | ||
| 13 | + .ct_page{ | ||
| 14 | + padding: 25px 15px; | ||
| 15 | + height: 100%; | ||
| 16 | + height: calc(100% - 50px); | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + .ct_cont{ | ||
| 20 | + height: calc(100% - 41px); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + .ct_cont>div>div.uk-card{ | ||
| 24 | + height: 99%; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + form .uk-inline{ | ||
| 28 | + width: calc(100% - 4px); | ||
| 29 | + margin-left: 2px; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + .ct-card-body{ | ||
| 33 | + overflow: auto; | ||
| 34 | + padding: 1px 1px 0 2px; | ||
| 35 | + height: calc(100% - 54px); | ||
| 36 | + position: relative; | ||
| 37 | + margin-top: -12px; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + .ct_li_desc{ | ||
| 41 | + color: #a8a8a8; | ||
| 42 | + font-size: 13px; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + .ct-card-body .uk-list-large{ | ||
| 46 | + font-size: 14px; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + .ct-card-body .uk-list-large>li{ | ||
| 50 | + cursor: default; | ||
| 51 | + padding-left: 20px; | ||
| 52 | + margin-top: 2px !important; | ||
| 53 | + padding-top: 17px !important; | ||
| 54 | + position: relative; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + .ct-card-body .uk-list-large>li:hover{ | ||
| 58 | + background: #edecec; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + .ct-card-body .uk-list-large>li.active{ | ||
| 62 | + background: #1e87f0 !important; | ||
| 63 | + color: white; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + .ct-card-body .uk-list-large>li.active>span.role-code{ | ||
| 67 | + color: #ffffff; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + .ct-card-body .uk-list-large.role-list>li:hover{ | ||
| 71 | + background: #fff494; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + .ct-card-body .uk-list-large>li.active .ct_li_desc{ | ||
| 75 | + color: #e6e6e6; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + .ct-card-body .uk-list-large>li>span.uk-badge{ | ||
| 79 | + position: absolute; | ||
| 80 | + top: 17px; | ||
| 81 | + right: 25px; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + .ct-card-body .uk-list-large>li>span.role-code{ | ||
| 85 | + padding: 4px 6px; | ||
| 86 | + color: #a8a8a8; | ||
| 87 | + margin-left: 5px; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + .top_title{ | ||
| 91 | + padding: 9px 0 5px 15px; | ||
| 92 | + border-bottom: 1px solid #ededed; | ||
| 93 | + border-left: 5px solid #FFC107; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + .top_title>.desc{ | ||
| 97 | + font-size: 13px; | ||
| 98 | + color: grey; | ||
| 99 | + margin-top: 3px; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + .left_menu_list{ | ||
| 103 | + overflow: auto; | ||
| 104 | + position: relative; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + .left_menu_list .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{ | ||
| 108 | + opacity: 0.6 !important; | ||
| 109 | + padding: 0 !important; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + ._company{ | ||
| 113 | + margin: 15px 0px; | ||
| 114 | + } | ||
| 115 | + ._company>h5{ | ||
| 116 | + margin-bottom: 10px; | ||
| 117 | + font-size: 15px; | ||
| 118 | + color: #6b6b6b; | ||
| 119 | + text-indent: 12px; | ||
| 120 | + } | ||
| 121 | + ._company>._fgs>label{ | ||
| 122 | + padding: 3px 12px 3px 10px; | ||
| 123 | + display: inline-block; | ||
| 124 | + border: 1px solid gainsboro; | ||
| 125 | + border-radius: 2px; | ||
| 126 | + margin: 5px; | ||
| 127 | + font-size: 14px; | ||
| 128 | + } | ||
| 129 | + ._company>._fgs>label.active{ | ||
| 130 | + background: #1e87f0; | ||
| 131 | + color: #fff; | ||
| 132 | + } | ||
| 133 | + ._company .uk-checkbox:checked:focus, | ||
| 134 | + .line_checkbox_list .uk-checkbox:checked:focus{ | ||
| 135 | + background-color: #1e87f0 !important; | ||
| 136 | + } | ||
| 137 | + .save_icon{ | ||
| 138 | + position: absolute; | ||
| 139 | + right: 2px; | ||
| 140 | + background: #bec4c9; | ||
| 141 | + font-size: 12px; | ||
| 142 | + padding: 2px 15px; | ||
| 143 | + color: #fff; | ||
| 144 | + box-shadow: 0 5px 15px rgba(0,0,0,0.08); | ||
| 145 | + cursor: pointer; | ||
| 146 | + } | ||
| 147 | + .save_icon:hover{ | ||
| 148 | + background: #FFC107; | ||
| 149 | + } | ||
| 150 | + .data_auth_list{ | ||
| 151 | + position: relative; | ||
| 152 | + } | ||
| 153 | + #user_authorize_wrap .top_title{ | ||
| 154 | + border-left: 5px solid #cacac8; | ||
| 155 | + } | ||
| 156 | + .xd_line_list{ | ||
| 157 | + height: 37%; | ||
| 158 | + padding: 7px; | ||
| 159 | + border-bottom: 1px solid #f2f2f2; | ||
| 160 | + overflow: auto; | ||
| 161 | + position: relative; | ||
| 162 | + } | ||
| 163 | + .xd_line_list>h5{ | ||
| 164 | + color: #858585; | ||
| 165 | + margin: 5px 5px 5px 0; | ||
| 166 | + font-size: 14px; | ||
| 167 | + } | ||
| 168 | + .sub_lines{ | ||
| 169 | + padding-left: 15px; | ||
| 170 | + } | ||
| 171 | + .sub_lines>span.line_btn { | ||
| 172 | + background: #00BCD4; | ||
| 173 | + color: #fff; | ||
| 174 | + padding: 4px 9px; | ||
| 175 | + display: inline-block; | ||
| 176 | + min-width: 68px; | ||
| 177 | + text-align: center; | ||
| 178 | + margin: 5px 2px; | ||
| 179 | + box-shadow: 0 5px 9px rgba(0,0,0,0.08); | ||
| 180 | + cursor: pointer; | ||
| 181 | + font-size: 14px; | ||
| 182 | + font-family: 微软雅黑; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + .sub_lines>span.line_btn.destroy{ | ||
| 186 | + background: #ff5c5c; | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + .sub_lines>span.line_btn.destroy:hover{ | ||
| 190 | + background: #ff7373; | ||
| 191 | + } | ||
| 192 | + | ||
| 193 | + .sub_lines>span.line_btn:hover{ | ||
| 194 | + background: #2dd7ed; | ||
| 195 | + } | ||
| 196 | + .add_line_icon{ | ||
| 197 | + cursor: pointer; | ||
| 198 | + padding: 2px 5px; | ||
| 199 | + border-radius: 5px; | ||
| 200 | + display: inline-block; | ||
| 201 | + } | ||
| 202 | + .add_line_icon>i{ | ||
| 203 | + vertical-align: top; | ||
| 204 | + margin-top: 3px; | ||
| 205 | + } | ||
| 206 | + .add_line_icon:hover{ | ||
| 207 | + background: #ededed; | ||
| 208 | + } | ||
| 209 | + .ct_pattern_form{ | ||
| 210 | + display: inline-block; | ||
| 211 | + } | ||
| 212 | + .xd_menu_grid{ | ||
| 213 | + padding: 25px 25px 0 25px; | ||
| 214 | + height: calc(63% - 91px); | ||
| 215 | + } | ||
| 216 | + .xd_menu_grid .uk-list{ | ||
| 217 | + border: 1px solid #ededed; | ||
| 218 | + height: calc(100% - 70px); | ||
| 219 | + overflow: auto; | ||
| 220 | + position: relative; | ||
| 221 | + } | ||
| 222 | + | ||
| 223 | + .xd_menu_grid .uk-list>li{ | ||
| 224 | + margin: 5px 0 !important; | ||
| 225 | + padding: 10px 0 0 10px !important; | ||
| 226 | + font-size: 14px; | ||
| 227 | + } | ||
| 228 | + .top_tools{ | ||
| 229 | + position: absolute; | ||
| 230 | + top: 15px; | ||
| 231 | + right: 25px; | ||
| 232 | + } | ||
| 233 | + .ct_field { | ||
| 234 | + display: inline-block; | ||
| 235 | + width: 240px; | ||
| 236 | + } | ||
| 237 | + .ct_field>select,.ct_field>input{ | ||
| 238 | + width: calc(100% - 60px); | ||
| 239 | + } | ||
| 240 | + .line_checkbox_list{ | ||
| 241 | + margin-top: 15px; | ||
| 242 | + } | ||
| 243 | + .line_checkbox_list>.btn{ | ||
| 244 | + padding: 5px 7px; | ||
| 245 | + border-radius: 2px; | ||
| 246 | + display: inline-block; | ||
| 247 | + margin: 4px 9px; | ||
| 248 | + font-size: 14px; | ||
| 249 | + font-family: 微软雅黑; | ||
| 250 | + border: 1px solid #d9d9d9; | ||
| 251 | + width: 100px; | ||
| 252 | + overflow: hidden; | ||
| 253 | + text-overflow: ellipsis; | ||
| 254 | + white-space: nowrap; | ||
| 255 | + } | ||
| 256 | + .line_checkbox_list>.btn>input{ | ||
| 257 | + margin-right: 5px; | ||
| 258 | + } | ||
| 259 | + .line_checkbox_list>.btn.active{ | ||
| 260 | + background: #1e87f0; | ||
| 261 | + color: #fff; | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + .line_checkbox_list>.btn.destroy, | ||
| 265 | + .line_checkbox_list>.btn.destroy>input{ | ||
| 266 | + border-color: #ff9595; | ||
| 267 | + color: #ff5c5c; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + .line_checkbox_list>.btn.destroy.active{ | ||
| 271 | + background: #ff5c5c; | ||
| 272 | + color: #fff; | ||
| 273 | + } | ||
| 274 | + | ||
| 275 | + .line_checkbox_list>.btn.destroy.active>input{ | ||
| 276 | + background-color: #ff5c5c !important; | ||
| 277 | + border-color: #ff5c5c !important; | ||
| 278 | + } | ||
| 279 | + | ||
| 280 | + #role_authorize_wrap .ztree *{ | ||
| 281 | + font-size: 14px; | ||
| 282 | + } | ||
| 283 | + #role_authorize_wrap .ztree li{ | ||
| 284 | + line-height: 21px; | ||
| 285 | + } | ||
| 286 | + .loading{ | ||
| 287 | + height: 100%; | ||
| 288 | + text-align: center; | ||
| 289 | + } | ||
| 290 | + .loading .uk-spinner{ | ||
| 291 | + margin-top: 200px; | ||
| 292 | + } | ||
| 293 | + .loading circle{ | ||
| 294 | + stroke: red; | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + #select_line_modal .uk-checkbox:checked { | ||
| 298 | + background-color: #1e87f0; | ||
| 299 | + } | ||
| 300 | + </style> | ||
| 301 | +</head> | ||
| 302 | + | ||
| 303 | +<body> | ||
| 304 | +<div class="loading"> | ||
| 305 | + <div uk-spinner></div> | ||
| 306 | +</div> | ||
| 307 | +<div class="ct_page" style="display: none;"> | ||
| 308 | + <h2 class="uk-heading-line uk-heading-bullet"><span>用户授权管理</span></h2> | ||
| 309 | + <div class="ct_cont uk-grid-small uk-child-width-expand" uk-grid> | ||
| 310 | + <div class="role_list uk-width-1-4 "> | ||
| 311 | + <div class="uk-card uk-card-default"> | ||
| 312 | + <form> | ||
| 313 | + <div class="uk-margin"> | ||
| 314 | + <div class="uk-inline" > | ||
| 315 | + <!--<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>--> | ||
| 316 | + <!--<input class="uk-input role_search_input" type="text" placeholder="搜索角色">--> | ||
| 317 | + </div> | ||
| 318 | + </div> | ||
| 319 | + </form> | ||
| 320 | + | ||
| 321 | + <div class="ct-card-body" > | ||
| 322 | + <ul class="uk-list uk-list-large uk-list-divider role-list"> | ||
| 323 | + </ul> | ||
| 324 | + </div> | ||
| 325 | + </div> | ||
| 326 | + </div> | ||
| 327 | + <div class="user_list uk-width-1-5 "> | ||
| 328 | + <div class="uk-card uk-card-default"> | ||
| 329 | + <form> | ||
| 330 | + <div class="uk-margin"> | ||
| 331 | + <div class="uk-inline" > | ||
| 332 | + <!--<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>--> | ||
| 333 | + <!--<input class="uk-input user_search_input" type="text" placeholder="搜索用户">--> | ||
| 334 | + </div> | ||
| 335 | + </div> | ||
| 336 | + </form> | ||
| 337 | + | ||
| 338 | + <div class="ct-card-body"> | ||
| 339 | + <ul class="uk-list uk-list-large user-list"> | ||
| 340 | + </ul> | ||
| 341 | + </div> | ||
| 342 | + </div> | ||
| 343 | + </div> | ||
| 344 | + <div class="auth_cont "> | ||
| 345 | + <div class="uk-card uk-card-default authorize_right_cont"> | ||
| 346 | + | ||
| 347 | + </div> | ||
| 348 | + </div> | ||
| 349 | + </div> | ||
| 350 | +</div> | ||
| 351 | + | ||
| 352 | +<script id="authorize-role-list-temp" type="text/html"> | ||
| 353 | + {{each list as r i}} | ||
| 354 | + <li data-id="{{r.id}}" data-name="{{r.roleName}}" data-code="{{r.codeUp}}">{{r.roleName}} | ||
| 355 | + <span class="role-code">{{r.codeName}}</span> | ||
| 356 | + <div class="ct_li_desc">{{r.createDateStr}}</div> | ||
| 357 | + <span class="uk-badge">{{r.count}}</span> | ||
| 358 | + </li> | ||
| 359 | + {{/each}} | ||
| 360 | +</script> | ||
| 361 | +<script id="authorize-user-list-temp" type="text/html"> | ||
| 362 | + {{each list as u i}} | ||
| 363 | + <li class="uk-animation-fade uk-animation-fast" data-name="{{u.name}}" data-code="{{u.userNameUp}}" data-id="{{u.id}}">{{u.name}}<span class="role-code">{{u.userName}}</span></li> | ||
| 364 | + {{/each}} | ||
| 365 | +</script> | ||
| 366 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | ||
| 367 | +<script src="/assets/js/common.js"></script> | ||
| 368 | +<script src="/assets/plugins/uk3.0/uikit.min.js"></script> | ||
| 369 | +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script> | ||
| 370 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | ||
| 371 | +<!-- EventProxy --> | ||
| 372 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 373 | +<!-- art-template 模版引擎 --> | ||
| 374 | +<script src="/assets/plugins/template.js"></script> | ||
| 375 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | ||
| 376 | +<script src="/assets/plugins/ztree_v3/js/jquery.ztree.core.min.js"></script> | ||
| 377 | +<script src="/assets/plugins/ztree_v3/js/jquery.ztree.excheck.min.js"></script> | ||
| 378 | +<script> | ||
| 379 | + var storage = window.localStorage; | ||
| 380 | + | ||
| 381 | + if (typeof String.prototype.startsWith != 'function') { | ||
| 382 | + String.prototype.startsWith = function (prefix){ | ||
| 383 | + return this.slice(0, prefix.length) === prefix; | ||
| 384 | + }; | ||
| 385 | + } | ||
| 386 | + var roles,users,role_users,modules,companyData,lineArray; | ||
| 387 | + | ||
| 388 | + var ep = EventProxy.create('query_roles', 'query_users', 'query_modules', 'query_company', 'query_line', function (rs, us, ms, cs, lines) { | ||
| 389 | + roles = rs; | ||
| 390 | + users = us; | ||
| 391 | + modules = ms; | ||
| 392 | + companyData = cs; | ||
| 393 | + lineArray=lines; | ||
| 394 | + role_users = {}; | ||
| 395 | + debugger | ||
| 396 | + for(var i=0,r;r=roles[i++];){ | ||
| 397 | + r.count=0; | ||
| 398 | + role_users[r.id]=[]; | ||
| 399 | + r.createDateStr=moment(r.createDate).format('YYYY-MM-DD HH:ss'); | ||
| 400 | + r.codeUp=r.codeName.toUpperCase(); | ||
| 401 | + for(var j=0,u;u=users[j++];){ | ||
| 402 | + if(u.roles.indexOf(r.id)!=-1){ | ||
| 403 | + r.count++; | ||
| 404 | + role_users[r.id].push(u); | ||
| 405 | + } | ||
| 406 | + } | ||
| 407 | + } | ||
| 408 | + //渲染角色list | ||
| 409 | + render_role_list(roles); | ||
| 410 | + //渲染用户list | ||
| 411 | + render_user_list(users); | ||
| 412 | + | ||
| 413 | + $('.loading').remove(); | ||
| 414 | + $('.ct_page').show(); | ||
| 415 | + }); | ||
| 416 | + | ||
| 417 | + //角色点击 | ||
| 418 | + $('ul.role-list').on('click', 'li', roleClickHanlder); | ||
| 419 | + //用户点击 | ||
| 420 | + $('ul.user-list').on('click', 'li', userClickHanlder); | ||
| 421 | + | ||
| 422 | + | ||
| 423 | + function roleClickHanlder() { | ||
| 424 | + if($(this).hasClass('active') && $('ul.user-list>li.active').length==0) | ||
| 425 | + return; | ||
| 426 | + | ||
| 427 | + reset_dom(); | ||
| 428 | + $('ul.role-list>li.active').removeClass('active'); | ||
| 429 | + $(this).addClass('active'); | ||
| 430 | + //重新渲染用户list | ||
| 431 | + var id = $(this).data('id'); | ||
| 432 | + render_user_list(role_users[id]); | ||
| 433 | + //加载角色授权页面 | ||
| 434 | + $('.authorize_right_cont').load('/pages/permission/authorize_all/role_auth.html', function () { | ||
| 435 | + $('#role_authorize_wrap', this).trigger('init', {role: get_role(id), modules: modules, companyData: companyData}); | ||
| 436 | + }); | ||
| 437 | + } | ||
| 438 | + | ||
| 439 | + function userClickHanlder() { | ||
| 440 | + if($(this).hasClass('active')) | ||
| 441 | + return; | ||
| 442 | + | ||
| 443 | + reset_dom(); | ||
| 444 | + $('ul.user-list>li.active').removeClass('active'); | ||
| 445 | + $(this).addClass('active'); | ||
| 446 | + | ||
| 447 | + //加载用户授权页面 | ||
| 448 | + var id = $(this).data('id'); | ||
| 449 | + $('.authorize_right_cont').load('/pages/permission/authorize_all/user_auth.html', function () { | ||
| 450 | + $('#user_authorize_wrap', this).trigger('init', {user: get_user(id),lineArray:lineArray, companyData:companyData}); | ||
| 451 | + }); | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + //refresh-user | ||
| 455 | + $('.authorize_right_cont').on('refresh-user', function () { | ||
| 456 | + $('ul.user-list>li.active').removeClass('active').trigger('click'); | ||
| 457 | + }); | ||
| 458 | + | ||
| 459 | + function reset_dom() { | ||
| 460 | + $('#select_line_modal').remove(); | ||
| 461 | + } | ||
| 462 | + | ||
| 463 | + //滚动条 | ||
| 464 | + $('.ct_page .uk-card .ct-card-body').perfectScrollbar({suppressScrollX: true}); | ||
| 465 | + | ||
| 466 | + //query all role | ||
| 467 | + var paramsRole = {}; | ||
| 468 | + paramsRole['codeName'] = 'ROLE_ADMIN'; | ||
| 469 | + var storage = window.localStorage; | ||
| 470 | + var userId=storage.getItem("editUser"); | ||
| 471 | + $get('/user',{id_eq:userId}, function (rs) { | ||
| 472 | + debugger | ||
| 473 | + //if (rs) | ||
| 474 | + ep.emit('query_roles', rs.content[0].roles); | ||
| 475 | + }); | ||
| 476 | + | ||
| 477 | + | ||
| 478 | + //query all user | ||
| 479 | + var paramsUser = {}; | ||
| 480 | + paramsRole['name'] = 'name'; | ||
| 481 | + $.get('/user/all_distinct',paramsUser, function (rs) { | ||
| 482 | + var userA={}; | ||
| 483 | + for(var i=0,u;u=rs[i++];){ | ||
| 484 | + if (u.id==userId){ | ||
| 485 | + discard_field(u); | ||
| 486 | + u.userNameUp=u.userName.toUpperCase(); | ||
| 487 | + u.lastLoginDateStr=moment(u.lastLoginDate).format('YYYY-MM-DD HH:ss'); | ||
| 488 | + userA[0]=u; | ||
| 489 | + } | ||
| 490 | + } | ||
| 491 | + ep.emit('query_users', userA); | ||
| 492 | + }); | ||
| 493 | + | ||
| 494 | + //query all modules | ||
| 495 | + $.get('/module/all_distinct', function (rs) { | ||
| 496 | + ep.emit('query_modules', rs); | ||
| 497 | + }); | ||
| 498 | + | ||
| 499 | + //query all company data | ||
| 500 | + $.get('/business/all', function (rs) { | ||
| 501 | + ep.emit('query_company', rs); | ||
| 502 | + }); | ||
| 503 | + | ||
| 504 | + //query all line | ||
| 505 | + $.get('/line/all', {'remove_ne': 1}, function (rs) { | ||
| 506 | + ep.emit('query_line', rs); | ||
| 507 | + }); | ||
| 508 | + | ||
| 509 | + function discard_field(u) { | ||
| 510 | + var array = []; | ||
| 511 | + $.each(u.roles, function () { | ||
| 512 | + array.push(this.id); | ||
| 513 | + }); | ||
| 514 | + u.roles = array; | ||
| 515 | + } | ||
| 516 | + | ||
| 517 | + function render_role_list(list) { | ||
| 518 | + var htmlStr = template('authorize-role-list-temp', {list: list}); | ||
| 519 | + $('ul.role-list').html(htmlStr); | ||
| 520 | + up_scroll(); | ||
| 521 | + } | ||
| 522 | + | ||
| 523 | + | ||
| 524 | + function render_user_list(list) { | ||
| 525 | + var htmlStr = template('authorize-user-list-temp', {list: list}); | ||
| 526 | + $('ul.user-list').html(htmlStr); | ||
| 527 | + up_scroll(); | ||
| 528 | + } | ||
| 529 | + | ||
| 530 | + function reset_role_list(){ | ||
| 531 | + var actives = $('ul.role-list>li.active'); | ||
| 532 | + if(actives.length > 0){ | ||
| 533 | + $('ul.role-list>li.active').removeClass('active'); | ||
| 534 | + render_user_list(users); | ||
| 535 | + $('.authorize_right_cont').empty(); | ||
| 536 | + } | ||
| 537 | + } | ||
| 538 | + | ||
| 539 | + function up_scroll() { | ||
| 540 | + $('.ct_page .uk-card .ct-card-body').perfectScrollbar('update'); | ||
| 541 | + } | ||
| 542 | + | ||
| 543 | + | ||
| 544 | + | ||
| 545 | + function get_role(id) { | ||
| 546 | + for(var i=0,r;r=roles[i++];){ | ||
| 547 | + if(r.id==id) | ||
| 548 | + return r; | ||
| 549 | + } | ||
| 550 | + return null; | ||
| 551 | + } | ||
| 552 | + | ||
| 553 | + function get_user(id) { | ||
| 554 | + for(var i=0,u;u=users[i++];){ | ||
| 555 | + if(u.id==id) | ||
| 556 | + return u; | ||
| 557 | + } | ||
| 558 | + return null; | ||
| 559 | + } | ||
| 560 | + | ||
| 561 | + $(document).on('submit', 'form', function () { | ||
| 562 | + return false; | ||
| 563 | + }); | ||
| 564 | + | ||
| 565 | + function convert_buss_data(rs) { | ||
| 566 | + var baseCode; | ||
| 567 | + //找到跟节点 | ||
| 568 | + $.each(rs, function () { | ||
| 569 | + if(this.upCode == 0){ | ||
| 570 | + baseCode=this.businessCode; | ||
| 571 | + return false; | ||
| 572 | + } | ||
| 573 | + }); | ||
| 574 | + if(!baseCode){ | ||
| 575 | + alert('大爷找不到根节点,数据有问题吧!!!'); | ||
| 576 | + return; | ||
| 577 | + } | ||
| 578 | + //提取二级节点 | ||
| 579 | + var secondMap={}; | ||
| 580 | + $.each(rs, function () { | ||
| 581 | + if(this.upCode==baseCode){ | ||
| 582 | + secondMap[this.businessCode] = { | ||
| 583 | + name: this.businessName, | ||
| 584 | + childs: [] | ||
| 585 | + }; | ||
| 586 | + } | ||
| 587 | + }); | ||
| 588 | + //分公司节点 | ||
| 589 | + $.each(rs, function () { | ||
| 590 | + if(secondMap[this.upCode]) | ||
| 591 | + secondMap[this.upCode].childs.push(this); | ||
| 592 | + }); | ||
| 593 | + | ||
| 594 | + //排序 | ||
| 595 | + for(var sid in secondMap){ | ||
| 596 | + secondMap[sid].childs.sort(naturalSort); | ||
| 597 | + } | ||
| 598 | + | ||
| 599 | + return secondMap; | ||
| 600 | + } | ||
| 601 | + | ||
| 602 | + var naturalSort=function (a, b) { | ||
| 603 | + return a.businessName.localeCompare(b.businessName); | ||
| 604 | + }; | ||
| 605 | + | ||
| 606 | + var groupBy = function (list, field) { | ||
| 607 | + var rs = {}, | ||
| 608 | + key; | ||
| 609 | + $.each(list, function () { | ||
| 610 | + key = this[field]; | ||
| 611 | + if (!rs[key]) | ||
| 612 | + rs[key] = []; | ||
| 613 | + | ||
| 614 | + rs[key].push(this); | ||
| 615 | + }); | ||
| 616 | + | ||
| 617 | + return rs; | ||
| 618 | + }; | ||
| 619 | +</script> | ||
| 620 | +</body> | ||
| 621 | +</html> | ||
| 0 | \ No newline at end of file | 622 | \ No newline at end of file |
src/main/resources/static/pages/permission/user/main.html
0 → 100644
| 1 | +<iframe src="authorize.html?origin=real_control_iframe" frameborder="0" style="height: 90%;width: 100%;"></iframe> | ||
| 2 | +<div class="form-actions"> | ||
| 3 | + <div class="row"> | ||
| 4 | + <div class="col-md-offset-3 col-md-4"> | ||
| 5 | + <!--<a href="main.html" class="btn green" ><i class="fa fa-check"></i> 上一步</a>--> | ||
| 6 | + <!--<button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button>--> | ||
| 7 | + <!--<a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a>--> | ||
| 8 | + </div> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 0 | \ No newline at end of file | 11 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/fbzdzx_config.html
0 → 100644
| 1 | +<div id="nav-fbzdzx_config-modal" class="uk-modal"> | ||
| 2 | + <div class="uk-modal-dialog uk-modal-dialog-blank" style="overflow: hidden;"> | ||
| 3 | + <button class="uk-modal-close uk-close" type="button"></button> | ||
| 4 | + <div class="uk-grid uk-flex-middle" data-uk-grid-margin> | ||
| 5 | + <div class="uk-width-medium-1-6 uk-height-viewport line-config-tree" data-uk-observe> | ||
| 6 | + <h3 class="title">翻班与自动完成</h3> | ||
| 7 | + <div class="uk-accordion" data-uk-accordion="{showfirst:false}" ></div> | ||
| 8 | + </div> | ||
| 9 | + <div class="uk-width-medium-5-6 uk-height-viewport right-container" data-uk-observe> | ||
| 10 | + <div id="fbzdzx_config_entity_panel"></div> | ||
| 11 | + <div id="buffer_config_panel"></div> | ||
| 12 | + </div> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + | ||
| 16 | + | ||
| 17 | + <script id="nav-fbzdzx_config-modal-tree-temp" type="text/html"> | ||
| 18 | + {{each array as line i}} | ||
| 19 | + <h3 class="uk-accordion-title" data-id="{{line.lineCode}}">{{line.name}}</h3> | ||
| 20 | + <div class="uk-accordion-content"> | ||
| 21 | + <ul class="uk-list uk-list-line" id="smooth_scroll_list"> | ||
| 22 | + <li><a data-href="#schedule_reload_time_panel" >班次更新时间</a></li> | ||
| 23 | + <li><a data-href="#schedule_auto_exec_panel" >班次自动执行</a></li> | ||
| 24 | + </ul> | ||
| 25 | + </div> | ||
| 26 | + {{/each}} | ||
| 27 | + </script> | ||
| 28 | + | ||
| 29 | + <script> | ||
| 30 | + (function () { | ||
| 31 | + var modal = '#nav-fbzdzx_config-modal', | ||
| 32 | + lineConfig, activeCode; | ||
| 33 | + | ||
| 34 | + //初始化滚动条 | ||
| 35 | + $('.right-container', modal).perfectScrollbar({suppressScrollX: true}); | ||
| 36 | + /** | ||
| 37 | + * 手风琴拨动 | ||
| 38 | + */ | ||
| 39 | + $('.uk-accordion').on('toggle.uk.accordion', function (e, active, toggle, content) { | ||
| 40 | + if(active){ | ||
| 41 | + activeCode = $(toggle).data('id'); | ||
| 42 | + load(); | ||
| 43 | + } | ||
| 44 | + }); | ||
| 45 | + | ||
| 46 | + $(modal).on('init', function (e, data) { | ||
| 47 | + e.stopPropagation(); | ||
| 48 | + var htmlStr = template('nav-fbzdzx_config-modal-tree-temp', {array: gb_data_basic.activeLines}); | ||
| 49 | + $('.line-config-tree .uk-accordion', modal).html(htmlStr); | ||
| 50 | + | ||
| 51 | + if(data.activeCode) | ||
| 52 | + activeCode = data.activeCode; | ||
| 53 | + else{ | ||
| 54 | + //展开tab激活的线路 | ||
| 55 | + var $activeTab = $('#main-tab-content>li.line_schedule.uk-active'); | ||
| 56 | + if($activeTab.length > 0) | ||
| 57 | + activeCode = $activeTab.data('id'); | ||
| 58 | + else{ | ||
| 59 | + //展开第一个 | ||
| 60 | + var $first = $('.uk-accordion-title:eq(0)', modal); | ||
| 61 | + activeCode = $first.data('id'); | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + setTimeout(function () { | ||
| 66 | + $('.uk-accordion-title[data-id='+activeCode+']', modal).trigger('click'); | ||
| 67 | + }, 500); | ||
| 68 | + }); | ||
| 69 | + | ||
| 70 | + | ||
| 71 | + var load = function () { | ||
| 72 | + //获取线路配置信息 | ||
| 73 | + $.get('/lineConfig/getByLineCode', {lineCode: activeCode}, function (conf) { | ||
| 74 | + lineConfig = conf; | ||
| 75 | + | ||
| 76 | + loadConfigEntity(); | ||
| 77 | + loadBufferConfig(); | ||
| 78 | + | ||
| 79 | + setTimeout(function () { | ||
| 80 | + //更新滚动条高度 | ||
| 81 | + $('.right-container', modal).perfectScrollbar('update'); | ||
| 82 | + }, 500); | ||
| 83 | + }); | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | + //线路配置表属性设置 | ||
| 87 | + var loadConfigEntity = function () { | ||
| 88 | + $.get('/real_control_v2/fragments/north/nav/line_config/fbzdzx_config_entity.html', function (attrDom) { | ||
| 89 | + $('.right-container #fbzdzx_config_entity_panel', modal) | ||
| 90 | + .html(attrDom) | ||
| 91 | + .find('#fbzdzx_config_entity_wrap') | ||
| 92 | + .trigger('init', {lineConfig: lineConfig}); | ||
| 93 | + }); | ||
| 94 | + }; | ||
| 95 | + | ||
| 96 | + | ||
| 97 | + //瞄点 | ||
| 98 | + $(modal).on('click', '#smooth_scroll_list>li>a', function () { | ||
| 99 | + var id = $(this).data('href'); | ||
| 100 | + scrollToElement($(id, modal)); | ||
| 101 | + }); | ||
| 102 | + | ||
| 103 | + function scrollToElement(ele) { | ||
| 104 | + var cont = $('.right-container', modal), diff = 10; | ||
| 105 | + cont.animate({ | ||
| 106 | + scrollTop: ele.offset().top - cont.offset().top + cont.scrollTop() - diff | ||
| 107 | + }, 300); | ||
| 108 | + } | ||
| 109 | + })(); | ||
| 110 | + </script> | ||
| 111 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/fbzdzx_config_entity.html
0 → 100644
| 1 | +<!-- 线路配置表相关属性 --> | ||
| 2 | +<div id="fbzdzx_config_entity_wrap"> | ||
| 3 | + <form class="uk-form"></form> | ||
| 4 | + | ||
| 5 | + <script id="fbzdzx_config_entity_form-temp" type="text/html"> | ||
| 6 | + <div id="schedule_reload_time_panel"> | ||
| 7 | + <h2 class="btn_title_line"> | ||
| 8 | + <a class="uk-link-reset">班次更新时间</a> | ||
| 9 | + </h2> | ||
| 10 | + <div> | ||
| 11 | + <div> | ||
| 12 | + <span class="line_name"></span>每天 | ||
| 13 | + <div class="uk-form-icon" style="margin: 0 5px;"> | ||
| 14 | + <i class="uk-icon-clock-o"></i> | ||
| 15 | + <input name="startOptInput" readonly type="text" class="z-depth-input" value="{{startOpt}}" | ||
| 16 | + style="width: 151px;" | ||
| 17 | + data-uk-timepicker> | ||
| 18 | + </div> | ||
| 19 | + 更新到当日排班 | ||
| 20 | + </div> | ||
| 21 | + <ul class="uk-list"> | ||
| 22 | + <li> | ||
| 23 | + <small><i class="uk-icon-question-circle"></i> 所有发车时间小于该时间的班次都默认跨过24点,手动调整的实发实达均应用此规则。</small> | ||
| 24 | + </li> | ||
| 25 | + </ul> | ||
| 26 | + <button class="uk-button uk-button-mini" id="clearRealScheduleBtn">删除实际排班</button> | ||
| 27 | + <button class="uk-button uk-button-mini" id="reLoadRealScheduleBtn">重新加载实际排班</button> | ||
| 28 | + <button class="uk-button uk-button-mini" disabled>加载历史GPS恢复到离站</button> | ||
| 29 | + </div> | ||
| 30 | + </div> | ||
| 31 | + | ||
| 32 | + <div id="schedule_auto_exec_panel"> | ||
| 33 | + <h2 class="btn_title_line"> | ||
| 34 | + <a class="uk-link-reset">班次自动执行</a> | ||
| 35 | + </h2> | ||
| 36 | + <div> | ||
| 37 | + <div> | ||
| 38 | + <label> | ||
| 39 | + <input type="checkbox" id="enableAutoExec" {{autoExec?"checked":""}}> 启用自动班次执行 | ||
| 40 | + </label> | ||
| 41 | + </div> | ||
| 42 | + <ul class="uk-list"> | ||
| 43 | + <li> | ||
| 44 | + <small style="color: red;font-size: 14px;">1、 你必须只应该对【无固定走向且无人监管的线路】启用此项。</small> | ||
| 45 | + </li> | ||
| 46 | + <li> | ||
| 47 | + <small>2、启用该选项后,系统将不再依赖相关定位信号来执行班次。</small> | ||
| 48 | + </li> | ||
| 49 | + <li> | ||
| 50 | + <small>3、系统将在合适的时候自动填入实发实达时间,以完善报表。</small> | ||
| 51 | + </li> | ||
| 52 | + <li> | ||
| 53 | + <small>4、系统不会下发班次调度指令。</small> | ||
| 54 | + </li> | ||
| 55 | + </ul> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + | ||
| 59 | + </script> | ||
| 60 | + | ||
| 61 | + <script> | ||
| 62 | + (function () { | ||
| 63 | + | ||
| 64 | + var wrap = '#fbzdzx_config_entity_wrap', conf, parks, upStationRoutes; | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 删除实际排班 | ||
| 68 | + */ | ||
| 69 | + var clearRealSchedule = function (e) { | ||
| 70 | + e.stopPropagation(); | ||
| 71 | + var lineCode = conf.line.lineCode; | ||
| 72 | + var htmlStr = '<h4 style="color: red;">你确定要删除【' + conf.line.name + '】今日的实际排班?</h4><h5 style="margin-top: 15px;">今日的实际排班会被删除</h5><h5 style="margin-top: 15px;">人车、路牌、待发等相关班次调整信息会被删除。</h5><h5 style="margin-top: 15px;">调度指令和期间与设备的通讯记录被保留</h5><h5 style="margin-top: 15px;">后台日志中的人工操作痕迹被保留</h5>'; | ||
| 73 | + alt_confirm(htmlStr, function () { | ||
| 74 | + show_wait_modal('正在清除数据...'); | ||
| 75 | + gb_common.$post('/realSchedule/deleteRealSchedule', {lineCode: lineCode}, function () { | ||
| 76 | + //刷新班次表格 | ||
| 77 | + gb_schedule_table.reLoadAndRefresh(lineCode); | ||
| 78 | + hide_wait_modal(); | ||
| 79 | + notify_succ('删除班次成功!!!'); | ||
| 80 | + }); | ||
| 81 | + }, '确认删除' + conf.line.name + '的实际排班', true); | ||
| 82 | + | ||
| 83 | + return false; | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * 重新载入实际排班 | ||
| 88 | + */ | ||
| 89 | + var reLoadRealSchedule = function (e) { | ||
| 90 | + e.stopPropagation(); | ||
| 91 | + var lineCode = conf.line.lineCode; | ||
| 92 | + show_wait_modal('正在重载数据...'); | ||
| 93 | + gb_common.$post('/realSchedule/reLoadRealSchedule', {lineCode: lineCode}, function () { | ||
| 94 | + //刷新班次表格 | ||
| 95 | + gb_schedule_table.reLoadAndRefresh(lineCode); | ||
| 96 | + hide_wait_modal(); | ||
| 97 | + notify_succ('重新载入班次成功'); | ||
| 98 | + }); | ||
| 99 | + return false; | ||
| 100 | + }; | ||
| 101 | + | ||
| 102 | + $(wrap).on('init', function (e, data) { | ||
| 103 | + e.stopPropagation(); | ||
| 104 | + conf = data.lineConfig; | ||
| 105 | + //停车场 | ||
| 106 | + $.get('/basic/parks', function (rs) { | ||
| 107 | + parks = []; | ||
| 108 | + for (var code in rs) { | ||
| 109 | + parks.push({code: code, name: rs[code]}); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + parks.sort(function (a, b) { | ||
| 113 | + return $.trim(a.name).localeCompare($.trim(b.name), 'zh-CN'); | ||
| 114 | + }); | ||
| 115 | + renderPSDom(); | ||
| 116 | + }); | ||
| 117 | + //上行站点路由 | ||
| 118 | + upStationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(conf.line.lineCode).sort(function (a, b) { | ||
| 119 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 120 | + }), 'directions')[0]; | ||
| 121 | + | ||
| 122 | + var htmlStr = template('fbzdzx_config_entity_form-temp', conf); | ||
| 123 | + $('form', wrap).html(htmlStr); | ||
| 124 | + | ||
| 125 | + $('.line_name', '#fbzdzx_config_entity_wrap').text(conf.line.name); | ||
| 126 | + //更新排班时间 | ||
| 127 | + $('input[name=startOptInput]', wrap).on('change', updateStartTime); | ||
| 128 | + //出场时间类型 | ||
| 129 | + $('select[name=outParkTypeSelect]', wrap).on('change', updateOutParkType); | ||
| 130 | + //原线路回场 | ||
| 131 | + $('select[name=inParkForSourceSelect]', wrap).on('change', enableInParkForSource); | ||
| 132 | + //删除班次 | ||
| 133 | + $('#clearRealScheduleBtn', wrap).on('click', clearRealSchedule); | ||
| 134 | + //重新载入实际排班 | ||
| 135 | + $('#reLoadRealScheduleBtn', wrap).on('click', reLoadRealSchedule); | ||
| 136 | + $('#enableAutoExec', wrap).on('click', autoExecFun); | ||
| 137 | + }); | ||
| 138 | + | ||
| 139 | + function changeTwinsParkAndStation() { | ||
| 140 | + var parks='',stations='' | ||
| 141 | + ,$panel = $('.park-and-station-wrap', wrap); | ||
| 142 | + | ||
| 143 | + $('select[name=twinsPark]', $panel).each(function () { | ||
| 144 | + parks += ($(this).val() + ','); | ||
| 145 | + }); | ||
| 146 | + | ||
| 147 | + $('select[name=twinsStation]', $panel).each(function () { | ||
| 148 | + stations += ($(this).val() + ','); | ||
| 149 | + }); | ||
| 150 | + | ||
| 151 | + if(parks.length > 0) | ||
| 152 | + parks = parks.substr(0, parks.length - 1); | ||
| 153 | + if(stations.length > 0) | ||
| 154 | + stations = stations.substr(0, stations.length - 1); | ||
| 155 | + | ||
| 156 | + gb_common.$post('/lineConfig/parkAndStationSet', { | ||
| 157 | + lineCode: conf.line.lineCode, | ||
| 158 | + twinsPark: parks, | ||
| 159 | + twinsStation: stations | ||
| 160 | + }, function (rs) { | ||
| 161 | + notify_succ('已保存!!'); | ||
| 162 | + conf = rs.conf; | ||
| 163 | + }); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + //更新排班时间 | ||
| 167 | + var startOptFlag; | ||
| 168 | + | ||
| 169 | + function updateStartTime() { | ||
| 170 | + if (startOptFlag || $(this).val() == conf.startOpt) | ||
| 171 | + return; | ||
| 172 | + startOptFlag = true; | ||
| 173 | + var that = this; | ||
| 174 | + setTimeout(function () { | ||
| 175 | + var timeStr = $(that).val(); | ||
| 176 | + gb_common.$post('/lineConfig/editTime', { | ||
| 177 | + lineCode: conf.line.lineCode, | ||
| 178 | + time: timeStr | ||
| 179 | + }, function (rs) { | ||
| 180 | + notify_succ('班次更新时间调整为 ' + timeStr); | ||
| 181 | + conf.startOpt = rs.time; | ||
| 182 | + }); | ||
| 183 | + startOptFlag = false; | ||
| 184 | + }, 300); | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + function updateOutParkType() { | ||
| 188 | + var type = $(this).val(); | ||
| 189 | + var lineCode = conf.line.lineCode; | ||
| 190 | + | ||
| 191 | + var data = {lineCode: lineCode, type: type, parkCode: '', stationCode: ''}; | ||
| 192 | + //出站既是出场 | ||
| 193 | + if (type == 2) { | ||
| 194 | + //如果配置上有信息 | ||
| 195 | + if(conf.twinsParks){ | ||
| 196 | + data.parkCode = conf.twinsParks; | ||
| 197 | + data.stationCode = conf.twinsStations; | ||
| 198 | + } | ||
| 199 | + else{ | ||
| 200 | + data.parkCode = gb_data_basic.getLineInformation(lineCode).carPark;//默认关联 线路标准停车场 | ||
| 201 | + data.stationCode = upStationRoutes[0].stationCode;//和上行起点站 | ||
| 202 | + } | ||
| 203 | + } | ||
| 204 | + gb_common.$post('/lineConfig/editOutTimeType', data, function (rs) { | ||
| 205 | + notify_succ('调整出场时间类型成功!'); | ||
| 206 | + conf = rs.conf; | ||
| 207 | + | ||
| 208 | + //渲染场站关联dom | ||
| 209 | + renderPSDom(); | ||
| 210 | + }); | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + | ||
| 214 | + | ||
| 215 | + function enableInParkForSource() { | ||
| 216 | + var enable = $(this).val(); | ||
| 217 | + gb_common.$post('/lineConfig/enableInParkForSource', { | ||
| 218 | + lineCode: conf.line.lineCode, | ||
| 219 | + enable: enable | ||
| 220 | + }, function () { | ||
| 221 | + notify_succ((enable == 1 ? '启用' : '禁用') + '原线路回场'); | ||
| 222 | + conf.inParkForSource = enable; | ||
| 223 | + }); | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + | ||
| 227 | + /** | ||
| 228 | + * 自动执行 | ||
| 229 | + */ | ||
| 230 | + function autoExecFun(){ | ||
| 231 | + var that = this; | ||
| 232 | + if(that.checked){ | ||
| 233 | + that.checked = false; | ||
| 234 | + alt_confirm('<span style="color: red;font-size: 16px;">启用【' + conf.line.name + '】的自动执行功能?</span>', function () { | ||
| 235 | + var data = { | ||
| 236 | + lineCode: conf.line.lineCode, | ||
| 237 | + autoExec: true | ||
| 238 | + }; | ||
| 239 | + gb_common.$post('/lineConfig/setAutoExec', data, function (rs) { | ||
| 240 | + notify_succ('启用成功!'); | ||
| 241 | + conf = rs.conf; | ||
| 242 | + | ||
| 243 | + that.checked = true; | ||
| 244 | + }); | ||
| 245 | + }, '我确定要将【' + conf.line.name + '】设置为自动执行', true); | ||
| 246 | + } | ||
| 247 | + else{ | ||
| 248 | + that.checked = true; | ||
| 249 | + alt_confirm('<span style="color: red;font-size: 16px;">禁用【' + conf.line.name + '】的自动执行功能?</span>', function () { | ||
| 250 | + var data = { | ||
| 251 | + lineCode: conf.line.lineCode, | ||
| 252 | + autoExec: false | ||
| 253 | + }; | ||
| 254 | + gb_common.$post('/lineConfig/setAutoExec', data, function (rs) { | ||
| 255 | + notify_succ('禁用成功!'); | ||
| 256 | + conf = rs.conf; | ||
| 257 | + | ||
| 258 | + that.checked = false; | ||
| 259 | + }); | ||
| 260 | + }, '我确定要禁用【' + conf.line.name + '】的自动执行', true); | ||
| 261 | + } | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + | ||
| 265 | + /** | ||
| 266 | + * 删除 场既是站 项目 | ||
| 267 | + */ | ||
| 268 | + $(wrap).on('click', '.c_2_s_list .item .uk-close', function () { | ||
| 269 | + $(this).parents('.item').remove(); | ||
| 270 | + changeTwinsParkAndStation(); | ||
| 271 | + }); | ||
| 272 | + | ||
| 273 | + | ||
| 274 | + $(wrap).on('change', 'select[name=twinsPark]', changeTwinsParkAndStation); | ||
| 275 | + $(wrap).on('change', 'select[name=twinsStation]', changeTwinsParkAndStation); | ||
| 276 | + })(); | ||
| 277 | + </script> | ||
| 278 | +</div> | ||
| 0 | \ No newline at end of file | 279 | \ No newline at end of file |