Menu.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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: "/fgzyfx",
  211. children: [
  212. {
  213. text: "风资源分析",
  214. icon: "svg-wind-site",
  215. path: "/windAnalysis",
  216. },
  217. ],
  218. },
  219. {
  220. text: "专题分析",
  221. icon: "svg-wind-site",
  222. path: "/fgzyfx",
  223. children: [
  224. {
  225. text: "综合分析",
  226. icon: "svg-wind-site",
  227. path: "/new/ztfx",
  228. },
  229. {
  230. text: "风能利用率",
  231. icon: "svg-wind-site",
  232. path: "/new/fnlyl",
  233. },
  234. {
  235. text: "维护损失率",
  236. icon: "svg-wind-site",
  237. path: "/new/whssl",
  238. },
  239. {
  240. text: "故障损失率",
  241. icon: "svg-wind-site",
  242. path: "/new/gzssl",
  243. },
  244. {
  245. text: "限电损失率",
  246. icon: "svg-wind-site",
  247. path: "/new/xdssl",
  248. },
  249. {
  250. text: "性能损失率",
  251. icon: "svg-wind-site",
  252. path: "/new/xnssl",
  253. },
  254. {
  255. text: "受累损失率",
  256. icon: "svg-wind-site",
  257. path: "/new/slssl",
  258. },
  259. {
  260. text: "MTBF分析",
  261. icon: "svg-wind-site",
  262. path: "/new/mtbf",
  263. },
  264. {
  265. text: "MTTR分析",
  266. icon: "svg-wind-site",
  267. path: "/new/mttr",
  268. },
  269. {
  270. text: "复位及时率",
  271. icon: "svg-wind-site",
  272. path: "/new/zfwjsl",
  273. },
  274. {
  275. text: "状态转换率",
  276. icon: "svg-wind-site",
  277. path: "/new/zztzhl",
  278. },
  279. {
  280. text: "消缺及时率",
  281. icon: "svg-wind-site",
  282. path: "/new/zxqjsl",
  283. },
  284. {
  285. text: "发电量分析",
  286. icon: "svg-wind-site",
  287. path: "/new/zfdl",
  288. },
  289. {
  290. text: "综合场用电量",
  291. icon: "svg-wind-site",
  292. path: "/new/zzhcydl",
  293. },
  294. ]
  295. },
  296. // {
  297. // text: "单机分析",
  298. // icon: "svg-wind-site",
  299. // path: "/fgzyfx",
  300. // children: [
  301. // {
  302. // text: "单机分析详细",
  303. // icon: "svg-wind-site",
  304. // path: "/new/dj1",
  305. // },
  306. // {
  307. // text: "电量预测",
  308. // icon: "svg-wind-site",
  309. // path: "/new/pf1",
  310. // },
  311. // {
  312. // text: "气象预测",
  313. // icon: "svg-wind-site",
  314. // path: "/new/fs",
  315. // }
  316. // ]
  317. // }
  318. ],
  319. },
  320. {
  321. id: "health",
  322. text: "健康管理",
  323. data: [
  324. {
  325. text: "健康管理",
  326. icon: "svg-wind-site",
  327. path: "/health",
  328. children: [
  329. {
  330. text: "量化评级",
  331. icon: "svg-wind-site",
  332. path: "/djpg",
  333. },
  334. {
  335. text: "健康推荐",
  336. icon: "svg-wind-site",
  337. path: "/health",
  338. },
  339. {
  340. text: "健康首页",
  341. icon: "svg-wind-site",
  342. path: "/health/health2",
  343. },
  344. {
  345. text: "健康总览",
  346. icon: "svg-wind-site",
  347. path: "/health/health6",
  348. },
  349. {
  350. text: "健康矩阵",
  351. icon: "svg-wind-site",
  352. path: "/health/health5",
  353. },
  354. // {
  355. // text: "健康列表",
  356. // icon: "svg-wind-site",
  357. // path: "/health/health6",
  358. // },
  359. {
  360. text: "健康列表",
  361. icon: "svg-wind-site",
  362. path: "/health/health8",
  363. },
  364. ],
  365. },
  366. ],
  367. },
  368. {
  369. id: "decision",
  370. text: "决策支持",
  371. data: [
  372. {
  373. text: "风机绩效榜",
  374. icon: "svg-matrix",
  375. path: "/decision/decision1",
  376. },
  377. {
  378. text: "五项损失率",
  379. icon: "svg-matrix",
  380. path: "/decision/decision2",
  381. },
  382. {
  383. text: "场内对标",
  384. icon: "svg-matrix",
  385. path: "/decision/decision2Cndb",
  386. },
  387. {
  388. text: "场际对标",
  389. icon: "svg-matrix",
  390. path: "/decision/decision2Cjdb",
  391. },
  392. {
  393. text: "项目对标",
  394. icon: "svg-matrix",
  395. path: "/decision/decision2Xmdb",
  396. },
  397. {
  398. text: "线路对标",
  399. icon: "svg-matrix",
  400. path: "/decision/decision2Xldb",
  401. },
  402. {
  403. text: "性能对标",
  404. icon: "svg-matrix",
  405. path: "/decision/decision3",
  406. },
  407. {
  408. text: "值际对标",
  409. icon: "svg-matrix",
  410. path: "/decision/decision4",
  411. },
  412. {
  413. text: "排行榜",
  414. icon: "svg-matrix",
  415. path: "/phb",
  416. children: [
  417. {
  418. text: "发电效率排行",
  419. icon: "svg-wind-site",
  420. path: "/powerRank",
  421. },
  422. {
  423. text: "总发电效率排行",
  424. icon: "svg-wind-site",
  425. path: "/totalPowerRank",
  426. },
  427. {
  428. text: "报警排行",
  429. icon: "svg-wind-site",
  430. path: "/warningRank",
  431. },
  432. ],
  433. },
  434. // 三率管理
  435. {
  436. text: "三率管理",
  437. icon: "svg-matrix",
  438. path: "/slgl",
  439. children: [
  440. {
  441. text: "复位及时率",
  442. icon: "svg-wind-site",
  443. path: "/fwjsl",
  444. },
  445. {
  446. text: "状态转换率",
  447. icon: "svg-wind-site",
  448. path: "/ztzhl",
  449. },
  450. {
  451. text: "消缺及时率",
  452. icon: "svg-wind-site",
  453. path: "/xqjsl",
  454. },
  455. ],
  456. },
  457. ],
  458. },
  459. {
  460. id: "knowledge",
  461. text: "知识管理",
  462. data: [
  463. {
  464. text: "故障知识列表",
  465. icon: "svg-matrix",
  466. path: "/knowledge",
  467. },
  468. {
  469. text: "安全措施知识",
  470. icon: "svg-matrix",
  471. path: "/knowledge2",
  472. },
  473. {
  474. text: "排查检修方案",
  475. icon: "svg-matrix",
  476. path: "/knowledge6",
  477. },
  478. {
  479. text: "预警知识",
  480. icon: "svg-matrix",
  481. path: "/knowledge7",
  482. },
  483. {
  484. text: "特征参数",
  485. icon: "svg-matrix",
  486. path: "/knowledge5",
  487. },
  488. {
  489. text: "风险辨识知识",
  490. icon: "svg-matrix",
  491. path: "/knowledge3",
  492. },
  493. {
  494. text: "作业指导知识",
  495. icon: "svg-matrix",
  496. path: "/knowledge4",
  497. },
  498. ],
  499. },
  500. {
  501. id: "report",
  502. text: "智能报表",
  503. data: [],
  504. },
  505. ],
  506. activeIndex: 0,
  507. isShowSubMenu: false,
  508. parentIndex: null,
  509. subMenu: [],
  510. subIndex: null,
  511. };
  512. },
  513. methods: {
  514. click (index) {
  515. this.activeIndex = index;
  516. this.subIndex = null;
  517. },
  518. subMenuShow (children, index) {
  519. if (children) {
  520. this.isShowSubMenu = true;
  521. this.parentIndex = index;
  522. } else {
  523. this.isShowSubMenu = false;
  524. this.parentIndex = null;
  525. }
  526. this.subMenu = children;
  527. },
  528. subMenuHide () {
  529. this.isShowSubMenu = false;
  530. this.parentIndex = null;
  531. this.subMenu = [];
  532. },
  533. subclick (index) {
  534. this.activeIndex = this.parentIndex;
  535. this.subIndex = index;
  536. },
  537. },
  538. computed: {
  539. currentMenu () {
  540. let data = this.menuData.filter((t) => {
  541. return t.id == this.currRoot;
  542. })[0].data;
  543. return data;
  544. },
  545. },
  546. watch: {
  547. // 监听路由
  548. $route: {
  549. handler: function (val, oldVal) {
  550. this.menuData.some((element, index) => {
  551. if (val.path.includes(element.id)) {
  552. this.currRoot = element.id;
  553. this.$nextTick(() => {
  554. this.currentMenu.some((element, index) => {
  555. if (val.path == element.path) {
  556. this.activeIndex = index;
  557. }
  558. });
  559. });
  560. return true;
  561. }
  562. });
  563. },
  564. //深度观察监听
  565. deep: true,
  566. },
  567. },
  568. };
  569. </script>
  570. <style lang="less">
  571. .menu {
  572. padding-top: 1.481vh;
  573. .menu-list {
  574. margin: 0;
  575. padding: 0;
  576. list-style: none;
  577. .menu-item {
  578. padding: 1.481vh 0;
  579. text-align: center;
  580. .menu-icon {
  581. display: flex;
  582. justify-content: center;
  583. }
  584. &.active i {
  585. color: #05bb4c;
  586. transition: color 1s;
  587. }
  588. }
  589. }
  590. i {
  591. font-size: 2.222vh;
  592. color: rgba(255, 255, 255, 50%);
  593. }
  594. }
  595. .sub-menu {
  596. position: absolute;
  597. top: 0;
  598. left: 5.3704vh;
  599. width: 138px;
  600. height: 100%;
  601. padding-top: 1.481vh;
  602. background: fade(#192a26, 75);
  603. border-right: 1px solid fade(@green, 50);
  604. box-shadow: inset 11px 0px 20px 0px fade(#021412, 60);
  605. .menu-list {
  606. margin: 0;
  607. padding: 0;
  608. list-style: none;
  609. .menu-item {
  610. display: flex;
  611. text-align: center;
  612. line-height: 1.5;
  613. padding: 8px 0;
  614. background: #121d1c;
  615. a {
  616. display: flex;
  617. width: 100%;
  618. height: 100%;
  619. padding: 0 1.4815vh;
  620. font-size: @fontsize-s;
  621. text-decoration: unset;
  622. .menu-icon {
  623. display: flex;
  624. align-items: center;
  625. svg {
  626. width: 14px;
  627. height: 14px;
  628. use {
  629. fill: fade(@green, 75);
  630. }
  631. }
  632. }
  633. }
  634. &.active {
  635. background: #323e70;
  636. .menu-icon {
  637. display: flex;
  638. svg use {
  639. fill: fade(@white, 75);
  640. }
  641. }
  642. }
  643. .sub-menu-text {
  644. margin-left: 1.1111vh;
  645. color: @gray-l;
  646. }
  647. & + .menu-item {
  648. border-top: 1px solid fade(@darkgray, 40);
  649. }
  650. }
  651. }
  652. i {
  653. font-size: 2.222vh;
  654. color: rgba(255, 255, 255, 50%);
  655. }
  656. }
  657. </style>