|
|
@@ -1,5 +1,15 @@
|
|
|
<template>
|
|
|
<div class="pb_content" style="background: #F0F2F5;" v-loading.fullscreen.lock="uploadWorkLoading">
|
|
|
+ <confirm-dialog
|
|
|
+ :visible.sync="confirmVisible"
|
|
|
+ :title="confirmTitle"
|
|
|
+ :message="confirmMessage"
|
|
|
+ :confirm-text="confirmConfirmText"
|
|
|
+ :cancel-text="confirmCancelText"
|
|
|
+ @confirm="handleConfirm"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ />
|
|
|
+
|
|
|
<div class="pb_content_body" style="position: relative; margin: 0">
|
|
|
<div class="right">
|
|
|
<div style="width: 100%; height: 100%; overflow: auto" ref="stepBox">
|
|
|
@@ -743,19 +753,31 @@
|
|
|
<div class="modal-body">
|
|
|
<div class="form-item">
|
|
|
<label class="form-label">{{ lang.ssSubjectCategory }}</label>
|
|
|
- <el-select v-model="selectedSubject" :placeholder="lang.ssSelectSubj" class="custom-select" collapse-tags
|
|
|
+ <!-- <el-select v-model="selectedSubject" :placeholder="lang.ssSelectSubj" class="custom-select" collapse-tags
|
|
|
multiple style="width: 100%">
|
|
|
<el-option v-for="option in subjectOptions" :key="option.id" :label="option.name"
|
|
|
:value="option.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
+ <selectTag
|
|
|
+ v-model="selectedSubject"
|
|
|
+ :options="subjectOptions"
|
|
|
+ :placeholder=lang.ssSelectSubj
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="form-item">
|
|
|
<label class="form-label">{{ lang.ssGradeType }}</label>
|
|
|
- <el-select v-model="selectedGrade" :placeholder="lang.ssSelectGrade" class="custom-select" collapse-tags
|
|
|
+ <!-- <el-select v-model="selectedGrade" :placeholder="lang.ssSelectGrade" class="custom-select" collapse-tags
|
|
|
multiple style="width: 100%">
|
|
|
<el-option v-for="option in gradeOptions" :key="option.id" :label="option.name"
|
|
|
:value="option.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
+ <selectTag
|
|
|
+ v-model="selectedGrade"
|
|
|
+ :options="gradeOptions"
|
|
|
+ :placeholder=lang.ssSelectGrade
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
@@ -785,35 +807,58 @@
|
|
|
<div class="form-box">
|
|
|
<div class="form-box-left">
|
|
|
<div class="form-row">
|
|
|
- <div class="form-item required" style="flex: 2;">
|
|
|
+ <div class="form-item required">
|
|
|
<label class="form-label">{{ lang.ssSubjectCategory }}</label>
|
|
|
- <el-select v-model="selectedSubject" :placeholder="lang.ssSelectSubj" class="custom-select" collapse-tags multiple
|
|
|
- style="width: 100%">
|
|
|
- <el-option v-for="option in subjectOptions" :key="option.id" :label="option.name"
|
|
|
- :value="option.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <selectTag
|
|
|
+ v-model="selectedSubject"
|
|
|
+ :options="subjectOptions"
|
|
|
+ :placeholder=lang.ssSelectSubj
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="form-item required">
|
|
|
+ <label class="form-label">{{ lang.ssClass }}{{ lang.ssLabel }}</label>
|
|
|
+ <selectTag
|
|
|
+ v-model="selectedGrade"
|
|
|
+ :options="gradeOptions"
|
|
|
+ :placeholder=lang.ssSelectGrade
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="form-row">
|
|
|
+ <div class="form-item required" style="flex: 2;">
|
|
|
+ <label class="form-label">{{ lang.ssClass }}</label>
|
|
|
+ <selectTag
|
|
|
+ v-model="checkboxList2"
|
|
|
+ :options="classOptions"
|
|
|
+ :placeholder=lang.ssSelectClass
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <div class="form-row">
|
|
|
<div class="form-item required">
|
|
|
<label class="form-label">{{ lang.ssGradeType }}</label>
|
|
|
- <el-select v-model="selectedGrade" :placeholder="lang.ssSelectGrade" class="custom-select" collapse-tags multiple
|
|
|
- style="width: 100%">
|
|
|
- <el-option v-for="option in gradeOptions" :key="option.id" :label="option.name"
|
|
|
- :value="option.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <selectTag
|
|
|
+ v-model="selectedGrade"
|
|
|
+ :options="gradeOptions"
|
|
|
+ :placeholder=lang.ssSelectGrade
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
</div>
|
|
|
|
|
|
<div class="form-item required">
|
|
|
<label class="form-label">{{ lang.ssClass }}</label>
|
|
|
- <el-select v-model="checkboxList2" :placeholder="lang.ssSelectClass" class="custom-select" collapse-tags multiple
|
|
|
- style="width: 100%">
|
|
|
- <el-option v-for="option in classOptions" :key="option.id" :label="option.name"
|
|
|
- :value="option.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <selectTag
|
|
|
+ v-model="checkboxList2"
|
|
|
+ :options="classOptions"
|
|
|
+ :placeholder=lang.ssSelectClass
|
|
|
+ style="width: 100%;"
|
|
|
+ />
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
|
|
|
<div class="form-row">
|
|
|
<div class="form-item required">
|
|
|
@@ -921,6 +966,8 @@ import BilibiliSearchDialog from "./dialog/BilibiliSearchDialog2.vue";
|
|
|
import { v4 as uuidv4 } from "uuid";
|
|
|
import InteractiveToolDialog from "./dialog/InteractiveToolDialog.vue";
|
|
|
import VideoUploadDialog from "./dialog/VideoUploadDialog2.vue";
|
|
|
+import ConfirmDialog from "../../common/ConfirmDialog";
|
|
|
+import selectTag from "./dialog/selectTag3.vue";
|
|
|
|
|
|
var OpenCC = require("opencc-js");
|
|
|
let converter = OpenCC.Converter({
|
|
|
@@ -973,7 +1020,9 @@ export default {
|
|
|
InteractiveToolDialog,
|
|
|
VideoUploadDialog,
|
|
|
BilibiliSearchDialog,
|
|
|
- appDialog
|
|
|
+ appDialog,
|
|
|
+ ConfirmDialog,
|
|
|
+ selectTag
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -989,6 +1038,12 @@ export default {
|
|
|
dialogVisibleBasicInfo: false,
|
|
|
dialogVisibleClass: false,
|
|
|
dialogVisiblePublish: false,
|
|
|
+ confirmVisible: false,
|
|
|
+ confirmTitle: '',
|
|
|
+ confirmMessage: '',
|
|
|
+ confirmConfirmText: '',
|
|
|
+ confirmCancelText: '',
|
|
|
+ confirmCallback: null,
|
|
|
loading: false,
|
|
|
courseName: "",
|
|
|
isTeacherSee: false,
|
|
|
@@ -1305,7 +1360,7 @@ export default {
|
|
|
// 暂时使用模拟数据
|
|
|
this.classOptions = this.grade2.map(item => ({
|
|
|
id: item.id,
|
|
|
- name: item.name
|
|
|
+ name: item.classname ? item.classname + '-' + item.name : item.name
|
|
|
}));
|
|
|
},
|
|
|
// 确认发布
|
|
|
@@ -1369,7 +1424,7 @@ export default {
|
|
|
generateFromAI() {
|
|
|
console.log('自AI生成');
|
|
|
if(!this.courseName){
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
}
|
|
|
if(this.avatar_loading){
|
|
|
@@ -1498,14 +1553,14 @@ export default {
|
|
|
// this.isTeacherSee = true
|
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.addWork();
|
|
|
}
|
|
|
} else {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
console.log("修改课程");
|
|
|
@@ -1542,14 +1597,14 @@ export default {
|
|
|
save(type = 1) {
|
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.addWork(2, type);
|
|
|
}
|
|
|
} else {
|
|
|
if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
return;
|
|
|
} else {
|
|
|
this.updateWork(2, type);
|
|
|
@@ -1614,45 +1669,47 @@ export default {
|
|
|
// }
|
|
|
},
|
|
|
lastSteps() {
|
|
|
- this.$confirm(this.lang.ssSaveEdit, this.lang.ssTip, {
|
|
|
- confirmButtonText: this.lang.ssSave,
|
|
|
- cancelButtonText: this.lang.ssNotSave,
|
|
|
- distinguishCancelAndClose: true,
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- console.log("保存已编辑内容");
|
|
|
- if (this.cid == "" || this.cid == undefined) {
|
|
|
- if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.addWork();
|
|
|
- }
|
|
|
+ this.confirmTitle = this.lang.ssTip;
|
|
|
+ this.confirmMessage = this.lang.ssSaveEdit;
|
|
|
+ this.confirmConfirmText = this.lang.ssSave;
|
|
|
+ this.confirmCancelText = this.lang.ssNotSave;
|
|
|
+ this.confirmCallback = () => {
|
|
|
+ console.log("保存已编辑内容");
|
|
|
+ if (this.cid == "" || this.cid == undefined) {
|
|
|
+ if (this.courseName == "") {
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
+ return;
|
|
|
} else {
|
|
|
- if (this.courseName == "") {
|
|
|
- this.$message.error(this.lang.ssFillCourseName);
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.updateWork();
|
|
|
- }
|
|
|
+ this.addWork();
|
|
|
}
|
|
|
- })
|
|
|
- .catch(v => {
|
|
|
- console.log(v);
|
|
|
- if (v == "cancel") {
|
|
|
- this.goTo(
|
|
|
- "/course?userid=" +
|
|
|
- this.userid +
|
|
|
- "&oid=" +
|
|
|
- this.oid +
|
|
|
- "&org=" +
|
|
|
- this.org +
|
|
|
- "&role=" +
|
|
|
- this.role
|
|
|
- );
|
|
|
+ } else {
|
|
|
+ if (this.courseName == "") {
|
|
|
+ this.$message.error(this.lang.ssFillCourseName2);
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ this.updateWork();
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ this.confirmVisible = true;
|
|
|
+ },
|
|
|
+ handleConfirm() {
|
|
|
+ if (this.confirmCallback) {
|
|
|
+ this.confirmCallback();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
+ console.log("不保存已编辑内容");
|
|
|
+ this.goTo(
|
|
|
+ "/course?userid=" +
|
|
|
+ this.userid +
|
|
|
+ "&oid=" +
|
|
|
+ this.oid +
|
|
|
+ "&org=" +
|
|
|
+ this.org +
|
|
|
+ "&role=" +
|
|
|
+ this.role
|
|
|
+ );
|
|
|
},
|
|
|
//获取ppt的数据
|
|
|
async getPPtJson() {
|
|
|
@@ -1678,6 +1735,30 @@ export default {
|
|
|
checkLoaded(resolve);
|
|
|
});
|
|
|
},
|
|
|
+ //获取ppt的数据
|
|
|
+ async getPPTimgExporting() {
|
|
|
+ const checkLoaded = async (resolve) => {
|
|
|
+ console.log("获取ppt数据")
|
|
|
+ let _pptIframe = this.$refs.pptIframeRef;
|
|
|
+ if (
|
|
|
+ _pptIframe &&
|
|
|
+ _pptIframe.contentWindow &&
|
|
|
+ _pptIframe.contentWindow.window &&
|
|
|
+ typeof _pptIframe.contentWindow.window.exportJSON === "function"
|
|
|
+ ) {
|
|
|
+ let _data = _pptIframe.contentWindow.window.imgExporting();
|
|
|
+ resolve(_data);
|
|
|
+ } else {
|
|
|
+ // 递归等待1000ms后重试
|
|
|
+ setTimeout(() => {
|
|
|
+ checkLoaded(resolve);
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ checkLoaded(resolve);
|
|
|
+ });
|
|
|
+ },
|
|
|
//上传文件
|
|
|
uploadFile(file) {
|
|
|
return new Promise((resolve) => {
|
|
|
@@ -1786,6 +1867,12 @@ export default {
|
|
|
this.uploadWorkLoading = true;
|
|
|
}
|
|
|
let _pptData = await this.getPPtJson();
|
|
|
+ let imgExporting = await this.getPPTimgExporting()
|
|
|
+ if (type == 1 && imgExporting) {
|
|
|
+ this.uploadWorkLoading = false;
|
|
|
+ this.$message.info(this.lang.ssPptLoad2)
|
|
|
+ return
|
|
|
+ }
|
|
|
const _pptData2 = JSON.parse(JSON.stringify(_pptData))
|
|
|
const pptContent = []
|
|
|
if (_pptData2.slides) {
|
|
|
@@ -1899,6 +1986,12 @@ export default {
|
|
|
this.uploadWorkLoading = true;
|
|
|
}
|
|
|
let _pptData = await this.getPPtJson();
|
|
|
+ let imgExporting = await this.getPPTimgExporting()
|
|
|
+ if (type == 1 && imgExporting) {
|
|
|
+ this.uploadWorkLoading = false;
|
|
|
+ this.$message.info(this.lang.ssPptLoad2)
|
|
|
+ return
|
|
|
+ }
|
|
|
const _pptData2 = JSON.parse(JSON.stringify(_pptData))
|
|
|
const pptContent = []
|
|
|
if (_pptData2.slides) {
|
|
|
@@ -2673,6 +2766,19 @@ export default {
|
|
|
this.addContent(cocoroboItem)
|
|
|
this.setPPtToolList();
|
|
|
},
|
|
|
+ setUrl() {
|
|
|
+ let url = 'https://beta.pbl.cocorobo.cn'
|
|
|
+ if (this.lang.lang === 'cn') {
|
|
|
+ url = 'https://pbl.cocorobo.cn'
|
|
|
+ }
|
|
|
+ else if (this.lang.lang === 'hk') {
|
|
|
+ url = 'https://pbl.cocorobo.hk'
|
|
|
+ }
|
|
|
+ else if (this.lang.lang === 'en') {
|
|
|
+ url = 'https://pbl.cocorobo.com'
|
|
|
+ }
|
|
|
+ return url
|
|
|
+ },
|
|
|
addTest() {
|
|
|
// var aj = this.testJson.testJson;
|
|
|
// var b = 1;
|
|
|
@@ -2765,7 +2871,8 @@ export default {
|
|
|
|
|
|
this.dialogVisibleChoice = false;
|
|
|
this.getWorkPageId(_data.id, 45, testJson).then(res => {
|
|
|
- let url = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`
|
|
|
+ let baseUrl = this.setUrl()
|
|
|
+ let url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`
|
|
|
this.pptCourseJson.toolsList.find(i => i.id === _data.id).url = url;
|
|
|
this.setPPtToolList();
|
|
|
_data.url = url
|
|
|
@@ -3021,7 +3128,8 @@ export default {
|
|
|
|
|
|
this.dialogVisible8 = false;
|
|
|
this.getWorkPageId(_data.id, 15, { answerQ: this.answerQ }).then(res => {
|
|
|
- let url = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`;
|
|
|
+ let baseUrl = this.setUrl()
|
|
|
+ let url = `${baseUrl}/pbl-teacher-table/dist/workPage.html#/setWorkPage?id=${res}&type=${_data.tool}`;
|
|
|
this.pptCourseJson.toolsList.find(i => i.id === _data.id).url = url;
|
|
|
this.setPPtToolList();
|
|
|
_data.url = url
|
|
|
@@ -3978,6 +4086,11 @@ export default {
|
|
|
padding: 0 30px 0 15px;
|
|
|
}
|
|
|
|
|
|
+.search_input >>> .el-input.is-active .el-input__inner,
|
|
|
+.search_input >>> .el-input__inner:focus{
|
|
|
+ border-color: #f8932f;
|
|
|
+}
|
|
|
+
|
|
|
.search_img {
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
@@ -4850,8 +4963,8 @@ export default {
|
|
|
}
|
|
|
|
|
|
.btn-cancel:hover {
|
|
|
- border-color: #c6e2ff;
|
|
|
- color: #409eff;
|
|
|
+ border-color: #ff9500;
|
|
|
+ color: #ff9500;
|
|
|
}
|
|
|
|
|
|
.publish-modal-footer .btn-cancel {
|