Browse Source

首页增加一个开发环境时进入系统的入口

ZaiZai 2 years ago
parent
commit
fe8747bdb3
3 changed files with 28 additions and 37 deletions
  1. 1 1
      src/layout/index.vue
  2. 4 0
      src/layout/layout.scss
  3. 23 36
      src/views/home/index.vue

+ 1 - 1
src/layout/index.vue

@@ -42,7 +42,7 @@
                     <UserInfoBar></UserInfoBar>
                 </div>
             </el-header>
-            <el-main class="hc-main-box" id="hc-main-box">
+            <el-main class="hc-main-box" id="hc-main-box" :class="MenuBarKey">
                 <router-view v-slot="{ Component }" v-if="reloadRouter">
                     <transition name="fade-transform">
                         <keep-alive include="ProductList">

+ 4 - 0
src/layout/layout.scss

@@ -152,6 +152,10 @@
             height: 100%;
             --el-main-padding: 24px;
             margin-top: -24px;
+            &.home-index {
+                --el-main-padding: 0;
+                margin-top: 0;
+            }
         }
         &.home {
             color: #ffffff;

+ 23 - 36
src/views/home/index.vue

@@ -1,24 +1,5 @@
 <template>
     <div class="home-styles-box">
-        <!-- <div class="hc-home-input-box">
-            <div class="hc-home-content">
-                <div class="hc-slogan-icon">
-                    <img class="logo" :src="ImgText2" alt="">
-                     
-                </div>
-            </div>
-        </div> -->
-        <!-- <div class="head_div">
-            <div class="head_div_btn right1 runbtn" @click="gotoManager"   v-if="userRoleId == website.role_id">
-                进馆查看
-            </div>
-            <div class="head_div_btn right1 runbtn" @click="gotoQuery"  v-else>
-                进入管理
-            </div>
-            <div class="head_div_btn runbtn" @click="toLogOut">
-                退出登录
-            </div>
-        </div> -->
         <iframe src="http://visual.hczcxx.cn/view/1610205487507001345"  v-if="userRoleId == website.role_id"
                         class="iframe"
                         ref="iframe">
@@ -27,21 +8,24 @@
                         class="iframe"
                         ref="iframe">
         </iframe>
+
+        <div class="test-btn-view">
+            <el-button type="primary" hc-btn @click="gotoQuery">开发测试时的进入系统入口</el-button>
+        </div>
     </div>
 </template>
 
 <script setup>
-import {ref, watch} from "vue";
+import {onMounted, ref, watch} from "vue";
 import {useAppStore} from "~src/store";
 import router from '~src/router/index';
-import ImgText2 from "~src/assets/view/text-2.png";
 import website from '~src/config/index'
-import {RefreshToken,LogOut} from "~sto/user";
 
 //变量
 const useAppState = useAppStore()
 const HomeTheme = ref(useAppState.getHomeTheme);
 const userRoleId = ref(useAppState.getRoleId);
+const isDEV = ref(import.meta.env.DEV)
 
 //监听
 watch(() => [
@@ -49,17 +33,16 @@ watch(() => [
 ], ([theme]) => {
     HomeTheme.value = theme
 })
-const gotoManager=()=>{
-     router.push({path: '/user/project'});
-}
+
+onMounted(() => {
+    isDEV.value = import.meta.env.DEV
+    console.log(import.meta.env.DEV)
+})
+
 const gotoQuery=()=>{
      router.push({path: '/using/query'});
 }
-const toLogOut=async()=>{
-        await LogOut();
-        window.$message?.info('退出成功');
-        router.push({name:'login'});
-}
+
 </script>
 
 <style lang="scss" scoped>
@@ -67,9 +50,13 @@ const toLogOut=async()=>{
 </style>
 
 <style lang="scss">
-.home-styles-box{
-    margin-left:  -24px !important;
-    margin-right: -24px !important;
+.home-styles-box {
+    position: relative;
+    .test-btn-view {
+        position: absolute;
+        left: 45%;
+        bottom: 25px;
+    }
 }
 .home-link a {
     color: inherit;
@@ -81,14 +68,14 @@ const toLogOut=async()=>{
     border: 0;
     overflow: hidden;
     box-sizing: border-box;
-   
+
   }
   .head_div{
       width: 100%;
      display: flex;
      height: 80px;
      padding-bottom: 15px;
-  
+
       background-color:rgb(4, 13, 56);
       .head_div_btn{
           position: absolute;
@@ -132,7 +119,7 @@ const toLogOut=async()=>{
 
 .runbtn{
      cursor: pointer;
-    
+
 }
 .runbtn:hover{
      animation: tada 1s;