gateHome.home.jsp 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167
  1. <%@ page import="ss.WebC" %>
  2. <html>
  3. <head>
  4. <title>${sessionScope.projectUrlDesc}</title>
  5. <%-- 先去掉,应该没用到。Lin
  6. <wd:write type="skin" t="dialog" />
  7. <wd:write type="skin" t="menu" />
  8. --%>
  9. <skin.ss file="/ss/gate"/>
  10. <js.ss file="/ss/appauthority.js"/>
  11. <js.ss file="/ss/qrcode/qrcode.js"/>
  12. <js.ss file="/ss/qrcode/jquery.qrcode.js"/>
  13. <%-- 先去掉,应该没用到。Lin
  14. <script type="text/javascript" src="mobile/js/iscroll.js"></script>
  15. --%>
  16. <js.ss file="/ss/touch.min.js"/>
  17. </head>
  18. <style>
  19. *{
  20. margin: 0px;
  21. padding: 0px;
  22. }
  23. body{
  24. width: 100%;
  25. height: 100%;
  26. }
  27. #ascrail2009{
  28. display:none!important;
  29. }
  30. video {
  31. position: fixed;
  32. max-width: 100%;
  33. min-height: 100%;
  34. height: auto;
  35. width: 100%;
  36. object-fit:fill;
  37. z-index: -999;
  38. }
  39. .login-pageBackground {
  40. background:none!important;
  41. }
  42. input::-webkit-input-placeholder{
  43. color:#fff!important;
  44. }
  45. .content-largeText td{
  46. width: 410px;
  47. padding-left: 60px;
  48. }
  49. .selectedStyle{
  50. width: 388px;
  51. margin: 1px 0px 0px 1px;
  52. font-family: Microsoft YaHei;
  53. padding: 0px 0 0 5px;
  54. line-height: 40px;
  55. height: 50px;
  56. border: 2px solid #cccccc;
  57. border-radius: 2px;
  58. appearance: none;
  59. font-size:36px ;
  60. -moz-appearance: none;
  61. -webkit-appearance: none;
  62. background: url("/skin/easy/image/dialog-select-icon.png") no-repeat 360px 18px;
  63. overflow:auto !important;
  64. }
  65. .selectedStyle option{
  66. font-size:30px !important;
  67. }
  68. select::-webkit-scrollbar {
  69. cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
  70. width: 8px;
  71. }
  72. select::-webkit-scrollbar-track {
  73. background-color: none;
  74. border-radius: 5px;
  75. cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
  76. }
  77. select::-webkit-scrollbar-thumb {
  78. background: #b7b7b7;
  79. cursor: url("/skin/easy/image/cur.ico"), default !important; /* (zgz/theme/EasyUses/image/cur.ico),。Lin */
  80. border-radius: 5px;
  81. }
  82. </style>
  83. <body style="margin:0px;padding:0px;" id="body">
  84. <input name="sbbs" type="hidden" value='dm'/> <%-- ='4OBKLLHDgszyEqmf5vFmuw=='。改为 .场地号。Lin --%>
  85. <input name="sbmc" type="hidden" />
  86. <video id="videoID" class="lj" muted autoplay="autoplay" loop="loop" style="display:block;overflow: hidden;">
  87. <source src="/skin/easy/hugeLogo.mov" > <%-- ="${sessionScope['XMMC']}/video/logo/hugeLogo.mov"。Lin --%>
  88. </video>
  89. <div class="login-pageBackground" style="display: flex;justify-content: center;align-items: center;">
  90. <div id="zzc" style="position: absolute;width: 100%;height: 100%;background: #888; z-index: 10000;opacity: 0;display: none;"></div>
  91. <%--显示时间--%>
  92. <div id="getDateInfo" class="getDateInfo lj">
  93. <span></span><span></span>
  94. </div>
  95. <div id="ryxx" style="width:800px; height:450px; display:none;position: absolute;color:black;border:1px white solid;border-radius:5px;background:#fff;z-index: 99999;">
  96. <div style="display:flex;width:680px;margin-left:60px;margin-top:61px;padding-bottom: 50px; border-bottom: 1px solid #cccccc;">
  97. <div>
  98. <input type="hidden" name="ryid" value="${ryid}" class="input-text input-number" />
  99. <img id="zjz" src="" onerror="this.src='/skin/easy/image/default-photo.png'" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius: 2px;"></img> <%-- ='${sessionScope["XMMC"]}/theme/EasyUses/image/default-photo.png'"。Lin --%>
  100. </div>
  101. <table class='xm content-largeText' style="color:#000;">
  102. <tr>
  103. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="xm"></span></td>
  104. </tr>
  105. <tr>
  106. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="bj" ></span></td>
  107. </tr>
  108. <tr>
  109. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"><span id="xh" ></span></td>
  110. </tr>
  111. <tr>
  112. <td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;">
  113. <span id="lxlb" class="content-largeWarningText" style="vertical-align: top;"></span>
  114. <span id="lxlbts" class="content-largeWarningText" style="display:none;vertical-align: top;">
  115. <img src="/skin/easy/image/warning.gif" style=" width: 60px;height: 60px;top: -2px;position: relative; "/> <%-- ="${sessionScope['XMMC']}/theme/EasyUses/image/warning.gif"。Lin --%>
  116. </span>
  117. </td>
  118. </tr>
  119. </table>
  120. </div>
  121. <div style="width: 100%;padding-top: 30px;text-align: center;">
  122. <input type="button" class="bottom-button " value="离校" id="leave" />
  123. <input type="button" class="bottom-button " value="返校" id="back" />
  124. <input type="button" class="bottom-button " value="取消" id="cancle" />
  125. </div>
  126. </div>
  127. <%--预约来访--%>
  128. <div id="yylf" style=" width:800px; height:385px; display:none;position: absolute;color:black;border:1px white solid;border-radius:5px;background:#fff;z-index: 99999;">
  129. <div style="display:flex;width:690px;margin-left:55px;margin-top:25px;padding-bottom: 50px; border-bottom: 1px solid #cccccc;">
  130. <table class='content-largeText' style="line-height: 50px;">
  131. <tr>
  132. <th>姓名</th>
  133. <td><span id="yylfxm" name="xm" ></span></td>
  134. </tr>
  135. <tr>
  136. <th>身份证号</th>
  137. <td><span id="yylfsfzh" name="sfzh" ></span></td>
  138. </tr>
  139. <tr>
  140. <th>人数</th>
  141. <td><span id="yylfrs" name="rs" ></span></td>
  142. </tr>
  143. <tr>
  144. <th>预约时间</th>
  145. <td><span id="yylfyysj" name="yysj" format="yyyy-MM-dd HH:mm:ss" miniDate="false"></span></td> <%-- 等 新UI 弄好了再改。Lin --%>
  146. </tr>
  147. </table>
  148. </div>
  149. <div style="width: 100%;padding-top: 25px;text-align: center;">
  150. <%-- 去掉,移到录入来访信息界面了 -- "确定" 按钮改为 "进入" 了。Lin
  151. <in@put type="button" class="bottom-button " value="进入" id="yylf_come" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  152. --%>
  153. <input type="button" class="bottom-button " value="离开" id="yylf_leave" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  154. <input type="button" class="bottom-button " value="取消" id="yylf_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
  155. </div>
  156. </div>
  157. <%--来访信息--%>
  158. <div id="lfxx" style=" display:none;width: 640px; height: 560px; position: absolute; color: black; border: 1px white solid; border-radius: 5px;background: #fff;padding: 50px 40px 28px 40px;z-index: 99999;">
  159. <div style="display: flex; width: 100%;padding-bottom: 50px;border-bottom: 1px solid #cccccc;justify-content: flex-end;">
  160. <table class='content-largeText' style="width:100%; line-height: 52px;">
  161. <tr>
  162. <th>姓名</th>
  163. <td><input id="jfxm" name="xm"/></td>
  164. </tr>
  165. <tr>
  166. <th>性别</th>
  167. <td>
  168. <input id="jfxbm" name="xbm" type="hidden" />
  169. <objp.ss name="xbm" cb="xb" inp="true"/>
  170. </td>
  171. </tr>
  172. <tr>
  173. <th>身份证号</th>
  174. <td><input id="jfsfzh" name="sfzh"/></td>
  175. </tr>
  176. <tr>
  177. <th>接访部门</th>
  178. <td>
  179. <input id="jfbmid" name="jfbmid" type="hidden"/>
  180. <objp.ss name="jfbmid" cb="jfbm" inp="true"/>
  181. </td>
  182. </tr>
  183. <tr>
  184. <th>接访班级</th>
  185. <td>
  186. <input id="jfbjid" name="jfbjid" type="hidden" />
  187. <objp.ss name="jfbjid" cb="jfbj" inp="true"/>
  188. </td>
  189. </tr>
  190. <tr>
  191. <th>接访人</th>
  192. <td>
  193. <div id="jfr-div">
  194. <div class="input-div input-s">
  195. <input name="jfryid" id="jfryid" type="hidden"/>
  196. <input name="jfryna" id="jfryna" style="margin: 0;"/>
  197. <span id="jfryid_button" class="smallButton icon-down" style="top: 5px !important;" onselectstart="return false;"></span>
  198. </div>
  199. <div id="jfryid_option" class="popup-div hLine-highlightBlod objectPickerOption scrollbar" style="display:none;max-height: 250px;z-index: 10000;" onselectstart="return false;">
  200. </div>
  201. </div>
  202. </td>
  203. </tr>
  204. <tr>
  205. <th>事由</th>
  206. <td>
  207. <textarea id="jfsy" class="smallScrollbar" style="overflow:hidden;padding-left: 5px;margin-left:-5px;position: absolute;resize: none;margin-top: 2px;height: 51px !important;width: 401px !important;z-index: 1;background: white;"></textarea>
  208. <script type="text/javascript" charset="utf-8">
  209. wd.edit.initGrowHigh('jfsy','null',{},null,false);
  210. </script>
  211. <span></span>
  212. <input id="syid" name="syid" type="hidden"/>
  213. <objp.ss name="syid" cb="lfsy" inp="true" add="true"/>
  214. </td>
  215. </tr>
  216. <tr>
  217. <th>人数</th>
  218. <td>
  219. <input id="jfrs" name="rs" value= "1" oninput="value=value.replace(/[^\d]/g,'')"/>
  220. </td>
  221. </tr>
  222. </table>
  223. </div>
  224. <div style="width:100%;padding-top:25px;text-align:center;">
  225. <%-- "确定" 改为 "进入",去掉后面的来访者离校的办理界面里的 "进入" 按钮(只有 "离开" 按钮) -- 填写来访信息时,就进入(增加写 来访.接访开始时间)。Lin
  226. <in@put id="lfqd" type="button" class="bottom-button " value="确定" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" /> --%>
  227. <input id="lfqd" type="button" class="bottom-button " value="进入" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  228. <input type="button" class="bottom-button " value="取消" id="jf_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
  229. </div>
  230. </div>
  231. <div id="scannerDiv" style="opacity: 0;">
  232. <input id="scanner"/>
  233. </div>
  234. <%--录入人员--%>
  235. <div id="lrry" class="lj" style="display:none;position: absolute;bottom: 28px;left:50%;margin-left:-365px; font-family: 'SIL Hei';color:#6c9ed7;line-height:18px;font-size:20px;">
  236. <table class='xm' style="color:#000;">
  237. <tr>
  238. <td>
  239. <input type="text" tabindex="1" name="sfzh" id="sfzh" placeholder="身份证号/学号" style="margin-right:18px;font-size: 20px; width:389px; height: 43px;color: #ffffff;border:1px solid #dae6eb;padding:10px 0 13px 19px;opacity: 0.65;" />
  240. </td>
  241. <td style="text-align: center;">
  242. <input type="button" class="mobileLogin-button" style="outline:#6c9ed7;position: absolute;width: 90px; height: 43px; background: transparent;color: #ffffff; border: 1px solid #dae6eb; font-size: 20px;opacity: 0.65;border-radius: 3px;" value="确定" id="qd" />
  243. </td>
  244. <td style="text-align: center;padding-left: 100px;">
  245. <input type="button" class="mobileLogin-button" style="outline:#6c9ed7;position: absolute;width: 90px; height: 43px; background: transparent;color: #ffffff; border: 1px solid #dae6eb; font-size: 20px;opacity: 0.65;border-radius: 3px;" value="清除" id="qc" />
  246. </td>
  247. </tr>
  248. </table>
  249. </div>
  250. <div id="ryxxlb" style="color:black;z-index:-1;"></div>
  251. <div id="jcjllb" style="width: 800px;height: calc(100% - 60px);position: absolute;color:black;z-index:-1;display: grid;align-content: center;overflow-y: auto;overflow-x: hidden;display: block;color: black;right: 30px;"></div>
  252. <div id="SFrefresh" style=" width:460px; height:245px; display:none;position: absolute;color:black;border:1px white solid;border-radius:5px;background:#fff;bottom: 29px;right: 29px;z-index: 99999;">
  253. <div class='content-largeText' style="width: 420px;display:flex;margin-left:20px;margin-top:25px;align-items: center;justify-content: center;height: 120px; border-bottom: 1px solid #cccccc;">
  254. 是否重启?
  255. </div>
  256. <div style="width: 100%;padding-top: 25px;text-align: center;">
  257. <input type="button" class="bottom-button " value="是" id="SFrefresh_qr" style="width: 150px;height: 50px;font-size: 30px;margin-right: 100px;" />
  258. <input type="button" class="bottom-button " value="否" id="SFrefresh_cancle" style="width: 150px;height: 50px;font-size: 30px;"/>
  259. </div>
  260. </div>
  261. <div class="bottomright" id="qrcodeBox" style="z-index: -2; display:block;">
  262. <%--默认图片--%>
  263. <!-- <equal.ss val='${empty sessionScope.ssUser}' val2="true"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  264. <div id="login-before" style="width:110px;height:144px;background:rgba(255,255,255,0.4);border-radius:2px;margin-bottom: -7px; ">
  265. <img src='/skin/easy/image/default-photo.png' style="margin:20px 23px 7px 23px;width:64px;height:88px;"/> <%-- ='${sessionScope["XMMC"]}/theme/EasyUses/image/default-photo.png'。Lin --%>
  266. <div class="xx">
  267. <div class="qrcode-text " style="color: #000;" >未登录</div>
  268. </div>
  269. </div>
  270. </equal.ss> -->
  271. <%--未登录显示二维码--%>
  272. <equal.ss val='${empty sessionScope.ssUser}' val2="true"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  273. <!-- style="display: none;" -->
  274. <div id="login-qrcode">
  275. <div style="height: 30px;">
  276. <span class="qrcode-text">扫一扫登录</span>
  277. </div>
  278. <div id="qrcode" style="width:110px;height:110px;z-index: 9999 !important;border: 5px solid #FFF;margin-bottom: -7px;">
  279. <div class='qrcode'> </div>
  280. </div>
  281. </div>
  282. </equal.ss>
  283. <div style="display: none;position:absolute;z-index:11111;" id="confirm-qrcode">
  284. <div style="height: 30px;">
  285. <span class="qrcode-text">扫一扫</span>
  286. </div>
  287. <div id="qrcode-confirm" style="width:110px;height:110px;z-index: 9999 !important;border: 5px solid #FFF;margin-bottom: -7px;">
  288. <div class='qrcode-confirm'> </div>
  289. </div>
  290. </div>
  291. <%--已登录显示头像,点击头像退出登录--%>
  292. <equal.ss val='${empty sessionScope.ssUser}' val2="false"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  293. <!-- <div id="login-after" class="lj" style="width:110px;height:144px;background:rgba(255,255,255,0.4);border-radius:2px;margin-bottom: -7px; ">
  294. <img onclick="clearInterval(zmxxhq);window.location=&quot;<serv.ss name='gateExit'/>&quot;;"
  295. onerror="this.src='/skin/easy/image/default-photo.png'" style="margin: 10px 23px 7px 23px;width:64px;height:88px;"
  296. src="<serv.ss name='dlByHttp' parm='{path:"${sessionScope.ssUser.zjzwj}"}'/>"/>
  297. <div class="xx">
  298. <div class="qrcode-text" style="color: #000;">${sessionScope.ssUser.xm}</div> <%-- ['env.ry'].。Lin --%>
  299. <div class="qrcode-text" style="color: #000;">${sessionScope.ssUser.ryh}</div> <%-- ['env.ry'].。Lin --%>
  300. </div>
  301. </div> -->
  302. <div class="userInfo xx lj" onclick="clearInterval(zmxxhq);window.location=&quot;<serv.ss name='gateExit'/>&quot;;">
  303. <span>${sessionScope.ssUser.xm}</span>
  304. <span>${sessionScope.ssUser.ryh}</span>
  305. </div>
  306. </equal.ss>
  307. </div>
  308. </div>
  309. <equal.ss val='${empty sessionScope.ssUser}' val2="false"> <%-- ='${empty sessionScope["wd.yh"]}'。Lin --%>
  310. <script type="text/javascript">
  311. var ryInfo = "${sessionScope.ssUser}"; <%-- ['env.ry']}。Lin --%>
  312. </script>
  313. </equal.ss>
  314. <script>
  315. function login() {
  316. var sbbs = $("input[name=sbbs]").val();
  317. var sbmc = $("input[name=sbmc]").val();
  318. $.post("<serv.ss name='runGateLoginByQrcode'/>", { // :'scanGateLoginSuccess'。Lin
  319. sbbs: sbbs,
  320. sbmc: sbmc
  321. }, function(result) {
  322. if(result.code != 1) {
  323. wd.display.alert(result.msg);
  324. } else {
  325. window.location.href = "/gateHome.jsp"; //? = "/"。临时改,为了测试。Lin
  326. }
  327. }, "json")
  328. }
  329. function utf16to8(str) {
  330. var out, i, len, c;
  331. out = "";
  332. len = str.length;
  333. for(i = 0; i < len; i++) {
  334. c = str.charCodeAt(i);
  335. if((c >= 0x0001) && (c <= 0x007F)) {
  336. out += str.charAt(i);
  337. } else if(c > 0x07FF) {
  338. out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
  339. out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
  340. out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
  341. } else {
  342. out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
  343. out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
  344. }
  345. }
  346. return out;
  347. }
  348. function qrcode() {
  349. $.ajax({
  350. type: "post",
  351. url: "<serv.ss name='wrQrcodeLoginKey'/>", // :'getPrivateKey'。Lin
  352. async: true,
  353. dataType: "json",
  354. success: function(data) {
  355. var sbbs = $("input[name='sbbs']").val();
  356. var json = {
  357. ss:2, // 增加,2 = gate login。Lin
  358. k: data.k, // ATR_keyByQrcodeLoginName = "k"。Lin
  359. d: sbbs
  360. };
  361. /* 改,ss:xx,yy:"zz",...。Lin
  362. qrCodeGenerate(".qrcode", "@hdGl" + JSON.stringify(json) + "@", 110, 110, "canvas");
  363. */
  364. var jsonStr = JSON.stringify(json);
  365. qrCodeGenerate(".qrcode", "ss:2,k:\""+ data.k +"\",d:\""+ sbbs +"\"", 110, 110, "canvas");
  366. }
  367. });
  368. }
  369. function qrCodeGenerate(ele, text, width, height, render) {
  370. var option = {
  371. render: "canvas",
  372. text: text,
  373. width: width || "200",
  374. height: height || "200",
  375. correctLevel: QRErrorCorrectLevel.M
  376. };
  377. $(ele).empty()
  378. $(ele).qrcode(option);
  379. }
  380. var stop = 2 * 60 * 1000; //两分钟后停止
  381. var begin;
  382. var end;
  383. function getLoginStatus() {
  384. //end = new Date().getTime();
  385. //if ((end - begin) > stop) {
  386. // stopInterval();
  387. // return;
  388. //}
  389. var sbbs = $("input[name=sbbs]").val();
  390. if(!sbbs)return;
  391. $.ajax({
  392. type: "post",
  393. url:"<serv.ss name='ifWrQrcodeLoginParmBySess' parm='{type:"gate"}'/>", // :'resetCookie',。Lin
  394. async: true,
  395. data:{sbbs:sbbs},
  396. dataType: "json",
  397. success: function(data) {
  398. if(data.code == 200 && window.loginStatus == '0') {
  399. stopInterval();
  400. //$("input[name='mm']").val("");
  401. //$("form[name='Form1'").submit();
  402. login();
  403. }
  404. if(data.code == 1) {
  405. stopInterval();
  406. var url = "<%=WebC.PPATH_errMsg%>?msg="+ data.msg; // = "/wd/page/rs.jsp?msg=" +。Lin
  407. var title = "提示";
  408. wd.display.showComponent({
  409. show: ["wdDialog"],
  410. hide: [],
  411. url: url,
  412. title: title,
  413. width: 500,
  414. high: 300,
  415. form: ""
  416. })
  417. } else if(data.code == 0) {
  418. console.log(data.msg);
  419. } else if(data.msg) {
  420. wd.display.alert(data.msg)
  421. }
  422. }
  423. });
  424. }
  425. var getLoginInterval;
  426. if(window.loginStatus == '0') {
  427. startInterval();
  428. }
  429. function startInterval() {
  430. qrcode();
  431. //$("#qrcodeBox").css("display", "block");
  432. //$("#trianglebottomright").css("display", "none");
  433. begin = new Date().getTime();
  434. if(!getLoginInterval) {
  435. getLoginInterval = setInterval(getLoginStatus, 3 * 1000);
  436. }
  437. }
  438. function stopInterval() {
  439. $("#qrcodeBox").css("display", "none");
  440. clearInterval(getLoginInterval);
  441. getLoginInterval = null;
  442. }
  443. $(function() {
  444. try {
  445. if(beacon && beacon.getComputerName) {
  446. $("input[name=sbmc]").val(beacon.getComputerName());
  447. }
  448. if(beacon && beacon.getMacAddress) {
  449. $("input[name=sbbs]").val(beacon.getMacAddress());
  450. }
  451. } catch(err) {
  452. console.log(err);
  453. }
  454. })
  455. </script>
  456. </body>
  457. <script type="text/javascript">
  458. /**
  459. *
  460. * 原来下面全部JS为拼音缩写而且无注解
  461. * 注解都是之后非作者补充的,可能有不正确
  462. *
  463. */
  464. var qrcodestr = '';
  465. var direction;
  466. var mjdid = '';
  467. var sfzh = '';
  468. var lfid = '';
  469. var globalJfryna = '';
  470. var globalJfryid = '';
  471. $(function(){
  472. try{
  473. lf_jfr_cx(false,false);
  474. /* 改,直接用页面写死的 sbbs(<input name="sbbs") -- 因抛出错误 "beacon is not defined",后面的程序被越过。Lin
  475. getMjdid(beacon.getMacAddress());
  476. */ getMjdid($("input[name=sbbs]").val());
  477. // bindMwid(); // 再去掉,没用到,也不用 < 打开 gateHome.home.jsp 时,写到 门禁点.门卫ID。此时,写入的 .门卫ID 为空(还没登录) < 也不能每次换班都写。Lin
  478. if(!beacon || !beacon.initIdcardDevice()){
  479. alert("初始化失败。检查是否安装驱动")
  480. }
  481. ///
  482. }catch(err){
  483. console.log(err);
  484. }
  485. /**
  486. * 接访人na
  487. */
  488. $('#jfryna').blur(function(){
  489. $('#jfryna').val(globalJfryna);
  490. $('#jfryid').val(globalJfryid);
  491. });
  492. /**
  493. * 接访人na
  494. */
  495. $('#jfryna').on('input',function(){
  496. if($('#jfryna').val() == ''){
  497. $('#jfryid_option').hide();
  498. return;
  499. }
  500. lf_jfr_cx(true,true);
  501. $('#jfryid_option').show();
  502. });
  503. $('#jfryid_option').on('click','.popupList',function(){
  504. var ryid = $(this).attr('value');
  505. var xm = $(this).text();
  506. $('#jfryna').val(xm);
  507. $('#jfryid').val(ryid).change();
  508. $('#jfryid_option').hide();
  509. });
  510. $('#jfryid').change(function(){
  511. var jfryid = $(this).val();
  512. if(jfryid == ''){
  513. globalJfryid = '';
  514. globalJfryna = '';
  515. return;
  516. }
  517. if(globalJfryid == jfryid){
  518. return;
  519. }
  520. globalJfryid = jfryid;
  521. globalJfryna = $('#jfryna').val();
  522. $.ajax({
  523. type: "post",
  524. /* 改,把参数统一移到 data:{} 里。Lin
  525. url: '@service{name:"lf_bjbm_cx"}@&ryid=' + jfryid,
  526. */
  527. /* 再改,移到 ry_selBaseInfoByRyid(”获取人员基本信息“),与 grcz_inp.ss.jsp 共用。Lin
  528. * 统一 Ajax 返回标准 -- .ssCode、.ssMsg、.ssData
  529. url: "<serv.ss name='gate_selBmAndBjByRyid'/>",
  530. */ url: "<serv.ss name='ry_selBaseInfoByRyid'/>",
  531. data: {
  532. ryid: jfryid,
  533. },
  534. async: true,
  535. dataType: "json",
  536. success: function(data) {
  537. /* 再改,统一 Ajax 返回标准 -- .ssCode、.ssMsg、.ssData。Lin
  538. console.log(data);
  539. if (data.error == '1') {
  540. wd.display.alert(data.msg);
  541. } else {
  542. wd.edit.objectPicker.getInstance("jfbmid").initValue(data.bmid,{triggerChange:false});
  543. wd.edit.objectPicker.getInstance("jfbjid").initValue(data.bjid,{triggerChange:false});
  544. }
  545. */
  546. if (data.ssCode != 0) {
  547. wd.display.alert(data.msg);
  548. } else {
  549. wd.edit.objectPicker.getInstance("jfbmid").initValue(data.ssData.bmid,{triggerChange:false});
  550. wd.edit.objectPicker.getInstance("jfbjid").initValue(data.ssData.bjid,{triggerChange:false});
  551. }
  552. }
  553. });
  554. });
  555. $('#jfryna').focus(function(){
  556. if($('#jfryna').val() == ''){
  557. return;
  558. }
  559. lf_jfr_cx(true,true);
  560. $('#jfryid_option').show();
  561. });
  562. $('#jfr-div').click(function(){
  563. return false;
  564. });
  565. $('#jfryid_button').click(function(){
  566. $('.popup-div:not(#jfryid_option)').hide();
  567. if($('#jfryid_option').is(':hidden')){
  568. lf_jfr_cx(true,false);
  569. }
  570. $('#jfryid_option').toggle();
  571. });
  572. setInterval(function(){
  573. $.ajax({
  574. type: "post",
  575. url: '@service{name:"wd.probe"}@',
  576. async: true,
  577. dataType: "json",
  578. success: function(data) {
  579. console.log(data);
  580. }
  581. });
  582. }, 1000 * 600);
  583. $('#zzc').click(function(){
  584. return false;
  585. });
  586. $('#SFrefresh_qr').click(function(){
  587. window.location.reload();
  588. });
  589. $('#SFrefresh_cancle').click(function(){
  590. $('#SFrefresh').hide();
  591. $('#zzc').hide();
  592. $('.lj').css('filter','blur(0px)');
  593. return false;
  594. });
  595. var refresh;
  596. $('#login-after').mousedown(function(e){
  597. // if('IMG' == $(e.target).prop('tagName')){
  598. // console.log("长按头像不触发刷新");
  599. // return;
  600. // }
  601. refresh = setInterval(function(){
  602. $('#SFrefresh').show();
  603. clearInterval(refresh);
  604. $('#zzc').show();
  605. $('.lj').css('filter','blur(20px)');
  606. }, 2000);
  607. return false;
  608. });
  609. $('#login-after').mouseup(function(){
  610. console.log("清除定时器");
  611. clearInterval(refresh);
  612. return false;
  613. });
  614. $('#login-after').mouseout(function(){
  615. console.log("清除定时器");
  616. clearInterval(refresh);
  617. });
  618. $('#login-before').mousedown(function(e){
  619. refresh = setInterval(function(){
  620. $('#SFrefresh').show();
  621. clearInterval(refresh);
  622. $('.lj').css('filter','blur(20px)');
  623. }, 2000);
  624. return false;
  625. });
  626. $('#login-before').mouseup(function(){
  627. console.log("清除定时器");
  628. clearInterval(refresh);
  629. return false;
  630. });
  631. $('#login-before').mouseout(function(){
  632. console.log("清除定时器");
  633. clearInterval(refresh);
  634. });
  635. $('#login-before').click(function(){
  636. $(this).hide();
  637. $('#login-qrcode').show();
  638. /// 临时增加,模拟 APP/小程序 扫码确认???Lin
  639. /* 去掉,来真的了。Lin
  640. $.ajax({
  641. type: "post",
  642. url: "<serv.ss name='gateLoginByQrcode'/>",
  643. async: true,
  644. dataType: "json",
  645. success: function(data) {
  646. }
  647. });
  648. */
  649. ///
  650. return false;
  651. });
  652. var lrryClose;
  653. var lrryCloseTime = 60 * 1000;
  654. $(document).on('mousedown',function(e){
  655. if($(e.target).parents('#jcjllb').length == 0){
  656. if(e.target.id == "jcjllb"){
  657. return;
  658. }
  659. if($(e.target).parents('.ryxxlb-child').length>0||e.target.className.indexOf("ryxxlb-child")>-1){
  660. if($(e.target).parents('.ryxxlb-child').length>0){
  661. $(e.target).parents('.ryxxlb-child').remove();
  662. }
  663. if(e.target.className.indexOf("ryxxlb-child")>-1){
  664. $(e.target).remove();
  665. }
  666. return;
  667. }
  668. clearTimeout(hideJcjllb);
  669. isDrag = false;
  670. handleHide("jcjllb");
  671. if(lrryClose){
  672. clearInterval(lrryClose);
  673. lrryClose = setInterval(function(){
  674. hideLrry();
  675. }, lrryCloseTime);
  676. }
  677. }
  678. });
  679. $(document).on('keydown mousemove',function(){
  680. if(lrryClose){
  681. clearInterval(lrryClose);
  682. lrryClose = setInterval(function(){
  683. hideLrry();
  684. }, lrryCloseTime);
  685. }
  686. });
  687. $('#qc').click(function(){
  688. $('#sfzh').val('');
  689. });
  690. $('body').click(function(e){
  691. e.stopPropagation();
  692. $('#jfryid_option').hide();
  693. if($(e.target).parents('#lrry').length > 0){
  694. return false;
  695. }
  696. if($('#zzc').is(':visible')){
  697. return false;
  698. }
  699. if(!isDrag){//如果是拖动就不触发
  700. $('#lrry').stop(true).fadeToggle(function(){
  701. if($('#lrry').is(':visible')){
  702. var zIndex = Number($("#jcjllb").css("z-index"))<0?2:Number($("#jcjllb").css("z-index"))+1;
  703. $("#lrry").css("z-index",zIndex);
  704. $("#sfzh").focus();
  705. console.log('设置定时器');
  706. clearInterval(lrryClose);
  707. lrryClose = setInterval(function(){
  708. console.log('定时器运行');
  709. hideLrry();
  710. }, lrryCloseTime);
  711. }else{
  712. $("#scanner").val("");
  713. $("#scanner").focus();
  714. clearInterval(lrryClose);
  715. lrryClose = null;
  716. }
  717. });
  718. }
  719. });
  720. $('#jf_cancle').click(function() {
  721. handleHide("lfxx");
  722. $('#lrry').show()
  723. return false;
  724. });
  725. $('#syid').change(function(){
  726. $('#jfsy').val($('#objectPickergrowheightsyid').val());
  727. $('[name="jfsy"]').val($('#objectPickergrowheightsyid')[0].srcText);
  728. });
  729. $('#yylf_come').click(function(){
  730. createLfJcjl(11);
  731. handleHide("yylf")
  732. return false;
  733. });
  734. $('#yylf_leave').click(function(){
  735. createLfJcjl(51);
  736. handleHide("yylf");
  737. return false;
  738. });
  739. $('#yylf_cancle').click(function() {
  740. handleHide("yylf");
  741. $('#lrry').show();
  742. /*$('#yylf').hide();
  743. $('#zzc').hide();
  744. $('.lj').css('filter','blur(0px)');*/
  745. return false;
  746. });
  747. $('#lfqd').click(function(){
  748. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  749. wd.display.alert("请先登录!");
  750. return false;
  751. }
  752. var jfsfzh = $('#jfsfzh').val();
  753. var jfxm = $('#jfxm').val();
  754. var jfxbm = $('#jfxbm').val();
  755. var jfbmid = $('#jfbmid').val();
  756. var jfbjid = $('#jfbjid').val();
  757. var jfryid = $('#jfryid').val();
  758. var rs = $('#jfrs').val();
  759. if(jfxm == '' || jfxbm == '' || jfryid == ''){
  760. wd.display.alert("请补全信息");
  761. return false;
  762. }
  763. if(jfsfzh != '' && jfsfzh.length != 15 && jfsfzh.length != 18){
  764. wd.display.alert("请输入正确的身份证号!");
  765. return false;
  766. }
  767. $.ajax({
  768. type: "post",
  769. url: "<serv.ss name='gate_insTempLf'/>", // :"lf_zj"。Lin
  770. async: true,
  771. dataType: "json",
  772. data:{
  773. sfzh:jfsfzh,
  774. xm:jfxm,
  775. xbm:jfxbm,
  776. jfbmid:jfbmid,
  777. jfbjid:jfbjid,
  778. jfryid:jfryid,
  779. sy:$('[name="jfsy"]').val(),
  780. syid:$('#syid').val(),
  781. mjdid:mjdid,
  782. mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
  783. rs:rs
  784. },
  785. success: function(data) {
  786. console.log(data);
  787. wd.display.alert(data.msg);
  788. handleHide("lfxx");
  789. /*
  790. $('#lfxx').hide();
  791. $('#zzc').hide();
  792. $('.lj').css('filter','blur(0px)');
  793. lfxxClear();*/
  794. }
  795. });
  796. return false;
  797. });
  798. $('#jfsfzh').blur(function(){
  799. $(this).val($(this).val().replace(/\s+/g,""));
  800. });
  801. $('#jfxm').blur(function(){
  802. $(this).val($(this).val().replace(/\s+/g,""));
  803. });
  804. $('#qd').click(function(){
  805. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  806. wd.display.alert("请先登录!");
  807. return;
  808. }
  809. sfzh = $('#sfzh').val();
  810. if(sfzh == ''){
  811. wd.display.alert("请输入身份证号或学号!");
  812. return;
  813. }
  814. $.ajax({
  815. type: "post",
  816. <%-- 改,sfzh 用 data{sfzh:sfzh} 去传输。Lin
  817. url: '@service{name:"jcjl_lfx_zjhcx"}@&sfzh=' + sfzh,
  818. --%>
  819. url: "<serv.ss name='gate_initMpByKey'/>",
  820. data: {
  821. sfzh:sfzh
  822. },
  823. async: true,
  824. dataType: "json",
  825. success: function(data) {
  826. console.log(data);
  827. if (data.error == '1') {
  828. wd.display.alert(data.msg);
  829. $('#jfsfzh').val(sfzh);
  830. if(sfzh.length == 15){
  831. wd.edit.objectPicker.getInstance("xbm").initValue(sfzh.substring(14,15)%2==0?2:1);
  832. }
  833. if(sfzh.length == 18){
  834. wd.edit.objectPicker.getInstance("xbm").initValue(sfzh.substring(16,17)%2==0?2:1);
  835. }
  836. sfzh = '';
  837. handleShow("lfxx");
  838. } else {
  839. if(data.lb == 0){
  840. <%-- 改。Lin
  841. $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
  842. $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
  843. $('#xm').text(data.xm == null ? '' : data.xm);
  844. $('#xh').text(data.ryh == null ? '' : data.ryh);
  845. $('#bj').text(data.bjmc == null ? '' : data.bjmc);
  846. $('#lxlb').text(data.lxlb == null ? '' : data.lxlb);
  847. $('#lxlbts').hide();
  848. if(data.lxlb == '请假' && data.ylkcs >= data.zdlkcs){
  849. $('#lxlb').text('次数已超出('+ data.ylkcs +')');
  850. $('#lxlbts').show();
  851. }
  852. $('#ryxx').show();
  853. $('#zzc').show();
  854. $('.lj').css('filter','blur(20px)');
  855. //bug
  856. $("#ryxx").height("450px");
  857. $("#cancle").show();
  858. $('#leave').show();
  859. $('#back').show();
  860. $("#ryxx").removeClass("mainState-green").removeClass("mainState-orange");
  861. }else{
  862. $('#lfxx').hide();
  863. handleShow("yylf");
  864. $('#yylfxm').text(data.xm);
  865. $('#yylfsfzh').text(data.ryh);
  866. $('#yylfrs').text(data.rs);
  867. $('#yylfyysj').text(new Date(data.yysj).toLocaleString('chinese', { hour12: false }).replace(/\//g,'-'));
  868. lfid = data.ryid;
  869. }
  870. }
  871. }
  872. });
  873. });
  874. $('#cancle').click(function(){
  875. handleHide("ryxx");
  876. $('#lrry').show();
  877. /*
  878. $('#ryxx').hide();
  879. sfzh = '';
  880. $('#zzc').hide();
  881. $('.lj').css('filter','blur(0px)');
  882. $("#scanner").focus();
  883. $("#confirm-qrcode").hide();*/
  884. return false;
  885. });
  886. $('#back').click(function(){
  887. createJcjl(11);
  888. handleHide("ryxx");
  889. /*
  890. $('#ryxx').hide();
  891. sfzh = '';
  892. $('#zzc').hide();
  893. $('.lj').css('filter','blur(0px)');*/
  894. return false;
  895. });
  896. $('#leave').click(function(){
  897. createJcjl(51);
  898. handleHide("ryxx");
  899. /*$('#ryxx').hide();
  900. sfzh = '';
  901. $('#zzc').hide();
  902. $('.lj').css('filter','blur(0px)');*/
  903. return false;
  904. });
  905. $('#ryxxlb').on('click','.ryxxlb-child',function(){
  906. $(this).remove();
  907. });
  908. });
  909. /**
  910. * 根据设备标识查询mjdid
  911. */
  912. function getMjdid(sbbs){
  913. console.log(sbbs);
  914. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  915. wd.display.alert("请先登录!");
  916. return;
  917. }
  918. $.ajax({
  919. type: "post",
  920. url: "<serv.ss name='gate_selMjdidBySbbs'/>", // :"mjd_mjdid_cx"。Lin
  921. async: true,
  922. dataType: "json",
  923. data:{
  924. sbbs:sbbs
  925. },
  926. success: function(data) {
  927. console.log(data);
  928. if (data.error == '1') {
  929. wd.display.alert(data.msg);
  930. mjdid = '';
  931. } else {
  932. console.log(data.mjdid);
  933. mjdid = data.mjdid;
  934. }
  935. }
  936. });
  937. }
  938. /**
  939. * 离返校学员信息增加
  940. */
  941. function createJcjl(jcfx){
  942. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  943. wd.display.alert("请先登录!");
  944. return;
  945. }
  946. var url = '';
  947. /* 改,把参数统一移到 data:{} 里。Lin
  948. if(sfzh == ''){
  949. url = '@service{name:"jcjl_lfx_zj"}@&code=' + qrcodestr;
  950. }else{
  951. url = '@service{name:"jcjl_lfx_zj"}@&sfzh=' + sfzh
  952. }
  953. */ url = "<serv.ss name='gate_insJcjlByMp'/>";
  954. $.ajax({
  955. type: "post",
  956. url: url,
  957. data:{
  958. /// 增加,把上面写在 URL 里的参数统一移到这。Lin
  959. code: qrcodestr,
  960. sfzh: sfzh,
  961. ///
  962. jcfx:jcfx,
  963. mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
  964. mjdid:mjdid
  965. },
  966. async: true,
  967. dataType: "json",
  968. success: function(data) {
  969. console.log(data);
  970. wd.display.alert(data.msg);
  971. }
  972. });
  973. }
  974. /**
  975. * 来访进出记录增加
  976. * @param {Object} jcfx
  977. */
  978. function createLfJcjl(jcfx){
  979. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  980. wd.display.alert("请先登录!");
  981. return;
  982. }
  983. $.ajax({
  984. type: "post",
  985. url: "<serv.ss name='gate_updTempLfByExit'/>", // :"jcjl_lf_zj"。Lin
  986. data:{
  987. jcfxm:jcfx,
  988. mwid:"${sessionScope.ssUser.ryid}", // ['env.ry'].。Lin
  989. mjdid:mjdid,
  990. dxid:lfid
  991. },
  992. async: true,
  993. dataType: "json",
  994. success: function(data) {
  995. console.log(data);
  996. wd.display.alert(data.msg);
  997. }
  998. });
  999. }
  1000. //扫描抢输入事件,监听到扫描枪输入后会调用
  1001. function onScanInput(str) {
  1002. console.log(str.toLowerCase());
  1003. if(str.indexOf("@entrance@")>-1||str.indexOf("@exit@")>-1){
  1004. //带有前缀的扫码器
  1005. if(str.match(/@entrance@/)){
  1006. direction = "entrance";
  1007. str = str.split("@entrance@")[1];
  1008. }else if(str.match(/@exit@/)){
  1009. direction = "exit";
  1010. str = str.split("@exit@")[1];
  1011. }else{
  1012. $("#scanner").val("");
  1013. return;
  1014. }
  1015. }else{
  1016. //没有前缀的扫码器
  1017. //@hdO{n:"ry",k:"a5c8247c075141279dbd853bbf741853"}@
  1018. if(str.length != 50&&str.split(".")[1].length !=35){
  1019. $("#scanner").val("");
  1020. return;
  1021. }
  1022. direction=null;
  1023. }
  1024. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1025. wd.display.alert("请先登录!");
  1026. $("#scanner").val("");
  1027. return;
  1028. }
  1029. var hdObj = eval('('+str.substr(4,str.length - 5)+')');
  1030. if(hdObj.n != 'ry'){
  1031. $("#scanner").val("");
  1032. return;
  1033. }
  1034. str = hdObj.k;
  1035. clearTimeout(hideRyxxTimeout);
  1036. if(direction){
  1037. $.ajax({
  1038. type: "post",
  1039. url: '@service{name:"jcjl_lfx_cx_sg"}@&code=' + str.toLowerCase(),
  1040. async: true,
  1041. dataType: "json",
  1042. data:{direction:direction,mjdid:mjdid},
  1043. success: function(data) {
  1044. console.log(data);
  1045. if (data.error == '1') {
  1046. wd.display.alert(data.msg)
  1047. } else {
  1048. //qrcodestr = str.toLowerCase();
  1049. qrcodestr = data.yhid;
  1050. sfzh = '';
  1051. <%-- 改。Lin
  1052. $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
  1053. $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
  1054. $('#xm').text(data.xm == null ? '' : data.xm);
  1055. $('#xh').text(data.ryh == null ? '' : data.ryh);
  1056. $('#bj').text(data.bjmc == null ? '' : data.bjmc);
  1057. if(direction == 'entrance'){
  1058. $("#ryxx").addClass("mainState-green").removeClass("mainState-orange");
  1059. // $('#lxlb').text("进校:"+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1060. $('#lxlb').text(""+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1061. }else{
  1062. $("#ryxx").addClass("mainState-orange").removeClass("mainState-green");
  1063. // $('#lxlb').text("离校:"+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1064. $('#lxlb').text(""+(data.lxlb == null ? '' : data.lxlb)+(data.MSG?"("+data.MSG+")":""));
  1065. }
  1066. $('#lxlbts').hide();
  1067. if(data.lxlb == '请假'){
  1068. var outnumber=false;
  1069. if(direction == 'entrance'){
  1070. outnumber=data.ylkcs > data.zdlkcs;
  1071. }else{
  1072. outnumber=data.ylkcs >= data.zdlkcs;
  1073. }
  1074. if(outnumber){
  1075. $('#lxlb').text('次数已超出('+ data.ylkcs +')');
  1076. $('#lxlbts').show();
  1077. }
  1078. }
  1079. $('#zzc').show();
  1080. $('.lj').css('filter','blur(20px)');
  1081. if(data.warn){
  1082. //要显示二维码给保安扫
  1083. showRyxx({k:data.randomKey,d:$("input[name='sbbs']").val()});
  1084. }else{
  1085. showRyxx();
  1086. }
  1087. }
  1088. }
  1089. });
  1090. }else{
  1091. $("#ryxx").removeClass("mainState-green").removeClass("mainState-orange");
  1092. $.ajax({
  1093. type: "post",
  1094. url: '@service{name:"jcjl_lfx_cx"}@&code=' + str.toLowerCase(),
  1095. async: true,
  1096. dataType: "json",
  1097. success: function(data) {
  1098. console.log(data);
  1099. if (data.error == '1') {
  1100. wd.display.alert(data.msg)
  1101. } else {
  1102. //qrcodestr = str.toLowerCase();
  1103. qrcodestr = data.yhid;
  1104. sfzh = '';
  1105. <%-- 改。Lin
  1106. $('#zjz').attr('src','@service{name:"getData"}@&path=' + data.zjzwj); --%>
  1107. $('#zjz').attr('src','/service?ssServ=dlByHttp&path='+ data.zjzwj);
  1108. $('#xm').text(data.xm == null ? '' : data.xm);
  1109. $('#xh').text(data.ryh == null ? '' : data.ryh);
  1110. $('#bj').text(data.bjmc == null ? '' : data.bjmc);
  1111. $('#lxlb').text(data.lxlb == null ? '' : data.lxlb);
  1112. $('#lxlbts').hide();
  1113. if(data.lxlb == '请假' && data.ylkcs >= data.zdlkcs){
  1114. $('#lxlb').text('次数已超出('+ data.ylkcs +')');
  1115. $('#lxlbts').show();
  1116. }
  1117. showRyxx();
  1118. $('#zzc').show();
  1119. $('.lj').css('filter','blur(20px)');
  1120. }
  1121. }
  1122. });
  1123. }
  1124. }
  1125. var lxConfirmInterval;
  1126. var hideRyxxTimeout;
  1127. /**
  1128. * 获取轮询结果
  1129. * @param {Object} k
  1130. */
  1131. function jcjl_getScanResult(k){
  1132. $.ajax({
  1133. type: "post",
  1134. url: '@service{name:"jcjl_getScanResult"}@',
  1135. async: true,
  1136. dataType: "json",
  1137. data:{
  1138. privateKey:k
  1139. },
  1140. success: function(data) {
  1141. if(data.status){
  1142. clearInterval(lxConfirmInterval);
  1143. alert(data.msg);
  1144. handleHide("ryxx");
  1145. }
  1146. }
  1147. });
  1148. }
  1149. /**
  1150. * 移除标识
  1151. * @param {Object} k
  1152. */
  1153. function removePrivateKey(k){
  1154. $.ajax({
  1155. type: "post",
  1156. url: '@service{name:"jcjl_removeScanConfirmMap"}@',
  1157. async: true,
  1158. dataType: "json",
  1159. data:{
  1160. privateKey:k
  1161. },
  1162. success: function(data) {
  1163. if(data.status){
  1164. }
  1165. }
  1166. })
  1167. }
  1168. function showRyxx(data){
  1169. $("#confirm-qrcode").hide();
  1170. handleShow("ryxx");
  1171. if(data){
  1172. $("#ryxx").height("339px");
  1173. $("#cancle").hide();
  1174. $('#leave').hide();
  1175. $('#back').hide();
  1176. $("#qrcodeBox").css("z-index",Number($("#jcjllb").css("z-index"))+1);
  1177. qrCodeGenerate(".qrcode-confirm", "@hdGc" + JSON.stringify(data) + "@", 110, 110, "canvas");
  1178. $("#confirm-qrcode").show();
  1179. lxConfirmInterval = setInterval(function(){
  1180. jcjl_getScanResult(data.k);
  1181. },500);
  1182. }else{
  1183. if(direction){
  1184. $("#ryxx").height("339px");
  1185. $('#leave').hide();
  1186. $('#back').hide();
  1187. $("#cancle").hide();
  1188. if(direction == "entrance"){
  1189. createJcjl(11);
  1190. }else{
  1191. createJcjl(51);
  1192. }
  1193. }else{
  1194. $("#ryxx").height("450px");
  1195. $("#cancle").val("取消").show();
  1196. $('#leave').show();
  1197. $('#back').show();
  1198. }
  1199. }
  1200. $("#zzc").click(function(){
  1201. if(data){
  1202. clearInterval(lxConfirmInterval);
  1203. removePrivateKey(data.k);
  1204. }
  1205. handleHide("ryxx");
  1206. });
  1207. hideRyxxTimeout = setTimeout(function(){
  1208. handleHide("ryxx");
  1209. },1000 * 20)
  1210. }
  1211. function hideLrry(){
  1212. $('#lrry').stop(true).fadeOut();
  1213. /* 先去掉,if(lrryClose) 会抛出错误 ReferenceError: lrryClose is not defined,导致不执行后面的语句。Lin
  1214. * clearInterval(lrryClose) 在调用 hideLrry() 前都有调用
  1215. * lrryClose 会被马上赋值:lrryClose = setInterval(function(){hideLrry();}, lrryCloseTime);
  1216. */
  1217. if(lrryClose){
  1218. clearInterval(lrryClose);
  1219. lrryClose = null;
  1220. }
  1221. /* */
  1222. $("#scanner").val("");
  1223. $("#scanner").focus();
  1224. }
  1225. var y = 0;
  1226. /**
  1227. * 根据设备标识获取进出记录
  1228. */
  1229. function showJcjllb(){
  1230. $("#lrry").hide();
  1231. $("#scanner").focus();
  1232. //下拉
  1233. $.ajax({
  1234. type: "post",
  1235. url: '@service{name:"getJcjlBySbbs"}@',
  1236. async: true,
  1237. dataType: "json",
  1238. data:{
  1239. sbbs:beacon.getMacAddress(),
  1240. },
  1241. success: function(data) {
  1242. handleShow("jcjllb");
  1243. if(data.length>0&&$("#ryxx").is(":hidden")){
  1244. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))+1);
  1245. }
  1246. for(var i=startrn;i<data.length&&i<endrn;i++){
  1247. jcjlEmpty = false;
  1248. var jcjl = data[i];
  1249. var mainState="";
  1250. if(jcjl.jcfxm == 11){
  1251. mainState = "mainState-green";
  1252. }else if(jcjl.jcfxm == 51){
  1253. mainState = "mainState-orange";
  1254. }else if(jcjl.jcfxm == 81){
  1255. mainState = "mainState-inportantrRed";
  1256. }else{
  1257. mainState = "mainState-orange";
  1258. }
  1259. var html = '<div class="jcjllb-child '+mainState+'" style="width:99%; height:350px;position: relative;border:1px white solid;border-radius:5px;background:#fff;'+($(".jcjllb-child").length > 0?"margin-bottom:25px;":"")+'">'
  1260. + '<div style="display:flex;width:680px;margin-left:60px;margin-top:61px;padding-bottom: 50px;">'
  1261. + '<div>'
  1262. + '<input type="hidden" name="ryid" value="'+ jcjl.ryid +'" class="input-text input-number" />';
  1263. if(jcjl.zjzwj){
  1264. <%-- 改。Lin
  1265. html += '<img id="zjz" src="@service{name:"getData"}@&path='+ jcjl.zjzwj +'" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>'; --%>
  1266. html += '<img id="zjz" src="/service?ssServ=dlByHttp&path="'+ jcjl.zjzwj +'" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>';
  1267. }else{
  1268. <%-- 改。Lin
  1269. html += '<img id="zjz" src="${sessionScope["XMMC"]}/theme/EasyUses/image/default-photo.png" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>'; --%>
  1270. html += '<img id="zjz" src="/skin/easy/image/default-photo.png" style="margin-left:10px; width:162px;height:226px;border: 1px solid #cccccc;border-radius:3px;"></img>';
  1271. }
  1272. html += '</div>'
  1273. + '<table class="xm content-largeText" style="color:#000;">';
  1274. if(jcjl.xm != null){
  1275. html += '<tr>'
  1276. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> ';
  1277. if(jcjl.dxm&&jcjl.dxm == 'lf'){
  1278. html+= '<span id="xm">'+ jcjl.xm +'(来访)</span> '
  1279. + '</td>'
  1280. + '</tr>';
  1281. }else{
  1282. html += '<span id="xm">'+ jcjl.xm +'</span> '
  1283. + '</td>'
  1284. + '</tr>';
  1285. }
  1286. }
  1287. if(jcjl.bjmc != null){
  1288. html += '<tr>'
  1289. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> '
  1290. + '<span id="bj" >'+ jcjl.bjmc +'</span> '
  1291. + '</td>'
  1292. + '</tr>';
  1293. }
  1294. if(jcjl.jcsj != null){
  1295. html += '<tr>'
  1296. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;">'
  1297. + '<span id="xh" >'+ new Date(jcjl.jcsj).format("yyyy-MM-dd hh:mm:ss") +'</span> '
  1298. + '</td>'
  1299. + '</tr>';
  1300. }
  1301. html += '<tr>'
  1302. + '<td style="width: 425px;height: 50px;word-break: break-all;overflow: hidden;display: inline-block;"> ';
  1303. //1 请假
  1304. //51 走读
  1305. //91 无原由
  1306. //所有拒绝的进出记录显示为无原由
  1307. if(jcjl.jcfxm == 81){
  1308. html+='<span class="content-largeWarningText" style="vertical-align: top;">不允许离校</span> ';
  1309. }else{
  1310. if(jcjl.lkyym == 1){//请假
  1311. html += '<span class="content-largeWarningText" style="vertical-align: top;color:black;">请假</span>';
  1312. }else if (jcjl.lkyym == 51){
  1313. html+='<span class="content-largeWarningText" style="vertical-align: top;color:black;">走读生</span> ';
  1314. }else{//无原有
  1315. html+='<span class="content-largeWarningText" style="vertical-align: top;">无原由</span> ';
  1316. }
  1317. if(jcjl.tw != null){
  1318. if(jcjl.tw < 37.3){
  1319. html += '<span class="content-largeWarningText" style="color:black;">'+ jcjl.tw +'℃</span>';
  1320. }else{
  1321. html += '<span class="content-largeWarningText" style="color:red;">'+ jcjl.tw +'℃</span>';
  1322. }
  1323. }
  1324. }
  1325. html += '</td></tr>';
  1326. html += '</table>'
  1327. + '</div> '
  1328. + '</div>';
  1329. $('#jcjllb').prepend(html);
  1330. if(startrn==0){
  1331. $('#jcjllb').scrollTop($('#jcjllb')[0].scrollHeight);
  1332. }
  1333. }
  1334. if(data.length>endrn){
  1335. startrn += endrn;
  1336. }else{
  1337. startrn += data.length;
  1338. }
  1339. endrn+=10;
  1340. clearTimeout(hideJcjllb);
  1341. hideJcjllb = setTimeout(function(){
  1342. //取消虚化
  1343. // handleHide("jcjllb");
  1344. },1000 * 20);
  1345. }
  1346. });
  1347. }
  1348. var isDrag = false;
  1349. $(function(e) {
  1350. stylesheetData.ryxxlb_left = $("#ryxxlb").css("left");
  1351. stylesheetData.ryxx_right = $("#ryxx").css("right");
  1352. stylesheetData.lfxx_right = $("#lfxx").css("right");
  1353. stylesheetData.yylf_right = $("#yylf").css("right");
  1354. //2020-12-17添加分辨率兼容的事件
  1355. if (screen.width == 1280&&screen.height == 960){
  1356. // $("#videoID").css({"max-width":"none","width":"1706","margin-left":"-194px"});
  1357. $("#videoID").css({"max-width":"none","width":"1920","margin-left":"-320px"});
  1358. $("#lrry").css("left","55%");
  1359. }
  1360. //2020-10-29添加下滑的事件
  1361. $("#jcjllb").on('touchstart',function(e){
  1362. y = e.originalEvent.touches["0"].screenY;
  1363. });
  1364. $("#jcjllb").on('touchend',function(e){
  1365. e.stopPropagation();
  1366. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1367. return;
  1368. }
  1369. if(e.originalEvent.changedTouches["0"].screenY>y){
  1370. showJcjllb()
  1371. }
  1372. });
  1373. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))-1);
  1374. touch.on('#jcjllb', 'touchend', function (e) {
  1375. e.stopPropagation();
  1376. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1377. return;
  1378. }
  1379. if(e.y>y){
  1380. isDrag = true;
  1381. showJcjllb()
  1382. }else{
  1383. isDrag = false;
  1384. }
  1385. });
  1386. document.onmousedown = function(e) {
  1387. var nextTime = new Date().getTime();
  1388. lastTime = nextTime;
  1389. /*
  1390. var nextTime = new Date().getTime();
  1391. var code = e.which;
  1392. var char = String.fromCharCode(code);
  1393. if (codeString == "") {
  1394. codeString += char;
  1395. } else if (nextTime - lastTime <= 30) {
  1396. codeString += char;
  1397. }
  1398. lastTime = nextTime;*/
  1399. };
  1400. touch.on('#jcjllb', 'touchstart', function (event) {
  1401. y = event.y;
  1402. });
  1403. getDatesInfo()
  1404. var codeString = "";
  1405. //定时器每隔200ms 清空codeString
  1406. /*var scanTimeer = setInterval(function() {
  1407. var now = new Date().getTime();
  1408. if (now - lastTime > 200) {
  1409. if (codeString.length > 0) {
  1410. onScanInput(codeString.replace(/\s+/g,""));
  1411. }
  1412. codeString = "";
  1413. }
  1414. }, 200);*/
  1415. var scanTimeer = setInterval(function() {
  1416. var now = new Date().getTime();
  1417. if (now - lastTime > 500) {
  1418. if ($("#scanner").val().length > 0) {
  1419. onScanInput($("#scanner").val().replace(/\s+/g,""));
  1420. $("#scanner").val("");
  1421. }
  1422. //codeString = "";
  1423. }
  1424. }, 500);
  1425. var lastTime;
  1426. var caseFormat = false;
  1427. document.onkeydown = function(e) {
  1428. var nextTime= new Date().getTime();
  1429. lastTime = nextTime;
  1430. /*var code = e.which;
  1431. var char = String.fromCharCode(code);
  1432. if (codeString == "") {
  1433. codeString += char;
  1434. } else if (nextTime - lastTime <= 30) {
  1435. codeString += char;
  1436. }
  1437. lastTime = nextTime;*/
  1438. };
  1439. $("#scanner").focus();
  1440. window.onbeforeunload= function(event) {
  1441. if(!beacon){
  1442. return;
  1443. }
  1444. beacon.shutDownIdcardDevice();
  1445. }
  1446. });
  1447. /**
  1448. * 显示时间
  1449. */
  1450. function getDatesInfo() {
  1451. var date=new Date();
  1452. var dates=date.getDate(),month=date.getMonth()+1,hours=date.getHours(),seconds=date.getMinutes(),year=date.getFullYear();
  1453. if(hours<10){
  1454. hours="0"+hours
  1455. }
  1456. if(seconds<10){
  1457. seconds="0"+seconds;
  1458. }
  1459. $("#getDateInfo").children("span")[0].innerHTML= year+"/" + month + "/" + dates;
  1460. $("#getDateInfo").children("span")[1].innerHTML = "" + hours + ":" + seconds;
  1461. }
  1462. setInterval(function () {
  1463. getDatesInfo()
  1464. },1000)
  1465. /**
  1466. *
  1467. * 未知功能
  1468. */
  1469. top.changeIdcard = function(idCardInfo){
  1470. if(${empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1471. wd.display.alert("请先登录!");
  1472. return;
  1473. }
  1474. idCardInfo = JSON.parse(idCardInfo);
  1475. var idCardNo = idCardInfo.sfzh;
  1476. console.log(idCardNo);
  1477. $.ajax({
  1478. type: "post",
  1479. url: '@service{name:"lf_yyxx_cx"}@',
  1480. async: true,
  1481. dataType: "json",
  1482. data:{
  1483. sfzh:idCardNo,
  1484. },
  1485. success: function(data) {
  1486. console.log(data);
  1487. if (data.error == '1') {
  1488. wd.display.alert(data.msg);
  1489. $('#yylf').hide();
  1490. handleShow("lfxx");
  1491. $('#jfsfzh').val(idCardNo);
  1492. $('#jfxm').val(idCardInfo.xm.replace(/\s+/g,""));
  1493. if(idCardNo.length == 15){
  1494. wd.edit.objectPicker.getInstance("xbm").initValue(idCardNo.substring(14,15)%2==0?2:1);
  1495. }else{
  1496. wd.edit.objectPicker.getInstance("xbm").initValue(idCardNo.substring(16,17)%2==0?2:1);
  1497. }
  1498. } else {
  1499. $('#lfxx').hide();
  1500. $('#yylf').show();
  1501. $('#yylfxm').text(idCardInfo.xm.replace(/\s+/g,""));
  1502. $('#yylfsfzh').text(idCardNo);
  1503. $('#yylfrs').text(data.rs);
  1504. $('#yylfyysj').text(new Date(data.yysj).toLocaleString('chinese', { hour12: false }).replace(/\//g,'-'));
  1505. lfid = data.lfid;
  1506. $('#zzc').show();
  1507. $('.lj').css('filter','blur(20px)');
  1508. }
  1509. }
  1510. });
  1511. }
  1512. /**
  1513. *
  1514. * 接访人查询
  1515. * @param {Object} isjfr
  1516. * @param {Object} usexm 搜索姓名
  1517. */
  1518. function lf_jfr_cx(isjfr,usexm){
  1519. var jfbmid = $('#jfbmid').val();
  1520. var jfbjid = $('#jfbjid').val();
  1521. var jfryna = $('#jfryna').val();
  1522. $.ajax({
  1523. url: "<serv.ss name='gate_selRyOptByBjidOrBmid'/>", // :"lf_jfr_cx"。Lin
  1524. type: 'post',
  1525. dataType: 'json',
  1526. data: {
  1527. bmid: jfbmid,
  1528. bjid: jfbjid,
  1529. xm: usexm ? jfryna : ''
  1530. },
  1531. success: function(data) {
  1532. console.log(data);
  1533. /// 增加,显示错误信息。Lin
  1534. if (data.error == '1') {
  1535. wd.display.alert(data.msg);
  1536. return;
  1537. }
  1538. ///
  1539. $('#jfryid_option').empty();
  1540. $('#jfryid_option').append('<div class="popupList" status="noitem" checkstate="unselected" value=""></div>');
  1541. for(var i = 0; i < data.length; i++){
  1542. $('#jfryid_option').append('<div class="popupList" status="people" value="'+ data[i].ryid +'" index="'+ i +'" checkstate="unselected">'+ data[i].xm +'</div>');
  1543. }
  1544. if(!isjfr){
  1545. $('#jfryna').val('');
  1546. $('#jfryid').val('');
  1547. globalJfryna = '';
  1548. globalJfryid = '';
  1549. }
  1550. }
  1551. });
  1552. }
  1553. wd.edit.objectPicker.getInstance("jfbmid").onchange = function(){
  1554. lf_jfr_cx(false,false);
  1555. }
  1556. wd.edit.objectPicker.getInstance("jfbjid").onchange = function(){
  1557. lf_jfr_cx(false,false);
  1558. }
  1559. function lfxxClear(){
  1560. $('jfsfzh').val('');
  1561. $('#jfxm').val('');
  1562. wd.edit.objectPicker.getInstance("jfbmid").initValue();
  1563. wd.edit.objectPicker.getInstance("xbm").initValue();
  1564. wd.edit.objectPicker.getInstance("jfbjid").initValue();
  1565. wd.edit.objectPicker.getInstance("syid").initValue();
  1566. $('#jfrs').val('1');
  1567. }
  1568. var jcjlcxsj;
  1569. var dsscjcjl;
  1570. var isProcessingBatch = false; // 全局锁,防止批量处理时重复调用
  1571. var cardHideTimer = null; // 卡片隐藏定时器
  1572. var hasCards = false; // 是否有卡片显示
  1573. /**
  1574. * 有gate2的情况下:不显示历史进出记录;gate1在左边,gata2右边
  1575. * 有gata1的情况下:历史进出记录列表在右边
  1576. *
  1577. * @return {[type]} [description]
  1578. */
  1579. var stylesheetData = {};
  1580. function handleShow(type){
  1581. $('.lj').css('filter','blur(20px)');
  1582. if(type == "ryxx"){
  1583. $('#ryxx').show();
  1584. handleHide("lfxx");
  1585. handleHide("yylf");
  1586. if($(".ryxxlb-child").length>0){
  1587. handleHide("jcjllb");
  1588. $("#ryxxlb").css("left","30px");
  1589. $("#ryxx").css("right","30px");
  1590. }else if($(".jcjllb-child").length>0){
  1591. $("#ryxx").css("left","30px");
  1592. }else{
  1593. $("#ryxx").css("left","");
  1594. $("#ryxx").css("right",stylesheetData.ryxx_right);
  1595. }
  1596. }else if(type == "ryxxlb"){
  1597. if($("#ryxx").is(":visible")){
  1598. $("#ryxxlb").css("left","30px");
  1599. $("#ryxx").css("right","30px");
  1600. }else if($("#lfxx").is(":visible")){
  1601. $("#ryxxlb").css("left","30px");
  1602. $("#lfxx").css("right","30px");
  1603. }else if($("#yylf").is(":visible")){
  1604. $("#ryxxlb").css("left","30px");
  1605. $("#yylf").css("right","30px");
  1606. }else if($(".jcjllb-child").length>0){
  1607. $("#ryxxlb").css("left","30px");
  1608. }else{
  1609. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1610. }
  1611. }else if(type == "jcjllb"){
  1612. //ryxxlb左移
  1613. $("#ryxxlb").css("left","30px");
  1614. }else if(type == "lfxx"){
  1615. $('#zzc').show();
  1616. $('#lfxx').show();
  1617. handleHide("ryxx");
  1618. handleHide("yylf");
  1619. handleHide("jcjllb");
  1620. if($(".ryxxlb-child").length>0){
  1621. $("#ryxxlb").css("left","30px");
  1622. $("#lfxx").css("right","30px");
  1623. }else if($(".jcjllb-child").length>0){
  1624. $("#lfxx").css("left","30px");
  1625. }else{
  1626. $("#lfxx").css("right",stylesheetData.lfxx_right);
  1627. $("#lfxx").css("left","");
  1628. }
  1629. }else if(type == "yylf"){
  1630. $('#yylf').show();
  1631. $('#zzc').show();
  1632. handleHide("ryxx");
  1633. handleHide("lfxx");
  1634. handleHide("jcjllb");
  1635. if($(".ryxxlb-child").length>0){
  1636. $("#ryxxlb").css("left","30px");
  1637. $("#yylf").css("right","30px");
  1638. }else if($(".jcjllb-child").length>0){
  1639. $("#yylf").css("left","30px");
  1640. }else{
  1641. $("#yylf").css("right",stylesheetData.yylf_right);
  1642. $("#yylf").css("left","");
  1643. }
  1644. }
  1645. }
  1646. var startrn = 0;
  1647. var endrn = 10;
  1648. var hideJcjllb;
  1649. var jcjlEmpty = true;
  1650. setInterval(function(){
  1651. if($("#ryxx").is(":hidden")&&jcjlEmpty&&$(".ryxxlb-child").length == 0&&$("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")){
  1652. $('.lj').css('filter','blur(0px)');
  1653. }
  1654. },50);
  1655. /**
  1656. * 主要用来去掉虚化的背景
  1657. * @param {[type]} flag [description]
  1658. * @return {[type]} [description]
  1659. */
  1660. function handleHide(type){
  1661. if(type == "ryxx"){
  1662. $('#ryxx').hide();
  1663. sfzh = '';
  1664. $("#scanner").focus();
  1665. $("#confirm-qrcode").hide();
  1666. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))+1);
  1667. if($(".ryxxlb-child").length>0){
  1668. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1669. }else if($("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")&&jcjlEmpty){
  1670. $('#zzc').hide();
  1671. $('.lj').css('filter','blur(0px)');
  1672. }
  1673. }else if(type == "ryxxlb"){
  1674. // 清除10秒自动隐藏的定时器
  1675. if(cardHideTimer){
  1676. clearTimeout(cardHideTimer);
  1677. cardHideTimer = null;
  1678. }
  1679. // 手动关闭所有卡片
  1680. var $container = $('#ryxxlb');
  1681. var $allCards = $container.find('.ryxxlb-child');
  1682. if($allCards.length > 0){
  1683. $allCards.addClass('fade-out');
  1684. setTimeout(function(){
  1685. $allCards.remove();
  1686. }, 400);
  1687. }
  1688. // 恢复视频播放
  1689. if(hasCards){
  1690. var $video = $('#videoID');
  1691. if($video.length > 0){
  1692. $video[0].play();
  1693. hasCards = false;
  1694. console.log("▶️ 手动关闭卡片,恢复视频播放");
  1695. }
  1696. }
  1697. if($("#ryxx").is(":visible")){
  1698. $("#ryxx").css("right",stylesheetData.ryxx_right);
  1699. }else if($("#lfxx").is(":visible")){
  1700. $("#lfxx").css("right",stylesheetData.lfxx_right);
  1701. }else if($("#yylf").is(":visible")){
  1702. $("#yylf").css("right",stylesheetData.lfxx_right);
  1703. }else if (jcjlEmpty){
  1704. $('.lj').css('filter','blur(0px)');
  1705. }
  1706. }else if(type == "jcjllb"){
  1707. if($(".ryxxlb-child").length == 0&&$("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")){
  1708. $('.lj').css('filter','blur(0px)');
  1709. }
  1710. $("#jcjllb").css("z-index",Number($("#qrcodeBox").css("z-index"))-1);
  1711. $("#jcjllb").empty();
  1712. jcjlEmpty = true;
  1713. startrn = 0;
  1714. endrn = 10;
  1715. if($("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")&&$("#yylf").is(":hidden")){
  1716. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1717. }
  1718. }else if(type == "lfxx"){
  1719. $('#lfxx').hide();
  1720. if($(".ryxxlb-child").length>0){
  1721. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1722. }else if($("#ryxx").is(":hidden")&&$("#yylf").is(":hidden")&&jcjlEmpty){
  1723. $('.lj').css('filter','blur(0px)');
  1724. $('#zzc').hide();
  1725. }
  1726. lfxxClear();
  1727. }else if(type == "yylf"){
  1728. $('#yylf').hide();
  1729. if($(".ryxxlb-child").length>0){
  1730. $("#ryxxlb").css("left",stylesheetData.ryxxlb_left);
  1731. }else if($("#ryxx").is(":hidden")&&$("#lfxx").is(":hidden")&&jcjlEmpty){
  1732. $('.lj').css('filter','blur(0px)');
  1733. $('#zzc').hide();
  1734. }
  1735. }
  1736. }
  1737. /**
  1738. * 获取闸门进出记录+显示 (三区域版本 - 支持批量处理)
  1739. */
  1740. function getAutodoorInfo(){
  1741. // 如果正在处理批量数据,跳过本次请求
  1742. if(isProcessingBatch){
  1743. console.log("⏸️ 正在处理批量数据,跳过本次请求");
  1744. return;
  1745. }
  1746. $.ajax({
  1747. url: "<serv.ss name='gate_selIoHstByTime'/>", // :"jcjl_zm_cx"。Lin
  1748. type: 'post',
  1749. dataType: 'json',
  1750. data: {
  1751. mjdid: mjdid,
  1752. jcjlcxsj: jcjlcxsj
  1753. },
  1754. success: function(data) {
  1755. if(data.length == 0) return;
  1756. handleShow("ryxxlb");
  1757. console.log("📥 进出记录:",data)
  1758. $("#ryxxlb").css("z-index",Number($("#jcjllb").css("z-index"))+1);
  1759. $('.lj').css('filter','blur(20px)');
  1760. // 设置处理标志
  1761. isProcessingBatch = true;
  1762. // 批量处理数据,带延迟动画
  1763. processRecordsBatch(data, 0);
  1764. }
  1765. });
  1766. }
  1767. /**
  1768. * 批量处理记录 (递归方式,带动画延迟)
  1769. * @param records 记录数组
  1770. * @param index 当前处理索引
  1771. */
  1772. function processRecordsBatch(records, index){
  1773. if(index >= records.length){
  1774. // 所有记录处理完毕,延迟释放锁(等待最后一张卡片动画完成)
  1775. setTimeout(function(){
  1776. isProcessingBatch = false;
  1777. console.log("✅ 批量处理完成,释放锁");
  1778. // 注意: 10秒倒计时已经在pushCardToThreeAreas中每次推送时自动重置
  1779. }, 1000);
  1780. return;
  1781. }
  1782. // 第一张卡片时暂停视频
  1783. if(index == 0 && !hasCards){
  1784. pauseVideo();
  1785. }
  1786. var jcjl = records[index];
  1787. // 判断进出类型
  1788. var cardType = getCardType(jcjl);
  1789. // 生成卡片HTML
  1790. var html = buildCardHtml(jcjl, cardType);
  1791. // 执行三区域推送逻辑
  1792. pushCardToThreeAreas(html, cardType);
  1793. console.log("🎬 处理第 " + (index + 1) + "/" + records.length + " 条: " + jcjl.xm + " (" + cardType + ")");
  1794. // 更新查询时间戳 (最后一条)
  1795. if(index == records.length - 1){
  1796. jcjlcxsj = new Date(jcjl.jcsj);
  1797. jcjlcxsj.setTime(jcjlcxsj.getTime() + 1000);
  1798. jcjlcxsj = jcjlcxsj.toLocaleString('chinese', { hour12: false }).replace(/\//g,'-');
  1799. console.log("🕐 更新时间戳:", jcjlcxsj);
  1800. }
  1801. // 递归处理下一条 (延迟1200ms,确保动画完整播放)
  1802. // 动画时长: 淡入50ms + 滑动800ms + 淡出400ms = 1250ms
  1803. if(index < records.length - 1){
  1804. setTimeout(function(){
  1805. processRecordsBatch(records, index + 1);
  1806. }, 1200);
  1807. }
  1808. }
  1809. /**
  1810. * 判断卡片类型
  1811. * @param jcjl 进出记录对象
  1812. * @return 'enter' | 'leave' | 'vacation'
  1813. */
  1814. function getCardType(jcjl){
  1815. // jcfxm=11 进入
  1816. if(jcjl.jcfxm == 11){
  1817. return 'enter';
  1818. }
  1819. // jcfxm=51 且 lkyym=1 请假离校
  1820. if(jcjl.jcfxm == 51 && jcjl.lkyym == 1){
  1821. return 'vacation';
  1822. }
  1823. // jcfxm=51 且 (lkyym=51 或 lkyym=91) 离校
  1824. if(jcjl.jcfxm == 51 && (jcjl.lkyym == 51 || jcjl.lkyym == 91)){
  1825. return 'leave';
  1826. }
  1827. // 默认为离校
  1828. return 'leave';
  1829. }
  1830. /**
  1831. * 生成卡片HTML
  1832. * @param jcjl 进出记录对象
  1833. * @param cardType 卡片类型
  1834. * @return HTML字符串
  1835. */
  1836. function buildCardHtml(jcjl, cardType){
  1837. // 根据类型设置颜色和状态文本
  1838. var mainState = '';
  1839. var statusText = '';
  1840. var statusClass = '';
  1841. if(cardType == 'enter'){
  1842. mainState = 'mainState-blue'; // 蓝色 - 进校
  1843. statusText = '进校';
  1844. statusClass = 'status-enter';
  1845. }else if(cardType == 'leave'){
  1846. mainState = 'mainState-green'; // 绿色 - 离校
  1847. statusText = '离校';
  1848. statusClass = 'status-leave';
  1849. }else if(cardType == 'vacation'){
  1850. mainState = 'mainState-orange'; // 橙色 - 请假
  1851. statusText = '请假'; // 改为"请假"而不是"请假离校"
  1852. statusClass = 'status-vacation';
  1853. }
  1854. var html = '<div class="ryxxlb-child '+mainState+'" data-type="'+cardType+'" style="border:1px white solid;border-radius:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:40px 30px;">'
  1855. + '<input type="hidden" name="ryid" value="'+ jcjl.ryid +'" />';
  1856. // 照片 (尺寸由CSS根据位置类控制)
  1857. if(jcjl.zjzwj){
  1858. html += '<img class="card-photo" src="/service?ssServ=dlByHttp&path='+ jcjl.zjzwj +'" style="border: 2px solid #cccccc;border-radius:8px;margin-bottom:30px;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);" onerror="this.src=\'/skin/easy/image/default-photo.png\'"/>';
  1859. }else{
  1860. html += '<img class="card-photo" src="/skin/easy/image/default-photo.png" style="border: 2px solid #cccccc;border-radius:8px;margin-bottom:30px;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);"/>';
  1861. }
  1862. // 名字+班级 (两端对齐 - 使用弹性盒布局)
  1863. html += '<div class="name-class-container" style="width:100%;display:flex;justify-content:space-between;margin-bottom:20px;font-weight:bold;color:#000;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);">';
  1864. if(jcjl.xm != null){
  1865. html += '<span class="name-text">'+ jcjl.xm +'</span>';
  1866. }
  1867. if(jcjl.bjmc != null){
  1868. html += '<span class="class-text">'+ jcjl.bjmc +'</span>';
  1869. }
  1870. html += '</div>';
  1871. // 状态 (颜色由CSS类控制)
  1872. html += '<div class="status-text '+statusClass+'" style="font-weight:bold;border-radius:8px;transition:all 0.8s cubic-bezier(0.4,0,0.2,1);">'+ statusText +'</div>';
  1873. html += '</div>';
  1874. return html;
  1875. }
  1876. /**
  1877. * 视频播放控制 - 有卡片时暂停,10秒无新卡片后恢复
  1878. */
  1879. function pauseVideo(){
  1880. var $video = $('#videoID');
  1881. if($video.length > 0){
  1882. $video[0].pause();
  1883. hasCards = true;
  1884. console.log("⏸️ 视频暂停");
  1885. }
  1886. }
  1887. function resumeVideoAfterDelay(){
  1888. // 清除之前的定时器
  1889. if(cardHideTimer){
  1890. clearTimeout(cardHideTimer);
  1891. }
  1892. // 10秒后隐藏卡片并恢复视频
  1893. cardHideTimer = setTimeout(function(){
  1894. var $container = $('#ryxxlb');
  1895. var $allCards = $container.find('.ryxxlb-child');
  1896. if($allCards.length > 0){
  1897. console.log("🎬 10秒无新卡片,隐藏所有卡片并恢复视频");
  1898. // 隐藏所有卡片
  1899. $allCards.addClass('fade-out');
  1900. setTimeout(function(){
  1901. $allCards.remove();
  1902. $('.lj').css('filter','none'); // 恢复背景清晰度
  1903. }, 400);
  1904. // 恢复视频播放
  1905. var $video = $('#videoID');
  1906. if($video.length > 0){
  1907. $video[0].play();
  1908. hasCards = false;
  1909. console.log("▶️ 视频恢复播放");
  1910. }
  1911. }
  1912. }, 10000);
  1913. }
  1914. /**
  1915. * 三区域推送逻辑 (Grid布局版 - 固定位置平滑移动)
  1916. * @param html 卡片HTML
  1917. * @param cardType 卡片类型 ('enter'|'leave'|'vacation')
  1918. */
  1919. function pushCardToThreeAreas(html, newCardType){
  1920. var $container = $('#ryxxlb');
  1921. var $leftCard = $container.find('.ryxxlb-child-left');
  1922. var $centerCard = $container.find('.ryxxlb-child-center');
  1923. var $rightCard = $container.find('.ryxxlb-child-right');
  1924. var $newCard = $(html);
  1925. // 每次推送新卡片时,重置10秒自动隐藏计时器
  1926. resumeVideoAfterDelay();
  1927. // 如果没有中间卡片,直接放中间
  1928. if($centerCard.length == 0){
  1929. $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
  1930. $container.append($newCard);
  1931. setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
  1932. return;
  1933. }
  1934. // 获取当前中间卡片的类型
  1935. var currentCenterType = $centerCard.attr('data-type');
  1936. // 根据【当前中间卡片】的类型决定推送方向 (不管新卡片是什么)
  1937. if(currentCenterType == 'enter'){
  1938. // 当前中间是进校 → 往左推
  1939. var $allCards = $container.find('.ryxxlb-child');
  1940. // 只有当已经有3张卡片时,才删除最左边的
  1941. if($allCards.length >= 3 && $leftCard.length > 0){
  1942. console.log("🗑️ 删除最左边卡片,当前总数:", $allCards.length);
  1943. $leftCard.addClass('fade-out');
  1944. setTimeout(function(){ $leftCard.remove(); }, 400);
  1945. }
  1946. // 当前中间移到左边
  1947. $centerCard.removeClass('ryxxlb-child-center')
  1948. .addClass('ryxxlb-child-left');
  1949. // 新卡片淡入中间
  1950. $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
  1951. $container.append($newCard);
  1952. setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
  1953. }else{
  1954. // 当前中间是离校/请假 → 往右推
  1955. var $allCards = $container.find('.ryxxlb-child');
  1956. // 只有当已经有3张卡片时,才删除最右边的
  1957. if($allCards.length >= 3 && $rightCard.length > 0){
  1958. console.log("🗑️ 删除最右边卡片,当前总数:", $allCards.length);
  1959. $rightCard.addClass('fade-out');
  1960. setTimeout(function(){ $rightCard.remove(); }, 400);
  1961. }
  1962. // 当前中间移到右边
  1963. $centerCard.removeClass('ryxxlb-child-center')
  1964. .addClass('ryxxlb-child-right');
  1965. // 新卡片淡入中间
  1966. $newCard.addClass('ryxxlb-child-center').css('opacity', 0);
  1967. $container.append($newCard);
  1968. setTimeout(function(){ $newCard.css('opacity', 1); }, 50);
  1969. }
  1970. }
  1971. var zmxxhq;
  1972. if(${not empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  1973. // 防止重复启动定时器
  1974. if(zmxxhq) clearInterval(zmxxhq);
  1975. zmxxhq = setInterval(getAutodoorInfo,1000);
  1976. console.log("闸门信息获取定时器已启动, ID:", zmxxhq);
  1977. }
  1978. /**
  1979. * 绑定门卫id
  1980. */
  1981. /* 再去掉,没用到,也不用 < 打开 gateHome.home.jsp 时,写到 门禁点.门卫ID。此时,写入的 .门卫ID 为空(还没登录) < 也不能每次换班都写。Lin
  1982. function bindMwid(){
  1983. $.ajax({
  1984. url: "<serv.ss name='gate_bindMwidByMjd'/>", // :"mjd_bind_mwid"。Lin
  1985. type: 'post',
  1986. dataType: 'json',
  1987. data: {
  1988. /// * 改,直接用页面写死的 sbbs(<input name="sbbs") -- 因抛出错误 "beacon is not defined",后面的程序被越过。Lin
  1989. // sbbs: beacon.getMacAddress(),
  1990. /// *
  1991. sbbs: $("input[name=sbbs]").val(),
  1992. mwid: "$@{sessionScope.ssUser.ryid}" // ['env.ry'].。Lin
  1993. },
  1994. success: function(data) {
  1995. }
  1996. });
  1997. }
  1998. */
  1999. /**
  2000. * 检查session是否有效
  2001. */
  2002. if(${not empty sessionScope.ssUser.ryid}){ // ['env.ry'].。Lin
  2003. setInterval(function(){
  2004. $.ajax({
  2005. url: "<serv.ss name='gate_chkSess'/>", // :"mjd_check_session"。Lin
  2006. type: 'post',
  2007. dataType: 'json',
  2008. success: function(data) {
  2009. if(data.isvalid == '0'){
  2010. window.location.href = "/";
  2011. }
  2012. }
  2013. });
  2014. },1000 * 10);
  2015. }
  2016. </script>
  2017. </html>