index.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. {extend name="common/base"/}
  2. {block name="style"}
  3. <link rel="stylesheet" href="{__GOUGU__}/gougu/css/layout.css" media="all">
  4. <style>
  5. .total {
  6. margin-right: 80px;
  7. color: #999;
  8. margin-top: 5px;
  9. opacity: 0;
  10. transition: all 0.5s;
  11. }
  12. .box {
  13. text-align: center;
  14. position: absolute;
  15. top: 215%;
  16. left: 34%;
  17. transform: translate(-50%, -50%);
  18. background: #fff;
  19. padding: 20px;
  20. border: 1px solid #ccc;
  21. border-radius: 5px;
  22. padding: 0;
  23. }
  24. .top-text {
  25. width: 100%;
  26. height: 80%;
  27. }
  28. .bottom-button {
  29. width: 100%;
  30. height: 20%;
  31. }
  32. #read_num{
  33. color: white;
  34. position: absolute;
  35. top: 22px;
  36. left: 25px;
  37. background-color: #ff2f00bf;
  38. border-radius: 50%;
  39. width: 20px;
  40. height: 20px;
  41. text-align: center;
  42. line-height: 20px;
  43. font-size: 12px;
  44. }
  45. .layui-nav-itemed a{
  46. color: #162a48 !important;
  47. }
  48. </style>
  49. {/block}
  50. <!-- 主体 -->
  51. {block name="body"}
  52. <div class="layui-layout-body">
  53. <div id="GouguApp">
  54. <div class="layui-layout gg-layout">
  55. <div class="layui-header">
  56. <!-- 头部区域 -->
  57. <div class="layui-layout-left">
  58. <span class="gg-head-item">
  59. <a href="javascript:;" gg-event="shrink" title="侧边伸缩"><i
  60. class="layui-icon layui-icon-shrink-right"></i></a>
  61. </span>
  62. <span class="gg-head-item gg-head-cache">
  63. <a href="javascript:;" gg-event="cache" data-href="/admin/api/cache_clear" title="清空缓存"><i
  64. class="layui-icon layui-icon-fonts-clear"></i></a>
  65. </span>
  66. <span class="gg-head-item gg-head-home">
  67. <a href="/" target="_blank" title="前台首页"><i class="layui-icon layui-icon-website"></i></a>
  68. </span>
  69. </div>
  70. <div class="layui-layout-right">
  71. <span class="gg-head-item gg-head-refresh">
  72. <a href="javascript:;" class="refreshThis" gg-event="refresh" title="刷新">
  73. <i class="layui-icon layui-icon-refresh"></i>
  74. </a>
  75. </span>
  76. <span class="gg-head-item gg-head-screen">
  77. <a href="javascript:;" gg-event="screen" data-screen="full">
  78. <i class="fullScreen layui-icon layui-icon-screen-full"></i>
  79. </a>
  80. </span>
  81. <span class="gg-head-item gg-head-set">
  82. <a href="javascript:;" id="theme">
  83. <i class="layui-icon layui-icon-set"></i>
  84. </a>
  85. </span>
  86. <span class="gg-head-item gg-head-message">
  87. <a data-href="/admin/message/index" href="javascript:;" data-id="1000" id="clean_unread" data-title="消息中心"
  88. class="side-menu-item" title="消息中心">
  89. <i class="layui-icon layui-icon-notice">
  90. </i>{if $count>0}<span id="read_num">{$count}</span>{/if}
  91. </a>
  92. </span>
  93. <!-- <div class="box layui-card" style="opacity: 0;" id="message">
  94. <div class="layui-card-header" style="border-bottom: 1px solid #e2e2e2;">
  95. 您有一条新的消息
  96. </div>
  97. <div class="layui-card-body">
  98. <div class="top-text">
  99. <span>张三</span><span>&nbsp;<b>审批通过</b>&nbsp;</span> <span style="color: #187FDD;">测试项目1</span>
  100. </div>
  101. <div class="bottom-button">
  102. <a type="button" class="layui-btn layui-btn-xs side-menu-item"
  103. data-href="/admin/message/index" data-title="消息中心"
  104. href="javascript:;" data-id="1000"
  105. id = 'lock' style="color: white;"
  106. >查看</a>
  107. <button type="button" class="layui-btn layui-btn-xs layui-bg-orange" value="关闭"
  108. id="refreshParent">关闭</button>
  109. </div>
  110. </div>
  111. </div> -->
  112. <span class="gg-head-item gg-head-avatar">
  113. <ul class="layui-nav">
  114. <li class="layui-nav-item">
  115. <a href="javascript:;">
  116. <img src="{:get_login_admin('thumb')}"
  117. onerror="javascript:this.src='{__ADMIN_IMG__}/nonepic360x360.jpg';this.onerror=null;">
  118. <cite>{:get_login_admin('nickname')}</cite>
  119. </a>
  120. <dl class="layui-nav-child" style="text-align: center; cursor: pointer;">
  121. <dd><a data-href="/admin/api/edit_personal" data-id="0101" data-title="基本资料"
  122. class="side-menu-item">基本资料</a></dd>
  123. <dd><a data-href="/admin/api/edit_password" data-id="0102" data-title="修改密码"
  124. class="side-menu-item">修改密码</a></dd>
  125. <dd><a data-href="/acctconnect/connect/index" data-id="0103" data-title="关联账号"
  126. class="side-menu-item">关联账号</a></dd>
  127. <hr>
  128. <dd gg-event="logout"><a>退出</a></dd>
  129. </dl>
  130. </li>
  131. </ul>
  132. </span>
  133. </div>
  134. </div>
  135. <!-- 侧边菜单 -->
  136. <div class="layui-side layui-side-menu layui-side-{$theme}">
  137. <div class="layui-side-scroll">
  138. <div class="layui-logo" gg-event="closeAllTabs" style="color: black;font-size: 0.95vw;">
  139. {$unit_name}
  140. <!-- <img src="{__ADMIN__}/images/syslogo.png" style="height: 40px;" class="syslogo">-->
  141. <!-- <img src="{__ADMIN__}/images/logo.png" style="height: 40px;" class="logo">-->
  142. </div>
  143. <ul id="menuList" class="layui-nav layui-nav-tree layui-inline" lay-shrink="all">
  144. {foreach name="menu" item="a"}
  145. <li class="layui-nav-item menu-li">
  146. <a class="side-menu-item" href="javascript:;" class="side-menu-item" lay-tips="{$a.title}"
  147. lay-direction="2" {notempty name="$a.isred" } data-red="{$a.isred}" {/notempty}
  148. data-id="{$a.id}" data-title="{$a.title}" data-href="/{$a.src}"><i
  149. class="icon {$a.icon}"></i> {$a.title}</a>
  150. {notempty name="$a.list"}
  151. <dl class="layui-nav-child">
  152. {foreach name="$a.list" item="b"}
  153. <dd>
  154. <a href="javascript:;" class="side-menu-item" {notempty name="$b.isred" }
  155. data-red="{$b.isred}" {/notempty} data-id="{$b.id}" data-title="{$b.title}"
  156. data-href="/{$b.src}">{$b.title}</a>
  157. {notempty name="$b.list"}
  158. <dl class="layui-nav-child">
  159. {foreach name="$b.list" item="c"}
  160. <dd>
  161. <a href="javascript:;" class="side-menu-item" data-id="{$c.id}"
  162. data-title="{$c.title}" data-href="/{$c.src}">{$c.title}</a>
  163. {notempty name="$c.list"}
  164. <dl class="layui-nav-child">
  165. {foreach name="$c.list" item="d"}
  166. <dd><a href="javascript:;" class="side-menu-item" data-id="{$d.id}"
  167. data-title="{$d.title}" data-href="/{$d.src}">{$d.title}</a>
  168. </dd>
  169. {/foreach}
  170. </dl>
  171. {/notempty}
  172. </dd>
  173. {/foreach}
  174. </dl>
  175. {/notempty}
  176. </dd>
  177. {/foreach}
  178. </dl>
  179. {/notempty}
  180. </li>
  181. {/foreach}
  182. </ul>
  183. </div>
  184. </div>
  185. <!-- 页面标签 -->
  186. <div id="pageTabs" class="page-tabs">
  187. <div class="layui-icon gg-tabs-control layui-icon-prev" gg-event="tabRollLeft"></div>
  188. <div class="layui-icon gg-tabs-control layui-icon-next" gg-event="tabRollRight"></div>
  189. <div class="layui-icon gg-tabs-control layui-icon-down">
  190. <ul class="layui-nav gg-tabs-select">
  191. <li class="layui-nav-item">
  192. <a href="javascript:;"></a>
  193. <dl class="layui-nav-child layui-anim-fadein">
  194. <dd gg-event="closeThisTabs"><a href="javascript:;">关闭当前</a></dd>
  195. <dd gg-event="closeOtherTabs"><a href="javascript:;">关闭其它</a></dd>
  196. <dd gg-event="closeAllTabs"><a href="javascript:;">关闭全部</a></dd>
  197. </dl>
  198. </li>
  199. </ul>
  200. </div>
  201. <div class="layui-tab gg-admin-tab" lay-unauto lay-allowClose="true" lay-filter="gg-admin-tab">
  202. <ul class="layui-tab-title" id="pageTabUl">
  203. <li lay-id="0" lay-attr="view/home/index.html" class="layui-this"><i
  204. class="layui-icon ri-home-smile-line"></i></li>
  205. </ul>
  206. </div>
  207. </div>
  208. <!-- 主体内容 -->
  209. <div class="layui-body" id="GouguAppBody">
  210. <div class="gg-tab-page layui-show" id="tabItem0">
  211. <iframe id="0" data-frameid="0" name="myiframe"
  212. src="{if $type==0}{:url('/admin/index/main')}{elseif $type==2}{:url('/admin/index/main_company')}{/if}"
  213. frameborder="0" align="left" width="100%" height="100%" scrolling="yes"></iframe>
  214. </div>
  215. </div>
  216. <!-- 辅助元素,用于移动设备下遮罩 -->
  217. <div class="gg-body-shade" gg-event="shade"></div>
  218. </div>
  219. </div>
  220. </div>
  221. <!-- /主体 -->
  222. {/block}
  223. <!-- 脚本 -->
  224. {block name="script"}
  225. <script>
  226. const moduleInit = ['tool', 'admin'];
  227. function gouguInit() {
  228. layui.dropdown.render({
  229. elem: '#theme',
  230. trigger: 'mousedown',
  231. align: 'center',
  232. data: [{
  233. title: '经典黑',
  234. theme: 'black'
  235. }, {
  236. title: '简约白',
  237. theme: 'white'
  238. }, {
  239. title: '海军蓝',
  240. theme: 'blue'
  241. }],
  242. click: function (data, othis) {
  243. console.log(othis)
  244. $.ajax({
  245. url: "/admin/index/set_theme",
  246. data: {
  247. 'theme': data.theme
  248. },
  249. success: function (e) {
  250. layer.msg(e.msg);
  251. if (e.code == 0) {
  252. setTimeout(function () {
  253. parent.location.reload();
  254. }, 1000)
  255. }
  256. }
  257. })
  258. }
  259. });
  260. window.showhongdian = function () {
  261. if($("a.layui-this").parent().parent().children().find('.hongdian').length == 1){
  262. // console.log($("a.layui-this").parent().parent().parent());
  263. $("a.layui-this").parent().parent().parent().find(".hongdian").css('display','none')
  264. }
  265. $('.layui-this').find('.hongdian').css('display','none')
  266. }
  267. var a = $('#menuList').find('a');
  268. for (let i = 0; i < a.length; i++) {
  269. if (a[i].dataset.red == 1) {
  270. a[i].innerHTML += ' <span class="layui-badge-dot hongdian"></span>'
  271. }
  272. }
  273. $('#GouguApp').on("click", '[gg-event="logout"]', function () {
  274. layer.confirm('确认注销登录吗?', {
  275. icon: 7,
  276. title: '警告'
  277. }, function (index) {
  278. //注销
  279. $.ajax({
  280. url: "/admin/login/login_out",
  281. success: function (e) {
  282. layer.msg(e.msg);
  283. if (e.code == 0) {
  284. setTimeout(function () {
  285. location.href = "{:url('admin/login/index')}"
  286. }, 1000)
  287. }
  288. }
  289. })
  290. layer.close(index);
  291. });
  292. });
  293. const box = document.querySelector('.box');
  294. function myfun1() {
  295. var opacity = 0;
  296. var fadeInterval = setInterval(function () {
  297. if (opacity < 1) {
  298. opacity += 0.1;
  299. box.style.opacity = opacity;
  300. } else {
  301. clearInterval(fadeInterval);
  302. }
  303. }, 100);
  304. }
  305. //不要括号    
  306. // window.onload = myfun1;
  307. // let i = 15
  308. // // 2.1 开启定时器
  309. // let n = setInterval(function myfun2() {
  310. // i--
  311. // if (i === 0) {
  312. // clearInterval(n) // 关闭定时器
  313. // var opacity = 1;
  314. // var fadeInterval = setInterval(function () {
  315. // if (opacity > 0) {
  316. // opacity -= 0.1;
  317. // box.style.opacity = opacity;
  318. // } else {
  319. // clearInterval(fadeInterval);
  320. // box.style.display = "none";
  321. // }
  322. // }, 100);
  323. // }
  324. // }, 1000)
  325. $("#clean_unread").click(function (){
  326. $("#read_num").css('display','none');
  327. })
  328. //关闭弹窗
  329. $('#refreshParent').click(()=>{
  330. let tanchuang = document.getElementById('message');
  331. tanchuang.style.display = 'none';
  332. })
  333. $('#lock').click(()=>{
  334. let tanchuang = document.getElementById('message');
  335. tanchuang.style.display = 'none';
  336. })
  337. function eliminate(type,lidom){
  338. let call=function (e){
  339. //写清除红点的js
  340. $(lidom[0]).find('.hongdian').css('display','none')
  341. let diannum = $('.hongdian').length
  342. let forcount = 0;
  343. if(diannum !== 0){
  344. for (let i = 0; i < diannum ; i++){
  345. let display = $('.hongdian')[i];
  346. console.log($(display).css('display'))
  347. if($(display).css('display') !== 'none'){
  348. forcount++
  349. }
  350. }
  351. }
  352. if(diannum == 0 || forcount == 0){
  353. parent.layui.pageTable.reloadData({
  354. done: function () {
  355. parent.hongdianselect()
  356. }
  357. })
  358. }
  359. }
  360. tool.post("/admin/project.api/eliminate", {type: type},call)
  361. }
  362. }
  363. </script>
  364. {/block}
  365. <!-- /脚本 -->