Menu.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986
  1. <template>
  2. <div class="menu">
  3. <ul class="menu-list">
  4. <li class="menu-item"
  5. v-for="(menu, index) of currentMenu"
  6. :key="menu"
  7. @click="click(index)"
  8. :class="{ active: activeIndex == index }"
  9. @mouseenter="subMenuShow(menu.children, index)">
  10. <router-link :to="menu.path">
  11. <el-tooltip class="item"
  12. effect="dark"
  13. :content="menu.text"
  14. placement="bottom"
  15. :show-after="500">
  16. <div class="menu-icon svg-icon"
  17. :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
  18. <SvgIcon :svgid="menu.icon"></SvgIcon>
  19. </div>
  20. </el-tooltip>
  21. </router-link>
  22. <!-- <div v-if="menu.children" class="sub-menu-item">
  23. <div class="menu-icon svg-icon" :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
  24. <SvgIcon :svgid="menu.icon"></SvgIcon>
  25. </div>
  26. </div> -->
  27. </li>
  28. </ul>
  29. </div>
  30. <div class="sub-menu"
  31. v-show="isShowSubMenu"
  32. @mouseleave="subMenuHide">
  33. <ul class="menu-list">
  34. <li class="menu-item"
  35. v-for="(menu, index) of subMenu"
  36. @click="subclick(index)"
  37. :key="menu"
  38. :class="{ active: subIndex == index }">
  39. <router-link :to="menu.path">
  40. <div class="menu-icon svg-icon">
  41. <SvgIcon :svgid="menu.icon"></SvgIcon>
  42. </div>
  43. <div class="sub-menu-text"
  44. :class="subIndex == index ? 'green' : 'gray'">{{ menu.text }}</div>
  45. </router-link>
  46. </li>
  47. </ul>
  48. </div>
  49. </template>
  50. <script>
  51. import SvgIcon from '@com/coms/icon/svg-icon.vue'
  52. export default {
  53. components: {
  54. SvgIcon
  55. },
  56. props: {},
  57. data() {
  58. return {
  59. currRoot: 'monitor',
  60. menuData: [
  61. {
  62. id: 'monitor',
  63. text: '状态监视',
  64. data: [
  65. {
  66. text: '驾驶舱',
  67. icon: 'svg-lead-cockpit',
  68. path: '/monitor/home'
  69. },
  70. {
  71. text: '基础矩阵',
  72. icon: 'svg-matrix',
  73. path: '/monitor/lightmatrix1'
  74. },
  75. {
  76. text: '明细矩阵',
  77. icon: 'svg-mx-matrix',
  78. path: '/monitor/lightmatrix3'
  79. },
  80. {
  81. text: '欠发矩阵',
  82. icon: 'svg-qf-matrix',
  83. path: '/monitor/lightmatrix2'
  84. },
  85. {
  86. text: '光伏矩阵',
  87. icon: 'svg-gf-matrix',
  88. path: '/monitor/lightmatrix'
  89. },
  90. {
  91. text: '状态监视',
  92. icon: 'svg-state-watch',
  93. path: '/monitor/status'
  94. },
  95. {
  96. text: 'Agc',
  97. icon: 'svg-agc',
  98. path: '/monitor/agc'
  99. },
  100. {
  101. text: '风场',
  102. icon: 'svg-wind-site',
  103. path: '/monitor/windsite/home/MHS_FDC'
  104. }
  105. ]
  106. }
  107. ,
  108. {
  109. id: 'decision',
  110. text: '经济运行',
  111. data: [
  112. {
  113. text: '对标管理',
  114. icon: 'svg-matrix',
  115. path: '/decision/decision1',
  116. children: [
  117. {
  118. text: '风机绩效榜',
  119. icon: 'svg-wind-site',
  120. path: '/decision/decision1'
  121. },
  122. {
  123. text: '五项损失率',
  124. icon: 'svg-wind-site',
  125. path: '/decision/decision2'
  126. },
  127. {
  128. text: '场内对标',
  129. icon: 'svg-wind-site',
  130. path: '/decision/decision2Cndb'
  131. },
  132. {
  133. text: '场际对标',
  134. icon: 'svg-wind-site',
  135. path: '/decision/decision2Cjdb'
  136. },
  137. {
  138. text: '项目对标',
  139. icon: 'svg-wind-site',
  140. path: '/decision/decision2Xmdb'
  141. },
  142. {
  143. text: '线路对标',
  144. icon: 'svg-wind-site',
  145. path: '/decision/decision2Xldb'
  146. },
  147. {
  148. text: '性能对标',
  149. icon: 'svg-wind-site',
  150. path: '/decision/decision3'
  151. },
  152. {
  153. text: '值际对标',
  154. icon: 'svg-wind-site',
  155. path: '/decision/decision4'
  156. },
  157. {
  158. text: '单机横向对比',
  159. icon: 'svg-matrix',
  160. path: '/decision/decision3db'
  161. },
  162. {
  163. text: '操作指令统计',
  164. icon: 'svg-matrix',
  165. path: '/decision/decision4czzl'
  166. }
  167. ]
  168. }, // 三率管理
  169. {
  170. text: '三率管理',
  171. icon: 'svg-matrix',
  172. path: '/fwjsl',
  173. children: [
  174. {
  175. text: '复位及时率',
  176. icon: 'svg-wind-site',
  177. path: '/fwjsl'
  178. },
  179. {
  180. text: '状态转换率',
  181. icon: 'svg-wind-site',
  182. path: '/ztzhl'
  183. },
  184. {
  185. text: '消缺及时率',
  186. icon: 'svg-wind-site',
  187. path: '/xqjsl'
  188. }
  189. ]
  190. } ,
  191. {
  192. text: "排行榜",
  193. icon: "svg-matrix",
  194. path: "/phb",
  195. children: [
  196. {
  197. text: "发电效率排行",
  198. icon: "svg-wind-site",
  199. path: "/powerRank",
  200. },
  201. {
  202. text: "总发电效率排行",
  203. icon: "svg-wind-site",
  204. path: "/totalPowerRank",
  205. },
  206. {
  207. text: "报警排行",
  208. icon: "svg-wind-site",
  209. path: "/warningRank",
  210. },
  211. ],
  212. },
  213. {
  214. text: '专题分析',
  215. icon: 'svg-wind-site',
  216. path: '/new/ztfx',
  217. children: [
  218. {
  219. text: '综合分析',
  220. icon: 'svg-wind-site',
  221. path: '/new/ztfx'
  222. },
  223. {
  224. text: '风能利用率',
  225. icon: 'svg-wind-site',
  226. path: '/new/fnlyl'
  227. },
  228. {
  229. text: '维护损失率',
  230. icon: 'svg-wind-site',
  231. path: '/new/whssl'
  232. },
  233. {
  234. text: '故障损失率',
  235. icon: 'svg-wind-site',
  236. path: '/new/gzssl'
  237. },
  238. {
  239. text: '限电损失率',
  240. icon: 'svg-wind-site',
  241. path: '/new/xdssl'
  242. },
  243. {
  244. text: '性能损失率',
  245. icon: 'svg-wind-site',
  246. path: '/new/xnssl'
  247. },
  248. {
  249. text: '受累损失率',
  250. icon: 'svg-wind-site',
  251. path: '/new/slssl'
  252. },
  253. {
  254. text: 'MTBF分析',
  255. icon: 'svg-wind-site',
  256. path: '/new/mtbf'
  257. },
  258. {
  259. text: 'MTTR分析',
  260. icon: 'svg-wind-site',
  261. path: '/new/mttr'
  262. },
  263. {
  264. text: '复位及时率',
  265. icon: 'svg-wind-site',
  266. path: '/new/zfwjsl'
  267. },
  268. {
  269. text: '状态转换率',
  270. icon: 'svg-wind-site',
  271. path: '/new/zztzhl'
  272. },
  273. {
  274. text: '消缺及时率',
  275. icon: 'svg-wind-site',
  276. path: '/new/zxqjsl'
  277. },
  278. {
  279. text: '发电量分析',
  280. icon: 'svg-wind-site',
  281. path: '/new/zfdl'
  282. },
  283. {
  284. text: '综合场用电量',
  285. icon: 'svg-wind-site',
  286. path: '/new/zzhcydl'
  287. }
  288. ]
  289. } ,
  290. {
  291. text: "风机分析",
  292. icon: "svg-matrix",
  293. path: "/fjfx",
  294. children: [
  295. {
  296. text: '单机性能分析',
  297. icon: 'svg-wind-site',
  298. path: '/performanceAnalysis'
  299. },
  300. {
  301. text: '单机月度分析',
  302. icon: 'svg-wind-site',
  303. path: '/singleAnalysis'
  304. },
  305. ],
  306. },
  307. {
  308. text: '气象分析',
  309. icon: 'svg-wind-site',
  310. path: '/new/fs'
  311. },
  312. {
  313. text: '电量预测',
  314. icon: 'svg-wind-site',
  315. path: '/nhycfsdl',
  316. children: [
  317. {
  318. text: '预测拟合风速电量',
  319. icon: 'svg-wind-site',
  320. path: '/nhycfsdl'
  321. },
  322. {
  323. text: '修正预测风速电量',
  324. icon: 'svg-wind-site',
  325. path: '/xzycfsdl'
  326. }
  327. ]
  328. }
  329. // {
  330. // text: "单机分析",
  331. // icon: "svg-wind-site",
  332. // path: "/fgzyfx",
  333. // children: [
  334. // {
  335. // text: "单机分析详细",
  336. // icon: "svg-wind-site",
  337. // path: "/new/dj1",
  338. // },
  339. // {
  340. // text: "电量预测",
  341. // icon: "svg-wind-site",
  342. // path: "/new/pf1",
  343. // },
  344. // {
  345. // text: "气象预测",
  346. // icon: "svg-wind-site",
  347. // path: "/new/fs",
  348. // }
  349. // ]
  350. // }
  351. ]
  352. },
  353. {
  354. id: 'health',
  355. text: '智慧检修',
  356. data: [
  357. {
  358. text: '沙盘',
  359. icon: 'svg-wind-site',
  360. // path: '/monitor/sandtable'
  361. path: '/health'
  362. },
  363. {
  364. text: '等级评估',
  365. icon: 'svg-wind-site',
  366. path: '/assess/index'
  367. },
  368. {
  369. text: '故障诊断',
  370. icon: 'svg-wind-site',
  371. path: '/malfunctionDiagnose',
  372. children: [
  373. {
  374. text: '故障诊断',
  375. icon: 'svg-wind-site',
  376. path: '/malfunctionDiagnose'
  377. },
  378. {
  379. text: '故障回溯',
  380. icon: 'svg-wind-site',
  381. path: '/malfunctionRecall'
  382. },
  383. ]
  384. },
  385. {
  386. text: '健康管理',
  387. icon: 'svg-wind-site',
  388. path: '/health',
  389. children: [
  390. {
  391. text: '健康推荐',
  392. icon: 'svg-wind-site',
  393. path: '/health'
  394. },
  395. {
  396. text: '健康首页',
  397. icon: 'svg-wind-site',
  398. path: '/health/health2'
  399. },
  400. {
  401. text: '健康总览',
  402. icon: 'svg-wind-site',
  403. path: '/health/health6'
  404. },
  405. {
  406. text: '健康矩阵',
  407. icon: 'svg-wind-site',
  408. path: '/health/health5'
  409. },
  410. // {
  411. // text: "健康列表",
  412. // icon: "svg-wind-site",
  413. // path: "/health/health6",
  414. // },
  415. {
  416. text: '健康列表',
  417. icon: 'svg-wind-site',
  418. path: '/health/health8'
  419. }
  420. ]
  421. },
  422. {
  423. text: '全生命周期',
  424. icon: 'svg-wind-site',
  425. path: '/allLifeManage'
  426. }, {
  427. text: '能效分析',
  428. icon: 'svg-wind-site',
  429. path: '/powerCurve',
  430. children: [
  431. {
  432. text: '功率曲线拟合',
  433. icon: 'svg-wind-site',
  434. path: '/powerCurve'
  435. },
  436. {
  437. text: '偏航对风分析',
  438. icon: 'svg-wind-site',
  439. path: '/nxfx2'
  440. },
  441. {
  442. text: '切入切出分析',
  443. icon: 'svg-wind-site',
  444. path: '/cutAnalyse'
  445. },
  446. {
  447. text: '曲线偏差率分析',
  448. icon: 'svg-wind-site',
  449. path: '/qxpclfx'
  450. },
  451. {
  452. text: '单机饱和度',
  453. icon: 'svg-wind-site',
  454. path: '/wtSaturability'
  455. }
  456. ]
  457. },
  458. {
  459. text: '可靠性分析',
  460. icon: 'svg-wind-site',
  461. path: '/new/alarmcenter1',
  462. children: [
  463. {
  464. text: '预警分析',
  465. icon: 'svg-wind-site',
  466. path: '/new/alarmcenter1'
  467. },
  468. {
  469. text: '故障分析',
  470. icon: 'svg-wind-site',
  471. path: '/new/alarmcenter2'
  472. },
  473. {
  474. text: '预警评判分析',
  475. icon: 'svg-wind-site',
  476. path: '/warnStatistics'
  477. },
  478. {
  479. text: '故障评判分析',
  480. icon: 'svg-wind-site',
  481. path: '/malfunctionStatistics'
  482. },
  483. {
  484. text: '部件评判分析',
  485. icon: 'svg-wind-site',
  486. path: '/bjgltjb'
  487. },
  488. ]
  489. },
  490. {
  491. text: '风光资源分析',
  492. icon: 'svg-wind-site',
  493. path: '/windAnalysis',
  494. children: [
  495. {
  496. text: '风资源散点',
  497. icon: 'svg-wind-site',
  498. path: '/windAnalysis'
  499. },
  500. {
  501. text: '风资源风向',
  502. icon: 'svg-wind-site',
  503. path: '/windAnalysis/fx'
  504. }
  505. ]
  506. },
  507. ]
  508. },
  509. {
  510. id: 'personnel',
  511. text: '安全管控',
  512. data: [
  513. // ,
  514. // {
  515. // text: "五项损失率",
  516. // icon: "svg-matrix",
  517. // path: "/decision/decision2",
  518. // },
  519. // {
  520. // text: "场内对标",
  521. // icon: "svg-matrix",
  522. // path: "/decision/decision2Cndb",
  523. // },
  524. // {
  525. // text: "场际对标",
  526. // icon: "svg-matrix",
  527. // path: "/decision/decision2Cjdb",
  528. // },
  529. // {
  530. // text: "项目对标",
  531. // icon: "svg-matrix",
  532. // path: "/decision/decision2Xmdb",
  533. // },
  534. // {
  535. // text: "线路对标",
  536. // icon: "svg-matrix",
  537. // path: "/decision/decision2Xldb",
  538. // },
  539. // {
  540. // text: "性能对标",
  541. // icon: "svg-matrix",
  542. // path: "/decision/decision3",
  543. // },
  544. // {
  545. // text: "值际对标",
  546. // icon: "svg-matrix",
  547. // path: "/decision/decision4",
  548. // }
  549. {
  550. text: '安全管控',
  551. icon: 'svg-matrix',
  552. path: '/new/personnel',
  553. children: [
  554. {
  555. text: '人员矩阵',
  556. icon: 'svg-wind-site',
  557. path: '/new/personnel'
  558. },
  559. {
  560. text: '全局监视',
  561. icon: 'svg-wind-site',
  562. path: '/globalMonitor'
  563. }
  564. ]
  565. }
  566. ]
  567. },
  568. {
  569. id: 'bdzcx',
  570. text: '智能报表',
  571. data: [
  572. , {
  573. text: '报表首页',
  574. icon: 'svg-wind-site',
  575. path: '/reportPandect'
  576. },// 统计分析
  577. {
  578. text: '统计分析',
  579. icon: 'svg-matrix',
  580. path: '/tjfx',
  581. children: [
  582. {
  583. text: '统计分析',
  584. icon: 'svg-matrix',
  585. path: '/tjfx'
  586. },
  587. {
  588. text: '表底值查询',
  589. icon: 'svg-matrix',
  590. path: '/bdzcx'
  591. }
  592. ]
  593. },
  594. // 报表管理
  595. {
  596. text: '报表管理',
  597. icon: 'svg-matrix',
  598. path: '/bdzcx',
  599. children: [
  600. {
  601. text: 'OA日报',
  602. icon: 'svg-matrix',
  603. path: '/oafd'
  604. },
  605. {
  606. text: 'OA日报(光伏)',
  607. icon: 'svg-matrix',
  608. path: '/oagf'
  609. },
  610. {
  611. text: '新能源日报',
  612. icon: 'svg-matrix',
  613. path: '/xnyrb'
  614. },
  615. {
  616. text: '国电电力MISS日报(风电)',
  617. icon: 'svg-matrix',
  618. path: '/missfdrb'
  619. },
  620. {
  621. text: '国电电力MISS日报(光伏)',
  622. icon: 'svg-matrix',
  623. path: '/missgfrb'
  624. },
  625. {
  626. text: '新能源风电生产月报',
  627. icon: 'svg-matrix',
  628. path: '/xnyfdscyb'
  629. },
  630. {
  631. text: '麻黄山生产月报',
  632. icon: 'svg-matrix',
  633. path: '/mhsscyb'
  634. },
  635. {
  636. text: '牛首山生产月报',
  637. icon: 'svg-matrix',
  638. path: '/nssscyb'
  639. },
  640. {
  641. text: '青山生产月报',
  642. icon: 'svg-matrix',
  643. path: '/qsscyb'
  644. },
  645. {
  646. text: '石板泉生产月报',
  647. icon: 'svg-matrix',
  648. path: '/sbqscyb'
  649. },
  650. {
  651. text: '香山生产月报',
  652. icon: 'svg-matrix',
  653. path: '/xsscyb'
  654. },
  655. {
  656. text: '新能源光伏生产月报',
  657. icon: 'svg-matrix',
  658. path: '/xnygfscyb'
  659. },
  660. {
  661. text: '大武口生产月报',
  662. icon: 'svg-matrix',
  663. path: '/dwkscyb'
  664. },
  665. {
  666. text: '平罗生产月报',
  667. icon: 'svg-matrix',
  668. path: '/plscyb'
  669. },
  670. {
  671. text: '宣和生产月报',
  672. icon: 'svg-matrix',
  673. path: '/xhscyb'
  674. }
  675. ]
  676. },
  677. // 自定制报表管理
  678. {
  679. text: '自定制报表管理',
  680. icon: 'svg-matrix',
  681. path: '/fdczzdy',
  682. children: [
  683. {
  684. text: '风电场站自定义',
  685. icon: 'svg-matrix',
  686. path: '/fdczzdy'
  687. },
  688. {
  689. text: '风电项目自定义',
  690. icon: 'svg-matrix',
  691. path: '/fdxmzdy'
  692. },
  693. {
  694. text: '光伏场站自定义',
  695. icon: 'svg-matrix',
  696. path: '/gfczzdy'
  697. },
  698. {
  699. text: '光伏项目自定义',
  700. icon: 'svg-matrix',
  701. path: '/gfxmzdy'
  702. }
  703. ]
  704. }
  705. ]
  706. },
  707. {
  708. id: 'realSearch',
  709. text: '数据管理',
  710. data: [
  711. {
  712. text: '原始数据查询',
  713. icon: 'svg-wind-site',
  714. path: '/realSearch',
  715. children: [
  716. {
  717. text: '测点数据查询',
  718. icon: 'svg-wind-site',
  719. path: '/realSearch'
  720. },
  721. {
  722. text: '测点历史数据查询',
  723. icon: 'svg-wind-site',
  724. path: '/historySearch'
  725. }
  726. ]
  727. },
  728. {
  729. text: '预警记录',
  730. icon: 'svg-wind-site',
  731. path: '/new/alarmcenter',
  732. children: [
  733. {
  734. text: '预警管理',
  735. icon: 'svg-wind-site',
  736. path: '/new/alarmcenter'
  737. },
  738. {
  739. text: '停机事件管理',
  740. icon: 'svg-wind-site',
  741. path: '/new/tjsj'
  742. },
  743. {
  744. text: '限电管理',
  745. icon: 'svg-wind-site',
  746. path: '/new/xdgl'
  747. },
  748. {
  749. text: '升压站报警',
  750. icon: 'svg-wind-site',
  751. path: '/alarmCenter/boosterAlarm'
  752. },
  753. {
  754. text: 'SCADA报警',
  755. icon: 'svg-wind-site',
  756. path: '/alarmCenter/scadaAlarm'
  757. },
  758. {
  759. text: '自定义报警',
  760. icon: 'svg-wind-site',
  761. path: '/alarmCenter/customAlarm'
  762. },
  763. {
  764. text: '自定义报警统计',
  765. icon: 'svg-wind-site',
  766. path: '/alarmCenter/customStatistics'
  767. }
  768. ]
  769. },
  770. {
  771. text: '专家知识',
  772. icon: 'svg-wind-site',
  773. path: '/knowledge',
  774. children: [
  775. {
  776. text: '故障知识列表',
  777. icon: 'svg-matrix',
  778. path: '/knowledge'
  779. },
  780. {
  781. text: '安全措施知识',
  782. icon: 'svg-matrix',
  783. path: '/knowledge2'
  784. },
  785. {
  786. text: '排查检修方案',
  787. icon: 'svg-matrix',
  788. path: '/knowledge6'
  789. },
  790. {
  791. text: '预警知识',
  792. icon: 'svg-matrix',
  793. path: '/knowledge7'
  794. },
  795. {
  796. text: '特征参数',
  797. icon: 'svg-matrix',
  798. path: '/knowledge5'
  799. },
  800. {
  801. text: '风险辨识知识',
  802. icon: 'svg-matrix',
  803. path: '/knowledge3'
  804. },
  805. {
  806. text: '作业指导知识',
  807. icon: 'svg-matrix',
  808. path: '/knowledge4'
  809. }
  810. ]
  811. }
  812. ]
  813. }
  814. ],
  815. activeIndex: 0,
  816. isShowSubMenu: false,
  817. parentIndex: null,
  818. subMenu: [],
  819. subIndex: null
  820. }
  821. },
  822. methods: {
  823. click(index) {
  824. this.activeIndex = index
  825. this.subIndex = null
  826. },
  827. subMenuShow(children, index) {
  828. if (children) {
  829. this.isShowSubMenu = true
  830. this.parentIndex = index
  831. } else {
  832. this.isShowSubMenu = false
  833. this.parentIndex = null
  834. }
  835. this.subMenu = children
  836. },
  837. subMenuHide() {
  838. this.isShowSubMenu = false
  839. this.parentIndex = null
  840. // this.subMenu = [];
  841. },
  842. subclick(index) {
  843. this.activeIndex = this.parentIndex
  844. this.subIndex = index
  845. }
  846. },
  847. computed: {
  848. currentMenu() {
  849. let data = this.menuData.filter(t => {
  850. return t.id == this.currRoot
  851. })[0].data
  852. return data
  853. }
  854. },
  855. watch: {
  856. // 监听路由
  857. $route: {
  858. handler: function(val, oldVal) {
  859. this.menuData.some((element, index) => {
  860. if (val.path.includes(element.id)) {
  861. this.currRoot = element.id
  862. this.$nextTick(() => {
  863. this.currentMenu.some((element, index) => {
  864. if (val.path == element.path) {
  865. this.activeIndex = index
  866. }
  867. })
  868. })
  869. return true
  870. }
  871. })
  872. },
  873. //深度观察监听
  874. deep: true
  875. }
  876. }
  877. }
  878. </script>
  879. <style lang="less">
  880. .menu {
  881. padding-top: 1.481vh;
  882. .menu-list {
  883. margin: 0;
  884. padding: 0;
  885. list-style: none;
  886. .menu-item {
  887. padding: 1.481vh 0;
  888. text-align: center;
  889. .menu-icon {
  890. display: flex;
  891. justify-content: center;
  892. }
  893. &.active i {
  894. color: #05bb4c;
  895. transition: color 1s;
  896. }
  897. }
  898. }
  899. i {
  900. font-size: 2.222vh;
  901. color: rgba(255, 255, 255, 50%);
  902. }
  903. }
  904. .sub-menu {
  905. position: absolute;
  906. top: 0;
  907. left: 5.3704vh;
  908. width: 158px;
  909. height: 100%;
  910. padding-top: 1.481vh;
  911. background: fade(#192a26, 75);
  912. border-right: 1px solid fade(@green, 50);
  913. box-shadow: inset 11px 0px 20px 0px fade(#021412, 60);
  914. .menu-list {
  915. margin: 0;
  916. padding: 0;
  917. list-style: none;
  918. .menu-item {
  919. display: flex;
  920. text-align: center;
  921. line-height: 1.5;
  922. padding: 8px 0;
  923. background: #121d1c;
  924. a {
  925. display: flex;
  926. width: 100%;
  927. height: 100%;
  928. padding: 0 1.4815vh;
  929. font-size: @fontsize-s;
  930. text-decoration: unset;
  931. .menu-icon {
  932. display: flex;
  933. align-items: center;
  934. svg {
  935. width: 14px;
  936. height: 14px;
  937. use {
  938. fill: fade(@green, 75);
  939. }
  940. }
  941. }
  942. }
  943. &.active {
  944. background: #323e70;
  945. .menu-icon {
  946. display: flex;
  947. svg use {
  948. fill: fade(@white, 75);
  949. }
  950. }
  951. }
  952. .sub-menu-text {
  953. margin-left: 1.1111vh;
  954. color: @gray-l;
  955. }
  956. & + .menu-item {
  957. border-top: 1px solid fade(@darkgray, 40);
  958. }
  959. }
  960. }
  961. i {
  962. font-size: 2.222vh;
  963. color: rgba(255, 255, 255, 50%);
  964. }
  965. }
  966. </style>