Menu.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. <template>
  2. <div class="menu">
  3. <ul class="menu-list">
  4. <li class="menu-item" v-for="(menu, index) of currentMenu" :key="menu" @click="click(index)" :class="{ active: activeIndex == index }"
  5. @mouseenter="subMenuShow(menu.children, index)">
  6. <router-link v-if="!menu.children" :to="menu.path">
  7. <el-tooltip class="item" effect="dark" :content="menu.text" placement="right" :show-after="500">
  8. <div class="menu-icon svg-icon" :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
  9. <SvgIcon :svgid="menu.icon"></SvgIcon>
  10. </div>
  11. </el-tooltip>
  12. </router-link>
  13. <div v-if="menu.children" class="sub-menu-item">
  14. <div class="menu-icon svg-icon" :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
  15. <SvgIcon :svgid="menu.icon"></SvgIcon>
  16. </div>
  17. </div>
  18. </li>
  19. </ul>
  20. </div>
  21. <div class="sub-menu" v-show="isShowSubMenu" @mouseleave="subMenuHide">
  22. <ul class="menu-list">
  23. <li class="menu-item" v-for="(menu, index) of subMenu" @click="subclick(index)" :key="menu" :class="{ active: subIndex == index }">
  24. <router-link :to="menu.path">
  25. <div class="menu-icon svg-icon">
  26. <SvgIcon :svgid="menu.icon"></SvgIcon>
  27. </div>
  28. <div class="sub-menu-text" :class="subIndex == index ? 'green' : 'gray'">{{ menu.text }}</div>
  29. </router-link>
  30. </li>
  31. </ul>
  32. </div>
  33. </template>
  34. <script>
  35. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  36. export default {
  37. components: {
  38. SvgIcon,
  39. },
  40. props: {},
  41. data () {
  42. return {
  43. currRoot: "monitor",
  44. menuData: [
  45. {
  46. id: "monitor",
  47. text: "状态监视",
  48. data: [
  49. {
  50. text: "驾驶舱",
  51. icon: "svg-lead-cockpit",
  52. path: "/monitor/home",
  53. },
  54. {
  55. text: "基础矩阵",
  56. icon: "svg-matrix",
  57. path: "/monitor/lightmatrix1",
  58. },
  59. {
  60. text: "明细矩阵",
  61. icon: "svg-mx-matrix",
  62. path: "/monitor/lightmatrix3",
  63. },
  64. {
  65. text: "欠发矩阵",
  66. icon: "svg-qf-matrix",
  67. path: "/monitor/lightmatrix2",
  68. },
  69. {
  70. text: "光伏矩阵",
  71. icon: "svg-gf-matrix",
  72. path: "/monitor/lightmatrix",
  73. },
  74. {
  75. text: "状态监视",
  76. icon: "svg-state-watch",
  77. path: "/monitor/status",
  78. },
  79. {
  80. text: "Agc",
  81. icon: "svg-agc",
  82. path: "/monitor/agc",
  83. },
  84. {
  85. text: "风场",
  86. icon: "svg-wind-site",
  87. path: "/monitor/windsite/home/MHS_FDC",
  88. },
  89. ],
  90. },
  91. {
  92. id: "realSearch",
  93. text: "数据管理",
  94. data: [
  95. {
  96. text: "原始数据查询",
  97. icon: "svg-wind-site",
  98. path: "/yssjcx",
  99. children: [
  100. {
  101. text: "测点数据查询",
  102. icon: "svg-wind-site",
  103. path: "/realSearch",
  104. },
  105. {
  106. text: "测点历史数据查询",
  107. icon: "svg-wind-site",
  108. path: "/historySearch",
  109. },
  110. ],
  111. },
  112. {
  113. text: "预警记录",
  114. icon: "svg-wind-site",
  115. path: "/new",
  116. children: [
  117. {
  118. text: "预警管理",
  119. icon: "svg-wind-site",
  120. path: "/new/alarmcenter",
  121. },
  122. {
  123. text: "预警分析",
  124. icon: "svg-wind-site",
  125. path: "/new/alarmcenter1",
  126. },
  127. {
  128. text: "故障分析",
  129. icon: "svg-wind-site",
  130. path: "/new/alarmcenter2",
  131. },
  132. {
  133. text: "停机事件管理",
  134. icon: "svg-wind-site",
  135. path: "/new/tjsj",
  136. },
  137. {
  138. text: "限电管理",
  139. icon: "svg-wind-site",
  140. path: "/new/xdgl",
  141. },
  142. {
  143. text: "升压站报警",
  144. icon: "svg-wind-site",
  145. path: "/alarmCenter/boosterAlarm",
  146. },
  147. {
  148. text: "SCADA报警",
  149. icon: "svg-wind-site",
  150. path: "/alarmCenter/scadaAlarm",
  151. },
  152. {
  153. text: "自定义报警",
  154. icon: "svg-wind-site",
  155. path: "/alarmCenter/customAlarm",
  156. },
  157. ],
  158. },
  159. ],
  160. },
  161. {
  162. id: "performanceAnalysis",
  163. text: "统计分析",
  164. data: [
  165. {
  166. text: "能效分析",
  167. icon: "svg-wind-site",
  168. path: "/nxfx",
  169. children: [
  170. {
  171. text: "功率曲线拟合",
  172. icon: "svg-wind-site",
  173. path: "/nxfx1",
  174. },
  175. {
  176. text: "偏航对风分析",
  177. icon: "svg-wind-site",
  178. path: "/nxfx2",
  179. },
  180. {
  181. text: "切入切出分析",
  182. icon: "svg-wind-site",
  183. path: "/cutAnalyse",
  184. },
  185. {
  186. text: "曲线偏差率分析",
  187. icon: "svg-wind-site",
  188. path: "/qxpclfx",
  189. },
  190. {
  191. text: "单机性能分析",
  192. icon: "svg-wind-site",
  193. path: "/performanceAnalysis",
  194. },
  195. {
  196. text: "单机月度分析",
  197. icon: "svg-wind-site",
  198. path: "/singleAnalysis",
  199. },
  200. {
  201. text: "单机饱和度",
  202. icon: "svg-wind-site",
  203. path: "/wtSaturability",
  204. },
  205. ],
  206. },
  207. {
  208. text: "可靠性分析",
  209. icon: "svg-wind-site",
  210. path: "/kxkfx",
  211. children: [
  212. {
  213. text: "预警评判分析",
  214. icon: "svg-wind-site",
  215. path: "/warnStatistics",
  216. },
  217. {
  218. text: "故障评判分析",
  219. icon: "svg-wind-site",
  220. path: "/malfunctionStatistics",
  221. }
  222. ],
  223. },
  224. {
  225. text: "风光资源分析",
  226. icon: "svg-wind-site",
  227. path: "/fgzyfx",
  228. children: [
  229. {
  230. text: "风资源分析",
  231. icon: "svg-wind-site",
  232. path: "/windAnalysis",
  233. },
  234. ],
  235. },
  236. {
  237. text: "专题分析",
  238. icon: "svg-wind-site",
  239. path: "/fgzyfx",
  240. children: [
  241. {
  242. text: "综合分析",
  243. icon: "svg-wind-site",
  244. path: "/new/ztfx",
  245. },
  246. {
  247. text: "风能利用率",
  248. icon: "svg-wind-site",
  249. path: "/new/fnlyl",
  250. },
  251. {
  252. text: "维护损失率",
  253. icon: "svg-wind-site",
  254. path: "/new/whssl",
  255. },
  256. {
  257. text: "故障损失率",
  258. icon: "svg-wind-site",
  259. path: "/new/gzssl",
  260. },
  261. {
  262. text: "限电损失率",
  263. icon: "svg-wind-site",
  264. path: "/new/xdssl",
  265. },
  266. {
  267. text: "性能损失率",
  268. icon: "svg-wind-site",
  269. path: "/new/xnssl",
  270. },
  271. {
  272. text: "受累损失率",
  273. icon: "svg-wind-site",
  274. path: "/new/slssl",
  275. },
  276. {
  277. text: "MTBF分析",
  278. icon: "svg-wind-site",
  279. path: "/new/mtbf",
  280. },
  281. {
  282. text: "MTTR分析",
  283. icon: "svg-wind-site",
  284. path: "/new/mttr",
  285. },
  286. {
  287. text: "复位及时率",
  288. icon: "svg-wind-site",
  289. path: "/new/zfwjsl",
  290. },
  291. {
  292. text: "状态转换率",
  293. icon: "svg-wind-site",
  294. path: "/new/zztzhl",
  295. },
  296. {
  297. text: "消缺及时率",
  298. icon: "svg-wind-site",
  299. path: "/new/zxqjsl",
  300. },
  301. {
  302. text: "发电量分析",
  303. icon: "svg-wind-site",
  304. path: "/new/zfdl",
  305. },
  306. {
  307. text: "综合场用电量",
  308. icon: "svg-wind-site",
  309. path: "/new/zzhcydl",
  310. },
  311. ]
  312. },
  313. // {
  314. // text: "单机分析",
  315. // icon: "svg-wind-site",
  316. // path: "/fgzyfx",
  317. // children: [
  318. // {
  319. // text: "单机分析详细",
  320. // icon: "svg-wind-site",
  321. // path: "/new/dj1",
  322. // },
  323. // {
  324. // text: "电量预测",
  325. // icon: "svg-wind-site",
  326. // path: "/new/pf1",
  327. // },
  328. // {
  329. // text: "气象预测",
  330. // icon: "svg-wind-site",
  331. // path: "/new/fs",
  332. // }
  333. // ]
  334. // }
  335. ],
  336. },
  337. {
  338. id: "health",
  339. text: "健康管理",
  340. data: [
  341. {
  342. text: "健康管理",
  343. icon: "svg-wind-site",
  344. path: "/health",
  345. children: [
  346. {
  347. text: "量化评级",
  348. icon: "svg-wind-site",
  349. path: "/djpg",
  350. },
  351. {
  352. text: "健康推荐",
  353. icon: "svg-wind-site",
  354. path: "/health",
  355. },
  356. {
  357. text: "健康首页",
  358. icon: "svg-wind-site",
  359. path: "/health/health2",
  360. },
  361. {
  362. text: "健康总览",
  363. icon: "svg-wind-site",
  364. path: "/health/health6",
  365. },
  366. {
  367. text: "健康矩阵",
  368. icon: "svg-wind-site",
  369. path: "/health/health5",
  370. },
  371. // {
  372. // text: "健康列表",
  373. // icon: "svg-wind-site",
  374. // path: "/health/health6",
  375. // },
  376. {
  377. text: "健康列表",
  378. icon: "svg-wind-site",
  379. path: "/health/health8",
  380. },
  381. ],
  382. },
  383. ],
  384. },
  385. {
  386. id: "decision",
  387. text: "决策支持",
  388. data: [
  389. {
  390. text: "风机绩效榜",
  391. icon: "svg-matrix",
  392. path: "/decision/decision1",
  393. },
  394. {
  395. text: "五项损失率",
  396. icon: "svg-matrix",
  397. path: "/decision/decision2",
  398. },
  399. {
  400. text: "场内对标",
  401. icon: "svg-matrix",
  402. path: "/decision/decision2Cndb",
  403. },
  404. {
  405. text: "场际对标",
  406. icon: "svg-matrix",
  407. path: "/decision/decision2Cjdb",
  408. },
  409. {
  410. text: "项目对标",
  411. icon: "svg-matrix",
  412. path: "/decision/decision2Xmdb",
  413. },
  414. {
  415. text: "线路对标",
  416. icon: "svg-matrix",
  417. path: "/decision/decision2Xldb",
  418. },
  419. {
  420. text: "性能对标",
  421. icon: "svg-matrix",
  422. path: "/decision/decision3",
  423. },
  424. {
  425. text: "值际对标",
  426. icon: "svg-matrix",
  427. path: "/decision/decision4",
  428. },
  429. {
  430. text: "排行榜",
  431. icon: "svg-matrix",
  432. path: "/phb",
  433. children: [
  434. {
  435. text: "发电效率排行",
  436. icon: "svg-wind-site",
  437. path: "/powerRank",
  438. },
  439. {
  440. text: "总发电效率排行",
  441. icon: "svg-wind-site",
  442. path: "/totalPowerRank",
  443. },
  444. {
  445. text: "报警排行",
  446. icon: "svg-wind-site",
  447. path: "/warningRank",
  448. },
  449. ],
  450. },
  451. // 三率管理
  452. {
  453. text: "三率管理",
  454. icon: "svg-matrix",
  455. path: "/slgl",
  456. children: [
  457. {
  458. text: "复位及时率",
  459. icon: "svg-wind-site",
  460. path: "/fwjsl",
  461. },
  462. {
  463. text: "状态转换率",
  464. icon: "svg-wind-site",
  465. path: "/ztzhl",
  466. },
  467. {
  468. text: "消缺及时率",
  469. icon: "svg-wind-site",
  470. path: "/xqjsl",
  471. },
  472. ],
  473. },
  474. ],
  475. },
  476. {
  477. id: "knowledge",
  478. text: "知识管理",
  479. data: [
  480. {
  481. text: "故障知识列表",
  482. icon: "svg-matrix",
  483. path: "/knowledge",
  484. },
  485. {
  486. text: "安全措施知识",
  487. icon: "svg-matrix",
  488. path: "/knowledge2",
  489. },
  490. {
  491. text: "排查检修方案",
  492. icon: "svg-matrix",
  493. path: "/knowledge6",
  494. },
  495. {
  496. text: "预警知识",
  497. icon: "svg-matrix",
  498. path: "/knowledge7",
  499. },
  500. {
  501. text: "特征参数",
  502. icon: "svg-matrix",
  503. path: "/knowledge5",
  504. },
  505. {
  506. text: "风险辨识知识",
  507. icon: "svg-matrix",
  508. path: "/knowledge3",
  509. },
  510. {
  511. text: "作业指导知识",
  512. icon: "svg-matrix",
  513. path: "/knowledge4",
  514. },
  515. ],
  516. },
  517. {
  518. id: "report",
  519. text: "智能报表",
  520. data: [],
  521. },
  522. ],
  523. activeIndex: 0,
  524. isShowSubMenu: false,
  525. parentIndex: null,
  526. subMenu: [],
  527. subIndex: null,
  528. };
  529. },
  530. methods: {
  531. click (index) {
  532. this.activeIndex = index;
  533. this.subIndex = null;
  534. },
  535. subMenuShow (children, index) {
  536. if (children) {
  537. this.isShowSubMenu = true;
  538. this.parentIndex = index;
  539. } else {
  540. this.isShowSubMenu = false;
  541. this.parentIndex = null;
  542. }
  543. this.subMenu = children;
  544. },
  545. subMenuHide () {
  546. this.isShowSubMenu = false;
  547. this.parentIndex = null;
  548. // this.subMenu = [];
  549. },
  550. subclick (index) {
  551. this.activeIndex = this.parentIndex;
  552. this.subIndex = index;
  553. },
  554. },
  555. computed: {
  556. currentMenu () {
  557. let data = this.menuData.filter((t) => {
  558. return t.id == this.currRoot;
  559. })[0].data;
  560. return data;
  561. },
  562. },
  563. watch: {
  564. // 监听路由
  565. $route: {
  566. handler: function (val, oldVal) {
  567. this.menuData.some((element, index) => {
  568. if (val.path.includes(element.id)) {
  569. this.currRoot = element.id;
  570. this.$nextTick(() => {
  571. this.currentMenu.some((element, index) => {
  572. if (val.path == element.path) {
  573. this.activeIndex = index;
  574. }
  575. });
  576. });
  577. return true;
  578. }
  579. });
  580. },
  581. //深度观察监听
  582. deep: true,
  583. },
  584. },
  585. };
  586. </script>
  587. <style lang="less">
  588. .menu {
  589. padding-top: 1.481vh;
  590. .menu-list {
  591. margin: 0;
  592. padding: 0;
  593. list-style: none;
  594. .menu-item {
  595. padding: 1.481vh 0;
  596. text-align: center;
  597. .menu-icon {
  598. display: flex;
  599. justify-content: center;
  600. }
  601. &.active i {
  602. color: #05bb4c;
  603. transition: color 1s;
  604. }
  605. }
  606. }
  607. i {
  608. font-size: 2.222vh;
  609. color: rgba(255, 255, 255, 50%);
  610. }
  611. }
  612. .sub-menu {
  613. position: absolute;
  614. top: 0;
  615. left: 5.3704vh;
  616. width: 158px;
  617. height: 100%;
  618. padding-top: 1.481vh;
  619. background: fade(#192a26, 75);
  620. border-right: 1px solid fade(@green, 50);
  621. box-shadow: inset 11px 0px 20px 0px fade(#021412, 60);
  622. .menu-list {
  623. margin: 0;
  624. padding: 0;
  625. list-style: none;
  626. .menu-item {
  627. display: flex;
  628. text-align: center;
  629. line-height: 1.5;
  630. padding: 8px 0;
  631. background: #121d1c;
  632. a {
  633. display: flex;
  634. width: 100%;
  635. height: 100%;
  636. padding: 0 1.4815vh;
  637. font-size: @fontsize-s;
  638. text-decoration: unset;
  639. .menu-icon {
  640. display: flex;
  641. align-items: center;
  642. svg {
  643. width: 14px;
  644. height: 14px;
  645. use {
  646. fill: fade(@green, 75);
  647. }
  648. }
  649. }
  650. }
  651. &.active {
  652. background: #323e70;
  653. .menu-icon {
  654. display: flex;
  655. svg use {
  656. fill: fade(@white, 75);
  657. }
  658. }
  659. }
  660. .sub-menu-text {
  661. margin-left: 1.1111vh;
  662. color: @gray-l;
  663. }
  664. & + .menu-item {
  665. border-top: 1px solid fade(@darkgray, 40);
  666. }
  667. }
  668. }
  669. i {
  670. font-size: 2.222vh;
  671. color: rgba(255, 255, 255, 50%);
  672. }
  673. }
  674. </style>