openpage.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <!-- 打开页-->
  3. <div class="openpage">
  4. <el-header>
  5. <myheader />
  6. </el-header>
  7. <!-- 主要内容 -->
  8. <div class="user lbg_color2">
  9. <div class="container border">
  10. <div class="user-slider lbg_color3 el-menu ">
  11. <el-menu class="lbg_color3 menuclass" :router='true' :default-active="activeIndex" @select="Select">
  12. <div class="ve_logo_img">
  13. <!-- <el-image
  14. style="height: 100%"
  15. :src="logo"
  16. fit="contain"
  17. ></el-image> -->
  18. </div>
  19. <h3 class="zjmian"><el-button @click="gohome()"><el-image
  20. style="height: 100%"
  21. :src="leftjt"
  22. fit="contain"
  23. ></el-image>主界面</el-button></h3>
  24. <el-menu-item index="/home/newfile">新建</el-menu-item>
  25. <el-menu-item index="/home/querylist" >打开</el-menu-item>
  26. <el-menu-item index="/home/savefile" >保存</el-menu-item>
  27. <el-menu-item >另存</el-menu-item>
  28. <el-menu-item >信息</el-menu-item>
  29. <el-menu-item >帮助</el-menu-item>
  30. </el-menu>
  31. </div>
  32. <section class="user-main ">
  33. <router-view > </router-view>
  34. </section>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script setup>
  40. import { ref, onMounted, reactive,computed } from "vue";
  41. import { RouterView, RouterLink,useRouter } from "vue-router"
  42. import { request, uploadFile } from "@/utils/request";
  43. import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
  44. import myheader from "@/components/header.vue"
  45. import logo from "@/assets/logo.png";
  46. import leftjt from "@/assets/flowimg/111.png";
  47. const router = useRouter();
  48. let dateKeyref=ref(new Date().getTime())
  49. // defaultPage: '/project',
  50. let defaultPage=ref('/home/newfile');
  51. const activeIndex=computed(()=>{
  52. const path = router.currentRoute.value.fullPath
  53. console.log(path);
  54. if (path === '/') {
  55. router.replace({ path: defaultPage.value })
  56. }
  57. return path
  58. })
  59. function Select(key) {
  60. router.replace({ path: key })
  61. if(key=='/home/querylist'){
  62. console.log(11111)
  63. }
  64. }
  65. const gohome = () => {
  66. let objlist = JSON.parse(sessionStorage.getItem("objlist"));
  67. router.push({path:"/home",query:{pid:objlist.pid}});
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .zjmian{
  72. padding: 10px;
  73. text-align: left;
  74. color: #FFD153;
  75. font-weight: 600;
  76. font-size: 16px;
  77. span{
  78. margin-right: 12px;
  79. }
  80. .el-image{
  81. // margin-bottom: 5px;
  82. width: 20px;
  83. margin-right: 8px;
  84. }
  85. .el-button{
  86. color: #FFD153;
  87. background-color: #2267B1;
  88. border: none;
  89. padding: 8px 15px 8px 7px;
  90. font-size: 18px;
  91. font-family: 'Source Sans Pro-Regular';
  92. }
  93. }
  94. .ve_logo_img{
  95. text-align: center;
  96. }
  97. .user{
  98. width: 100%;
  99. height: calc(100vh - 40px);
  100. }
  101. .user .container .user-slider{
  102. width: 190px;
  103. height: 100%;
  104. padding-top: 20px;
  105. }
  106. .user-slider {
  107. .el-menu {
  108. border: none;
  109. &-item {
  110. height: 36px;
  111. line-height: 36px;
  112. font-size: 16px;
  113. text-align: center;
  114. color: #b6b6b6;
  115. &.is-active {
  116. color:red;
  117. background: #2267B1;
  118. }
  119. }
  120. }
  121. .menuclass {
  122. background-color:rgba(0, 0, 0, 0)
  123. }
  124. }
  125. .lbg_color3{
  126. background: #2267B1;
  127. }
  128. .border .el-menu{
  129. border: none;
  130. .el-menu-item{
  131. color: #fff;
  132. padding: 0 45px !important;
  133. font-family: 'Source Sans-Regular';
  134. font-size: 16px;
  135. }
  136. }
  137. .user .container .user-main{
  138. width: calc(100% - 190px);
  139. height: 100%;
  140. background: #Fff;
  141. padding: 10px;
  142. }
  143. .user .container{
  144. display: -webkit-box;
  145. display: -ms-flexbox;
  146. display: flex;
  147. -webkit-box-pack: justify;
  148. -ms-flex-pack: justify;
  149. justify-content: space-between;
  150. -webkit-box-align: center;
  151. -ms-flex-align: center;
  152. align-items: center;
  153. width: 100%;
  154. height: 100%;
  155. }
  156. .user-slider .el-menu-item.is-active{
  157. color: #333;
  158. background: #ecf5ff;
  159. }
  160. .user-slider .el-menu-item:hover{
  161. color: #FFD153;
  162. }
  163. </style>