Menu.vue 17 KB

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