|
|
@@ -2,12 +2,8 @@
|
|
|
<div class="pptEasyClass">
|
|
|
<div class="pec_main" v-loading="pageLoading">
|
|
|
<!-- 录音转文字 -->
|
|
|
- <iframe
|
|
|
- allow="camera *; microphone *;display-capture;midi;encrypted-media;"
|
|
|
- :src="iframeSrcop"
|
|
|
- ref="iiframe"
|
|
|
- v-show="false"
|
|
|
- ></iframe>
|
|
|
+ <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;" :src="iframeSrcop" ref="iiframe"
|
|
|
+ v-show="false"></iframe>
|
|
|
<div class="pec_header">
|
|
|
<div class="pec_h_left">
|
|
|
<div @click.stop="back" class="backBtn" v-if="screenType != 2 || tType == 1">
|
|
|
@@ -25,15 +21,23 @@
|
|
|
<div class="pec_h_center">
|
|
|
<el-tooltip effect="dark" :content="lang.ssRefresh" placement="bottom">
|
|
|
<div class="refresh_icon" @click="refreshCourse">
|
|
|
- <img src="../../assets/icon/course/refresh-2.svg" />
|
|
|
+ <img src="../../assets/icon/course/refresh-2.svg" />
|
|
|
</div>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip class="item" effect="dark" :content="recordedForm.status == 1 ? lang.ssFinishClassRecording : lang.ssBeginClassRecording" placement="bottom" v-show="(jArray.includes(oid) || jArray.includes(org)) && courseDetail.userid == userid && tcid">
|
|
|
- <div class="pec_h_r_btn_refresh" :class="{ 'recording': recordedForm.status == 1 }" @click="toggleRecording">
|
|
|
- <svg t="1772588344140" viewBox="0 0 1024 1024" p-id="1693" width="200" height="200"><path d="M512 1024a512.568889 512.568889 0 0 1-512-512 512.625778 512.625778 0 0 1 512-512 512.568889 512.568889 0 0 1 512 512 512.568889 512.568889 0 0 1-512 512zM512 73.329778c-241.948444 0-438.670222 196.835556-438.670222 438.670222S270.051556 950.670222 512 950.670222s438.670222-196.835556 438.670222-438.670222S753.948444 73.329778 512 73.329778z m0 686.592a245.191111 245.191111 0 1 1 0-490.382222 245.191111 245.191111 0 0 1 0 490.382222z" p-id="1694"></path></svg>
|
|
|
+ <el-tooltip class="item" effect="dark"
|
|
|
+ :content="recordedForm.status == 1 ? lang.ssFinishClassRecording : lang.ssBeginClassRecording"
|
|
|
+ placement="bottom"
|
|
|
+ v-show="(jArray.includes(oid) || jArray.includes(org)) && courseDetail.userid == userid && tcid">
|
|
|
+ <div class="pec_h_r_btn_refresh" :class="{ 'recording': recordedForm.status == 1 }"
|
|
|
+ @click="toggleRecording">
|
|
|
+ <svg t="1772588344140" viewBox="0 0 1024 1024" p-id="1693" width="200" height="200">
|
|
|
+ <path
|
|
|
+ d="M512 1024a512.568889 512.568889 0 0 1-512-512 512.625778 512.625778 0 0 1 512-512 512.568889 512.568889 0 0 1 512 512 512.568889 512.568889 0 0 1-512 512zM512 73.329778c-241.948444 0-438.670222 196.835556-438.670222 438.670222S270.051556 950.670222 512 950.670222s438.670222-196.835556 438.670222-438.670222S753.948444 73.329778 512 73.329778z m0 686.592a245.191111 245.191111 0 1 1 0-490.382222 245.191111 245.191111 0 0 1 0 490.382222z"
|
|
|
+ p-id="1694"></path>
|
|
|
+ </svg>
|
|
|
<span>{{ recordedForm.status == 1 ? lang.ssStopRecording2 : lang.ssRecord }}</span>
|
|
|
- </div>
|
|
|
- </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
|
|
|
<el-tooltip effect="dark" :content="courseDetail.title" placement="bottom">
|
|
|
<div class="pec_h_l_title">
|
|
|
@@ -41,19 +45,14 @@
|
|
|
</div>
|
|
|
</el-tooltip>
|
|
|
<div class="free-browse-switch" v-if="courseDetail.userid == userid">
|
|
|
- <el-switch
|
|
|
- v-model="freeBrowse"
|
|
|
- :active-value="false"
|
|
|
- :inactive-value="true"
|
|
|
- class="custom-switch"
|
|
|
- active-color="#03ae2b"
|
|
|
- inactive-color="#d8d8d8"
|
|
|
- @change="onFreeBrowseChange"
|
|
|
- ></el-switch>
|
|
|
- <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse : lang.ssFollowMode }}</span>
|
|
|
+ <el-switch v-model="freeBrowse" :active-value="false" :inactive-value="true" class="custom-switch"
|
|
|
+ active-color="#03ae2b" inactive-color="#d8d8d8" @change="onFreeBrowseChange"></el-switch>
|
|
|
+ <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse :
|
|
|
+ lang.ssFollowMode }}</span>
|
|
|
</div>
|
|
|
<div class="free-browse-switch" v-if="tType == 2">
|
|
|
- <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse : lang.ssFollowMode }}</span>
|
|
|
+ <span class="switch-label" :class="{ active: freeBrowse }">{{ freeBrowse ? lang.ssFreeBrowse :
|
|
|
+ lang.ssFollowMode }}</span>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
@@ -62,7 +61,8 @@
|
|
|
<!-- openObserveDialog -->
|
|
|
<!-- toggleRecording -->
|
|
|
|
|
|
- <div class="pec_h_r_btn_uploadVoiceBtn" @click="uploadVoiceBtn" v-if="courseDetail.userid == userid" v-show="false">
|
|
|
+ <div class="pec_h_r_btn_uploadVoiceBtn" @click="uploadVoiceBtn" v-if="courseDetail.userid == userid"
|
|
|
+ v-show="false">
|
|
|
<span>{{ lang.ssUploadRecordingFile }}</span>
|
|
|
</div>
|
|
|
|
|
|
@@ -86,21 +86,10 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 课堂观察弹窗 -->
|
|
|
- <el-dialog
|
|
|
- :visible.sync="showObserveDialog"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false"
|
|
|
- :show-close="true"
|
|
|
- width="90%"
|
|
|
- top="5vh"
|
|
|
- class="observe-dialog"
|
|
|
- >
|
|
|
- <iframe
|
|
|
- v-if="showObserveDialog"
|
|
|
- :src="observeDialogUrl"
|
|
|
- frameborder="0"
|
|
|
- style="width: 100%; height: 85vh; border: none;"
|
|
|
- ></iframe>
|
|
|
+ <el-dialog :visible.sync="showObserveDialog" :close-on-click-modal="false" :close-on-press-escape="false"
|
|
|
+ :show-close="true" width="90%" top="5vh" class="observe-dialog">
|
|
|
+ <iframe v-if="showObserveDialog" :src="observeDialogUrl" frameborder="0"
|
|
|
+ style="width: 100%; height: 85vh; border: none;"></iframe>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -165,9 +154,9 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
iframeSrcop() {
|
|
|
- if(this.$region == 'hk') {
|
|
|
+ if (this.$region == 'hk') {
|
|
|
return `https://cloud.cocorobo.hk/browser/public/index.html`;
|
|
|
- } else if(this.$region == 'com') {
|
|
|
+ } else if (this.$region == 'com') {
|
|
|
return `https://cloud.cocorobo.com/browser/public/index.html`;
|
|
|
} else {
|
|
|
return `https://beta.cloud.cocorobo.cn/browser/public/index.html`;
|
|
|
@@ -181,46 +170,51 @@ export default {
|
|
|
refreshCourse() {
|
|
|
this.getCourseDetail();
|
|
|
},
|
|
|
- audioStart(){
|
|
|
+ audioStart() {
|
|
|
this.onStartRecordWithMicrosoft();
|
|
|
},
|
|
|
toggleRecording() {
|
|
|
+ return new Promise(resolve => {
|
|
|
+ if (this.recordedForm.status == 1) {
|
|
|
+ // 检查录音时间是否至少为5秒
|
|
|
+ const now = new Date();
|
|
|
+ const duration = (now - new Date(this.recordingStartTime)) / 1000;
|
|
|
+ if (duration < 5) {
|
|
|
+ this.$message.warning(this.lang.ssRecordingTimeAtLeast5Seconds);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm(this.lang.ssStopRecordingNotice, this.lang.ssStopRecordingConfirm, {
|
|
|
+ confirmButtonText: this.lang.ssConfirm,
|
|
|
+ cancelButtonText: this.lang.ssCancel,
|
|
|
+ confirmButtonClass: "pptEasyClassConfirmButtonText",
|
|
|
+ cancelButtonClass: "pptEasyClassCancelButtonText"
|
|
|
+ }).then(() => {
|
|
|
+ console.log("确定")
|
|
|
+ // this.$message({
|
|
|
+ // dangerouslyUseHTMLString: true,
|
|
|
+ // customClass:"pptEasyClassMessage",
|
|
|
+ // message: '已停止录制 <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank">查看结果</p>'
|
|
|
+ // });
|
|
|
+ this.onFinishRecordWithMicrosoft().then(() => {
|
|
|
+ resolve(true)
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ console.log("取消")
|
|
|
+ resolve(false)
|
|
|
+ });
|
|
|
|
|
|
- if (this.recordedForm.status == 1) {
|
|
|
- // 检查录音时间是否至少为5秒
|
|
|
- const now = new Date();
|
|
|
- const duration = (now - new Date(this.recordingStartTime)) / 1000;
|
|
|
- if (duration < 5) {
|
|
|
- this.$message.warning(this.lang.ssRecordingTimeAtLeast5Seconds);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$confirm(this.lang.ssStopRecordingNotice, this.lang.ssStopRecordingConfirm, {
|
|
|
- confirmButtonText: this.lang.ssConfirm,
|
|
|
- cancelButtonText: this.lang.ssCancel,
|
|
|
- confirmButtonClass:"pptEasyClassConfirmButtonText",
|
|
|
- cancelButtonClass:"pptEasyClassCancelButtonText"
|
|
|
- }).then(() => {
|
|
|
- console.log("确定")
|
|
|
- // this.$message({
|
|
|
- // dangerouslyUseHTMLString: true,
|
|
|
- // customClass:"pptEasyClassMessage",
|
|
|
- // message: '已停止录制 <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank">查看结果</p>'
|
|
|
- // });
|
|
|
- this.onFinishRecordWithMicrosoft();
|
|
|
- }).catch(() => {
|
|
|
- console.log("取消")
|
|
|
- });
|
|
|
-
|
|
|
- } else {
|
|
|
- const now = new Date();
|
|
|
- const duration = (now - new Date(this.recordingEndTime)) / 1000;
|
|
|
- if (duration < 5) {
|
|
|
- this.$message.warning('录音时间至少间距5秒');
|
|
|
- return;
|
|
|
+ } else {
|
|
|
+ const now = new Date();
|
|
|
+ const duration = (now - new Date(this.recordingEndTime)) / 1000;
|
|
|
+ if (duration < 5) {
|
|
|
+ this.$message.warning('录音时间至少间距5秒');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.onStartRecordWithMicrosoft();
|
|
|
+ resolve(true)
|
|
|
}
|
|
|
- this.onStartRecordWithMicrosoft();
|
|
|
- }
|
|
|
- // })
|
|
|
+ })
|
|
|
+ // })
|
|
|
},
|
|
|
// ============ start 微软录音转译
|
|
|
onStartRecordWithMicrosoft() {
|
|
|
@@ -285,90 +279,94 @@ export default {
|
|
|
};
|
|
|
|
|
|
iiframe.contentWindow.ConversationTranscriber();
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(permissionStatus => {
|
|
|
- if (permissionStatus.state !== "granted") {
|
|
|
- // 没有开启录音权限,直接确定停止录音
|
|
|
- this.recordedForm.status = "0";
|
|
|
- let iframe = this.$refs["iiframe"];
|
|
|
- iframe.contentWindow.onSessionStopped = null;
|
|
|
- iframe.contentWindow.window.onRecognizedResult = null;
|
|
|
- this.$message.success(this.lang.ssNoPermStop);
|
|
|
- return;
|
|
|
- }
|
|
|
- })
|
|
|
- },10000)
|
|
|
+ if (permissionStatus.state !== "granted") {
|
|
|
+ // 没有开启录音权限,直接确定停止录音
|
|
|
+ this.recordedForm.status = "0";
|
|
|
+ let iframe = this.$refs["iiframe"];
|
|
|
+ iframe.contentWindow.onSessionStopped = null;
|
|
|
+ iframe.contentWindow.window.onRecognizedResult = null;
|
|
|
+ this.$message.success(this.lang.ssNoPermStop);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 10000)
|
|
|
|
|
|
},
|
|
|
async onFinishRecordWithMicrosoft() {
|
|
|
- navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(async permissionStatus => {
|
|
|
- if (permissionStatus.state !== "granted") {
|
|
|
- // 没有开启录音权限,直接确定停止录音
|
|
|
- this.recordedForm.status = "0";
|
|
|
- let iframe = this.$refs["iiframe"];
|
|
|
- iframe.contentWindow.onSessionStopped = null;
|
|
|
- iframe.contentWindow.window.onRecognizedResult = null;
|
|
|
- this.$message.success(this.lang.ssNoPermStop);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.recordedForm.status == 1) {
|
|
|
- //正在录音时
|
|
|
- let iiframe = this.$refs["iiframe"];
|
|
|
- iiframe.contentWindow.window.document
|
|
|
- .getElementById("scenarioStopButton")
|
|
|
- .click();
|
|
|
- // 录音借宿
|
|
|
- iiframe.contentWindow.onSessionStopped = async (s, e) => {
|
|
|
- this.recordedForm.status = 0;
|
|
|
- this.controlsStatus = 2;
|
|
|
- this.showGetTextLoading = false;
|
|
|
- // this.$message.success("已结束录音");
|
|
|
-
|
|
|
- console.log("结束录音👇");
|
|
|
- console.log("结束录音", e);
|
|
|
- this.recordedForm.audioBlob.push(e.preaudio);
|
|
|
- let blob = new Blob(this.recordedForm.audioBlob, {
|
|
|
- type: "audio/wav"
|
|
|
- });
|
|
|
- let file = new File([blob], "recordedFile.wav", {
|
|
|
- type: "audio/wav"
|
|
|
- });
|
|
|
- // 存储文件和文本到全局对象
|
|
|
- await this.storeRecordingData(file);
|
|
|
- // 记录结束录音时间
|
|
|
- this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
|
- hour12: false,
|
|
|
- timeZone: "Asia/Shanghai"
|
|
|
- }).replace(/\//g, "-");
|
|
|
- // 调用 addPPTClass 接口
|
|
|
- this.addPPTClass(file);
|
|
|
- iiframe.contentWindow.onSessionStopped = null;
|
|
|
- iiframe.contentWindow.window.onRecognizedResult = null;
|
|
|
- };
|
|
|
- } else if (this.recordedForm.status == 2) {
|
|
|
- //暂停录音时
|
|
|
- this.recordedForm.status = 0;
|
|
|
- this.controlsStatus = 2;
|
|
|
- this.showGetTextLoading = false;
|
|
|
- let blob = new Blob(this.recordedForm.audioBlob, {
|
|
|
- type: "audio/wav"
|
|
|
- });
|
|
|
- let file = new File([blob], "recordedFile.wav", { type: "audio/wav" });
|
|
|
- // 存储文件和文本到全局对象
|
|
|
- await this.storeRecordingData(file);
|
|
|
- // 记录结束录音时间
|
|
|
- this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
|
- hour12: false,
|
|
|
- timeZone: "Asia/Shanghai"
|
|
|
- }).replace(/\//g, "-");
|
|
|
- // 调用 addPPTClass 接口
|
|
|
- this.addPPTClass(file);
|
|
|
- }
|
|
|
+ return new Promise(resolve => {
|
|
|
+ navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(async permissionStatus => {
|
|
|
+ if (permissionStatus.state !== "granted") {
|
|
|
+ // 没有开启录音权限,直接确定停止录音
|
|
|
+ this.recordedForm.status = "0";
|
|
|
+ let iframe = this.$refs["iiframe"];
|
|
|
+ iframe.contentWindow.onSessionStopped = null;
|
|
|
+ iframe.contentWindow.window.onRecognizedResult = null;
|
|
|
+ this.$message.success(this.lang.ssNoPermStop);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.recordedForm.status == 1) {
|
|
|
+ //正在录音时
|
|
|
+ let iiframe = this.$refs["iiframe"];
|
|
|
+ iiframe.contentWindow.window.document
|
|
|
+ .getElementById("scenarioStopButton")
|
|
|
+ .click();
|
|
|
+ // 录音借宿
|
|
|
+ iiframe.contentWindow.onSessionStopped = async (s, e) => {
|
|
|
+ this.recordedForm.status = 0;
|
|
|
+ this.controlsStatus = 2;
|
|
|
+ this.showGetTextLoading = false;
|
|
|
+ // this.$message.success("已结束录音");
|
|
|
+
|
|
|
+ console.log("结束录音👇");
|
|
|
+ console.log("结束录音", e);
|
|
|
+ this.recordedForm.audioBlob.push(e.preaudio);
|
|
|
+ let blob = new Blob(this.recordedForm.audioBlob, {
|
|
|
+ type: "audio/wav"
|
|
|
+ });
|
|
|
+ let file = new File([blob], "recordedFile.wav", {
|
|
|
+ type: "audio/wav"
|
|
|
+ });
|
|
|
+ // 存储文件和文本到全局对象
|
|
|
+ await this.storeRecordingData(file);
|
|
|
+ // 记录结束录音时间
|
|
|
+ this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
|
+ hour12: false,
|
|
|
+ timeZone: "Asia/Shanghai"
|
|
|
+ }).replace(/\//g, "-");
|
|
|
+ // 调用 addPPTClass 接口
|
|
|
+ this.addPPTClass(file);
|
|
|
+ iiframe.contentWindow.onSessionStopped = null;
|
|
|
+ iiframe.contentWindow.window.onRecognizedResult = null;
|
|
|
+ resolve(true)
|
|
|
+ };
|
|
|
+ } else if (this.recordedForm.status == 2) {
|
|
|
+ //暂停录音时
|
|
|
+ this.recordedForm.status = 0;
|
|
|
+ this.controlsStatus = 2;
|
|
|
+ this.showGetTextLoading = false;
|
|
|
+ let blob = new Blob(this.recordedForm.audioBlob, {
|
|
|
+ type: "audio/wav"
|
|
|
+ });
|
|
|
+ let file = new File([blob], "recordedFile.wav", { type: "audio/wav" });
|
|
|
+ // 存储文件和文本到全局对象
|
|
|
+ await this.storeRecordingData(file);
|
|
|
+ // 记录结束录音时间
|
|
|
+ this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
|
+ hour12: false,
|
|
|
+ timeZone: "Asia/Shanghai"
|
|
|
+ }).replace(/\//g, "-");
|
|
|
+ // 调用 addPPTClass 接口
|
|
|
+ this.addPPTClass(file);
|
|
|
+ resolve(true)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
storeRecordingData(file) {
|
|
|
// 配置全局 window 对象存储录音数据
|
|
|
- return new Promise((resolve)=>{
|
|
|
+ return new Promise((resolve) => {
|
|
|
if (!window.recordingData) {
|
|
|
window.recordingData = {};
|
|
|
}
|
|
|
@@ -383,7 +381,7 @@ export default {
|
|
|
// localStorage.setItem("recordedFileBase64", base64data);
|
|
|
// localStorage.setItem('recordedFileName', file.name);
|
|
|
// localStorage.setItem('recordedFileType', file.type);
|
|
|
- resolve(true)
|
|
|
+ resolve(true)
|
|
|
// console.log("录音数据已存储到全局对象:", window.recordingData);
|
|
|
// } catch (err) {
|
|
|
// resolve(false)
|
|
|
@@ -393,7 +391,7 @@ export default {
|
|
|
// reader.readAsDataURL(file);
|
|
|
})
|
|
|
},
|
|
|
- openObserveDialog(pptid,file) {
|
|
|
+ openObserveDialog(pptid, file) {
|
|
|
// this.observeDialogUrl = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
|
|
|
// this.showObserveDialog = true;
|
|
|
|
|
|
@@ -441,12 +439,12 @@ export default {
|
|
|
}, 5000);
|
|
|
|
|
|
const checkWinClosed = setInterval(() => {
|
|
|
- if (_pageWindow.closed) {
|
|
|
- clearTimeout(timeoutTimer);
|
|
|
- clearInterval(checkWinClosed);
|
|
|
- window.removeEventListener('message', handleVue3Ready);
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
+ if (_pageWindow.closed) {
|
|
|
+ clearTimeout(timeoutTimer);
|
|
|
+ clearInterval(checkWinClosed);
|
|
|
+ window.removeEventListener('message', handleVue3Ready);
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
// 优化:仅通过轮询方式检查窗口是否加载完成并发送消息,被打开页面无需做任何处理
|
|
|
// const sendFileData = () => {
|
|
|
// if (_pageWindow && !_pageWindow.closed) {
|
|
|
@@ -483,18 +481,18 @@ export default {
|
|
|
// }
|
|
|
// }, 100);
|
|
|
|
|
|
- setTimeout(()=>{
|
|
|
+ setTimeout(() => {
|
|
|
window.focus()
|
|
|
- },100)
|
|
|
+ }, 100)
|
|
|
|
|
|
- function openPageWindow(){
|
|
|
+ function openPageWindow() {
|
|
|
_pageWindow.focus()
|
|
|
}
|
|
|
|
|
|
this.$message({
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
- customClass:"pptEasyClassMessage",
|
|
|
- duration:3000,
|
|
|
+ customClass: "pptEasyClassMessage",
|
|
|
+ duration: 3000,
|
|
|
message: `${this.lang.ssStoppedRecording} <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank" onclick="(${openPageWindow.toString()})()">${this.lang.ssViewRecordingResult}</p>`
|
|
|
});
|
|
|
|
|
|
@@ -511,7 +509,7 @@ export default {
|
|
|
.then(res => {
|
|
|
console.log("addPPTClass", res);
|
|
|
let id = res.data[0][0].id;
|
|
|
- this.openObserveDialog(id,file);
|
|
|
+ this.openObserveDialog(id, file);
|
|
|
})
|
|
|
.catch(err => {
|
|
|
console.error(err);
|
|
|
@@ -650,17 +648,37 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
afterClass() {
|
|
|
- this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
|
|
|
- confirmButtonText: this.lang.ssConfirm,
|
|
|
- cancelButtonText: this.lang.ssCancel,
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
|
|
|
- this.$message.success(this.lang.ssStudentLoggedOut)
|
|
|
- setTimeout(()=>{
|
|
|
- this.back()
|
|
|
- },1000)
|
|
|
- }).catch(() => {});
|
|
|
+ if (this.recordedForm.status == 1) {
|
|
|
+ this.toggleRecording().then((flag) => {
|
|
|
+ if (flag) {
|
|
|
+ this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
|
|
|
+ confirmButtonText: this.lang.ssConfirm,
|
|
|
+ cancelButtonText: this.lang.ssCancel,
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
|
|
|
+ this.$message.success(this.lang.ssStudentLoggedOut)
|
|
|
+ setTimeout(() => {
|
|
|
+ this.back()
|
|
|
+ }, 1000)
|
|
|
+ }).catch(() => { });
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$confirm(this.lang.ssEndClassConfirm, this.lang.ssPrompt, {
|
|
|
+ confirmButtonText: this.lang.ssConfirm,
|
|
|
+ cancelButtonText: this.lang.ssCancel,
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$refs.ppt.contentWindow.PPTistStudent.forceLogout();
|
|
|
+ this.$message.success(this.lang.ssStudentLoggedOut)
|
|
|
+ setTimeout(() => {
|
|
|
+ this.back()
|
|
|
+ }, 1000)
|
|
|
+ }).catch(() => { });
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
onFreeBrowseChange(value) {
|
|
|
this.freeBrowse = value;
|
|
|
@@ -689,21 +707,21 @@ export default {
|
|
|
];
|
|
|
this.ajax
|
|
|
.post(this.$store.state.api + "addOperationTimeT2", params)
|
|
|
- .then((res) => {})
|
|
|
+ .then((res) => { })
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
- getAIJ(){
|
|
|
- this.ajax.get(this.$store.state.api+"getAIJ","").then(res=>{
|
|
|
- let a = res.data[4];
|
|
|
+ getAIJ() {
|
|
|
+ this.ajax.get(this.$store.state.api + "getAIJ", "").then(res => {
|
|
|
+ let a = res.data[4];
|
|
|
console.log(a)
|
|
|
- let Array = [];
|
|
|
- a.forEach(i=>Array.push(i.oid))
|
|
|
- this.jArray = Array;
|
|
|
- })
|
|
|
- },
|
|
|
- doSyncClassData(){
|
|
|
+ let Array = [];
|
|
|
+ a.forEach(i => Array.push(i.oid))
|
|
|
+ this.jArray = Array;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ doSyncClassData() {
|
|
|
if (this.courseDetail.userid == this.userid && this.org == '16ace517-b5c7-4168-a9bb-a9e0035df840') {
|
|
|
let endTime = new Date().toLocaleString("zh-CN", {
|
|
|
hour12: false,
|
|
|
@@ -722,7 +740,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 直接上传录制音频/视频
|
|
|
- uploadVoiceBtn(){
|
|
|
+ uploadVoiceBtn() {
|
|
|
const input = document.createElement('input');
|
|
|
input.type = 'file';
|
|
|
input.accept = '.m4a,.mp4,.mov,.mp3,.wav';
|
|
|
@@ -730,37 +748,37 @@ export default {
|
|
|
input.onchange = (e) => {
|
|
|
const fileList = e.target.files;
|
|
|
const file = fileList[0]
|
|
|
- this.recordingStartTime = new Date(window.recordingStartTime?window.recordingStartTime:new Date()).toLocaleString("zh-CN", {
|
|
|
- hour12: false,
|
|
|
- timeZone: "Asia/Shanghai"
|
|
|
- }).replace(/\//g, "-");
|
|
|
- this.recordingEndTime = new Date(window.recordingEndTime?window.recordingEndTime:new Date()).toLocaleString("zh-CN", {
|
|
|
- hour12: false,
|
|
|
- timeZone: "Asia/Shanghai"
|
|
|
- }).replace(/\//g, "-");
|
|
|
+ this.recordingStartTime = new Date(window.recordingStartTime ? window.recordingStartTime : new Date()).toLocaleString("zh-CN", {
|
|
|
+ hour12: false,
|
|
|
+ timeZone: "Asia/Shanghai"
|
|
|
+ }).replace(/\//g, "-");
|
|
|
+ this.recordingEndTime = new Date(window.recordingEndTime ? window.recordingEndTime : new Date()).toLocaleString("zh-CN", {
|
|
|
+ hour12: false,
|
|
|
+ timeZone: "Asia/Shanghai"
|
|
|
+ }).replace(/\//g, "-");
|
|
|
this.addPPTClass(file)
|
|
|
- // 判断文件类型并获取音频或视频时长
|
|
|
- // if (file && (file.type.startsWith('audio/') || file.type.startsWith('video/'))) {
|
|
|
- // const url = URL.createObjectURL(file);
|
|
|
- // let media;
|
|
|
- // if (file.type.startsWith('audio/')) {
|
|
|
- // media = new Audio();
|
|
|
- // } else {
|
|
|
- // media = document.createElement('video');
|
|
|
- // }
|
|
|
- // media.preload = 'metadata';
|
|
|
- // media.src = url;
|
|
|
- // media.onloadedmetadata = () => {
|
|
|
- // const duration = media.duration;
|
|
|
- // console.log('文件时长(秒):', duration);
|
|
|
- // // 这里可以赋值或者进一步处理时长 duration
|
|
|
- // URL.revokeObjectURL(url);
|
|
|
- // };
|
|
|
- // media.onerror = () => {
|
|
|
- // console.error('无法读取文件时长');
|
|
|
- // URL.revokeObjectURL(url);
|
|
|
- // };
|
|
|
- // }
|
|
|
+ // 判断文件类型并获取音频或视频时长
|
|
|
+ // if (file && (file.type.startsWith('audio/') || file.type.startsWith('video/'))) {
|
|
|
+ // const url = URL.createObjectURL(file);
|
|
|
+ // let media;
|
|
|
+ // if (file.type.startsWith('audio/')) {
|
|
|
+ // media = new Audio();
|
|
|
+ // } else {
|
|
|
+ // media = document.createElement('video');
|
|
|
+ // }
|
|
|
+ // media.preload = 'metadata';
|
|
|
+ // media.src = url;
|
|
|
+ // media.onloadedmetadata = () => {
|
|
|
+ // const duration = media.duration;
|
|
|
+ // console.log('文件时长(秒):', duration);
|
|
|
+ // // 这里可以赋值或者进一步处理时长 duration
|
|
|
+ // URL.revokeObjectURL(url);
|
|
|
+ // };
|
|
|
+ // media.onerror = () => {
|
|
|
+ // console.error('无法读取文件时长');
|
|
|
+ // URL.revokeObjectURL(url);
|
|
|
+ // };
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -783,11 +801,11 @@ export default {
|
|
|
this.freeBrowse = value;
|
|
|
console.log('自由浏览模式已切换为:', this.freeBrowse);
|
|
|
}
|
|
|
- if(!this.userJson || !this.userJson.accountNumber){
|
|
|
+ if (!this.userJson || !this.userJson.accountNumber) {
|
|
|
let res = await this.ajax.get(this.$store.state.api + "selectUser", {
|
|
|
userid: this.$route.query.userid
|
|
|
- });
|
|
|
- this.userJson = res.data[0][0]
|
|
|
+ });
|
|
|
+ this.userJson = res.data[0][0]
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.doSyncClassData();
|
|
|
@@ -887,7 +905,7 @@ export default {
|
|
|
border: 1px solid #cad1dc;
|
|
|
}
|
|
|
|
|
|
-.pec_h_r_btnArea> div + div {
|
|
|
+.pec_h_r_btnArea>div+div {
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
|
|
|
@@ -915,7 +933,7 @@ export default {
|
|
|
fill: #666666;
|
|
|
}
|
|
|
|
|
|
-.pec_h_center>.pec_h_r_btn_refresh>svg{
|
|
|
+.pec_h_center>.pec_h_r_btn_refresh>svg {
|
|
|
|
|
|
width: 1rem;
|
|
|
height: 1rem;
|
|
|
@@ -933,9 +951,11 @@ export default {
|
|
|
0% {
|
|
|
box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.4);
|
|
|
}
|
|
|
+
|
|
|
70% {
|
|
|
box-shadow: 0 0 0 10px rgba(245, 63, 63, 0);
|
|
|
}
|
|
|
+
|
|
|
100% {
|
|
|
box-shadow: 0 0 0 0 rgba(245, 63, 63, 0);
|
|
|
}
|
|
|
@@ -947,7 +967,7 @@ export default {
|
|
|
color: #F53F3F;
|
|
|
}
|
|
|
|
|
|
-.pec_h_r_btn_uploadVoiceBtn{
|
|
|
+.pec_h_r_btn_uploadVoiceBtn {
|
|
|
border-color: #F0E1DD;
|
|
|
background-color: #FFF7F5;
|
|
|
color: #000;
|
|
|
@@ -1040,15 +1060,15 @@ export default {
|
|
|
cursor: unset !important;
|
|
|
}
|
|
|
|
|
|
-.observe-dialog >>> .el-dialog__header {
|
|
|
+.observe-dialog>>>.el-dialog__header {
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
-.observe-dialog >>> .el-dialog__body {
|
|
|
+.observe-dialog>>>.el-dialog__body {
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
-.observe-dialog >>> .el-dialog__headerbtn {
|
|
|
+.observe-dialog>>>.el-dialog__headerbtn {
|
|
|
top: 22px;
|
|
|
right: 20px;
|
|
|
z-index: 100;
|