Menu.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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 }" @mouseenter="subMenuShow(menu.children, index)">
  5. <router-link v-if="!menu.children" :to="menu.path">
  6. <el-tooltip class="item" effect="dark" :content="menu.text" placement="right" :show-after="500">
  7. <div class="menu-icon svg-icon" :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
  8. <SvgIcon :svgid="menu.icon"></SvgIcon>
  9. </div>
  10. </el-tooltip>
  11. </router-link>
  12. <div v-if="menu.children" class="sub-menu-item">
  13. <div class="menu-icon svg-icon" :class="activeIndex == index ? 'svg-icon-green' : 'svg-icon-gray'">
  14. <SvgIcon :svgid="menu.icon"></SvgIcon>
  15. </div>
  16. </div>
  17. </li>
  18. </ul>
  19. </div>
  20. <div class="sub-menu" v-show="isShowSubMenu" @mouseleave="subMenuHide">
  21. <ul class="menu-list">
  22. <li class="menu-item" v-for="(menu, index) of subMenu" @click="subclick(index)" :key="menu" :class="{ active: subIndex == index }">
  23. <router-link :to="menu.path">
  24. <div class="menu-icon svg-icon">
  25. <SvgIcon :svgid="menu.icon"></SvgIcon>
  26. </div>
  27. <div class="sub-menu-text" :class="subIndex == index ? 'green' : 'gray'">{{ menu.text }}</div>
  28. </router-link>
  29. </li>
  30. </ul>
  31. </div>
  32. </template>
  33. <script>
  34. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  35. export default {
  36. components: {
  37. SvgIcon,
  38. },
  39. props: {},
  40. data() {
  41. return {
  42. currRoot: "monitor",
  43. menuData: [
  44. {
  45. id: "monitor",
  46. text: "状态监视",
  47. data: [
  48. {
  49. text: "驾驶舱",
  50. icon: "svg-lead-cockpit",
  51. path: "/monitor/home",
  52. },
  53. {
  54. text: "基础矩阵",
  55. icon: "svg-matrix",
  56. path: "/monitor/lightmatrix1",
  57. },
  58. {
  59. text: "明细矩阵",
  60. icon: "svg-mx-matrix",
  61. path: "/monitor/lightmatrix3",
  62. },
  63. {
  64. text: "欠发矩阵",
  65. icon: "svg-qf-matrix",
  66. path: "/monitor/lightmatrix2",
  67. },
  68. {
  69. text: "光伏矩阵",
  70. icon: "svg-gf-matrix",
  71. path: "/monitor/lightmatrix",
  72. },
  73. {
  74. text: "状态监视",
  75. icon: "svg-state-watch",
  76. path: "/monitor/status",
  77. },
  78. {
  79. text: "Agc",
  80. icon: "svg-agc",
  81. path: "/monitor/agc",
  82. },
  83. {
  84. text: "风场",
  85. icon: "svg-wind-site",
  86. path: "/monitor/windsite/home/MHS_FDC",
  87. },
  88. ],
  89. },
  90. {
  91. id: "realSearch",
  92. text: "数据管理",
  93. data: [
  94. {
  95. text: "原始数据查询",
  96. icon: "svg-wind-site",
  97. path: "/yssjcx",
  98. children: [
  99. {
  100. text: "测点数据查询",
  101. icon: "svg-wind-site",
  102. path: "/realSearch"
  103. },
  104. {
  105. text: "测点历史数据查询",
  106. icon: "svg-wind-site",
  107. path: "/historySearch"
  108. }
  109. ]
  110. }
  111. ],
  112. },
  113. {
  114. id: "singleAnalysis",
  115. text: "统计分析",
  116. data: [
  117. {
  118. text: "能效分析",
  119. icon: "svg-wind-site",
  120. path: "/nxfx",
  121. children: [
  122. {
  123. text: "功率曲线拟合",
  124. icon: "svg-wind-site",
  125. path: "/nxfx1",
  126. },
  127. {
  128. text: "偏航对风分析",
  129. icon: "svg-wind-site",
  130. path: "/nxfx2",
  131. },
  132. {
  133. text: "切入切出分析",
  134. icon: "svg-wind-site",
  135. path: "/cutAnalyse",
  136. },
  137. {
  138. text: "曲线偏差率分析",
  139. icon: "svg-wind-site",
  140. path: "/nxfx4",
  141. },
  142. {
  143. text: "单机性能分析",
  144. icon: "svg-wind-site",
  145. path: "/performanceAnalysis",
  146. },
  147. {
  148. text: "单机月度分析",
  149. icon: "svg-wind-site",
  150. path: "/singleAnalysis",
  151. },
  152. {
  153. text: "单机饱和度",
  154. icon: "svg-wind-site",
  155. path: "/wtSaturability",
  156. }
  157. ]
  158. },
  159. {
  160. text: "风光资源分析",
  161. icon: "svg-wind-site",
  162. path: "/fgzyfx",
  163. children: [
  164. {
  165. text: "风资源分析",
  166. icon: "svg-wind-site",
  167. path: "/windAnalysis",
  168. }
  169. ]
  170. },
  171. {
  172. text: "单机分析",
  173. icon: "svg-wind-site",
  174. path: "/fgzyfx",
  175. children: [
  176. {
  177. text: "单机分析详细",
  178. icon: "svg-wind-site",
  179. path: "/new/dj1",
  180. },
  181. {
  182. text: "电量预测",
  183. icon: "svg-wind-site",
  184. path: "/new/pf1",
  185. },
  186. {
  187. text: "气象预测",
  188. icon: "svg-wind-site",
  189. path: "/new/fs",
  190. }
  191. ]
  192. }
  193. ],
  194. },
  195. {
  196. id: "health",
  197. text: "健康管理",
  198. data: [
  199. {
  200. text: "健康管理",
  201. icon: "svg-wind-site",
  202. path: "/health",
  203. children: [
  204. {
  205. text: "健康推荐",
  206. icon: "svg-wind-site",
  207. path: "/health",
  208. },
  209. {
  210. text: "健康首页",
  211. icon: "svg-wind-site",
  212. path: "/health/health2",
  213. },
  214. {
  215. text: "健康总览",
  216. icon: "svg-wind-site",
  217. path: "/health/health6",
  218. },
  219. {
  220. text: "健康矩阵",
  221. icon: "svg-wind-site",
  222. path: "/health/health5",
  223. },
  224. // {
  225. // text: "健康列表",
  226. // icon: "svg-wind-site",
  227. // path: "/health/health6",
  228. // },
  229. {
  230. text: "健康列表",
  231. icon: "svg-wind-site",
  232. path: "/health/health8",
  233. },
  234. ],
  235. },
  236. ],
  237. },
  238. {
  239. id: "decision",
  240. text: "决策支持",
  241. data: [
  242. {
  243. text: "风机绩效榜",
  244. icon: "svg-matrix",
  245. path: "/decision/decision1",
  246. },
  247. {
  248. text: "五项损失率",
  249. icon: "svg-matrix",
  250. path: "/decision/decision2",
  251. },
  252. {
  253. text: "场内对标",
  254. icon: "svg-matrix",
  255. path: "/decision/decision2Cndb",
  256. },
  257. {
  258. text: "场际对标",
  259. icon: "svg-matrix",
  260. path: "/decision/decision2Cjdb",
  261. },
  262. {
  263. text: "项目对标",
  264. icon: "svg-matrix",
  265. path: "/decision/decision2Xmdb",
  266. },
  267. {
  268. text: "线路对标",
  269. icon: "svg-matrix",
  270. path: "/decision/decision2Xldb",
  271. },
  272. // {
  273. // text: "决策支持3",
  274. // icon: "svg-matrix",
  275. // path: "/decision/decision3",
  276. // },
  277. // {
  278. // text: "决策支持4",
  279. // icon: "svg-matrix",
  280. // path: "/decision/decision4",
  281. // },
  282. {
  283. text: "排行榜",
  284. icon: "svg-matrix",
  285. path: "/phb",
  286. children: [
  287. {
  288. text: "发电效率排行",
  289. icon: "svg-wind-site",
  290. path: "/powerRank",
  291. },
  292. {
  293. text: "总发电效率排行",
  294. icon: "svg-wind-site",
  295. path: "/totalPowerRank",
  296. },
  297. {
  298. text: "报警排行",
  299. icon: "svg-wind-site",
  300. path: "/warningRank",
  301. }
  302. ]
  303. },
  304. // 三率管理
  305. {
  306. text:'三率管理',
  307. icon:'svg-matrix',
  308. path:'/slgl',
  309. children:[
  310. {
  311. text:'复位及时率',
  312. icon:'svg-wind-site',
  313. path:'/fwjsl'
  314. },
  315. {
  316. text:'状态转换率',
  317. icon:'svg-wind-site',
  318. path:'/ztzhl'
  319. },
  320. {
  321. text:'消缺及时率',
  322. icon:'svg-wind-site',
  323. path:'/xqjsl'
  324. }
  325. ]
  326. }
  327. ],
  328. },
  329. {
  330. id: "knowledge",
  331. text: "知识管理",
  332. data: [
  333. {
  334. text: "故障知识列表",
  335. icon: "svg-matrix",
  336. path: "/knowledge",
  337. },
  338. {
  339. text: "安全措施知识",
  340. icon: "svg-matrix",
  341. path: "/knowledge2",
  342. },
  343. {
  344. text: "排查检修方案",
  345. icon: "svg-matrix",
  346. path: "/knowledge6",
  347. },
  348. {
  349. text: "预警知识",
  350. icon: "svg-matrix",
  351. path: "/knowledge7",
  352. },
  353. {
  354. text: "特征参数",
  355. icon: "svg-matrix",
  356. path: "/knowledge5",
  357. },
  358. {
  359. text: "风险辨识知识",
  360. icon: "svg-matrix",
  361. path: "/knowledge3",
  362. },
  363. {
  364. text: "作业指导知识",
  365. icon: "svg-matrix",
  366. path: "/knowledge4",
  367. }
  368. ],
  369. },
  370. {
  371. id: "report",
  372. text: "智能报表",
  373. data: [],
  374. },
  375. ],
  376. activeIndex: 0,
  377. isShowSubMenu: false,
  378. parentIndex: null,
  379. subMenu: [],
  380. subIndex: null,
  381. };
  382. },
  383. methods: {
  384. click(index) {
  385. this.activeIndex = index;
  386. this.subIndex = null;
  387. },
  388. subMenuShow(children, index) {
  389. if (children) {
  390. this.isShowSubMenu = true;
  391. this.parentIndex = index;
  392. } else {
  393. this.isShowSubMenu = false;
  394. this.parentIndex = null;
  395. }
  396. this.subMenu = children;
  397. },
  398. subMenuHide() {
  399. this.isShowSubMenu = false;
  400. this.parentIndex = null;
  401. this.subMenu = [];
  402. },
  403. subclick(index) {
  404. this.activeIndex = this.parentIndex;
  405. this.subIndex = index;
  406. },
  407. },
  408. computed: {
  409. currentMenu() {
  410. let data = this.menuData.filter((t) => {
  411. return t.id == this.currRoot;
  412. })[0].data;
  413. return data;
  414. },
  415. },
  416. watch: {
  417. // 监听路由
  418. $route: {
  419. handler: function(val, oldVal) {
  420. this.menuData.some((element, index) => {
  421. if (val.path.includes(element.id)) {
  422. this.currRoot = element.id;
  423. this.$nextTick(() => {
  424. this.currentMenu.some((element, index) => {
  425. if (val.path == element.path) {
  426. this.activeIndex = index;
  427. }
  428. });
  429. });
  430. return true;
  431. }
  432. });
  433. },
  434. //深度观察监听
  435. deep: true,
  436. },
  437. },
  438. };
  439. </script>
  440. <style lang="less">
  441. .menu {
  442. padding-top: 1.481vh;
  443. .menu-list {
  444. margin: 0;
  445. padding: 0;
  446. list-style: none;
  447. .menu-item {
  448. padding: 1.481vh 0;
  449. text-align: center;
  450. .menu-icon {
  451. display: flex;
  452. justify-content: center;
  453. }
  454. &.active i {
  455. color: #05bb4c;
  456. transition: color 1s;
  457. }
  458. }
  459. }
  460. i {
  461. font-size: 2.222vh;
  462. color: rgba(255, 255, 255, 50%);
  463. }
  464. }
  465. .sub-menu {
  466. position: absolute;
  467. top: 0;
  468. left: 5.3704vh;
  469. width: 138px;
  470. height: 100%;
  471. padding-top: 1.481vh;
  472. background: fade(#192a26, 75);
  473. border-right: 1px solid fade(@green, 50);
  474. box-shadow: inset 11px 0px 20px 0px fade(#021412, 60);
  475. .menu-list {
  476. margin: 0;
  477. padding: 0;
  478. list-style: none;
  479. .menu-item {
  480. display: flex;
  481. text-align: center;
  482. line-height: 1.5;
  483. padding: 8px 0;
  484. background: #121d1c;
  485. a {
  486. display: flex;
  487. width: 100%;
  488. height: 100%;
  489. padding: 0 1.4815vh;
  490. font-size: @fontsize-s;
  491. text-decoration: unset;
  492. .menu-icon {
  493. display: flex;
  494. align-items: center;
  495. svg {
  496. width: 14px;
  497. height: 14px;
  498. use {
  499. fill: fade(@green, 75);
  500. }
  501. }
  502. }
  503. }
  504. &.active {
  505. background: #323e70;
  506. .menu-icon {
  507. display: flex;
  508. svg use {
  509. fill: fade(@white, 75);
  510. }
  511. }
  512. }
  513. .sub-menu-text {
  514. margin-left: 1.1111vh;
  515. color: @gray-l;
  516. }
  517. & + .menu-item {
  518. border-top: 1px solid fade(@darkgray, 40);
  519. }
  520. }
  521. }
  522. i {
  523. font-size: 2.222vh;
  524. color: rgba(255, 255, 255, 50%);
  525. }
  526. }
  527. </style>