소스 검색

修改拔尖人才与跨学科学习页面修改

11wqe1 1 일 전
부모
커밋
1ec2343486
2개의 변경된 파일383개의 추가작업 그리고 4개의 파일을 삭제
  1. 361 0
      src/components/sidebarL2.vue
  2. 22 4
      src/views/HomeView.vue

+ 361 - 0
src/components/sidebarL2.vue

@@ -0,0 +1,361 @@
+<template>
+        <div class="left">            
+                <!-- 权限 -->
+                <div class="logo2">
+                    <img src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/logo17446996549611754360746364.png" alt="">
+                </div>
+                <div style="width: 100%;">
+                    <!-- 渲染平台工具类型 -->
+                    <div class="barY">
+                        <div class="ulTOne" @click.stop="goto(p,pin)"
+                            v-for="(p,pin) in appSignL(barList)" :key="pin+'p'">
+                                <div class="menu_left">
+                                    <img :src="activeL === (pin +1) ? p.url[0].menuActiveIcon : p.url[0].menuIcon" class="logo" alt="">
+                                    <span class="barT" :style="{color : activeL === (pin +1) ? '#0051D7' :''}">
+                                        {{ p.name }}
+                                    </span>
+                                </div>
+                        </div>
+                    </div>
+                </div>
+
+        </div>
+</template>
+
+<script>
+import { mapGetters, mapActions } from 'vuex';
+import store from '../store'
+import { myMixin } from "@/mixins/mixin.js"
+
+    export default {
+        mixins: [ myMixin ],
+        props:['cocoNoteType'],
+        computed: {
+            ...mapGetters(['userinfo','userinfo2','fromL','appSign']),
+            // 筛选是否为管理员可见,是否被删除
+            appSignL(){
+                return function(val){
+                    let data = []
+                    val.forEach(e =>{
+                        if (e.toolId === 'futureClass' && this.cocoNoteType == 'coconote' && this.roleUser.type != 2) {
+                            data.push(e)
+                        }
+                    })
+                    val.forEach(e =>{
+                        if (e.toolId === 'person' && this.cocoNoteType == 'person' && this.roleUser.type != 2) {
+                            data.push(e)
+                        }
+                    })
+                    val.forEach( e =>{
+                        if (e.toolId == 'project') {
+                            data.push(e)
+                        }
+                    })
+                    console.log('data',data);
+                    data.forEach((e,index)=>{
+                        e.url.forEach(k=>{
+                            k.menuIcon = data[index].url[0].menuIcon
+                            k.menuActiveIcon = data[index].url[0].menuActiveIcon
+                        })
+                    })
+                    
+                    // if (!data[0].activeIcon){
+                    //     data[0].activeIcon = data2[0].activeIcon
+                    // }
+                    // if (!data[0].defaultIcon){
+                    //     data[0].defaultIcon = data2[0].defaultIcon
+                    // }
+                    // if (!data[0].hoverIcon){
+                    //     data[0].hoverIcon = data2[0].hoverIcon
+                    // }
+                    // if (!data[0].icon){
+                    //     data[0].icon = data2[0].icon
+                    // }
+                    // if (!data[0].platformIcon){
+                    //     data[0].platformIcon = data2[0].platformIcon
+                    // }
+                    return data
+                }
+            },
+            roleUser(){
+                return Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
+            }
+        },
+        data() {
+            return {
+                // 一级选中第几个
+                activeL: 1,
+                barList:[
+                    {   
+                        name:'协同建构',
+                        toolId: "futureClass",
+                        argumentList: [
+                            "userid",
+                            "oid",
+                            "org",
+                            "role"
+                        ],
+                        url: [
+                            {
+                                region: "cn",
+                                url: "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/synergyCourse",
+                                name: "协同建构",
+                                menuIcon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/apps%20%281%291763449293821.svg',
+                                menuActiveIcon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/apps1763449300318.svg'
+                            },
+                            {
+                                region: "beta",
+                                url: "https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/synergyCourse",
+                                name: "协同建构",
+                                menuIcon:'',
+                                menuActiveIcon:''
+                            },
+                        ],
+                    },
+                    {
+                        name:'拔尖人才',
+                        toolId: "person",
+                        argumentList: [
+                            "userid",
+                            "oid",
+                            "org",
+                            "role",
+                            "tType"
+                        ],
+                        url: [
+                            {
+                                region: "cn",
+                                url: "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/topTalent",
+                                name: "拔尖人才",
+                                menuIcon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E6%8B%94%E5%B0%96%E4%BA%BA%E6%89%8D1763449440270.svg',
+                                menuActiveIcon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E6%8B%94%E5%B0%96%E4%BA%BA%E6%89%8D%20%281%291763449466031.svg'
+                            },
+                            {
+                                region: "beta",
+                                url: "https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/topTalent",
+                                name: "拔尖人才",
+                                menuIcon:'',
+                                menuActiveIcon:''
+                            },
+                        ],
+                    },
+                    {
+                        name:'课程管理',
+                        toolId: "project",
+                        argumentList: [
+                            "userid",
+                            "oid",
+                            "org",
+                            "role"
+                        ],
+                        url: [
+                            {
+                                region: "cn",
+                                url: "https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/course",
+                                name: "课程管理",
+                                menuIcon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E8%AF%BE%E7%A8%8B%E7%AE%A1%E7%90%861758074687332.svg',
+                                menuActiveIcon:'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E8%AF%BE%E7%A8%8B%E7%AE%A1%E7%90%86%20%281%291758074703481.svg'
+                            },
+                            {
+                                region: "beta",
+                                url: "https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/course",
+                                name: "课程管理",
+                                menuIcon:'',
+                                menuActiveIcon:''
+                            },
+                        ],
+                    },
+                ]
+            }
+        },
+        methods: {
+            ...mapActions({
+                logout: 'user/logout'
+            }),
+            
+            mouGet(val){
+                
+                if(!val.includes('appStore')) return
+                // console.log('val',val);
+                this.getData()
+            },
+            // 点击一级导航
+            async goto(val = null,index){
+                console.log('goto',index,val);
+
+                try {
+                    window.topU.gotype = '' 
+                } catch (error) {
+                    console.log(error);
+                }
+
+                this.activeL = index + 1            
+
+                console.log('this.appSign',this.appSign);
+                console.log('val.toolId',val.toolId);
+                // 点击相同应用不刷新  
+                if (this.appSign == val.toolId) return
+
+                // 更新标识
+                await store.commit('user/SET_AppSIGN', val.toolId)
+
+                let url = ''
+                // 查出对应账号的应用区域地址
+                val.url.forEach(e => {
+                    // if (e.region == this.roleUser.schoolArea || e.region == this.roleUser.orgArea) {
+                    if (e.region == this.$region) {
+                        url = e.url
+                    }
+                });
+                
+                let _userinfo = this.roleUser, //登录用户信息
+                { userid: _userid, organizeid: _oid, type: _type, org: _org, role: _role, classid: _classId } = _userinfo; // 解构赋值获取用户信息
+                const _TscreenType = 1, _SscreenType = 3; // 常量定义
+                let queryString = ''
+                if(val.argumentList && val.argumentList.length){
+                    const paramsMap = {
+                        userid: _userid,
+                        org: _org,
+                        oid: _oid,
+                        tType: _type,
+                        role: _role,
+                        classId: _classId,
+                        TscreenType: _TscreenType,
+                        SscreenType: _SscreenType
+                    };
+
+                    const canshu = val.argumentList
+                .filter(param => paramsMap[param] !== undefined || param === 'type')
+                .map(param => param === 'type' ? `tType=${paramsMap['tType']}` : `${param}=${paramsMap[param]}`);
+                    queryString = canshu.length ? (url.includes('?') ? '&' : '?') + canshu.join('&') : ''; // 生成查询字符串
+                }
+
+                let _url = ''
+                if (val.toolId == "futureClass") {
+                    _url = url + queryString +'&ly=1'
+                } else if (val.toolId == "AIPopCourse") {
+                    // 为了隐藏侧边栏与顶部 
+                    _url = url + queryString +'&gotype=1'
+                } else{
+                    _url = url + queryString
+                }
+                if(val.toolId == 'study' && this.roleUser.type == 2){
+                    _url = _url.replace(/([?&])classId=([^&]*)/, '$1cid=$2');
+                }
+                console.log('_url',_url);
+
+                let pl = {json:_url ,stateL :true,toolId :val.toolId}
+                console.log('pl',pl);
+                
+
+                // 添加打开应用
+                this.$emit('AddAppJson',pl)
+
+                // this.addOp3('1', "", { type:this.prefixL + val.toolId + (this.roleUser.type == 1 ? '_teacher' : '_student') + "_open" }, "success")
+
+            },
+        },
+       
+       
+    }
+</script>
+
+<style scoped>
+
+.left {
+    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
+    width: 80px;
+    height: 100%;
+    padding:23px 6px;
+    box-sizing: border-box;
+    background-color: #ffffff;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    gap: 24px;
+    overflow: auto;
+    border-right: 1px #D5D5D5 solid;
+}
+
+.ulTOne{ 
+    width: 100%;
+    border-radius: 10px;
+    display: flex;
+    height: 48px;
+    flex-wrap:nowrap;
+    align-content: center;
+    justify-content: center;
+    cursor: pointer;
+    position: relative;
+}
+
+
+.barT{
+    font-size:10px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}
+
+.menu_left {
+  width: 32px;
+  height: 42px;
+  font-size: 10px;
+  color: #64748b;
+  box-sizing: border-box;
+  cursor: pointer;
+  margin: auto;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 2px;
+}
+
+
+.barT{
+    font-size:12px;
+    overflow: hidden;
+    /* font-weight: 600; */
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}
+.logo2 {
+    cursor: pointer;
+  box-sizing: border-box;
+  width: 100%;
+  background-color: #fff;
+  text-align: center;
+}
+.logo2 img{
+    width: 60px;
+    height: 60px;
+}
+
+/* .menu_left {
+  width: 32px;
+  font-size: 10px;
+  color: #64748b;
+  box-sizing: border-box;
+  cursor: pointer;
+  margin: auto;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 2px;
+} */
+.logo{
+  margin: auto;
+  width: 24px;
+  height: 24px;
+}
+.barY{
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+    display: flex;
+    flex-direction: column;
+    gap: 10px;
+}
+.left::-webkit-scrollbar { width: 0px; } 
+.left { scrollbar-width: none; }
+</style>

+ 22 - 4
src/views/HomeView.vue

@@ -8,6 +8,12 @@
 					@AddAppJson="AddAppJson"
 					ref="sidebarLRef"
 				></sidebarL>
+				<sidebarL2
+					v-if="cocoNoteType"
+					@AddAppJson="AddAppJson"
+					:cocoNoteType="cocoNoteType"
+					ref="sidebarLRef"
+				></sidebarL2>
 			</div>
 			<div class="table-container">
 				<div class="top" v-show="!appSign || cocoNoteType">
@@ -82,10 +88,7 @@
 						</iframe>
 					</div>
 				</div>
-
-				<!-- 荔园首页定制工具,不保存缓存 -->
-				<!-- style="height: calc(100vh - 60px)" -->
-				<div v-if="clearifa">
+				<div v-if="cocoNoteType" style="display: flex;">
 					<iframe
 						allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
 						frameborder="no"
@@ -96,6 +99,18 @@
 					>
 					</iframe>
 				</div>
+				<!-- 荔园首页定制工具,不保存缓存 -->
+				<!-- style="height: calc(100vh - 60px)" -->
+				<div v-if="clearifa">
+					<iframe
+						allow="camera *; microphone *; display-capture; midi; encrypted-media; fullscreen; geolocation; clipboard-read; clipboard-write; accelerometer; autoplay; gyroscope; payment; picture-in-picture; usb; xr-spatial-tracking;"
+						frameborder="no"
+						@load="handleLoad"
+						style="border: 0; width: 100%;height: 100%;"
+						:src="clearifa"
+					>
+					</iframe>
+				</div>			
 
 				<div
 					v-if="loading"
@@ -188,6 +203,8 @@
 import { mapGetters, mapActions } from "vuex";
 import { loginOut,getCourseGroup } from "@/api/user";
 import sidebarL from "../components/sidebarL.vue";
+import sidebarL2 from "../components/sidebarL2.vue";
+
 import { API_CONFIG } from "@/common/apiConfig";
 import store from "../store";
 import userInfoA from "../components/userInfoA.vue";
@@ -200,6 +217,7 @@ export default {
 
 	components: {
 		sidebarL,
+		sidebarL2,
 		homepageL,
 		userInfoA,
 	},