Menu.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  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: "/qxpclfx",
  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: "/djpg",
  318. },
  319. {
  320. text: "健康推荐",
  321. icon: "svg-wind-site",
  322. path: "/health",
  323. },
  324. {
  325. text: "健康首页",
  326. icon: "svg-wind-site",
  327. path: "/health/health2",
  328. },
  329. {
  330. text: "健康总览",
  331. icon: "svg-wind-site",
  332. path: "/health/health6",
  333. },
  334. {
  335. text: "健康矩阵",
  336. icon: "svg-wind-site",
  337. path: "/health/health5",
  338. },
  339. // {
  340. // text: "健康列表",
  341. // icon: "svg-wind-site",
  342. // path: "/health/health6",
  343. // },
  344. {
  345. text: "健康列表",
  346. icon: "svg-wind-site",
  347. path: "/health/health8",
  348. },
  349. ],
  350. },
  351. ],
  352. },
  353. {
  354. id: "decision",
  355. text: "决策支持",
  356. data: [
  357. {
  358. text: "风机绩效榜",
  359. icon: "svg-matrix",
  360. path: "/decision/decision1",
  361. },
  362. {
  363. text: "五项损失率",
  364. icon: "svg-matrix",
  365. path: "/decision/decision2",
  366. },
  367. {
  368. text: "场内对标",
  369. icon: "svg-matrix",
  370. path: "/decision/decision2Cndb",
  371. },
  372. {
  373. text: "场际对标",
  374. icon: "svg-matrix",
  375. path: "/decision/decision2Cjdb",
  376. },
  377. {
  378. text: "项目对标",
  379. icon: "svg-matrix",
  380. path: "/decision/decision2Xmdb",
  381. },
  382. {
  383. text: "线路对标",
  384. icon: "svg-matrix",
  385. path: "/decision/decision2Xldb",
  386. },
  387. {
  388. text: "性能对标",
  389. icon: "svg-matrix",
  390. path: "/decision/decision3",
  391. },
  392. {
  393. text: "值际对标",
  394. icon: "svg-matrix",
  395. path: "/decision/decision4",
  396. },
  397. {
  398. text: "排行榜",
  399. icon: "svg-matrix",
  400. path: "/phb",
  401. children: [
  402. {
  403. text: "发电效率排行",
  404. icon: "svg-wind-site",
  405. path: "/powerRank",
  406. },
  407. {
  408. text: "总发电效率排行",
  409. icon: "svg-wind-site",
  410. path: "/totalPowerRank",
  411. },
  412. {
  413. text: "报警排行",
  414. icon: "svg-wind-site",
  415. path: "/warningRank",
  416. },
  417. ],
  418. },
  419. // 三率管理
  420. {
  421. text: "三率管理",
  422. icon: "svg-matrix",
  423. path: "/slgl",
  424. children: [
  425. {
  426. text: "复位及时率",
  427. icon: "svg-wind-site",
  428. path: "/fwjsl",
  429. },
  430. {
  431. text: "状态转换率",
  432. icon: "svg-wind-site",
  433. path: "/ztzhl",
  434. },
  435. {
  436. text: "消缺及时率",
  437. icon: "svg-wind-site",
  438. path: "/xqjsl",
  439. },
  440. ],
  441. },
  442. ],
  443. },
  444. {
  445. id: "knowledge",
  446. text: "知识管理",
  447. data: [
  448. {
  449. text: "故障知识列表",
  450. icon: "svg-matrix",
  451. path: "/knowledge",
  452. },
  453. {
  454. text: "安全措施知识",
  455. icon: "svg-matrix",
  456. path: "/knowledge2",
  457. },
  458. {
  459. text: "排查检修方案",
  460. icon: "svg-matrix",
  461. path: "/knowledge6",
  462. },
  463. {
  464. text: "预警知识",
  465. icon: "svg-matrix",
  466. path: "/knowledge7",
  467. },
  468. {
  469. text: "特征参数",
  470. icon: "svg-matrix",
  471. path: "/knowledge5",
  472. },
  473. {
  474. text: "风险辨识知识",
  475. icon: "svg-matrix",
  476. path: "/knowledge3",
  477. },
  478. {
  479. text: "作业指导知识",
  480. icon: "svg-matrix",
  481. path: "/knowledge4",
  482. },
  483. ],
  484. },
  485. {
  486. id: "report",
  487. text: "智能报表",
  488. data: [],
  489. },
  490. ],
  491. activeIndex: 0,
  492. isShowSubMenu: false,
  493. parentIndex: null,
  494. subMenu: [],
  495. subIndex: null,
  496. };
  497. },
  498. methods: {
  499. click (index) {
  500. this.activeIndex = index;
  501. this.subIndex = null;
  502. },
  503. subMenuShow (children, index) {
  504. if (children) {
  505. this.isShowSubMenu = true;
  506. this.parentIndex = index;
  507. } else {
  508. this.isShowSubMenu = false;
  509. this.parentIndex = null;
  510. }
  511. this.subMenu = children;
  512. },
  513. subMenuHide () {
  514. this.isShowSubMenu = false;
  515. this.parentIndex = null;
  516. this.subMenu = [];
  517. },
  518. subclick (index) {
  519. this.activeIndex = this.parentIndex;
  520. this.subIndex = index;
  521. },
  522. },
  523. computed: {
  524. currentMenu () {
  525. let data = this.menuData.filter((t) => {
  526. return t.id == this.currRoot;
  527. })[0].data;
  528. return data;
  529. },
  530. },
  531. watch: {
  532. // 监听路由
  533. $route: {
  534. handler: function (val, oldVal) {
  535. this.menuData.some((element, index) => {
  536. if (val.path.includes(element.id)) {
  537. this.currRoot = element.id;
  538. this.$nextTick(() => {
  539. this.currentMenu.some((element, index) => {
  540. if (val.path == element.path) {
  541. this.activeIndex = index;
  542. }
  543. });
  544. });
  545. return true;
  546. }
  547. });
  548. },
  549. //深度观察监听
  550. deep: true,
  551. },
  552. },
  553. };
  554. </script>
  555. <style lang="less">
  556. .menu {
  557. padding-top: 1.481vh;
  558. .menu-list {
  559. margin: 0;
  560. padding: 0;
  561. list-style: none;
  562. .menu-item {
  563. padding: 1.481vh 0;
  564. text-align: center;
  565. .menu-icon {
  566. display: flex;
  567. justify-content: center;
  568. }
  569. &.active i {
  570. color: #05bb4c;
  571. transition: color 1s;
  572. }
  573. }
  574. }
  575. i {
  576. font-size: 2.222vh;
  577. color: rgba(255, 255, 255, 50%);
  578. }
  579. }
  580. .sub-menu {
  581. position: absolute;
  582. top: 0;
  583. left: 5.3704vh;
  584. width: 138px;
  585. height: 100%;
  586. padding-top: 1.481vh;
  587. background: fade(#192a26, 75);
  588. border-right: 1px solid fade(@green, 50);
  589. box-shadow: inset 11px 0px 20px 0px fade(#021412, 60);
  590. .menu-list {
  591. margin: 0;
  592. padding: 0;
  593. list-style: none;
  594. .menu-item {
  595. display: flex;
  596. text-align: center;
  597. line-height: 1.5;
  598. padding: 8px 0;
  599. background: #121d1c;
  600. a {
  601. display: flex;
  602. width: 100%;
  603. height: 100%;
  604. padding: 0 1.4815vh;
  605. font-size: @fontsize-s;
  606. text-decoration: unset;
  607. .menu-icon {
  608. display: flex;
  609. align-items: center;
  610. svg {
  611. width: 14px;
  612. height: 14px;
  613. use {
  614. fill: fade(@green, 75);
  615. }
  616. }
  617. }
  618. }
  619. &.active {
  620. background: #323e70;
  621. .menu-icon {
  622. display: flex;
  623. svg use {
  624. fill: fade(@white, 75);
  625. }
  626. }
  627. }
  628. .sub-menu-text {
  629. margin-left: 1.1111vh;
  630. color: @gray-l;
  631. }
  632. & + .menu-item {
  633. border-top: 1px solid fade(@darkgray, 40);
  634. }
  635. }
  636. }
  637. i {
  638. font-size: 2.222vh;
  639. color: rgba(255, 255, 255, 50%);
  640. }
  641. }
  642. </style>