11wqe1 2 mesi fa
parent
commit
7f003245f6

BIN
src/assets/img/moren.png


+ 115 - 58
src/components/sidebarL.vue

@@ -1,58 +1,62 @@
 <template>
-        <div class="left">
-            <div class="logo2">
-                <img :src="fromL.basics.logo" alt="">
-            </div>
-            <div class="ulT">
+        <div style="position: relative;height: 100%;">
+            <div class="left">
+                <div class="logo2">
+                    <img :src="fromL.basics.logo ? fromL.basics.logo : require('../assets/img/moren.png')" alt="">
+                </div>
+                <div class="ulT">
 
-                <!-- 默认首页 -->
-                <div @click.stop="goto(0)" :style="{background :activeL === 0 ?'#E6F0FF':'',zIndex : 10000 }">
-                    <div class="menu_left">
-                        <img  class="logo" :src="activeL === 0 ? require('../assets/img/sy1.svg') : require('../assets/img/sy.svg')" alt="">
-                        <span  :style="{color : activeL === 0 ? '#0051D7' :''}">首页</span>
+                    <!-- 默认首页 -->
+                    <div @click.stop="goto(0)" :style="{background :activeL === 0 ?'#E6F0FF':'',zIndex : 10000 }">
+                        <div class="menu_left">
+                            <img  class="logo" :src="activeL === 0 ? require('../assets/img/sy1.svg') : require('../assets/img/sy.svg')" alt="">
+                            <span  :style="{color : activeL === 0 ? '#0051D7' :''}">首页</span>
+                        </div>
                     </div>
-                </div>
 
-                <!-- 权限 -->
-                <div v-for="(item,index) in appSignL(fromL.admin.sidebar.list)"
-                    @click.stop="goto(index,item)" 
-                    :style="{background :activeL === (index +1) ?'#E6F0FF':'',zIndex : 10000 }" 
-                    :key="index+1">
+                    <!-- 权限 -->
+                    <div v-for="(item,index) in appSignL(fromL.admin.sidebar.list)"
+                        @click.stop="goto(index,item)" 
+                        :style="{background :activeL === (index +1) ?'#E6F0FF':'',zIndex : 10000 }" 
+                        :key="index+1">
 
-                    <!-- 渲染菜单类型 -->
-                    <div class="menu_left" v-if="item.menuName">
-                        <img  class="logo" :src="activeL === (index +1) ? item.menuActiveIcon : item.menuIcon" alt="">
-                        <span :style="{color : activeL === (index +1) ? '#0051D7' :''}">{{ item.menuName }}</span>
-                    </div>
-                  
-                    <!-- 渲染应用类型,               status判断是否被删除  isAdmin是否为管理员可见 -->
-                    <div v-else>
-                        <div>
-                            <div v-for="(p,pin) in AppCon(item.url)" :key="pin+'p'">
-                                <div class="menu_left" >
-                                    <div>
-                                        <img class="logo3"  
-                                        :src="activeL === (index +1) ? p.icon : p.activeIcon" 
-                                        alt="">
+                        <!-- 渲染菜单类型 -->
+                        <div class="menu_left" v-if="item.menuName">
+                            <img  class="logo" :src="activeL === (index +1) ? item.menuActiveIcon : item.menuIcon" alt="">
+                            <span :style="{color : activeL === (index +1) ? '#0051D7' :''}">{{ item.menuName }}</span>
+                        </div>
+                    
+                        <!-- 渲染应用类型,               status判断是否被删除  isAdmin是否为管理员可见 -->
+                        <div v-else>
+                            <div>
+                                <div v-for="(p,pin) in AppCon(item.url)" :key="pin+'p'">
+                                    <div class="menu_left" >
+                                        <div>
+                                            <img class="logo3"  
+                                            :src="activeL === (index +1) ? p.icon : p.activeIcon" 
+                                            alt="">
+                                        </div>
+                                        <span :style="{color : activeL === (index +1) ? '#0051D7' :''}">
+                                            {{ p.name }}
+                                        </span>
                                     </div>
-                                    <span :style="{color : activeL === (index +1) ? '#0051D7' :''}">
-                                        {{ p.name }}
-                                    </span>
+                                    
                                 </div>
-                                
                             </div>
                         </div>
                     </div>
+                
+                </div>
+                <div class="userInfo">
+                    <img style="width: 40px;height: 40px;object-fit: cover;border-radius: 50%;margin-bottom: 4px;" :src="userinfo.headportrait ? userinfo.headportrait : require('../assets/img/toux.png')" alt="">
+                    <div style="margin-bottom: 8px;">{{ userinfo.username }}</div>
+                    <span style="cursor: pointer;padding: 5px;background-color: #e7e7e7;box-sizing: border-box;border-radius: 5px;" @click="handleLogout">退出登录</span>
                 </div>
-               
-            </div>
-            <div class="userInfo">
-                <img style="width: 40px;height: 40px;object-fit: cover;border-radius: 50%;margin-bottom: 4px;" :src="userinfo.headportrait ? userinfo.headportrait : require('../assets/img/toux.png')" alt="">
-                <div style="margin-bottom: 8px;">{{ userinfo.username }}</div>
-                <span style="cursor: pointer;padding: 5px;background-color: #e7e7e7;box-sizing: border-box;border-radius: 5px;" @click="handleLogout">退出登录</span>
             </div>
+           
             
             <!-- 二级导航 -->
+            <transition name="slide">
                 <div class="ulTCopy" v-if="isShow && barCopy.length != 0" >
                     <div class="ulTCopyTit">
                         <span>{{ barCopyTit }}</span>
@@ -63,11 +67,9 @@
                         <div class="ulTCopyTxt" v-for="(i,ind) in appSignL(barCopy)" @click="levTwo(i)" :key="ind+'a'">
                             <div>
                                 <div style="display: flex;justify-content: space-between;align-items: center;" v-for="(p,pin) in AppCon(i.url)" :key="pin+'p'">
-                                    <div>  
-                                        <img style="width: 30px;object-fit: contain;margin-right: 5px;"  
-                                        :src="p.icon" 
-                                        alt="">
-                                    </div>
+                                    <img style="width: 30px;object-fit: contain;margin-right: 5px;"  
+                                    :src="p.icon" 
+                                    alt="">
                                     <span>{{ p.name }}</span>
                                 </div>
                             </div>
@@ -75,6 +77,7 @@
                     </div>
 
                 </div>
+            </transition>
             <div v-if="isShow" @click="closeCopy" style="width: 100vw;height: 100vh;position: absolute;left: 0;top: 0;z-index: 1;"></div>
         </div>
 </template>
@@ -197,7 +200,6 @@ import store from '../store'
                     this.barCopyTit = val.menuName
                     this.barCopy = JSON.parse(JSON.stringify(val.children))
                     this.isShow = true
-
                 }else{
                     this.isShow = false
 
@@ -223,7 +225,7 @@ import store from '../store'
                         userid: _userid,
                         org: _org,
                         oid: _oid,
-                        type: _type,
+                        tType: _type,
                         role: _role,
                         classId: _classId,
                         TscreenType: _TscreenType,
@@ -238,9 +240,25 @@ import store from '../store'
                     }
 
                 let _url = url + queryString
-                this.$emit('update:urlAddress',_url)
 
-                console.log('_url',_url);
+                let kpl = ` <iframe 
+                                v-if="appSign && urlAddress"
+                                allow= "camera *; microphone *;display-capture;midi;encrypted-media;"
+                                frameborder="no" 
+                                border="0" 
+                                style="border:0;width:100%;height:100%;" 
+                                src="${_url}" 
+                                ref="pageCon"
+                                >
+                            </iframe>`
+
+                let pl = {json:kpl ,stateL :true,toolId :val.toolId}
+
+                this.$emit('AddAppJson',pl)
+
+
+                // this.$emit('update:urlAddress',_url,)
+
 
                     // let dom = document.querySelector('#pageCon')
                     
@@ -279,7 +297,7 @@ import store from '../store'
                     userid: _userid,
                     org: _org,
                     oid: _oid,
-                    type: _type,
+                    tType: _type,
                     role: _role,
                     classId: _classId,
                     TscreenType: _TscreenType,
@@ -294,9 +312,21 @@ import store from '../store'
                 }
 
                 let _url = url + queryString
-                this.$emit('update:urlAddress',_url)
-
-                console.log('_url',_url);
+                let kpl = ` <iframe 
+                                v-if="appSign && urlAddress"
+                                allow= "camera *; microphone *;display-capture;midi;encrypted-media;"
+                                frameborder="no" 
+                                border="0" 
+                                style="border:0;width:100%;height:100%;" 
+                                src="${_url}" 
+                                ref="pageCon"
+                                >
+                            </iframe>`
+
+                let pl = {json:kpl ,stateL :true,toolId :val.toolId}
+
+                this.$emit('AddAppJson',pl)
+                // console.log('_url',_url);
                
                 // let dom = document.querySelector('#pageCon')
         
@@ -369,18 +399,45 @@ import store from '../store'
 }
 .ulTCopy{
     position: absolute;
-    right: 0;
+    left: -256px;
     top: 0;
-    transform: translate(256px,0);
     height: 100%;
     width: 256px;
-    z-index: 999999999;
+    z-index: 99999;
     background-color: #ffffff;
     overflow: visible; 
-    transition: width 2s ease; /* 定义过渡效果 */
+    transform: translateX(336px); /* 初始位置在视图之外 */
     box-shadow: inset 2px 0 8px rgba(0, 0, 0, 0.1),5px 3px 5px 0px rgba(0, 0, 0, 0.1);
 }
 
+/* .sidebar {
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 250px;
+  height: 100%;
+  background-color: #333;
+  color: #fff;
+  padding: 20px;
+} */
+
+.slide-enter-active, .slide-leave-active {
+  transition: transform 0.5s ease;
+  z-index: -1000 !important;
+
+}
+
+.slide-enter{
+    z-index: -1000 !important;
+  transform: translateX(0); /* 进入时移动到正常位置 */
+}
+.slide-leave-to /* .slide-leave-active in <2.1.8 */ {
+
+    z-index: -1000 !important;
+
+  transform: translateX(0); /* 进入时移动到正常位置 */
+}
+
 .ulTCopyTit{
     height: 72px;padding: 16px;box-sizing: border-box;color: #000;font-size: 18px;font-weight: 600;
     display: flex;

+ 19 - 4
src/components/topPage.vue

@@ -4,7 +4,7 @@
             <div class="topBlock">
                 <div class="topTit" style="display: flex;">
                     <div>欢迎使用</div>
-                    <div style="color: #0354D7;margin: 0 15px;"><span v-if="userinfo.orgName">{{userinfo.orgName}}—</span>{{ fromL.basics.title }}</div>
+                    <div style="color: #0354D7;margin: 0 15px;"><span v-if="userinfo.orgName">{{userinfo.orgName}}—</span>{{ userinfo.schoolName }}</div>
                     <div>AI平台!</div>
                 </div>
                 <div class="topDetail">
@@ -145,7 +145,7 @@ import store from '../store'
                     userid: _userid,
                     org: _org,
                     oid: _oid,
-                    type: _type,
+                    tType: _type,
                     role: _role,
                     classId: _classId,
                     TscreenType: _TscreenType,
@@ -161,9 +161,24 @@ import store from '../store'
 
                 let _url = url + queryString
                 console.log('_url',_url);
+
+
+                  let kpl = ` <iframe 
+                                v-if="appSign && urlAddress"
+                                allow= "camera *; microphone *;display-capture;midi;encrypted-media;"
+                                frameborder="no" 
+                                border="0" 
+                                style="border:0;width:100%;height:100%;" 
+                                src="${_url}" 
+                                ref="pageCon"
+                                >
+                            </iframe>`
+
+                let pl = {json:kpl ,stateL :true,toolId :val.toolId}
+
+                // this.$emit('AddAppJson',pl)
                 
-                
-                this.$emit('cutUrl',_url)
+                this.$emit('cutUrl',pl)
         
                 // document.querySelector('#pageCon').innerHTML = '';
                 

+ 39 - 17
src/views/HomeView.vue

@@ -9,25 +9,21 @@
     </div> -->
     <div class="container">
       <div class="leftBar" style="height: 100%;">
-        <sidebarL @getPer="getPer" :urlAddress.sync="urlAddress"  ref="sidebarLRef"></sidebarL>
+        <sidebarL @getPer="getPer" @AddAppJson="AddAppJson" :urlAddress.sync="urlAddress"  ref="sidebarLRef"></sidebarL>
       </div>
       <div class="table-container">
         <!-- <router-view></router-view> -->
          <!-- 首页 -->
-         <homepageL :urlAddress.sync="urlAddress" v-show="!appSign" ref="homepageLRef"></homepageL>
+         <homepageL @AddAppJson="AddAppJson" :urlAddress.sync="urlAddress" v-show="!appSign" ref="homepageLRef"></homepageL>
 
          <!-- 应用  -->
-         <iframe 
-            v-if="appSign && urlAddress"
-            allow= "camera *; microphone *;display-capture;midi;encrypted-media;"
-            frameborder="no" 
-            border="0" 
-            scrolling="no" 
-            style="border:0;width:100%;height:100%;" 
-            :src="urlAddress" 
-            ref="pageCon"
-            >
-        </iframe>
+          <div  v-for="(item,index) in AppJSon" :key="index">
+            <div style="height: 100vh;" v-show="item.stateL">
+              <div style="height: 100%;"  v-html="item.json"></div>
+            </div>
+          </div>
+        
+         
          <!-- <div style="height: 100%;" id="pageCon"></div> -->
       </div>
     </div>
@@ -54,7 +50,8 @@ export default {
       perData:[],
       toolList:[],
       form:{},
-      urlAddress:''
+      urlAddress:'',
+      AppJSon:[]
     }
   },
   computed: {
@@ -64,6 +61,31 @@ export default {
     ...mapActions({
       logout: 'user/logout'
     }),
+    AddAppJson(val){
+      console.log('val',val);
+     
+      
+      let data = this.AppJSon.filter(e=>{
+        return val.toolId == e.toolId
+      })
+      console.log('data',data);
+
+      if (data.length == 0) {
+        this.AppJSon.forEach(e=>{
+          this.$set(e, 'stateL', false); // 使用 Vue.set 确保响应式
+        })
+
+        this.AppJSon.push(val)
+      }else{
+        this.AppJSon.forEach(e=>{
+          if (val.toolId == e.toolId) {
+            this.$set(e, 'stateL', true); // 使用 Vue.set 确保响应式
+          }else{
+            this.$set(e, 'stateL', false); // 确保响应式更新
+          }
+        })
+      }
+    },
 
     
     async handleLogout() {
@@ -225,9 +247,9 @@ export default {
   width: 100%;
   background-color: #F9FAFB;
 }
-/* .leftBar{ */
+.leftBar{
   /* box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px 6px rgb(0 0 0 / 0.1); */
   /* overflow: visible;  */
-  /* z-index: 999999999; */
-/* } */
+  z-index: 999999999999999;
+}
 </style>

+ 1 - 1
src/views/homepageL.vue

@@ -57,7 +57,7 @@ import { API_CONFIG } from "@/common/apiConfig";
                     });
             },
             cutUrl(val){
-                this.$emit('update:urlAddress',val)
+                this.$emit('AddAppJson',val)
             },
         },
     }