Menu.vue 27 KB

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