openpage.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. // console.log("objlist的值:",objlist);
  68. router.push({path:"/home",query:{id:'2',pid:objlist.pid}});
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .zjmian{
  73. padding: 10px;
  74. text-align: left;
  75. color: #FFD153;
  76. font-weight: 600;
  77. font-size: 16px;
  78. span{
  79. margin-right: 12px;
  80. }
  81. .el-image{
  82. // margin-bottom: 5px;
  83. width: 20px;
  84. margin-right: 8px;
  85. }
  86. .el-button{
  87. color: #FFD153;
  88. background-color: #2267B1;
  89. border: none;
  90. padding: 8px 15px 8px 7px;
  91. font-size: 18px;
  92. font-family: 'Microsoft YaHei';
  93. }
  94. }
  95. .ve_logo_img{
  96. text-align: center;
  97. }
  98. .user{
  99. width: 100%;
  100. height: calc(100vh - 40px);
  101. }
  102. .user .container .user-slider{
  103. width: 190px;
  104. height: 100%;
  105. padding-top: 20px;
  106. }
  107. .user-slider {
  108. .el-menu {
  109. border: none;
  110. &-item {
  111. height: 36px;
  112. line-height: 36px;
  113. font-size: 16px;
  114. text-align: center;
  115. color: #b6b6b6;
  116. &.is-active {
  117. color:red;
  118. background: #2267B1;
  119. }
  120. }
  121. }
  122. .menuclass {
  123. background-color:rgba(0, 0, 0, 0)
  124. }
  125. }
  126. .lbg_color3{
  127. background: #2267B1;
  128. }
  129. .border .el-menu{
  130. border: none;
  131. .el-menu-item{
  132. color: #fff;
  133. padding: 0 45px !important;
  134. font-family: 'Microsoft YaHei';
  135. font-size: 16px;
  136. }
  137. }
  138. .user .container .user-main{
  139. width: calc(100% - 190px);
  140. height: 100%;
  141. background: #Fff;
  142. padding: 10px;
  143. }
  144. .user .container{
  145. display: -webkit-box;
  146. display: -ms-flexbox;
  147. display: flex;
  148. -webkit-box-pack: justify;
  149. -ms-flex-pack: justify;
  150. justify-content: space-between;
  151. -webkit-box-align: center;
  152. -ms-flex-align: center;
  153. align-items: center;
  154. width: 100%;
  155. height: 100%;
  156. }
  157. .user-slider .el-menu-item.is-active{
  158. color: #333;
  159. background: #ecf5ff;
  160. }
  161. .user-slider .el-menu-item:hover{
  162. color: #FFD153;
  163. }
  164. </style>