Menu.vue 14 KB

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