leftMenu.jsp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8" %>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
  5. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  6. <!-- 左侧导航区域 -->
  7. <div id="leftMenu" class="layui-side left_menu" :class="{close: collapse}">
  8. <!-- <div class="top_menu" @click="changeSide" v-if="collapse"></div> -->
  9. <div class="header_content_left">
  10. <div class="header_code"></div>
  11. <div class="header_text">哈密市工业项目智慧平台</div>
  12. </div>
  13. <div class="expand_collapse_btn" @click="changeSide"></div>
  14. <div class="layui-side-scroll">
  15. <ul class="layui-nav layui-nav-tree" lay-filter="test">
  16. <li :class="['layui-nav-item', {'layui-nav-itemed layui-nav-itemed-hand': Number(active) === index}]"
  17. v-for="(item, index) in navLs" :key="index" v-if="menuCode.indexOf(item.code) >= 0"
  18. >
  19. <a :title="item.txt" @click="onSelectItem(index)" href="javascript:;">
  20. <div class="left">
  21. <i class='icon'
  22. :class="Number(active) === index ? item.activeIcon : item.icon"
  23. ></i>{{item.txt}}
  24. </div>
  25. <i class="layui-icon layui-icon-down"></i>
  26. </a>
  27. <!-- <a v-else :title="item.txt" @click="onSelectItem(index)" :class="['icon', ]" href="javascript:;">{{item.txt}}</a> -->
  28. <dl class="layui-nav-child" v-if="item.child != null">
  29. <dd v-if="menuCode.indexOf(it.code) >= 0"
  30. v-for="(it,ind) in item.child" :key="'inner_' + ind"
  31. :class="{'layui-this': it.code === curSelectedMenu}"
  32. >
  33. <a :title="it.txt" href="javascript:;"
  34. @click="onSelectItem(index,ind)"
  35. >{{it.txt}}</a>
  36. </dd>
  37. </dl>
  38. </li>
  39. </ul>
  40. </div>
  41. </div>
  42. <script type="text/javascript">
  43. var year = new Date().getFullYear();
  44. new Vue({
  45. el: "#leftMenu",
  46. data: {
  47. winH: 0,
  48. collapse: false,
  49. tabActive: 1,
  50. curSelectedMenu: '',
  51. isDialog: '${isDialog}',
  52. active: 0, // 左侧菜单选中项
  53. buttonActive: 1,
  54. buttonActive2: 1,
  55. menuCode: "${menuCode}".split(","),
  56. topBreadcrumb: '',
  57. navLs: [
  58. {
  59. icon: 'icon_big_screen_active',
  60. activeIcon: 'icon_big_screen_active',
  61. code: '101',
  62. txt: '智慧分析大屏',
  63. url: 'statics/analysisScreenTwo'
  64. },
  65. {
  66. icon: 'icon_project_active',
  67. activeIcon: 'icon_project_active',
  68. code: '4',
  69. txt: '项目四库管理',
  70. child: [
  71. {
  72. txt: '储备库',
  73. code: '402',
  74. url: 'subject/subInfo/projTz?type=3',
  75. before: function () {
  76. window.localStorage.removeItem("TzQueryParam_cb_${loginUserId}")
  77. }
  78. },
  79. {
  80. txt: '新建库',
  81. code: '408',
  82. url: 'subject/subInfo/projTz?type=0',
  83. before: function () {
  84. window.localStorage.removeItem("TzQueryParam_xj_${loginUserId}")
  85. }
  86. },
  87. {
  88. txt: '在建库',
  89. code: '401',
  90. url: 'subject/subInfo/projTz?type=1',
  91. before: function () {
  92. window.localStorage.removeItem("TzQueryParam_main_${loginUserId}")
  93. }
  94. },
  95. {
  96. txt: '投产库',
  97. code: '403',
  98. url: 'subject/subInfo/projTz?type=4',
  99. before: function () {
  100. window.localStorage.removeItem("TzQueryParam_end_${loginUserId}")
  101. }
  102. }
  103. ,
  104. {
  105. txt: '项目总库',
  106. code: '404',
  107. url: 'subject/subInfo/projTz?type=5',
  108. before: function () {
  109. window.localStorage.removeItem("TzQueryParam_end_${loginUserId}")
  110. }
  111. }
  112. ]
  113. },
  114. {
  115. icon: 'icon_work_bench_active',
  116. activeIcon: 'icon_work_bench_active',
  117. code: '201',
  118. txt: '互动工作台',
  119. url: 'workBench/zrWorkBench',
  120. kind: ["1", "4"]
  121. },
  122. {
  123. icon: 'icon_organ_manage_active',
  124. activeIcon: 'icon_organ_manage_active',
  125. code: '3',
  126. txt: '项目前期管理',
  127. child: [
  128. {
  129. txt: '项目信息申报',
  130. code: '301',
  131. url: 'subject/subInfo/report'
  132. },
  133. {
  134. txt: '前期手续办理情况',
  135. code: '303',
  136. url: 'subject/subInfo/pre'/* ?type=qx */
  137. }
  138. ]
  139. },
  140. {
  141. icon: 'icon_project_active',
  142. activeIcon: 'icon_project_active',
  143. code: '1999',
  144. txt: '重点项目调度',
  145. child: [
  146. {
  147. txt: '储备项目',
  148. code: '1103',
  149. url: 'subject/subInfo/projTz?type=yearReserve',
  150. before: function () {
  151. window.localStorage.removeItem("TzQueryParam_yearReserve_${loginUserId}")
  152. }
  153. },
  154. {
  155. txt: '新建项目',
  156. code: '1101',
  157. url: 'subject/subInfo/projTz?type=yearNew',
  158. before: function () {
  159. window.localStorage.removeItem("TzQueryParam_yearNew_${loginUserId}")
  160. }
  161. },
  162. {
  163. txt: '在建项目',
  164. code: '1102',
  165. url: 'subject/subInfo/projTz?type=yearExtend',
  166. before: function () {
  167. window.localStorage.removeItem("TzQueryParam_yearExtend_${loginUserId}")
  168. }
  169. },
  170. {
  171. txt: '投产项目',
  172. code: '1104',
  173. url: 'subject/subInfo/projTz?type=yearSum',
  174. before: function () {
  175. window.localStorage.removeItem("TzQueryParam_yearSum_${loginUserId}")
  176. }
  177. },
  178. ]
  179. },
  180. {
  181. icon: 'icon_over_time_active', activeIcon: 'icon_over_time_active',
  182. code: '5',
  183. txt: '统计分析',
  184. url: 'tjfx/index'
  185. // url: 'register/underConstruction'
  186. },
  187. {
  188. icon: 'icon_over_time_active',
  189. activeIcon: 'icon_over_time_active',
  190. code: '6',
  191. txt: '预警问题督办',
  192. child: [
  193. {
  194. txt: '问题统计分析',
  195. code: '602',
  196. icon: 'icon_question_gz',
  197. url: 'problem/info/index'
  198. // url: 'register/underConstruction'
  199. },
  200. {
  201. txt: '问题推送处理',
  202. code: '603',
  203. url: "problemtrack/index"
  204. // url: 'register/underConstruction'
  205. }
  206. ]
  207. },
  208. {
  209. icon: 'icon_zjfwk_active',
  210. activeIcon: 'icon_zjfwk_active',
  211. txt: '智联工地',
  212. code: '7',
  213. child: [
  214. {
  215. code: '702',
  216. txt: '项目地图',
  217. url: 'smart/query'
  218. //url: 'register/underConstruction'
  219. },
  220. {
  221. code: '703',
  222. txt: '实时视频',
  223. url: 'smart/vedio'
  224. //url: 'register/underConstruction'
  225. },
  226. {
  227. txt: '周调度图片',
  228. code: '706',
  229. url: 'graphicProgress/list'
  230. // url: 'register/underConstruction'
  231. },
  232. {
  233. txt: '月航拍全景',
  234. code: '707',
  235. url: 'aerial/list'
  236. // url: 'register/underConstruction'
  237. }
  238. ]
  239. },
  240. {
  241. icon: 'icon_project_xtgl_active',
  242. activeIcon: 'icon_project_xtgl_active',
  243. code: '9',
  244. txt: '系统管理',
  245. child: [
  246. {
  247. txt: '项目单位信息',
  248. code: '904',
  249. url: 'register/query'
  250. },
  251. {
  252. txt: '行业部门信息',
  253. code: '906',
  254. url: 'junit/index'
  255. },
  256. {
  257. txt: '字典管理',
  258. code: '909',
  259. url: 'dicsystable/index',
  260. },
  261. {
  262. txt: '行业设置',
  263. code: '918',
  264. url: 'subIndu/index',
  265. },
  266. {
  267. txt: '公告管理',
  268. code: '910',
  269. url: 'notice/index'
  270. },
  271. {
  272. txt: '系统参数设置',
  273. code: '911',
  274. url: 'sysTable/index'
  275. },
  276. // {
  277. // txt: '操作日志查询',
  278. // code: '913',
  279. // url: 'subDataLog/index'
  280. // },
  281. {
  282. txt: '登录日志',
  283. code: '920',
  284. url: 'loginlog/index'
  285. },
  286. {
  287. txt: '审计日志',
  288. code: '408',
  289. url: 'auditLog/index'
  290. },
  291. {
  292. txt: '短信日志查询',
  293. code: '915',
  294. url: 'msgLog/index'
  295. },
  296. {
  297. code: '917',
  298. txt: 'A项目年度计划',
  299. // url: 'annualPlan/index'
  300. url: 'annualPlan/index'
  301. },
  302. {
  303. txt: 'B项目周报',
  304. code: '406',
  305. // url: 'weekReport/view'
  306. url: 'weekReport/view'
  307. },
  308. {
  309. txt: 'C项目月报',
  310. code: '407',
  311. // url: 'monthReport/view'
  312. url: 'monthReport/view'
  313. },
  314. {
  315. txt: 'D每个月项目转换情况',
  316. code: '450',
  317. url: 'tjfx/xmzhtj'
  318. // url: 'register/underConstruction'
  319. },
  320. ]
  321. }
  322. ],
  323. imgLs: 10
  324. },
  325. mounted: function () {
  326. const self = this
  327. const si = setInterval(() => {
  328. if (document.querySelector('#rightContent')) {
  329. self.init();
  330. clearInterval(si)
  331. }
  332. }, 100)
  333. window.addEventListener("message", e => {
  334. console.log('leftMenu receive message:', e.data)
  335. this.changeSide(e.data.collapse ?? false)
  336. });
  337. window.toWorkBench = this.toWorkBench;
  338. window.toTask = this.toTask;
  339. },
  340. methods: {
  341. init: function () {
  342. if (this.isDialog === '1') {
  343. this.toTask();
  344. }
  345. const $ = layui.jquery
  346. // $('#rightContent').width(document.body.clientWidth - 190).height(document.body.clientHeight - 50);
  347. // window.addEventListener('resize', function () {
  348. // $('#rightContent').height(document.body.clientHeight - 50);
  349. // })
  350. //通过hash值的索引定位应该加载哪个页面
  351. var href = window.location.href;
  352. var toUrl = href.replace(App.getUrl("index"), "");
  353. if (toUrl.indexOf("#") == 0 && toUrl.length >= 2) {
  354. var hashIndex = toUrl.replace("#", "").split("_");
  355. for (var i = 0; i < hashIndex.length; i++) {
  356. if (!isNumber(hashIndex[i])) {
  357. return;
  358. }
  359. }
  360. if (hashIndex.length > 1) {
  361. this.onSelectItem(hashIndex[0], hashIndex[1]);
  362. } else {
  363. this.onSelectItem(hashIndex[0]);
  364. }
  365. //页面选中
  366. /* for(var i =0;i<this.navLs.length;i++){
  367. if (this.navLs[i].child != null){
  368. //再次循环
  369. for (var j=0;j<this.navLs[i].child.length;j++){
  370. if(toUrl.indexOf(this.navLs[i].child[j].url) >= 0){
  371. $("#rightContent").attr("src",App.getUrl(toUrl.substring(2,toUrl.length)));
  372. this.active = i;
  373. break;
  374. }
  375. }
  376. }else{
  377. if(toUrl.indexOf(this.navLs[i].url) >= 0){
  378. $("#rightContent").attr("src",App.getUrl(toUrl.substring(2,toUrl.length)));
  379. this.active = i;
  380. break;
  381. }
  382. }
  383. } */
  384. } else {
  385. //初始化选中第一个菜单
  386. for (var i = 0; i < this.navLs.length; i++) {
  387. if (this.menuCode.indexOf(this.navLs[i].code) >= 0) {
  388. if (this.navLs[i].child) {
  389. var child = this.navLs[i].child;
  390. for (var j = 0; j < child.length; j++) {
  391. if (this.menuCode.indexOf(child[j].code) >= 0) {
  392. this.onSelectItem(i, j);
  393. return;
  394. }
  395. }
  396. } else {
  397. this.onSelectItem(i);
  398. return;
  399. }
  400. }
  401. }
  402. }
  403. },
  404. changeSide: function (status) {
  405. if (typeof status === 'boolean') {
  406. this.collapse = status
  407. } else {
  408. this.collapse = !this.collapse
  409. }
  410. const iframeObj = $("#rightContent")
  411. iframeObj[0].contentWindow.postMessage({
  412. collapse: this.collapse,
  413. topBreadcrumb: this.topBreadcrumb,
  414. });
  415. },
  416. toWorkBench: function () {
  417. var index = this.navLs.findIndex(item => {
  418. return item.txt === '工作台';
  419. });
  420. this.onSelectItem(index)
  421. },
  422. toTask: function () {
  423. /* top.App.openLayer({
  424. title : "项目调度情况",
  425. content : App.getUrl("meetingRecords/show"),
  426. height : "700",
  427. width : "90%"
  428. });*/
  429. //详情
  430. var index = top.layer.open({
  431. type: 2,
  432. area: ['95%', '100%'],
  433. content: App.getUrl("taskRecords/show"),
  434. shade: 0.5,
  435. shadeClose: true
  436. });
  437. //top.layer.full(index);
  438. },
  439. onSelectItem: function (index, ind) {
  440. this.active = index;
  441. if (ind != undefined) {
  442. var chooseNode = this.navLs[index]["child"][ind];
  443. if (chooseNode.url) {
  444. if (chooseNode.before && typeof (chooseNode.before) == 'function') {
  445. chooseNode.before();
  446. }
  447. window.location.hash = index + "_" + ind;
  448. var parentNodeText = this.navLs[index].txt;
  449. this.curSelectedMenu = this.navLs[index].child?.[ind].code ?? ''
  450. $("#rightContent").attr("src", App.getUrl(chooseNode.url));
  451. const htmlStr = '<span style="margin-right: 5px; color: #dde1e6;">' + parentNodeText + ' /</span>' + chooseNode.txt
  452. this.topBreadcrumb = htmlStr
  453. } else {
  454. App.msg.warn("正在建设中");
  455. }
  456. } else if (this.navLs[index].url) {
  457. var chooseNode = this.navLs[index];
  458. if (chooseNode.before && typeof (chooseNode.before) == 'function') {
  459. chooseNode.before();
  460. }
  461. window.location.hash = index;
  462. $("#rightContent").attr("src", App.getUrl(this.navLs[index].url));
  463. this.topBreadcrumb = this.navLs[index].txt
  464. }
  465. },
  466. onChangeActive: function (index) {
  467. this.tabActive = index
  468. },
  469. onButtonActive: function (index) {
  470. this.buttonActive = index
  471. },
  472. onView: function () {
  473. const $ = layui.jquery
  474. layer.open({
  475. type: 1,
  476. title: '确认信息',
  477. skin: 'pop_info_class',
  478. id: 'layerPop1', //防止重复弹出
  479. content: $('#popInfo'),
  480. btn: ['取消', '提交'],
  481. btnAlign: 'c', //按钮居中
  482. yes: function () {
  483. layer.closeAll();
  484. },
  485. btn2: function () {
  486. },
  487. cancel: function () {
  488. layer.closeAll();
  489. }
  490. })
  491. }
  492. }
  493. });
  494. window.onresize = function () {
  495. $("#rightContent").css("width", "100%");
  496. }
  497. </script>
  498. <style>
  499. #rightContent {
  500. width: 100%;
  501. border: none;
  502. height: calc(100% - 6px);
  503. }
  504. .left_menu {
  505. width: 200px;
  506. }
  507. </style>