|
|
@@ -3,14 +3,14 @@
|
|
|
<div class="container">
|
|
|
<div class="leftBar" style="height: 100%">
|
|
|
<sidebarL
|
|
|
- v-if="!this.$route.query.courseId"
|
|
|
+ v-if="!courseId && !cocoNoteType"
|
|
|
@getPer="getPer"
|
|
|
@AddAppJson="AddAppJson"
|
|
|
ref="sidebarLRef"
|
|
|
></sidebarL>
|
|
|
</div>
|
|
|
<div class="table-container">
|
|
|
- <div class="top" v-show="!appSign">
|
|
|
+ <div class="top" v-show="!appSign || cocoNoteType">
|
|
|
<div class="topCon">
|
|
|
<div class="title">
|
|
|
<span v-if="roleUser.orgName">{{ roleUser.orgName }}</span>
|
|
|
@@ -47,7 +47,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="prefixL != 'liyuan_'" @click="backVersion" class="Version">
|
|
|
+ <div v-if="prefixL != 'liyuan_' && !cocoNoteType" @click="backVersion" class="Version">
|
|
|
{{ lang.Returnoldversion }}
|
|
|
</div>
|
|
|
<el-button
|
|
|
@@ -184,7 +184,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
-import { loginOut } from "@/api/user";
|
|
|
+import { loginOut,getCourseGroup } from "@/api/user";
|
|
|
import sidebarL from "../components/sidebarL.vue";
|
|
|
import { API_CONFIG } from "@/common/apiConfig";
|
|
|
import store from "../store";
|
|
|
@@ -275,6 +275,10 @@ export default {
|
|
|
betaL: this.$region,
|
|
|
clearifa: "",
|
|
|
msgNum: 0,
|
|
|
+ cocoNoteType: this.$route.query.cocoNoteType,
|
|
|
+ // cocoNoteType: '666',
|
|
|
+ courseId: this.$route.query.courseId,
|
|
|
+ // courseId: 'da5aa5b7-a98c-11f0-84cf-005056924926',
|
|
|
// 荔园集团下的学校
|
|
|
mergedList: [
|
|
|
"3823a6a5-1b6e-11f0-a66a-005056924926",
|
|
|
@@ -462,9 +466,90 @@ export default {
|
|
|
}, 2000);
|
|
|
}
|
|
|
},
|
|
|
- handleLoad(){
|
|
|
+ async handleLoad(){
|
|
|
this.loading = false;
|
|
|
console.log('iframe加载完成');
|
|
|
+ if (this.cocoNoteType && this.courseId) {
|
|
|
+ let params = {
|
|
|
+ cid: this.courseId,
|
|
|
+ classid: '1',
|
|
|
+ };
|
|
|
+
|
|
|
+ try {
|
|
|
+ let res = await getCourseGroup(params);
|
|
|
+ if (res.data && res.data[1].length) {
|
|
|
+ let groupPerson = res.data[1]
|
|
|
+ let groupCid = ''
|
|
|
+ for (var i = 0; i < groupPerson.length; i++) {
|
|
|
+ if (groupPerson[i].userid == this.roleUser.userid) {
|
|
|
+ groupCid = groupPerson[i].groupCid
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (groupCid) {
|
|
|
+ window.topU.postMessage(
|
|
|
+ {
|
|
|
+ tools: "opencCscl",
|
|
|
+ cid: this.courseId,
|
|
|
+ gid: groupCid,
|
|
|
+ },
|
|
|
+ "*"
|
|
|
+ );
|
|
|
+ this.addOp3('1', "", { courseid: this.courseId , type: (this.roleUser.type == 1 ? '_teacher' : '_student') + "CocoNote_open" }, "success")
|
|
|
+ } else {
|
|
|
+ this.$message.error("没有加入分组请先加入分组");
|
|
|
+ this.goToCourse3(this.courseId)
|
|
|
+ this.addOp3('1', "", { courseid: this.courseId , type: (this.roleUser.type == 1 ? '_teacher' : '_student') + "CocoNote_open" }, '没有加入分组请先加入分组')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error("没有加入分组请先加入分组");
|
|
|
+ this.goToCourse3(this.courseId)
|
|
|
+ this.addOp3('1', "", { courseid: this.courseId , type: (this.roleUser.type == 1 ? '_teacher' : '_student') + "CocoNote_open" }, '没有加入分组请先加入分组')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.addOp3(
|
|
|
+ "1",
|
|
|
+ "",
|
|
|
+ { courseid: this.courseId ,type: (this.roleUser.type == 1 ? '_teacher' : '_student') + "CocoNote_open" },
|
|
|
+ error
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goToCourse3() {
|
|
|
+
|
|
|
+ // if (courseId) {
|
|
|
+
|
|
|
+ this.openApp4({
|
|
|
+ stateL: true,
|
|
|
+ toolId: "synergyCourse/add",
|
|
|
+ clearL: true,
|
|
|
+ });
|
|
|
+ // this.$router.push(
|
|
|
+ // "/synergyCourse/add?cid=" +
|
|
|
+ // courseId +
|
|
|
+ // "&userid=" +
|
|
|
+ // this.userid +
|
|
|
+ // "&oid=" +
|
|
|
+ // this.oid +
|
|
|
+ // "&org=" +
|
|
|
+ // this.org +
|
|
|
+ // "&role=" +
|
|
|
+ // this.role
|
|
|
+ // );
|
|
|
+ // } else {
|
|
|
+ // this.$router.push(
|
|
|
+ // "/synergyCourse/add?userid=" +
|
|
|
+ // this.userid +
|
|
|
+ // "&oid=" +
|
|
|
+ // this.oid +
|
|
|
+ // "&org=" +
|
|
|
+ // this.org +
|
|
|
+ // "&role=" +
|
|
|
+ // this.role
|
|
|
+ // );
|
|
|
+ // this.addOp3('1', "", { type: "CocoNote_standard_add" }, "success")
|
|
|
+ // }
|
|
|
},
|
|
|
async handleLogout() {
|
|
|
this.$confirm(this.lang.sureexit, this.lang.tip, {
|
|
|
@@ -515,7 +600,7 @@ export default {
|
|
|
let queryString = "";
|
|
|
if (argumentList && argumentList.length) {
|
|
|
const paramsMap = {
|
|
|
- courseId: this.$route.query.courseId,
|
|
|
+ courseId: this.courseId,
|
|
|
userid: _userid,
|
|
|
oid: _oid,
|
|
|
org: _org,
|
|
|
@@ -555,6 +640,127 @@ export default {
|
|
|
"success"
|
|
|
);
|
|
|
},
|
|
|
+ // coconotetype网址登录到页面直接跳转到协同建构
|
|
|
+ async openApp3(val) {
|
|
|
+ let url = "";
|
|
|
+ let argumentList = ["userid", "oid", "org","role"];
|
|
|
+ if (this.betaL == "beta") {
|
|
|
+ url = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/${val.toolId}`;
|
|
|
+ } else {
|
|
|
+ url = `https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/${val.toolId}`;
|
|
|
+ }
|
|
|
+
|
|
|
+ await store.commit("user/SET_AppSIGN", val.toolId);
|
|
|
+
|
|
|
+ let _userinfo = this.roleUser, //登录用户信息
|
|
|
+ {
|
|
|
+ userid: _userid,
|
|
|
+ organizeid: _oid,
|
|
|
+ org: _org,
|
|
|
+ role:_role,
|
|
|
+ } = _userinfo; // 解构赋值获取用户信息
|
|
|
+ let queryString = "";
|
|
|
+ if (argumentList && argumentList.length) {
|
|
|
+ const paramsMap = {
|
|
|
+ userid: _userid,
|
|
|
+ oid: _oid,
|
|
|
+ org: _org,
|
|
|
+ role: _role,
|
|
|
+ ly :1
|
|
|
+ };
|
|
|
+
|
|
|
+ const canshu = 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 = url + queryString;
|
|
|
+ console.log("_url", _url);
|
|
|
+
|
|
|
+ let pl = {
|
|
|
+ json: _url,
|
|
|
+ stateL: true,
|
|
|
+ toolId: val.toolId,
|
|
|
+ clearL: val.clearL,
|
|
|
+ };
|
|
|
+ this.AddAppJson(pl)
|
|
|
+ // this.$emit("cutUrl", pl);
|
|
|
+ this.addOp3(
|
|
|
+ "1",
|
|
|
+ "",
|
|
|
+ { type: this.prefixL + val.toolId + (this.roleUser.type == 1 ? '_teacher' : '_student') + "stu_open" },
|
|
|
+ "success"
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // coconotetype网址登录到页面直接跳转到协同建构,未加入分组后提示加入分组
|
|
|
+ async openApp4(val) {
|
|
|
+ let url = "";
|
|
|
+ let argumentList = ["userid", "oid", "org","role","cid"];
|
|
|
+ if (this.betaL == "beta") {
|
|
|
+ url = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/${val.toolId}`;
|
|
|
+ } else {
|
|
|
+ url = `https://pbl.cocorobo.cn/pbl-teacher-table/dist/#/${val.toolId}`;
|
|
|
+ }
|
|
|
+
|
|
|
+ await store.commit("user/SET_AppSIGN", val.toolId);
|
|
|
+
|
|
|
+ let _userinfo = this.roleUser, //登录用户信息
|
|
|
+ {
|
|
|
+ userid: _userid,
|
|
|
+ organizeid: _oid,
|
|
|
+ org: _org,
|
|
|
+ role:_role,
|
|
|
+ } = _userinfo; // 解构赋值获取用户信息
|
|
|
+ let queryString = "";
|
|
|
+ if (argumentList && argumentList.length) {
|
|
|
+ const paramsMap = {
|
|
|
+ cid: this.courseId,
|
|
|
+ userid: _userid,
|
|
|
+ oid: _oid,
|
|
|
+ org: _org,
|
|
|
+ role: _role,
|
|
|
+ ly :1
|
|
|
+ };
|
|
|
+
|
|
|
+ const canshu = 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 = url + queryString;
|
|
|
+ console.log("_url", _url);
|
|
|
+
|
|
|
+ let pl = {
|
|
|
+ json: _url,
|
|
|
+ stateL: true,
|
|
|
+ toolId: val.toolId,
|
|
|
+ clearL: val.clearL,
|
|
|
+ };
|
|
|
+ this.AddAppJson(pl)
|
|
|
+ // this.$emit("cutUrl", pl);
|
|
|
+ this.addOp3(
|
|
|
+ "1",
|
|
|
+ "",
|
|
|
+ { type: this.prefixL + val.toolId + (this.roleUser.type == 1 ? '_teacher' : '_student') + "stu_open" },
|
|
|
+ "success"
|
|
|
+ );
|
|
|
+ },
|
|
|
// 获取学校权限与组织权限,优先使用学校权限,其次使用组织权限
|
|
|
async getPer() {
|
|
|
this.clearifa = "";
|
|
|
@@ -593,15 +799,9 @@ export default {
|
|
|
mounted() {
|
|
|
console.log("重新获取数据");
|
|
|
console.log('this.$route.query.courseId',this.$route.query.courseId);
|
|
|
- this.getPer();
|
|
|
- // this.getMsg()
|
|
|
- if (this.$route.query.courseId) {
|
|
|
- this.openApp2({
|
|
|
- stateL: true,
|
|
|
- toolId: "courseDetail",
|
|
|
- clearL: true,
|
|
|
- });
|
|
|
- }
|
|
|
+ console.log('this.$route.query.cocoNoteType',this.$route.query.cocoNoteType);
|
|
|
+
|
|
|
+
|
|
|
if (
|
|
|
!this.roleUser.cclassid &&
|
|
|
this.roleUser.type == 1 &&
|
|
|
@@ -611,6 +811,23 @@ export default {
|
|
|
) {
|
|
|
this.editInfo();
|
|
|
}
|
|
|
+ // this.getMsg()
|
|
|
+ if(this.cocoNoteType){
|
|
|
+ this.openApp3({
|
|
|
+ stateL: true,
|
|
|
+ toolId: "synergyCourse",
|
|
|
+ clearL: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }else if (this.courseId) {
|
|
|
+ this.openApp2({
|
|
|
+ stateL: true,
|
|
|
+ toolId: "courseDetail",
|
|
|
+ clearL: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.getPer();
|
|
|
},
|
|
|
};
|
|
|
</script>
|