pageMenu.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <div class="pageMenu" v-bind:class="{ widthFold: menuFold }">
  3. <div class="panel">
  4. <div class="icon" v-show="!menuFold" @click="menuFoldHandle()">
  5. <b></b>
  6. </div>
  7. <div class="iconFold" v-show="menuFold" @click="menuFoldHandle(1)">
  8. <b></b>
  9. </div>
  10. <ul class="menuFold" v-show="menuFold">
  11. <li
  12. @click="menuFoldHandle(1)"
  13. v-bind:class="{ isOpened: opened === 'modelLibrary' }"
  14. >
  15. <b class="my-icon-menuA is"></b>
  16. </li>
  17. <li
  18. @click="menuFoldHandle(1)"
  19. v-bind:class="{ isOpened: opened === 'algorithmsLibrary' }"
  20. >
  21. <b class="my-icon-menuB"></b>
  22. </li>
  23. <li
  24. @click="menuFoldHandle(1)"
  25. v-bind:class="{ isOpened: opened === 'sceneLibrary' }"
  26. >
  27. <b class="my-icon-menuC"></b>
  28. </li>
  29. <li
  30. @click="menuFoldHandle(1)"
  31. v-bind:class="{ isOpened: opened === 'systemManagement' }"
  32. >
  33. <b class="my-icon-menuD"></b>
  34. </li>
  35. <li
  36. @click="menuFoldHandle(1)"
  37. v-bind:class="{ isOpened: opened === 'systemManagement' }"
  38. >
  39. <b class="my-icon-menuE"></b>
  40. </li>
  41. <li
  42. @click="menuFoldHandle(1)"
  43. v-bind:class="{ isOpened: opened === 'systemManagement' }"
  44. >
  45. <b class="my-icon-menuF"></b>
  46. </li>
  47. </ul>
  48. <div class="menuList" v-show="!menuFold">
  49. <el-menu
  50. default-active="modelLibrary"
  51. class="el-menu-vertical-demo"
  52. background-color="#3397FF"
  53. :router="true"
  54. @select="menuSel"
  55. >
  56. <!-- active-text-color="#ffffff" -->
  57. <el-submenu index="modelLibrary">
  58. <template slot="title">
  59. <i class="my-icon-menuA"></i>
  60. <span>模型库</span>
  61. </template>
  62. <el-menu-item index="sensorModel"
  63. >传感器模型</el-menu-item
  64. >
  65. <el-menu-item index="vehicleModel"
  66. >车辆模型</el-menu-item
  67. >
  68. <el-menu-item index="vehicleConfigurationList"
  69. >车辆配置</el-menu-item
  70. >
  71. </el-submenu>
  72. <el-submenu index="algorithmsLibrary">
  73. <template slot="title">
  74. <i class="my-icon-menuB"></i>
  75. <span>算法库</span>
  76. </template>
  77. <el-menu-item index="algorithmsLibraryList"
  78. >算法库列表</el-menu-item
  79. >
  80. </el-submenu>
  81. <el-submenu index="sceneLibrary">
  82. <template slot="title">
  83. <i class="my-icon-menuC"></i>
  84. <span>场景库</span>
  85. </template>
  86. <el-menu-item index="naturalDrivingScenarioList"
  87. >自然驾驶场景</el-menu-item
  88. >
  89. <el-menu-item
  90. index="standardRegulationSimulationScenarioList"
  91. >标准法规仿真场景</el-menu-item
  92. >
  93. <el-menu-item
  94. index="trafficAccidentSimulationScenarioList"
  95. >交通事故仿真场景</el-menu-item
  96. >
  97. <el-menu-item index="scenarioTestPackageManagementList"
  98. >场景测试包管理</el-menu-item
  99. >
  100. <el-menu-item index="gradingRulesList"
  101. >打分规则</el-menu-item
  102. >
  103. </el-submenu>
  104. <el-submenu index="workManagement">
  105. <template slot="title">
  106. <i class="my-icon-menuD"></i>
  107. <span>工作管理</span>
  108. </template>
  109. <el-menu-item index="manualRunProjectList"
  110. >手动运行项目</el-menu-item
  111. >
  112. </el-submenu>
  113. <!-- <el-submenu index="systemManagement">
  114. <template slot="title">
  115. <i class="my-icon-menuF"></i>
  116. <span>系统管理</span>
  117. </template>
  118. <el-menu-item index="accountManagement"
  119. >账户管理</el-menu-item
  120. >
  121. </el-submenu> -->
  122. </el-menu>
  123. </div>
  124. </div>
  125. <div class="fold" v-show="menuFold">
  126. <img :src="imgSrc" width="100%" height="100%" />
  127. </div>
  128. <div class="unfold" v-show="!menuFold">
  129. <img :src="imgSrc" width="100%" height="100%" />
  130. </div>
  131. </div>
  132. </template>
  133. <script>
  134. export default {
  135. name: "pageMenu",
  136. data() {
  137. return {
  138. menuFold: false, // menu是否折叠
  139. opened: false,
  140. imgSrc: require("@/assets/common/image/photoF.png"),
  141. };
  142. },
  143. methods: {
  144. menuFoldHandle(val) {
  145. if (val) {
  146. this.menuFold = false;
  147. } else {
  148. this.menuFold = true;
  149. }
  150. this.$emit("menuFold", this.menuFold);
  151. },
  152. menuSel(index, indexPath) {
  153. // console.log(index, indexPath);
  154. this.opened = indexPath[0];
  155. },
  156. },
  157. created() {
  158. localStorage.setItem(
  159. "Authorization",
  160. "Bearer 9882c634-9af6-4647-89dc-8ad53c04a56b"
  161. );
  162. // document.cookie = 'Authorization=Bearer 52de2c22-c2f9-4307-b49d-5b5593792352'
  163. // console.log(this.$route);
  164. /* let { code, ticket } = this.$route.query;
  165. if (code && ticket) {
  166. this.$axios({
  167. method: "post",
  168. url: this.$api.common.single,
  169. data: { code, ticket },
  170. }).then((res) => {
  171. if (res.code == 200 && !!res.info.access_token) {
  172. localStorage.setItem(
  173. "Authorization",
  174. "Bearer " + res.info.access_token
  175. );
  176. } else {
  177. alert(res);
  178. }
  179. });
  180. } else {
  181. console.log(66);
  182. } */
  183. },
  184. };
  185. </script>
  186. <style scoped lang="less">
  187. .pageMenu {
  188. position: absolute;
  189. top: 0;
  190. left: 0;
  191. right: 0;
  192. bottom: 0;
  193. z-index: 6;
  194. width: 150px;
  195. height: 100%;
  196. [class^="my-icon-"] {
  197. vertical-align: middle;
  198. text-align: center;
  199. font-size: 18px;
  200. background-size: contain;
  201. }
  202. }
  203. .widthFold {
  204. width: 60px;
  205. }
  206. .panel {
  207. position: absolute;
  208. left: 0;
  209. top: 0;
  210. bottom: 0;
  211. z-index: 9;
  212. width: 100%;
  213. height: 100%;
  214. background: @themeColor;
  215. }
  216. .icon,
  217. .iconFold {
  218. display: flex;
  219. align-items: center;
  220. justify-content: center;
  221. height: 61px;
  222. border-bottom: 1px solid #ffffff;
  223. cursor: pointer;
  224. b {
  225. display: block;
  226. background-size: contain;
  227. }
  228. }
  229. .iconFold {
  230. width: 60px;
  231. b {
  232. width: 28px;
  233. height: 38px;
  234. background: url("../../assets/common/image/menu/iconFold.png") center
  235. no-repeat;
  236. }
  237. }
  238. .icon {
  239. width: 150px;
  240. b {
  241. width: 98px;
  242. height: 27px;
  243. background: url("../../assets/common/image/menu/icon.png") center
  244. no-repeat;
  245. }
  246. }
  247. .el-submenu [class^="my-icon-"] {
  248. width: 24px;
  249. height: 18px;
  250. margin-right: 5px;
  251. }
  252. .my-icon-menuA {
  253. background: url("../../assets/common/image/menu/menuA.png") center no-repeat;
  254. }
  255. .my-icon-menuB {
  256. background: url("../../assets/common/image/menu/menuB.png") center no-repeat;
  257. }
  258. .my-icon-menuC {
  259. background: url("../../assets/common/image/menu/menuC.png") center no-repeat;
  260. }
  261. .my-icon-menuD {
  262. background: url("../../assets/common/image/menu/menuD.png") center no-repeat;
  263. }
  264. .my-icon-menuE {
  265. background: url("../../assets/common/image/menu/menuE.png") center no-repeat;
  266. }
  267. .my-icon-menuF {
  268. background: url("../../assets/common/image/menu/menuF.png") center no-repeat;
  269. }
  270. .menuFold {
  271. li {
  272. display: flex;
  273. align-items: center;
  274. justify-content: center;
  275. height: 40px;
  276. margin-top: 20px;
  277. cursor: pointer;
  278. b {
  279. display: block;
  280. width: 20px;
  281. height: 20px;
  282. }
  283. }
  284. .isOpened {
  285. background-color: #2979cc;
  286. }
  287. }
  288. .el-menu {
  289. // background: @themeColor;
  290. /deep/ .el-submenu__title,
  291. .el-menu-item {
  292. color: #D7E7FE;
  293. &.is-active {
  294. color: #ffffff;
  295. font-weight: bold;
  296. }
  297. }
  298. /deep/ .el-submenu__title {
  299. padding-left: 15px !important;
  300. padding-right: 10px;
  301. span {
  302. color: #ffffff;
  303. }
  304. }
  305. /deep/ .el-submenu__icon-arrow {
  306. right: 10px;
  307. }
  308. /deep/ .el-submenu__title i,
  309. /deep/ .el-menu-item i {
  310. color: #ffffff;
  311. }
  312. /deep/ .el-submenu .el-menu-item {
  313. min-width: auto;
  314. width: 100%;
  315. padding: 0;
  316. padding-left: 30px !important;
  317. }
  318. }
  319. .el-submenu.is-active {
  320. /deep/ .el-submenu__title {
  321. background-color: #2979cc !important;
  322. }
  323. }
  324. .el-submenu.is-active.is-opened {
  325. /deep/ .el-submenu__title {
  326. background-color: @themeColor !important;
  327. }
  328. }
  329. .el-submenu.is-opened {
  330. .el-menu,
  331. .el-menu-item {
  332. background-color: #2979cc !important;
  333. }
  334. }
  335. .hasList {
  336. // /deep/ .el-submenu__title
  337. /deep/ .el-menu-item {
  338. color: #d7e7fe;
  339. }
  340. /deep/ .is-active {
  341. background-color: #3982eb !important;
  342. color: #ffffff;
  343. }
  344. }
  345. .userIcon {
  346. > div {
  347. position: fixed;
  348. bottom: 30px;
  349. }
  350. }
  351. .fold,
  352. .unfold {
  353. position: fixed;
  354. bottom: 30px;
  355. z-index: 12;
  356. border-radius: 50%;
  357. cursor: pointer;
  358. overflow: hidden;
  359. }
  360. .fold {
  361. width: 36px;
  362. height: 36px;
  363. left: 12px;
  364. }
  365. .unfold {
  366. width: 60px;
  367. height: 60px;
  368. left: 35px;
  369. }
  370. </style>