0
0

index_copy.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=0, maximum-scale=0, user-scalable=yes,shrink-to-fit=no">
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>{:get_config('web_site_title')}</title>
  9. <link rel="icon" href="./favicon.png">
  10. <meta name="keywords" content="" />
  11. <meta name="description" content="" />
  12. <link rel="shortcut icon" href="/favicon.ico">
  13. <link rel="stylesheet" href="/static/hplus/css/bootstrap.min.css">
  14. <link rel="stylesheet" href="/static/hplus/css/font-awesome.min.css?v=4.4.0" />
  15. <link rel="stylesheet" href="/static/hplus/css/animate.css"/>
  16. <link rel="stylesheet" href="/static/hplus/css/style.css?v=4.1.0">
  17. <link rel="stylesheet" href="/static/hplus/css/jquery.contextMenu.min.css"/>
  18. <link rel="stylesheet" href="/static/elementui2.15.5/index.css"/>
  19. <link rel="stylesheet" href="/admin/css/common.css">
  20. <link rel="stylesheet" href="/admin/css/index.css">
  21. <script src="/static/hplus/js/jquery.min.js?v=2.1.4"></script>
  22. <style>
  23. .nav.navbar-right > li > a {
  24. display: inline-block;
  25. }
  26. #orderNums{
  27. /*vertical-align: middle;*/
  28. color: red;
  29. position: relative;
  30. top: -3px;
  31. }
  32. .nn:focus, .nn:hover{
  33. background-color:#fff !important;
  34. }
  35. .navbar-title{
  36. display: inline-block;
  37. font-size: 26px;
  38. padding-left: 20px;
  39. line-height: 60px;
  40. float: left;
  41. font-weight: bold;
  42. }
  43. .navbar-header{
  44. width: 550px!important;
  45. }
  46. .sidebox{
  47. width: 100%;
  48. height: 100%;
  49. position: relative;
  50. }
  51. .side-box-switch{
  52. width: 28px;
  53. height: 168px;
  54. position: absolute;
  55. z-index: 10;
  56. top: 50%;
  57. right: -28px;
  58. /*background-color: red !important;*/
  59. margin-top: -84px;
  60. cursor: pointer;
  61. }
  62. .side-box-switch .switch-img{
  63. width: 100%;
  64. height: 100%;
  65. }
  66. .main-box-padding-left{
  67. padding-left: 120px !important;
  68. }
  69. .main-box-padding-left1{
  70. padding-left: 280px !important;
  71. }
  72. .main-box-padding-left3{
  73. padding-left: 0px !important;
  74. }
  75. .menusub-box{
  76. width: 100%;
  77. height: 100%;
  78. overflow: hidden;
  79. }
  80. </style>
  81. </head>
  82. <body class="fixed-sidebar full-height-layout gray-bg fixed-nav pace-done">
  83. <nav class="navbar navbar-fixed-top" role="navigation">
  84. <div class="navbar-title">{:get_config('web_site_title')}</div>
  85. <div class="navbar-header">
  86. {if $userInfo.type==1}
  87. <!--{:get_config('web_site_title')}&nbsp;|&nbsp;-->
  88. <div data-width="60%" data-title="切换组织" url="{:url('Index/changeOrg')}" onclick="layer_open(this,2)" style="cursor: pointer;display: inline-block;">
  89. {:session('orgName')} <span class="glyphicon glyphicon-menu-down" style="font-size: 16px;" aria-hidden="true"></span>
  90. </div>
  91. {else}
  92. <!--{:get_config('web_site_title')}&nbsp;|&nbsp;-->
  93. <div data-width="60%" style="display: inline-block;">
  94. {:session('orgName')}
  95. </div>
  96. {/if}
  97. </div>
  98. <ul class="nav navbar-top-links navbar-right">
  99. <!--<li class="dropdown">
  100. <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#"> <i class="fa fa-bell"></i> <span class="label label-primary">8</span> </a>
  101. <ul class="dropdown-menu dropdown-alerts">
  102. <li>
  103. <a href="mailbox.html">
  104. <div>
  105. <i class="fa fa-envelope fa-fw"></i> 您有16条未读消息
  106. <span class="pull-right text-muted small">4分钟前</span>
  107. </div>
  108. </a>
  109. </li>
  110. <li class="divider"></li>
  111. <li>
  112. <a href="profile.html">
  113. <div>
  114. <i class="fa fa-qq fa-fw"></i> 3条新回复
  115. <span class="pull-right text-muted small">12分钟前</span>
  116. </div>
  117. </a>
  118. </li>
  119. <li class="divider"></li>
  120. <li>
  121. <div class="text-center link-block">
  122. <a class="J_menuItem" href="notifications.html" data-index="89">
  123. <strong>查看所有 </strong>
  124. <i class="fa fa-angle-right"></i>
  125. </a>
  126. </div>
  127. </li>
  128. </ul>
  129. </li>-->
  130. <li class="dropdown">
  131. {if ($isDispatch == 1)}
  132. <a href="javascript:;" id="goOrder" url="{:url('Index/ordersList')}?mode=0&order_mode=1" onclick="layer_open_dispatch(this,2)" class="glyphicon glyphicon-bell">
  133. <text id="orderNums">{if condition="$orderNums > 0"}({$orderNums}){/if}</text>
  134. </a>
  135. <a href="javascript:;" class="nn" onclick="offNotice()" id="offNotice" >
  136. <text id="offNoticeBtn">关闭通知</text>
  137. </a>
  138. <input type="hidden" id="offNoticeVal" value="0">
  139. {/if}
  140. <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">欢迎,{:session('user_auth.real_name')} </a>
  141. <ul class="dropdown-menu animated fadeInRight m-t-xs">
  142. <li><a class="JmenuItem" href="{:url('User/modifyPass')}">修改密码</a></li>
  143. <li><a href="{:url('Common/logout')}">安全退出</a></li>
  144. </ul>
  145. </li>
  146. </ul>
  147. </nav>
  148. <div id="vueapphhq">
  149. <div class="sidebar-box sidebar-box-h2 menuall" id="sidebar-box-h2">
  150. <div class="sidebox">
  151. <div class="side-box-switch switch-open" onclick="toggleSide(this)">
  152. <img class="switch-img switch-img-open" style="display: none" src="/admin/img/open.png" alt="">
  153. <img class="switch-img switch-img-close" src="/admin/img/close.png" alt="">
  154. </div>
  155. <div class="menusub-box">
  156. <div class="sidebar-box-sub">
  157. <div class="sidebar-collapse bg-theme">
  158. <div class="sidenav" id="side-menu">
  159. {volist name="menus" id="v"}
  160. <div class="side-list">
  161. <a id="menu{$v.id}" class="Jiframe" data-id="{$v.id}" data-url="{$v.url}" href="javascript:;">
  162. {notempty name="v['icons']"}<i class="{$v.icons}"></i>{/notempty}
  163. <span>{$v.title}</span>
  164. </a>
  165. </div>
  166. {/volist}
  167. <!--<div class="side-list">
  168. <a class="" href="layouts.html"><i class="fa fa-columns"></i> <span>首页</span></a>
  169. </div>
  170. <div class="side-list">
  171. <a class="active" href="layouts.html"><i class="fa fa-columns"></i> <span>订单</span></a>
  172. </div>
  173. <div class="side-list">
  174. <a class="" href="layouts.html"><i class="fa fa-columns"></i> <span>工单</span></a>
  175. </div>
  176. <div class="side-list">
  177. <a class="" href="layouts.html"><i class="fa fa-columns"></i> <span>日常工作</span></a>
  178. </div>
  179. <div class="side-list">
  180. <a class="" href="layouts.html"><i class="fa fa-columns"></i> <span>设备台账</span></a>
  181. </div>-->
  182. </div>
  183. </div>
  184. </div>
  185. <div class="sidebar-box-sub sidebar-box-sub2">
  186. <div class="sidebar-collapse">
  187. <div class="sidenavsub" id="side-menu2" style="padding-top: 10px;">
  188. <!--<div class="side-group">
  189. <div class="side-group-label">系统设置</div>
  190. <div class="side-list">
  191. <a class="J_iframe" href="layouts.html"><span>项目管理</span></a>
  192. </div>
  193. <div class="side-list">
  194. <a class="J_iframe active" href="layouts.html"><span>部门管理</span></a>
  195. </div>
  196. <div class="side-list">
  197. <a class="J_iframe" href="layouts.html"><span>用户管理</span></a>
  198. </div>
  199. </div>
  200. <div class="side-list">
  201. <a class="J_iframe active" href="layouts.html"><span>权限管理</span></a>
  202. </div>
  203. <div class="side-list">
  204. <a class="J_iframe" href="layouts.html"><span>报修类型管理</span></a>
  205. </div>
  206. <div class="side-list">
  207. <a class="J_iframe" href="layouts.html"><span>地点管理</span></a>
  208. </div>
  209. <div class="side-list">
  210. <a class="J_iframe" href="layouts.html"><span>运送类型管理</span></a>
  211. </div>
  212. <div class="side-list">
  213. <a class="J_iframe" href="layouts.html"><span>时间代码管理</span></a>
  214. </div>-->
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. <div class="main-box main-box-h2" id="main-iframe">
  223. <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="{:url('Index/def')}" frameborder="0" data-id="index_v1.html" seamless></iframe>
  224. <!--</div>-->
  225. <script src="/static/hplus/js/bootstrap.min.js?v=3.3.7"></script>
  226. <script src="/static/layer3.2.0/layer.js"></script>
  227. <script src="/static/hplus/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  228. <script src="/static/hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
  229. <script src="/static/hplus/js/plugins/contextMenu/jquery.contextMenu.min.js"></script>
  230. <script src="/static/hplus/js/hplus.js?v=4.1.0"></script>
  231. <script type="text/javascript" src="/static/hplus/js/contabs.js"></script>
  232. <!-- 第三方插件 -->
  233. <script src="/static/hplus/js/plugins/pace/pace.min.js"></script>
  234. <script src="/static/elementui2.15.5/vue-2.6.14.js"></script>
  235. <script src="/static/elementui2.15.5/index.js"></script>
  236. <script src="/admin/js/common.js"></script>
  237. {if condition="is_login() and !is_admin(is_login()) and btnAuth(is_login(),'PhoneMonitor/show')"}
  238. <textarea style="display: none;" id="StatusArea" rows="13" name="S1" class="form-control" readonly></textarea>
  239. <script language="javascript" type="text/javascript" src="/static/phonejs/qnviccub.js"></script>
  240. <script language="javascript" type="text/javascript" src="/static/phonejs/qnvfunc.js"></script>
  241. <script language="javascript" type="text/javascript" src="/static/phonejs/json2.js"></script>
  242. <script language="javascript" type="text/javascript" src="/static/phonejs/deviceapi.js"></script>
  243. <script>
  244. var fp;
  245. $(document).ready(function(){
  246. TV_Initialize();
  247. getEvent(T_GetEvent);
  248. });
  249. $(window).unload(function(){
  250. TV_Disable();
  251. });
  252. setInterval(function () {
  253. OpenDevice(ODT_LBRIDGE,function(nResult){AppendStatus('打开设备.');});
  254. },30000);
  255. //离开页面
  256. $(window).bind('beforeunload',function(){
  257. TV_Disable();
  258. });
  259. function openPhone() {
  260. // let gphone = "13838379499";
  261. // let fp = "d:\\wyluyin\\" + getCurrentDate(3) + "_" + gphone + ".wav";
  262. // check_phone(gphone,fp);
  263. }
  264. function playBtn() {
  265. // let path = "d:\\wyluyin\\20220608191204_13027625915.wav";
  266. // console.log('path:',path);
  267. PlayFile(1,QNV_PLAY_FILE_START,0,PLAYFILE_MASK_REPEAT,path,function(id){
  268. console.log('play:',id);
  269. });
  270. }
  271. function check_phone(gphone,fp) {
  272. fp = base64encode(fp);
  273. var url = '{:url("orders/phone")}?phone=' + gphone + '&fp='+fp;
  274. var title = '添加订单';
  275. layer.open({
  276. type: 2,
  277. shade: 0.8,
  278. title: title,
  279. area: ['800px', '400px'],
  280. fix: false, //不固定
  281. maxmin: true,
  282. content: url,
  283. skin: 'layer-ext-moon',
  284. success: function(layero, index) {
  285. layer.iframeAuto(index);
  286. },
  287. // btn: ['取消']
  288. });
  289. return false;
  290. }
  291. function AppendStatus(szStatus)
  292. {
  293. // console.log(szStatus);
  294. // $("#StatusArea").append(szStatus+"\r\n" );
  295. // var scrollTop = $("#StatusArea")[0].scrollHeight;
  296. // $("#StatusArea").scrollTop(scrollTop);
  297. }
  298. function AppendStatusEx(uID,szStatus)
  299. {
  300. uID=uID+1;
  301. AppendStatus("通道"+uID+":"+szStatus);
  302. }
  303. function T_GetEvent(uID,uEventType,uHandle,uResult,szdata)
  304. {
  305. // console.log(uID,uEventType,uHandle,uResult,szdata);
  306. //var vValueArray=qnviccub.QNV_Event(0,2,0,"","",1024);
  307. if(uEventType == -1)
  308. return;
  309. var vValue=" type="+uEventType+" Handle="+uHandle+" Result="+uResult+" szdata="+szdata;
  310. switch(uEventType)
  311. {
  312. case BriEvent_PhoneHook:// 本地电话机摘机事件
  313. AppendStatusEx(uID,"本地电话机摘机"+vValue);
  314. TV_StartRecordFile(uID,fp);
  315. break;
  316. case BriEvent_PhoneDial:// 只有在本地话机摘机,没有调用软摘机时,检测到DTMF拨号
  317. AppendStatusEx(uID,"本地话机拨号"+vValue);
  318. break;
  319. case BriEvent_PhoneHang:// 本地电话机挂机事件
  320. TV_HangUpCtrl(uID);
  321. AppendStatusEx(uID,"本地电话机挂机"+vValue);
  322. TV_StopRecordFile(uID);
  323. break;
  324. case BriEvent_CallIn:// 外线通道来电响铃事件
  325. AppendStatusEx(uID,"外线通道来电响铃事件"+vValue);
  326. break;
  327. case BriEvent_GetCallID://得到来电号码
  328. AppendStatusEx(uID,"得到来电号码"+vValue);
  329. fp = "d:\\wyluyin\\" + getCurrentDate(3) + "_" + szdata + ".wav";
  330. check_phone(szdata,fp);
  331. break;
  332. case BriEvent_StopCallIn:// 对方停止呼叫(产生一个未接电话)
  333. AppendStatusEx(uID,"对方停止呼叫(产生一个未接电话)"+vValue);
  334. break;
  335. case BriEvent_DialEnd:// 调用开始拨号后,全部号码拨号结束
  336. AppendStatusEx(uID,"调用开始拨号后,全部号码拨号结束"+vValue);
  337. break;
  338. case BriEvent_PlayFileEnd:// 播放文件结束事件
  339. AppendStatusEx(uID,"播放文件结束事件"+vValue);
  340. break;
  341. case BriEvent_PlayMultiFileEnd:// 多文件连播结束事件
  342. AppendStatusEx(uID,"多文件连播结束事件"+vValue);
  343. break;
  344. case BriEvent_PlayStringEnd://播放字符结束
  345. AppendStatusEx(uID,"播放字符结束"+vValue);
  346. break;
  347. case BriEvent_RepeatPlayFile:// 播放文件结束准备重复播放
  348. AppendStatusEx(uID,"播放文件结束准备重复播放"+vValue);
  349. break;
  350. case BriEvent_SendCallIDEnd:// 给本地设备发送震铃信号时发送号码结束
  351. AppendStatusEx(uID,"给本地设备发送震铃信号时发送号码结束"+vValue);
  352. break;
  353. case BriEvent_RingTimeOut://给本地设备发送震铃信号时超时
  354. AppendStatusEx(uID,"给本地设备发送震铃信号时超时"+vValue);
  355. break;
  356. case BriEvent_Ringing://正在内线震铃
  357. AppendStatusEx(uID,"正在内线震铃"+vValue);
  358. break;
  359. case BriEvent_Silence:// 通话时检测到一定时间的静音.默认为5秒
  360. AppendStatusEx(uID,"通话时检测到一定时间的静音"+vValue);
  361. break;
  362. case BriEvent_GetDTMFChar:// 线路接通时收到DTMF码事件
  363. AppendStatusEx(uID,"线路接通时收到DTMF码事件"+vValue);
  364. break;
  365. case BriEvent_RemoteHook:// 拨号后,被叫方摘机事件
  366. AppendStatusEx(uID,"拨号后,被叫方摘机事件"+vValue);
  367. break;
  368. case BriEvent_RemoteHang://对方挂机事件
  369. TV_HangUpCtrl(uID);
  370. AppendStatusEx(uID,"对方挂机事件"+vValue);
  371. TV_StopRecordFile(uID);
  372. break;
  373. case BriEvent_Busy:// 检测到忙音事件,表示PSTN线路已经被断开
  374. AppendStatusEx(uID,"检测到忙音事件,表示PSTN线路已经被断开"+vValue);
  375. break;
  376. case BriEvent_DialTone:// 本地摘机后检测到拨号音
  377. AppendStatusEx(uID,"本地摘机后检测到拨号音"+vValue);
  378. break;
  379. case BriEvent_RingBack:// 电话机拨号结束呼出事件。
  380. AppendStatusEx(uID,"电话机拨号结束呼出事件"+vValue);
  381. break;
  382. case BriEvent_MicIn:// MIC插入状态
  383. AppendStatusEx(uID,"MIC插入状态"+vValue);
  384. break;
  385. case BriEvent_MicOut:// MIC拔出状态
  386. AppendStatusEx(uID,"MIC拔出状态"+vValue);
  387. break;
  388. case BriEvent_FlashEnd:// 拍插簧(Flash)完成事件,拍插簧完成后可以检测拨号音后进行二次拨号
  389. AppendStatusEx(uID,"拍插簧(Flash)完成事件,拍插簧完成后可以检测拨号音后进行二次拨号"+vValue);
  390. break;
  391. case BriEvent_RefuseEnd:// 拒接完成
  392. AppendStatusEx(uID,"拒接完成"+vValue);
  393. break;
  394. case BriEvent_SpeechResult:// 语音识别完成
  395. AppendStatusEx(uID,"语音识别完成"+vValue);
  396. break;
  397. case BriEvent_FaxRecvFinished:// 接收传真完成
  398. AppendStatusEx(uID,"接收传真完成"+vValue);
  399. break;
  400. case BriEvent_FaxRecvFailed:// 接收传真失败
  401. AppendStatusEx(uID,"接收传真失败"+vValue);
  402. break;
  403. case BriEvent_FaxSendFinished:// 发送传真完成
  404. AppendStatusEx(uID,"发送传真完成"+vValue);
  405. break;
  406. case BriEvent_FaxSendFailed:// 发送传真失败
  407. AppendStatusEx(uID,"发送传真失败"+vValue);
  408. break;
  409. case BriEvent_OpenSoundFailed:// 启动声卡失败
  410. AppendStatusEx(uID,"启动声卡失败"+vValue);
  411. break;
  412. case BriEvent_UploadSuccess://远程上传成功
  413. AppendStatusEx(uID,"远程上传成功"+vValue);
  414. break;
  415. case BriEvent_UploadFailed://远程上传失败
  416. AppendStatusEx(uID,"远程上传失败"+vValue);
  417. break;
  418. case BriEvent_EnableHook:// 应用层调用软摘机/软挂机成功事件
  419. AppendStatusEx(uID,"应用层调用软摘机/软挂机成功事件"+vValue);
  420. break;
  421. case BriEvent_EnablePlay:// 喇叭被打开或者/关闭
  422. AppendStatusEx(uID,"喇叭被打开或者/关闭"+vValue);
  423. break;
  424. case BriEvent_EnableMic:// MIC被打开或者关闭
  425. AppendStatusEx(uID,"MIC被打开或者关闭"+vValue);
  426. break;
  427. case BriEvent_EnableSpk:// 耳机被打开或者关闭
  428. AppendStatusEx(uID,"耳机被打开或者关闭"+vValue);
  429. break;
  430. case BriEvent_EnableRing:// 电话机跟电话线(PSTN)断开/接通
  431. AppendStatusEx(uID,"电话机跟电话线(PSTN)断开/接通"+vValue);
  432. break;
  433. case BriEvent_DoRecSource:// 修改录音源
  434. AppendStatusEx(uID,"修改录音源"+vValue);
  435. break;
  436. case BriEvent_DoStartDial:// 开始软件拨号
  437. AppendStatusEx(uID,"开始软件拨号"+vValue);
  438. break;
  439. case BriEvent_RecvedFSK:// 接收到FSK信号,包括通话中FSK/来电号码的FSK
  440. AppendStatusEx(uID,"接收到FSK信号,包括通话中FSK/来电号码的FSK"+vValue);
  441. break;
  442. case BriEvent_PlugOut:
  443. AppendStatusEx(uID,"设备移除");
  444. // alert('设备移除');
  445. break;
  446. case BriEvent_DevErr://设备错误
  447. AppendStatusEx(uID,"设备错误"+ decodeURIComponent(vValue) );
  448. // alert('设备错误');
  449. break;
  450. default:
  451. if(uEventType < BriEvent_EndID)
  452. AppendStatusEx(uID,"忽略其它事件发生:ID=" + uEventType+ vValue);
  453. break;
  454. }
  455. }
  456. </script>
  457. {/if}
  458. {if condition="$isDispatch eq 1"}
  459. <audio id="dingdantixing" src="/static/tixing.mp3" controls="controls" style="display: none;"></audio>
  460. <script>
  461. var time1;
  462. var audio = document.getElementById('dingdantixing');
  463. $(function () {
  464. var interval = function () {
  465. var url = "{:url('Index/order')}";
  466. $.get(url,function (data) {
  467. if(data.code == 1){
  468. var audio = document.getElementById('dingdantixing');
  469. audio.play();
  470. if(data.data > 0){
  471. document.getElementById('orderNums').innerHTML ='('+data.data +')';
  472. }
  473. // layer.msg('您有新的订单请及时处理',{time:3000});
  474. }
  475. });
  476. }
  477. time1 = setInterval(interval,30000);
  478. $("#offNoticeBtn").click(function () {
  479. var off = parseInt($("#offNoticeVal").val());
  480. if(off==0){
  481. clearInterval(time1);
  482. $("#offNoticeVal").val(1)
  483. $("#offNoticeBtn").html('开启通知');
  484. audio.pause();
  485. }else {
  486. $("#offNoticeVal").val(0)
  487. time1 = setInterval(interval,30000);
  488. $("#offNoticeBtn").html('关闭通知');
  489. }
  490. })
  491. })
  492. </script>
  493. {/if}
  494. <script>
  495. var menus = {:json_encode($menus)};
  496. $(function () {
  497. // $('#side-menu').slimScroll({
  498. // height: ($('.sidebar-box').height() + 40) + 'px'
  499. // });
  500. // $('#side-menu2').slimScroll({
  501. // height: $('.sidebar-box').height() + 'px'
  502. // });
  503. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  504. $('#main-iframe').addClass('main-box-h2');
  505. $('#menu-1').addClass('active');
  506. // $('.sidenav .side-list a').hover(
  507. // function () {
  508. // $(this).addClass("hover");
  509. // let id = $(this).attr('data-id');
  510. // initSubMenu(id);
  511. // },
  512. // function () {
  513. // $(this).removeClass("hover");
  514. // }
  515. // );
  516. $(document).on('click','#side-menu .Jiframe',function () {
  517. let id = $(this).attr('data-id');
  518. let url = $(this).attr('data-url');
  519. $('#main-iframe').removeClass('main-box-padding-left');
  520. $('#main-iframe').removeClass('main-box-padding-left1');
  521. $('#main-iframe').removeClass('main-box-padding-left3');
  522. // var width2 = localStorage.getItem("width1");
  523. // console.log(width2,'xxxxxxxxxxxxxxxx')
  524. // if(width2 == 120){
  525. // $('#main-iframe').css('padding-left','120px');
  526. // }
  527. // if(width2 == 280){
  528. // $('#main-iframe').css('padding-left','280px');
  529. // }
  530. if(url){
  531. if(id==485 || id==467 || id==488 || id==489){
  532. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  533. $('#main-iframe').addClass('main-box-h2');
  534. window.open(url);
  535. }else {
  536. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  537. $('#main-iframe').addClass('main-box-h2');
  538. let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+url+'" frameborder="0" data-id="'+url+'" seamless></iframe>';
  539. $('#main-iframe').html(str);
  540. }
  541. }else{
  542. $('#sidebar-box-h2').addClass('sidebar-box-h2');
  543. $('#main-iframe').removeClass('main-box-h2');
  544. }
  545. $(this).addClass("hover");
  546. initSubMenu(id);
  547. $('#side-menu .Jiframe').removeClass('active');
  548. $(this).addClass('active');
  549. });
  550. $(document).on('click','#side-menu2 .Jiframe',function () {
  551. $('#main-iframe').removeClass('main-box-padding-left');
  552. $('#main-iframe').removeClass('main-box-padding-left1');
  553. $('#main-iframe').removeClass('main-box-padding-left3');
  554. let pid = $(this).attr('data-pid');
  555. let url = $(this).attr('data-url');
  556. let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+url+'" frameborder="0" data-id="'+url+'" seamless></iframe>';
  557. $('#main-iframe').html(str);
  558. $('#side-menu2 .Jiframe').removeClass('active');
  559. $(this).addClass('active');
  560. // 寻找父级元素
  561. $('#side-menu .Jiframe').removeClass('active');
  562. $('#menu'+pid).addClass('active');
  563. });
  564. $(document).on('click','.JmenuItem',function () {
  565. $('#main-iframe').removeClass('main-box-padding-left');
  566. $('#main-iframe').removeClass('main-box-padding-left1');
  567. $('#main-iframe').removeClass('main-box-padding-left3');
  568. let url = $(this).attr('href');
  569. let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+url+'" frameborder="0" data-id="'+url+'" seamless></iframe>';
  570. $('#main-iframe').html(str);
  571. return false;
  572. });
  573. });
  574. function initSubMenu(id) {
  575. $('#main-iframe').removeClass('main-box-padding-left');
  576. $('#main-iframe').removeClass('main-box-padding-left1');
  577. $('#main-iframe').removeClass('main-box-padding-left3');
  578. let submenus = [];
  579. for (let o in menus){
  580. if(id == menus[o].id){
  581. submenus = menus[o].child;
  582. break;
  583. }
  584. }
  585. if(submenus.length > 0){
  586. $('#sidebar-box-h2').addClass('sidebar-box-h2');
  587. $('#main-iframe').removeClass('main-box-h2');
  588. }else{
  589. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  590. $('#main-iframe').addClass('main-box-h2');
  591. }
  592. let str = '';
  593. for (let o in submenus){
  594. if(submenus[o].child.length > 0){
  595. // <div class="side-group">
  596. // <div class="side-group-label">系统设置</div>
  597. // <div class="side-list">
  598. // <a class="J_iframe" href="layouts.html"><span>项目管理</span></a>
  599. // </div>
  600. // </div>
  601. str += '<div class="side-group">';
  602. str += '<div class="side-group-label">'+submenus[o].title+'</div>';
  603. let children = submenus[o].child;
  604. for(let n in children){
  605. str += '<div class="side-list">';
  606. str += '<a class="Jiframe" id="menu'+children[n].id+'" data-id="'+children[n].id+'" data-pid="'+submenus[o].pid+'" data-url="'+children[n].url+'" href="javascript:;"><span>'+children[n].title+'</span></a>';
  607. str += '</div>';
  608. }
  609. str += '</div>';
  610. }else{
  611. // <div class="side-list">
  612. // <a class="J_iframe active" href="layouts.html"><span>权限管理</span></a>
  613. // </div>
  614. str += '<div class="side-list">';
  615. str += '<a class="Jiframe" id="menu'+submenus[o].id+'" data-id="'+submenus[o].id+'" data-pid="'+submenus[o].pid+'" data-url="'+submenus[o].url+'" href="javascript:;"><span>'+submenus[o].title+'</span></a>';
  616. str += '</div>';
  617. }
  618. }
  619. $('#side-menu2').html(str);
  620. }
  621. function add_highlight(url){
  622. console.log('url',url);
  623. $('.side-list a').removeClass('active');
  624. for (let o in menus){
  625. if(menus[o].url && menus[o].url == url){
  626. $('#menu'+menus[o].id).addClass('active');
  627. break;
  628. }
  629. let child1 = menus[o].child;
  630. let flag = false;
  631. let id = 0;
  632. if(child1.length > 0){
  633. for (let m in child1){
  634. if(child1[m].url && child1[m].url == url){
  635. flag = true;
  636. id = child1[m].id;
  637. break;
  638. }
  639. let child2 = child1[m].child;
  640. for (let n in child2){
  641. if(child2[n].url && child2[n].url == url){
  642. flag = true;
  643. id = child2[n].id;
  644. break;
  645. }
  646. }
  647. if(flag){
  648. break;
  649. }
  650. }
  651. }
  652. console.log('flag11',flag,id);
  653. if(flag){
  654. initSubMenu(menus[o].id);
  655. $('#menu'+menus[o].id).addClass('active');
  656. $('#menu'+id).addClass('active');
  657. break;
  658. }
  659. }
  660. }
  661. // $(document).on('click','#goOrder',function () {
  662. // let url = $(this).attr('href');
  663. // let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+url+'" frameborder="0" data-id="'+url+'" seamless></iframe>';
  664. // $('#main-iframe').html(str);
  665. // return false;
  666. // });
  667. function layer_open_dispatch(_self,flag){
  668. var url = $(_self).attr('url');
  669. var title = $(_self).attr('data-title');
  670. var width = $(_self).attr('data-width')?$(_self).attr('data-width'):'90%';
  671. var height = $(_self).attr('data-height')?$(_self).attr('data-height'):'90%';
  672. layer.open({
  673. type: 2,
  674. title: title,
  675. shadeClose: true,
  676. shade: 0.3,
  677. maxmin: true,
  678. area: [width, height],
  679. content: url,
  680. end: function () {
  681. update_order_count();
  682. }
  683. });
  684. }
  685. function update_order_count() {
  686. let url = "{:url('Index/ocount')}";
  687. $.post(url,function (res) {
  688. if(res.code == 1){
  689. let count = res.data.count;
  690. if(count > 0){
  691. $('#orderNums').html('('+count+')');
  692. }else{
  693. $('#orderNums').html('');
  694. }
  695. }
  696. });
  697. }
  698. function toggleSide(_self) {
  699. var width = $('.menuall').width();
  700. if(Number(width) > 1){
  701. var width1 = Number(width);
  702. localStorage.setItem("width1",width1);
  703. }
  704. if ( $(_self).hasClass('switch-open') ) {
  705. $(_self).removeClass('switch-open');
  706. $(_self).find('.switch-img-open').show();
  707. $(_self).find('.switch-img-close').hide();
  708. $('.menuall').css('width','0');
  709. $('.menusub-box').css('display','none');
  710. $('#main-iframe').addClass('main-box-padding-left3');
  711. }else{
  712. $(_self).addClass('switch-open');
  713. $(_self).find('.switch-img-open').hide();
  714. $(_self).find('.switch-img-close').show();
  715. $('.menuall').css('width','');
  716. $('.menusub-box').css('display','block');
  717. $('#main-iframe').removeClass('main-box-padding-left3');
  718. var width2 = localStorage.getItem("width1");
  719. if(width2 == 120){
  720. // $('#main-iframe').css('padding-left','120px');
  721. $('#main-iframe').addClass('main-box-padding-left');
  722. }
  723. if(width2 == 280){
  724. // $('#main-iframe').css('padding-left','280px');
  725. $('#main-iframe').addClass('main-box-padding-left1');
  726. }
  727. localStorage.removeItem("width1");
  728. }
  729. }
  730. </script>
  731. </body>
  732. </html>