11wqe1 3 tháng trước cách đây
mục cha
commit
9f326f9c47

+ 30 - 27
src/components/sidebarL.vue

@@ -58,7 +58,7 @@
                                     </span>
                                 </div>
                                 <!-- 二级导航 -->
-                                <div class="ulTCopy" v-if="item.toolId == 'appStore' && cocoFlowList[0] && cocoFlowList[1] && cocoFlowList[0].length && cocoFlowList[1].length">
+                                <div class="ulTCopy" v-if="item.toolId.includes('appStore') && ((cocoFlowList[0] && cocoFlowList[0].length) || (cocoFlowList[1] &&  cocoFlowList[1].length))">
                                     <div class="ulTCopyTit">
                                         <span>CocoFlow</span>
                                     </div>
@@ -169,14 +169,18 @@ import { API_CONFIG } from "@/common/apiConfig";
                 });
             },
             mouGet(val){
-                if(val != 'appStore') return
+                console.log('val',val);
+                
+                if(!val.includes('appStore')) return
                 console.log('666')
                 this.getData()
             },
             // 点击一级导航
             async goto(index,val = null){
                 // console.log('goto',val);
-              
+
+               // 清空二级菜单选中状态
+                this.activeLTwo = ''
                 // val = null 就是点击了首页
                 if (val) {
                     this.activeL = index + 1               
@@ -186,13 +190,10 @@ import { API_CONFIG } from "@/common/apiConfig";
                     this.$emit('update:urlAddress','')
 
                     this.$emit('getPer')
-                    // 清空选中状态
-                    this.activeLTwo = ''
                     this.activeL = index
                     return
                 }
            
-                    this.activeLTwo = ''
 
 
                     // 点击相同应用不刷新  
@@ -202,6 +203,7 @@ import { API_CONFIG } from "@/common/apiConfig";
                     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) {
@@ -209,6 +211,7 @@ import { API_CONFIG } from "@/common/apiConfig";
                             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; // 常量定义
@@ -236,17 +239,17 @@ import { API_CONFIG } from "@/common/apiConfig";
                     console.log('_url',_url);
                     
 
-                    let kpl = ` <iframe 
-                                    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 kpl = ` <iframe 
+                    //                 allow= "camera *; microphone *;display-capture;midi;encrypted-media;"
+                    //                 frameborder="no" 
+                    //                 border="0" 
+                    //                 style="border:0;width:100%;height:100%;" 
+                    //                 src="${_url}" 
+                    //                 ref="${val.toolId}"
+                    //                 >
+                    //             </iframe>`
 
-                    let pl = {json:kpl ,stateL :true,toolId :val.toolId}
+                    let pl = {json:_url ,stateL :true,toolId :val.toolId}
 
                     // 添加打开应用
                     this.$emit('AddAppJson',pl)
@@ -320,17 +323,17 @@ import { API_CONFIG } from "@/common/apiConfig";
                 let _url = url + queryString
                 console.log('_url',_url);
                 
-                let kpl = ` <iframe 
-                                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}
+                // let kpl = ` <iframe 
+                //                 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:_url ,stateL :true,toolId :val.toolId}
 
                 this.$emit('AddAppJson',pl)
             },

+ 209 - 187
src/components/topPage.vue

@@ -64,20 +64,29 @@
         <!-- 常见应用  -->
         <div class="footCon">
             <div class="footConLeft">
-                <img src="../assets/img/Cop2.svg" alt="">
-                <!-- <div class="CocoTit">
-                    COCO FLOW
-                </div> -->
+                <img v-if="fromL.basics.cocoFlow" :src="fromL.basics.cocoFlow" alt="">
+
+                <div v-else style="min-width: 150px;display: flex;flex-direction: column;justify-content: flex-end;">
+                    <img class="CutImg" src="../assets/img/dong.png" alt="">
+                    <div class="CocoTit">
+                        COCO FLOW
+                    </div>
+                </div>
+                
             </div>
 
             <div style="display: flex;gap: 16px;flex: 1;">
                 <div class="footList">
                     <div class="footListCon" v-for="(item,index) in admincocoFlow" @click="openNewWindow(item)" :key="index+'2p'">
                         <div class="footListConimg">
-                            <img v-if="!fromL.admin.cocoFlow.length" 
-                            style="margin-bottom: 12px;height: 40px;width: 40px;object-fit: contain;" 
+                            <img v-if="fromL.admin.cocoFlow.length == 0" 
+                            class="footListConimgPic"
                             :src="appImgList[index]" alt="">
 
+                            <img v-else-if="fromL.admin.cocoFlow[index].setIcon" 
+                            class="footListConimgPic"
+                            :src="fromL.admin.cocoFlow[index].setIcon" alt="">
+
                             <img
                             style="margin-bottom: 12px;height: 40px;width: 40px;object-fit: contain;"  
                             v-else :src="JSON.parse(item.json).icon" alt="">
@@ -98,11 +107,16 @@
                     </div>
                 </div>
 
-                <div class="footList2">
+                <div v-if="CocoFlowList.length" class="footList2">
                     <div class="footListCon6" v-for="(item,index) in CocoFlowList" @click="openNewWindow(item)" :key="index+'4p'">
                         <div class="footListConimg">
                             <!-- <img style="margin-bottom: 12px;height: 24px;width: 22px;" :src="JSON.parse(item.json).icon" alt=""> -->
-                            <img style="margin-bottom: 12px;height: 40px;width: 40px;object-fit: contain;" :src="require('../assets/img/cocoflow2.svg')" alt="">
+                            <img v-if="fromL.admin.cocoFlow2[index].setIcon" 
+                            class="footListConimgPic"
+                            :src="fromL.admin.cocoFlow2[index].setIcon" alt="">
+                            <img v-else class="footListConimgPic" :src="JSON.parse(item.json).icon" alt="">
+                            
+                            <!-- <img v-else class="footListConimgPic" :src="require('../assets/img/cocoflow2.svg')" alt=""> -->
                         </div>
                         <div class="TabListName">{{ item.name }}</div>
                         <div class="TabListBri">
@@ -149,7 +163,7 @@
         </div>
 
         <!-- 常见应用弹框 -->
-        <el-dialog
+        <!-- <el-dialog
         title="应用列表"
         :visible.sync="dialogVisible"
         class="moreDia"
@@ -181,7 +195,7 @@
                 <el-button @click="handleClose">取消</el-button>
                 <el-button @click="addUsuallyApp" style="background-color: #0663FE;" type="primary">确认</el-button>
             </div>
-        </el-dialog>
+        </el-dialog> -->
     </div>
 </template>
 
@@ -253,16 +267,15 @@ import { API_CONFIG } from "@/common/apiConfig";
                 // 平台工具 
                 tabList:[],
                 appImgList:[
-                    require('../assets/img/img4.svg'),
-                    require('../assets/img/img1.svg'),
-                    require('../assets/img/img3.svg'),
-                    require('../assets/img/img5.svg'),
+                    require('../assets/img/img7.svg'),
                     require('../assets/img/img8.svg'),
                     require('../assets/img/img2.svg'),
-                    require('../assets/img/img7.svg'),
                     require('../assets/img/img6.svg'),
+                    require('../assets/img/img5.svg'),
+                    require('../assets/img/img1.svg'),
+                    require('../assets/img/img4.svg'),
+                    require('../assets/img/img3.svg'),
                 ],
-
                 hovList:[],
             }
         },
@@ -273,174 +286,46 @@ import { API_CONFIG } from "@/common/apiConfig";
             },
             // 首页平台应用浮动效果
             setHovered(index, value) {
-                // console.log(index, value);
-                
-
                 this.tabList[index].hovered = value;
-                // console.log('this.tabList',this.tabList[index].hovered);
-                
             },
-            // 删除应用
-            delApp(val){
-                this.$confirm('确定删除吗', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(async () => {
-                    let params = [
-                            {
-                                functionName: API_CONFIG.ajax_del_usuallyApp.functionName,
-                                aid: val, 
-                            },
-                        ];
-                        
-                    this.$ajax
-                        .post(API_CONFIG.baseUrl, params)
-                        .then(() => {
-                            this.$message.success('删除成功')
-                            this.getData()
-                        })
-                        .catch((err) => {
-                            console.log(err);
-                            this.$message.error("删除失败");
-                        });
-                   
-                }).catch(() => {
-                    // 取消操作
-                });
+            // 获取已添加cocoFlow应用
+            getData(){
+                let cocoFlowCopy = []
+                if (this.fromL.admin.cocoFlow2 && this.fromL.admin.cocoFlow2.length) {
+                    cocoFlowCopy = this.fromL.admin.cocoFlow2.map(item => item.id);
+                }else{
+                    return
+                }
 
-                
-                
-            },
-            handleClose(){
-                this.usuallyList= []
-                this.tab= []
-                this.dialogVisible = false
-            },
-            // 弹框选择添加应用
-            addApp(val){
-                // let data = this.CocoFlowList.filter(e=>{
-                //     return e.id == val 
-                // })
-                // if (data.length != 0) return this.$message.info('常用列表已添加')
-                let kpl = [...this.tab,...this.CocoFlowList]
-                // console.log(kpl);
-                
 
-                const index = this.tab.indexOf(val);
-                if (index !== -1) {
-                    this.tab.splice(index, 1); // 删除第一个匹配项
-                } else {
-                    if (kpl.length > 3) return this.$message.info('只能添加四个常用应用哦')
-                    this.tab.push(val);    // 添加元素到末尾
-                }
-            },
-            // 打开常见应用弹框
-            openUsuallyApp(){
-                this.dialogVisible = true
-                this.loading = true
-                let params = [
-                    {
-                        functionName: API_CONFIG.ajax_usuallyApp.functionName,
-                        uid: this.roleUser.userid, 
-                        cn: this.roleUser.schoolArea ? this.roleUser.schoolArea : this.roleUser.orgArea, //学校id
-                    },
-                ];
-                
-                this.$ajax
-                    .post(API_CONFIG.baseUrl, params)
-                    .then((res) => {
-                        this.usuallyList = res.data[0]
-                        this.loading = false
+                    // let appList=[
+                    //     "4aed8607-19e1-11f0-a66a-005056924926",
+                    //     "337f9d06-1eb6-11f0-a66a-005056924926",
+                    //     "52b4aae8-088d-11f0-b508-005056924926",
+                    //     "5c95f692-1460-11f0-bad1-005056924926"
+                    // ]
 
-                    })
-                    .catch((err) => {
-                        console.log(err);
-                        this.loading = false
-                        this.$message.error("获取工具数据失败");
-                    });
-            },
-            // 添加常用确定按钮
-            async addUsuallyApp(){
-                const uploadYn = async files => {
-                    for (let index = 0; index < files.length; index++) {
-                        await this.XAdd(files[index]);
-                        console.log(index);
-                    }
-                }
-                await uploadYn(this.tab);
-                console.log('完成了');
-                this.getData()
-                this.handleClose()
-            },
-            // 循环添加用户选择常见应用
-            XAdd(val){
-                return new Promise((resolve) => {
                     let params = [
                         {
-                            functionName: API_CONFIG.ajax_add_usuallyApp.functionName,
-                            oid:this.roleUser.organizeid,
-                            aid: val,
-                            uid: this.roleUser.userid,
+                            functionName: API_CONFIG.ajax_AdminApp.functionName,
+                            con: cocoFlowCopy.join(','), 
                         },
                     ];
-                    
-                    this.$ajax
-                        .post(API_CONFIG.baseUrl, params)
-                        .then(() => {
-                            resolve(1)
-                        })
-                        .catch((err) => {
-                            console.log(err);
-                        });
-                    })
-            },
-
-            // 获取已添加cocoFlow应用
-            getData(){
-                // let params = [
-                //     {
-                //         functionName: API_CONFIG.ajax_addedUsuallyApp.functionName,
-                //         uid: this.roleUser.userid, 
-                //     },
-                // ];
-                
-                // this.$ajax
-                //     .post(API_CONFIG.baseUrl, params)
-                //     .then((res) => {
-                //         this.CocoFlowList = res.data[0]
-                //     })
-                //     .catch((err) => {
-                //         console.log(err);
-                //         this.$message.error("获取工具数据失败");
-                //     });
-
-
-                    let appList=[
-                    "4aed8607-19e1-11f0-a66a-005056924926",
-                    "337f9d06-1eb6-11f0-a66a-005056924926",
-                    "52b4aae8-088d-11f0-b508-005056924926",
-                    "5c95f692-1460-11f0-bad1-005056924926"
-
-                        ]
-
-                let params = [
-                    {
-                        functionName: API_CONFIG.ajax_AdminApp.functionName,
-                        con: appList.join(','), 
-                    },
-                ];
                 
                 this.$ajax
                     .post(API_CONFIG.baseUrl, params)
                     .then((res) => {
-                        this.CocoFlowList = res.data[0]
+                        let _data = res.data[0];
+
+                        this.CocoFlowList = cocoFlowCopy.map(id => _data.find(item => item.id === id));
+
                     })
                     .catch((err) => {
                         console.log(err);
                         this.$message.error("获取工具数据失败");
                     });
             },
+            // 筛选可用平台工具,判断是否管理员可见,去除已删除工具
             siftCoco(){
                 let data = []
                 let val = JSON.parse(JSON.stringify(this.fromL.admin.index.list))
@@ -462,35 +347,50 @@ import { API_CONFIG } from "@/common/apiConfig";
                 }
 
                 this.tabList = data
-                console.log('this.tabList',this.tabList);
+                // console.log('this.tabList',this.tabList);
 
             },
             getAdmincocoFlow(){
                 // 筛选可用平台工具,判断是否管理员可见,去除已删除工具
                 this.siftCoco()
                 // console.log('getAdmincocoFlow',this.fromL);
+
+                let cocoFlowCopy = this.fromL.admin.cocoFlow.map(item => item.id);
+                console.log('cocoFlowCopy',cocoFlowCopy);
                 
-                let appList=["2d05a12a-f0e7-11ef-b508-005056924926",
-                            "38ee6402-0539-11f0-b508-005056924926",
-                            "1c83613c-ffb7-11ef-b508-005056924926",
-                            "0d3d87bd-00b6-11f0-b508-005056924926",
-                            "ee61f383-0311-11f0-b508-005056924926",
-                            "701615ab-ffe8-11ef-b508-005056924926",
-                            "d1edef14-ef6f-11ef-b508-005056924926",
-                            "a8781a86-00d8-11f0-b508-005056924926",
-                        ]
+                let appList= [
+                        "d1edef14-ef6f-11ef-b508-005056924926",
+                        "701615ab-ffe8-11ef-b508-005056924926",
+                        "a8781a86-00d8-11f0-b508-005056924926",
+                        "ee61f383-0311-11f0-b508-005056924926",
+                        "38ee6402-0539-11f0-b508-005056924926",
+                        "1c83613c-ffb7-11ef-b508-005056924926",
+                        "0d3d87bd-00b6-11f0-b508-005056924926",
+                        "2d05a12a-f0e7-11ef-b508-005056924926",
+                    ]
+                        
+                       
 
                 let params = [
                     {
                         functionName: API_CONFIG.ajax_AdminApp.functionName,
-                        con: this.fromL.admin.cocoFlow.length == 0 ? appList.join(',') : this.fromL.admin.cocoFlow.join(','), 
+                        con: cocoFlowCopy.length == 0 ? appList.join(',') : cocoFlowCopy.join(','), 
                     },
                 ];
                 
                 this.$ajax
                     .post(API_CONFIG.baseUrl, params)
                     .then((res) => {
-                        this.admincocoFlow = res.data[0]
+                        let _data = res.data[0]
+
+                        if (cocoFlowCopy.length == 0) {
+                            this.admincocoFlow = appList.map(id => _data.find(item => item.id === id));
+                        }else{
+                            this.admincocoFlow = cocoFlowCopy.map(id => _data.find(item => item.id === id));
+                        }
+
+
+
                     })
                     .catch((err) => {
                         console.log(err);
@@ -542,17 +442,17 @@ import { API_CONFIG } from "@/common/apiConfig";
                 console.log('_url',_url);
 
 
-                  let kpl = ` <iframe 
-                                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 kpl = ` <iframe 
+                //                 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}
+                let pl = {json:_url ,stateL :true,toolId :val.toolId}
 
                 // this.$emit('AddAppJson',pl)
                 
@@ -571,6 +471,120 @@ import { API_CONFIG } from "@/common/apiConfig";
                 // // 基本用法:打开指定 URL
                 window.open(val.url, "_blank");
             },
+            //#region 
+             // handleClose(){
+            //     this.usuallyList= []
+            //     this.tab= []
+            //     this.dialogVisible = false
+            // },
+             // 弹框选择添加应用
+            // addApp(val){
+            //     // let data = this.CocoFlowList.filter(e=>{
+            //     //     return e.id == val 
+            //     // })
+            //     // if (data.length != 0) return this.$message.info('常用列表已添加')
+            //     let kpl = [...this.tab,...this.CocoFlowList]
+            //     // console.log(kpl);
+                
+
+            //     const index = this.tab.indexOf(val);
+            //     if (index !== -1) {
+            //         this.tab.splice(index, 1); // 删除第一个匹配项
+            //     } else {
+            //         if (kpl.length > 3) return this.$message.info('只能添加四个常用应用哦')
+            //         this.tab.push(val);    // 添加元素到末尾
+            //     }
+            // },
+             // // 添加常用确定按钮
+            // async addUsuallyApp(){
+            //     const uploadYn = async files => {
+            //         for (let index = 0; index < files.length; index++) {
+            //             await this.XAdd(files[index]);
+            //             console.log(index);
+            //         }
+            //     }
+            //     await uploadYn(this.tab);
+            //     console.log('完成了');
+            //     this.getData()
+            //     this.handleClose()
+            // },
+            // // 循环添加用户选择常见应用
+            // XAdd(val){
+            //     return new Promise((resolve) => {
+            //         let params = [
+            //             {
+            //                 functionName: API_CONFIG.ajax_add_usuallyApp.functionName,
+            //                 oid:this.roleUser.organizeid,
+            //                 aid: val,
+            //                 uid: this.roleUser.userid,
+            //             },
+            //         ];
+                    
+            //         this.$ajax
+            //             .post(API_CONFIG.baseUrl, params)
+            //             .then(() => {
+            //                 resolve(1)
+            //             })
+            //             .catch((err) => {
+            //                 console.log(err);
+            //             });
+            //         })
+            // },
+             // // 删除应用
+            // delApp(val){
+            //     this.$confirm('确定删除吗', '提示', {
+            //         confirmButtonText: '确定',
+            //         cancelButtonText: '取消',
+            //         type: 'warning'
+            //     }).then(async () => {
+            //         let params = [
+            //                 {
+            //                     functionName: API_CONFIG.ajax_del_usuallyApp.functionName,
+            //                     aid: val, 
+            //                 },
+            //             ];
+                        
+            //         this.$ajax
+            //             .post(API_CONFIG.baseUrl, params)
+            //             .then(() => {
+            //                 this.$message.success('删除成功')
+            //                 this.getData()
+            //             })
+            //             .catch((err) => {
+            //                 console.log(err);
+            //                 this.$message.error("删除失败");
+            //             });
+                   
+            //     }).catch(() => {
+            //         // 取消操作
+            //     });
+            // },
+            // 打开常见应用弹框
+            // openUsuallyApp(){
+            //     this.dialogVisible = true
+            //     this.loading = true
+            //     let params = [
+            //         {
+            //             functionName: API_CONFIG.ajax_usuallyApp.functionName,
+            //             uid: this.roleUser.userid, 
+            //             cn: this.roleUser.schoolArea ? this.roleUser.schoolArea : this.roleUser.orgArea, //学校id
+            //         },
+            //     ];
+                
+            //     this.$ajax
+            //         .post(API_CONFIG.baseUrl, params)
+            //         .then((res) => {
+            //             this.usuallyList = res.data[0]
+            //             this.loading = false
+
+            //         })
+            //         .catch((err) => {
+            //             console.log(err);
+            //             this.loading = false
+            //             this.$message.error("获取工具数据失败");
+            //         });
+            // },
+            //#endregion
         },
     }
 </script>
@@ -715,12 +729,17 @@ import { API_CONFIG } from "@/common/apiConfig";
     box-sizing: border-box;
     display: flex;
     padding-right: 40px;
+    object-fit: contain;
 }
 .footConLeft img{
     min-width: 150px;
     border-radius: 15px;
     /* object-view-box: inset(0% 12px 30px 30px); */
 }
+.CutImg{
+    width: 100% !important;
+    object-view-box: inset(0% 12px 30px 30px);
+}
 .CocoTit{
     width: 100%;
     min-width: 150px;
@@ -786,6 +805,9 @@ import { API_CONFIG } from "@/common/apiConfig";
     padding-top: 8px;
     box-sizing: border-box;
 }
+.footListConimgPic{
+    margin-bottom: 12px;height: 40px;width: 40px;object-fit: contain;
+}
 .cha{
     display: none;position: absolute;top: 10px;right: 10px;
 }

+ 24 - 0
src/store/modules/user.js

@@ -185,6 +185,30 @@ const actions = {
       });
 
       // 第三步
+      if (perData.admin.cocoFlow) {
+				perData.admin.cocoFlow.forEach((i, index) => {
+					let _index = toolList.findIndex((i2) => i.id == i2.id);
+					if (_index != -1) {
+						let _setData = toolList[_index];
+						_setData.setIcon = i.setIcon;
+						perData.admin.cocoFlow[index] = _setData;
+					} else {
+						console.log("无应用", i);
+					}
+				});
+			}
+      if (perData.admin.cocoFlow2) {
+        perData.admin.cocoFlow2.forEach((i, index) => {
+          let _index = toolList.findIndex((i2) => i.id == i2.id);
+          if (_index != -1) {
+          let _setData = toolList[_index];
+          _setData.setIcon = i.setIcon;
+          perData.admin.cocoFlow2[index] = _setData;
+        } else {
+          console.log("无应用", i);
+        }
+        });
+      }
 			perData.admin.index.list.forEach((i, index) => {
 				let _index = toolList.findIndex((i2) => i == i2.id);
 				if (_index != -1) {

+ 372 - 310
src/views/HomeView.vue

@@ -1,212 +1,271 @@
 <template>
-  <div class="body">
-   
-    <div class="container">
-      <div class="leftBar" style="height: 100%;">
-        <sidebarL @getPer="getPer" @AddAppJson="AddAppJson" :urlAddress.sync="urlAddress"  ref="sidebarLRef"></sidebarL>
-      </div>
-      <div class="table-container">
+	<div class="body">
+		<div class="container">
+			<div class="leftBar" style="height: 100%">
+				<sidebarL
+					@getPer="getPer"
+					@AddAppJson="AddAppJson"
+					:urlAddress.sync="urlAddress"
+					ref="sidebarLRef"
+				></sidebarL>
+			</div>
+			<div class="table-container">
+				<div class="top">
+					<div class="topCon">
+						<div class="title">
+							<span v-if="roleUser.orgName">{{ roleUser.orgName }}</span>
+							<span style="color: #0663fe; font-weight: 600">{{
+								roleUser.schoolName
+							}}</span>
+						</div>
+						<div class="person">
+							<div class="person_name">
+								<img
+									@click="openData()"
+									style="
+										width: 40px;
+										height: 40px;
+										object-fit: cover;
+										border-radius: 50%;
+										cursor: pointer;
+									"
+									:src="
+										roleUser.headportrait
+											? roleUser.headportrait
+											: require('../assets/img/toux2.png')
+									"
+									alt=""
+								/>
+								<div class="personInfo">
+									<div class="personInfoTit">
+										{{ roleUser.username }}
+									</div>
+									<div class="personInfoBri">
+										{{ userSuffix() }}
+									</div>
+								</div>
+							</div>
+							<el-button
+								type="text"
+								@click="handleLogout"
+								style="margin-left: 20px"
+								>退出</el-button
+							>
+						</div>
+					</div>
+				</div>
+				<!-- <router-view></router-view> -->
+				<!-- 首页 -->
+				<homepageL
+					@AddAppJson="AddAppJson"
+					:urlAddress.sync="urlAddress"
+					v-show="!appSign"
+					ref="homepageLRef"
+				></homepageL>
 
-        <div class="top">
-          <div class="topCon">
-            <div class="title">
-              <span v-if="roleUser.orgName">{{roleUser.orgName}}</span >
-              <span style="color: #0663FE;font-weight: 600;">{{ roleUser.schoolName }}</span>
-                
-            </div>
-            <div class="person">
-              <div class="person_name">
-                <img
-                 @click="openData()"
-                style="width: 40px;height: 40px;object-fit: cover;border-radius: 50%; cursor: pointer;" 
-                :src="roleUser.headportrait ? roleUser.headportrait : require('../assets/img/toux2.png')" alt="">
-                <div class="personInfo">
-                  <div class="personInfoTit">
-                    {{  roleUser.username }}
-                  </div>
-                  <div class="personInfoBri">
-                    {{ userSuffix() }}
-                  </div>
-                </div>
-              </div>
-              <el-button type="text" @click="handleLogout" style="margin-left: 20px">退出</el-button>
-            </div>
-          </div>
-        </div>
-        <!-- <router-view></router-view> -->
-         <!-- 首页 -->
-         <homepageL @AddAppJson="AddAppJson" :urlAddress.sync="urlAddress" v-show="!appSign" ref="homepageLRef"></homepageL>
+				<!-- 循环数组展示iframe  -->
+				<div v-for="(item, index) in AppJSon" :key="index">
+					<!-- {{ item }} -->
+					<div style="height: calc(100vh - 60px)" v-show="item.stateL">
+						<iframe
+							allow="camera *; microphone *;display-capture;midi;encrypted-media;"
+							frameborder="no"
+							style="border: 0; width: 100%; height: calc(100vh - 60px)"
+							:src="item.json"
+							:ref="item.toolId"
+						>
+						</iframe>
+					</div>
+				</div>
 
-         <!-- 循环数组展示iframe  -->
-          <div
-              v-for="(item,index) in AppJSon" :key="index">
-            <div style="height: calc(100vh - 60px);" v-show="item.stateL">
-              <div style="height: 100%;"  v-html="item.json"></div>
-            </div>
-          </div>
-        
-         <div v-if="loading" style="position: absolute;left: 0;top: 0;width: 100%;height: 100%;background-color: #fff;
-              display: flex;justify-content: center;align-items: center;">
-          <div style="display: flex;flex-direction: column;align-items: center;">
-            <img style="height: 75px;transform: scale(2);" src="../assets/img/cocoloading.gif" alt="">
-            <div style="color: #0354D7;">拼命加载中...</div>
-          </div>  
-
-         </div>
-      </div>
-    </div>
-  </div>
+				<div
+					v-if="loading"
+					style="
+						position: absolute;
+						left: 0;
+						top: 0;
+						width: 100%;
+						height: 100%;
+						background-color: #fff;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+					"
+				>
+					<div
+						style="display: flex; flex-direction: column; align-items: center"
+					>
+						<img
+							style="height: 75px; transform: scale(2)"
+							src="../assets/img/cocoloading.gif"
+							alt=""
+						/>
+						<div style="color: #0354d7">拼命加载中...</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
 </template>
 
 <script>
-import { mapGetters, mapActions } from 'vuex';
-import { loginOut } from '@/api/user';
-import sidebarL from '../components/sidebarL.vue';
+import { mapGetters, mapActions } from "vuex";
+import { loginOut } from "@/api/user";
+import sidebarL from "../components/sidebarL.vue";
 import { API_CONFIG } from "@/common/apiConfig";
-import store from '../store'
-import homepageL from './homepageL.vue';
-
+import store from "../store";
+import homepageL from "./homepageL.vue";
 
 export default {
-  name: "HomeView",
-  components:{
-    sidebarL,
-    homepageL
-  },
-  data() {
-    return {
-      perData:[],
-      toolList:[],
-      form:{},
-      urlAddress:'',
-      AppJSon:[],
-      loading:false
-    }
-  },
-  computed: {
-    ...mapGetters(['userinfo','appSign','userinfo2']),
-    userSuffix(){
-      let yym = ''
-      return function() {
-        
-        // this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1 && 
-        yym = Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
-       
-        let val = yym.accountNumber
+	name: "HomeView",
+	components: {
+		sidebarL,
+		homepageL,
+	},
+	data() {
+		return {
+			urlAddress: "",
+			AppJSon: [],
+			loading: false,
+		};
+	},
+	computed: {
+		...mapGetters(["userinfo", "appSign", "fromL", "userinfo2"]),
+		userSuffix() {
+			let yym = "";
+			return function () {
+				// this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1 &&
+				yym =
+					Object.keys(this.userinfo2).length != 0
+						? this.userinfo2
+						: this.userinfo;
 
-        let userName = JSON.parse(JSON.stringify(val))
+				let val = yym.accountNumber;
 
-        const regEmail = new RegExp("^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$");
-        
-        // // 判断用户输入账户带不带后缀
-        if (!regEmail.test(userName)) {
-          console.log('111');
-        } else {
-          const parts = userName.split('@');
-          userName = parts[0];
-        }
+				let userName = JSON.parse(JSON.stringify(val));
 
-        return userName
-      }
-    },
-    roleUser(){
-      // this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&&
-        return  Object.keys(this.userinfo2).length != 0 ? this.userinfo2 : this.userinfo
-    }
-  },
-  methods: {
-    ...mapActions({
-      logout: 'user/logout'
-    }),
-    openData(){
-        window.topU.U.MD.D.I.openApplication('my')
-    },
-    // 打开平台应用工具
-    AddAppJson(val){
-      console.log('val',val);
+				const regEmail = new RegExp(
+					"^[A-Za-z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
+				);
 
-      // 判断有没有打开过这个应用
-      let data = this.AppJSon.filter(e=>{
-        return val.toolId == e.toolId
-      })
-      // console.log('data',data);
+				// // 判断用户输入账户带不带后缀
+				if (!regEmail.test(userName)) {
+					console.log("111");
+				} else {
+					const parts = userName.split("@");
+					userName = parts[0];
+				}
 
-      if (data.length == 0) {   //为0则添加进列表,并将其他的展示状态改为false
-        this.loading = true
+				return userName;
+			};
+		},
+		roleUser() {
+			// this.userinfo.role == 1 && this.userinfo.rrole == 1 && this.userinfo.type == 1&&
+			return Object.keys(this.userinfo2).length != 0
+				? this.userinfo2
+				: this.userinfo;
+		},
+	},
+	methods: {
+		...mapActions({
+			logout: "user/logout",
+		}),
+		// 打开个人信息
+		openData() {
+			window.topU.U.MD.D.I.openApplication("my");
+		},
+		// 打开平台应用工具
+		AddAppJson(val) {
+			// console.log('val',val);
+
+			// 判断有没有打开过这个应用
+			let data = this.AppJSon.filter((e) => {
+				return val.toolId == e.toolId;
+			});
 
-        // 打开平台工具加载两秒
-        setTimeout(() => {
-          this.loading = false
-        }, 2000);
-        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) {  //已经打开过了,将点击的工具展示状态改为false
-            this.$set(e, 'stateL', true); // 使用 Vue.set 确保响应式
-          }else{
-            this.$set(e, 'stateL', false); // 确保响应式更新
-          }
-        })
-      }
-    },
+			if (data.length == 0) {
+				//为0则添加进列表,并将其他的展示状态改为false
+				this.loading = true;
 
-    
-    async handleLogout() {
-      this.$confirm('确定退出吗', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(async () => {
-        loginOut()
-          .then(async () => {
-            this.$message({
-              message: '退出成功',
-              type: 'success'
-            });
-            await this.logout();
-            this.$router.push('/login');
-          })
-          .catch(err => {
-            console.error(err);
-          });
-      }).catch(() => {
-        // 取消操作
-      });
-    },
-   
-    // 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
-    getPer() {
-      // 查询首页应用
-      this.$refs.homepageLRef.getData()
-      //查询cocofrow最近使用与收藏
-      this.$refs.sidebarLRef.getData()
+				// 打开平台工具加载两秒
+				setTimeout(() => {
+					this.loading = false;
+				}, 2000);
+
+				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) {
+						//已经打开过了,将点击的工具展示状态改为false
+						this.$set(e, "stateL", true); // 使用 Vue.set 确保响应式
+					} else {
+						this.$set(e, "stateL", false); // 确保响应式更新
+					}
+				});
+
+				setTimeout(() => {
+					
+          console.log('this.$refs.appRef.contentWindow.document.body;',this.$refs[val.toolId][0].contentWindow.document.body);
+          
+					if (!this.$refs[val.toolId][0].contentWindow.document.body) {
+						this.$refs[val.toolId][0].contentWindow.location.reload();
+					}
+				}, 2000);
+			}
+		},
+
+		async handleLogout() {
+			this.$confirm("确定退出吗", "提示", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
+			})
+				.then(async () => {
+					loginOut()
+						.then(async () => {
+							this.$message({
+								message: "退出成功",
+								type: "success",
+							});
+							await this.logout();
+							this.$router.push("/login");
+						})
+						.catch((err) => {
+							console.error(err);
+						});
+				})
+				.catch(() => {
+					// 取消操作
+				});
+		},
+
+		// 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
+		async getPer() {
+			// 查询首页应用
+			this.$refs.homepageLRef.getData();
+			//查询cocofrow最近使用与收藏
+			this.$refs.sidebarLRef.getData();
 
-      let params = [
-        {
-          functionName: API_CONFIG.ajax_schoolPermission.functionName, // 调用存储过程的名称
-          org: this.roleUser.org, //组织id
-          oid: this.roleUser.organizeid, //学校id
-        },
-      ];
-      
-      // 发起请求
-      this.$ajax
-        .post(API_CONFIG.baseUrl, params)
-        .then((res) => {
-          let data = res.data[0]
-          // console.log('data', data)
-          this.perData= JSON.parse(data[0].json)
-          this.getToolData()
-        })
-        .catch((err) => {
-          console.error("请求失败,错误信息:", err);
-        });
-    },
-    getToolData() {
 			let params = [
+				{
+					functionName: API_CONFIG.ajax_schoolPermission.functionName, // 调用存储过程的名称
+					org: this.roleUser.org, //组织id
+					oid: this.roleUser.organizeid, //学校id
+				},
+			];
+			// 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
+			// 第一步
+			let res = await this.$ajax.post(API_CONFIG.baseUrl, params);
+			let perData = JSON.parse(res.data[0][0].json);
+
+			// console.log('perData',JSON.parse(JSON.stringify(perData)));
+
+			// 第二步
+			let params2 = [
 				{
 					functionName: "select_desktopToolByPage",
 					status: "",
@@ -214,169 +273,172 @@ export default {
 					lim: 9999999,
 				},
 			];
-			this.$ajax
-				.post(API_CONFIG.baseUrl, params)
-				.then((res) => {
-					let _data = res.data;
-					let _list = _data[0];
-					_list.forEach((i) => {
-						i.url = JSON.parse(i.url);
-						i.json = JSON.parse(i.json);
-						i.argumentList = JSON.parse(i.argumentList);
-					});
-					this.toolList = _list;
-          // console.log('_list',_list);
-          
-					this.setDataListToo(_list);
-				})
-				.catch((err) => {
-					console.log(err);
-					this.$message.error("获取工具数据失败");
-				});
-		},
-    async setDataListToo(toolList = []) {
-      // console.log('toolList',toolList);
-      
-			let _form = JSON.parse(JSON.stringify(this.perData));
-			// _form.desktop.list.forEach((i, index) => {
-			// 	let _index = toolList.findIndex((i2) => i == i2.id);
-			// 	if (_index != -1) {
-			// 		_form.desktop.list[index] = toolList[_index];
-			// 	} else {
-			// 		console.log("无工具", i);
-			// 	}
-			// });
+			let res2 = await this.$ajax.post(API_CONFIG.baseUrl, params2);
+			let toolList = res2.data[0];
+			toolList.forEach((i) => {
+				i.url = JSON.parse(i.url);
+				i.json = JSON.parse(i.json);
+				i.argumentList = JSON.parse(i.argumentList);
+			});
+
+			// 第三步
 
-			_form.admin.index.list.forEach((i, index) => {
+			if (perData.admin.cocoFlow) {
+				perData.admin.cocoFlow.forEach((i, index) => {
+					let _index = toolList.findIndex((i2) => i.id == i2.id);
+					if (_index != -1) {
+						let _setData = toolList[_index];
+						_setData.setIcon = i.setIcon;
+						perData.admin.cocoFlow[index] = _setData;
+					} else {
+						console.log("无应用", i);
+					}
+				});
+			}
+			if (perData.admin.cocoFlow2) {
+				perData.admin.cocoFlow2.forEach((i, index) => {
+					let _index = toolList.findIndex((i2) => i.id == i2.id);
+					if (_index != -1) {
+						let _setData = toolList[_index];
+						_setData.setIcon = i.setIcon;
+						perData.admin.cocoFlow2[index] = _setData;
+					} else {
+						console.log("无应用", i);
+					}
+				});
+			}
+			perData.admin.index.list.forEach((i, index) => {
 				let _index = toolList.findIndex((i2) => i == i2.id);
 				if (_index != -1) {
-					_form.admin.index.list[index] = toolList[_index];
-          _form.admin.index.list[index].hovered = false
+					perData.admin.index.list[index] = toolList[_index];
+					perData.admin.index.list[index].hovered = false;
 				} else {
 					console.log("无工具", i);
 				}
 			});
 
-			_form.admin.sidebar.list.forEach((i, index) => {
+			perData.admin.sidebar.list.forEach((i, index) => {
 				if (i.children) {
 					i.children.forEach((i2, index2) => {
-						let _toolList = JSON.parse(JSON.stringify(toolList))
+						let _toolList = JSON.parse(JSON.stringify(toolList));
 						let _index = _toolList.findIndex((i3) => i2 == i3.id);
-						
+
 						if (_index != -1) {
-							_form.admin.sidebar.list[index].children[index2] = _toolList[_index];
-							_form.admin.sidebar.list[index].children[index2].typeId = _form.admin.sidebar.list[index].typeId + "," +_toolList[_index].id;
+							perData.admin.sidebar.list[index].children[index2] =
+								_toolList[_index];
+							perData.admin.sidebar.list[index].children[index2].typeId =
+								perData.admin.sidebar.list[index].typeId +
+								"," +
+								_toolList[_index].id;
 						} else {
 							console.log("无工具", i);
 						}
 					});
 				} else {
-					let _toolList = JSON.parse(JSON.stringify(toolList))
+					let _toolList = JSON.parse(JSON.stringify(toolList));
 					let _index = _toolList.findIndex((i2) => i == i2.id);
 					if (_index != -1) {
-						_form.admin.sidebar.list[index] = _toolList[_index];
-						_form.admin.sidebar.list[index].typeId =
-							_form.admin.sidebar.list[index].id;
+						perData.admin.sidebar.list[index] = _toolList[_index];
+						perData.admin.sidebar.list[index].typeId =
+							perData.admin.sidebar.list[index].id;
 					} else {
 						console.log("无工具", i);
-					} 
+					}
 				}
 			});
 
-      // console.log('_form',_form);
-      await store.commit('user/SET_FROM', _form)
-      // 获取后台管理设置常见应用
-      this.$refs.homepageLRef.getadmincocoFlow()
-      
-			this.$forceUpdate();
+			await store.commit("user/SET_FROM", perData);
+			// 获取后台管理设置常见应用
+			this.$refs.homepageLRef.getadmincocoFlow();
+			console.log("state.fromL", this.fromL);
 		},
-  },
-  mounted() {
-    console.log('重新获取数据');
-    
-      this.getPer()
-  },
+	},
+	mounted() {
+		console.log("重新获取数据");
+		this.getPer();
+	},
 };
 </script>
 
 <style scoped>
-.top{
-  width: 100%;
-  padding: 0 90px;
-  display: flex;
-  height: 60px;
-  box-sizing: border-box;
+.top {
+	width: 100%;
+	padding: 0 90px;
+	display: flex;
+	height: 60px;
+	box-sizing: border-box;
 }
-.topCon{
-  display: flex;
-  width: 100%;
-  justify-content: space-between;
-  align-items: center;
+.topCon {
+	display: flex;
+	width: 100%;
+	justify-content: space-between;
+	align-items: center;
 }
 .body {
-  width: 100%;
-  height: 100%;
-  overflow: hidden;
-  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+	width: 100%;
+	height: 100%;
+	overflow: hidden;
+	font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
+		"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
 }
-.title{
-  font-family: PingFang SC;
-  font-weight: 400;
-  font-size: 14px;
-  line-height: 100%;
-  letter-spacing: 0%;
-  color: #969BA3;
-  display: flex;
-  gap: 11px;
+.title {
+	font-family: PingFang SC;
+	font-weight: 400;
+	font-size: 14px;
+	line-height: 100%;
+	letter-spacing: 0%;
+	color: #969ba3;
+	display: flex;
+	gap: 11px;
 }
-.person{
-  display: flex;
-  align-items: center;
+.person {
+	display: flex;
+	align-items: center;
 }
-.person_name{
-  display: flex;
-  gap: 9px;
+.person_name {
+	display: flex;
+	gap: 9px;
 }
-.personInfo{
-  display: flex;
-  flex-direction: column;
-  justify-content: space-between;
-  padding: 1px 0 2px;
-  box-sizing: border-box;
+.personInfo {
+	display: flex;
+	flex-direction: column;
+	justify-content: space-between;
+	padding: 5px 0 2px;
+	box-sizing: border-box;
 }
-.personInfoTit{
-  font-family: PingFang SC;
-  font-weight: 500;
-  font-size: 16px;
-  line-height: 100%;
-  color: #000000;
+.personInfoTit {
+	font-family: PingFang SC;
+	font-weight: 500;
+	font-size: 16px;
+	line-height: 100%;
+	color: #000000;
 }
-.personInfoBri{
-  font-family: PingFang SC;
-  font-weight: 300;
-  font-size: 10px;
-  line-height: 100%;
-  color: #969BA3;
+.personInfoBri {
+	font-family: PingFang SC;
+	font-weight: 300;
+	font-size: 10px;
+	line-height: 100%;
+	color: #969ba3;
 }
 .container {
-  display: flex;
-  width: 100%;
-  height: 100vh;
+	display: flex;
+	width: 100%;
+	height: 100vh;
 }
-.container >>> .el-loading-mask{
-  z-index: 0;
+.container >>> .el-loading-mask {
+	z-index: 0;
 }
 .table-container {
-  /* display: flex;
+	/* display: flex;
   flex: 1;
   justify-content: center; */
-  width: 100%;
-  background-color: #F9FAFB;
-  position: relative;
+	width: 100%;
+	background-color: #f9fafb;
+	position: relative;
 }
-.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: 999;
+.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: 999;
 }
-</style>
+</style>

+ 3 - 0
src/views/kanBan/components/AquickEntrance.vue

@@ -82,6 +82,9 @@ import { addrrole } from "@/api/user";
                     // console.log('res.data[0]',res.data[0]);
                     if (res.data[0].length) {
                         await store.commit('user/SET_USERINFO2', res.data[0][0])
+
+                        await store.commit('user/SET_AppSIGN', '')
+
                         this.loading = false
 
                         this.$router.push('/');

+ 5 - 2
src/views/kanBan/index.vue

@@ -82,6 +82,7 @@ export default {
     },
     computed: {
     ...mapGetters(['userinfo','userinfo2','fromL','appSign']),
+    // 去除账号后缀
     userSuffix(){
       return function(val) {
         let userName = JSON.parse(JSON.stringify(val))
@@ -112,6 +113,7 @@ export default {
         gotoli(){
             this.$router.push('/homepageL');
         },
+        // 退出登录
         async handleLogout() {
             this.$confirm('确定退出吗', '提示', {
                 confirmButtonText: '确定',
@@ -134,8 +136,9 @@ export default {
                 // 取消操作
             });
         },
+        // 导航栏切换
         setActive(Index) {
-            this.isActive = Index; // 设置激活的按钮
+            this.isActive = Index; 
         }
     },
     mounted() {
@@ -193,7 +196,7 @@ export default {
   display: flex;
   flex-direction: column;
   justify-content: space-between;
-  padding: 1px 0 2px;
+  padding: 5px 0 2px;
   box-sizing: border-box;
 }
 .personInfoTit{