|
@@ -23,6 +23,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pec_h_center">
|
|
<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" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-tooltip>
|
|
|
<div class="pec_h_r_btn_refresh" :class="{ 'recording': recordedForm.status == 1 }" @click="toggleRecording" 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" v-show="(jArray.includes(oid) || jArray.includes(org)) && courseDetail.userid == userid && tcid">
|
|
|
<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>
|
|
<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>
|
|
<span>{{ recordedForm.status == 1 ? lang.ssStopRecording2 : lang.ssRecord }}</span>
|
|
@@ -47,11 +52,7 @@
|
|
|
<div class="free-browse-switch" v-if="tType == 2">
|
|
<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>
|
|
|
- <el-tooltip effect="dark" :content="lang.ssRefresh" placement="bottom">
|
|
|
|
|
- <div class="refresh_icon" @click="refreshCourse">
|
|
|
|
|
- <img src="../../assets/icon/course/refresh-2.svg" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pec_h_right">
|
|
<div class="pec_h_right">
|
|
|
<div class="pec_h_r_btnArea">
|
|
<div class="pec_h_r_btnArea">
|
|
@@ -263,7 +264,7 @@ export default {
|
|
|
|
|
|
|
|
iiframe.contentWindow.ConversationTranscriber();
|
|
iiframe.contentWindow.ConversationTranscriber();
|
|
|
},
|
|
},
|
|
|
- onFinishRecordWithMicrosoft() {
|
|
|
|
|
|
|
+ async onFinishRecordWithMicrosoft() {
|
|
|
if (this.recordedForm.status == 1) {
|
|
if (this.recordedForm.status == 1) {
|
|
|
//正在录音时
|
|
//正在录音时
|
|
|
let iiframe = this.$refs["iiframe"];
|
|
let iiframe = this.$refs["iiframe"];
|
|
@@ -271,16 +272,12 @@ export default {
|
|
|
.getElementById("scenarioStopButton")
|
|
.getElementById("scenarioStopButton")
|
|
|
.click();
|
|
.click();
|
|
|
// 录音借宿
|
|
// 录音借宿
|
|
|
- iiframe.contentWindow.onSessionStopped = (s, e) => {
|
|
|
|
|
|
|
+ iiframe.contentWindow.onSessionStopped = async (s, e) => {
|
|
|
this.recordedForm.status = 0;
|
|
this.recordedForm.status = 0;
|
|
|
this.controlsStatus = 2;
|
|
this.controlsStatus = 2;
|
|
|
this.showGetTextLoading = false;
|
|
this.showGetTextLoading = false;
|
|
|
// this.$message.success("已结束录音");
|
|
// this.$message.success("已结束录音");
|
|
|
- this.$message({
|
|
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
|
|
- customClass:"pptEasyClassMessage",
|
|
|
|
|
- message: `${this.lang.ssStoppedRecording} <p style="color:#3AB855;text-decoration: underline;cursor: pointer;float:right;margin-left:10px" target="_blank">${this.lang.ssViewRecordingResult}</p>`
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
console.log("结束录音👇");
|
|
console.log("结束录音👇");
|
|
|
console.log("结束录音", e);
|
|
console.log("结束录音", e);
|
|
|
this.recordedForm.audioBlob.push(e.preaudio);
|
|
this.recordedForm.audioBlob.push(e.preaudio);
|
|
@@ -291,7 +288,7 @@ export default {
|
|
|
type: "audio/wav"
|
|
type: "audio/wav"
|
|
|
});
|
|
});
|
|
|
// 存储文件和文本到全局对象
|
|
// 存储文件和文本到全局对象
|
|
|
- this.storeRecordingData(file);
|
|
|
|
|
|
|
+ await this.storeRecordingData(file);
|
|
|
// 记录结束录音时间
|
|
// 记录结束录音时间
|
|
|
this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
|
hour12: false,
|
|
hour12: false,
|
|
@@ -312,7 +309,7 @@ export default {
|
|
|
});
|
|
});
|
|
|
let file = new File([blob], "recordedFile.wav", { type: "audio/wav" });
|
|
let file = new File([blob], "recordedFile.wav", { type: "audio/wav" });
|
|
|
// 存储文件和文本到全局对象
|
|
// 存储文件和文本到全局对象
|
|
|
- this.storeRecordingData(file);
|
|
|
|
|
|
|
+ await this.storeRecordingData(file);
|
|
|
// 记录结束录音时间
|
|
// 记录结束录音时间
|
|
|
this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
this.recordingEndTime = new Date().toLocaleString("zh-CN", {
|
|
|
hour12: false,
|
|
hour12: false,
|
|
@@ -324,17 +321,47 @@ export default {
|
|
|
},
|
|
},
|
|
|
storeRecordingData(file) {
|
|
storeRecordingData(file) {
|
|
|
// 配置全局 window 对象存储录音数据
|
|
// 配置全局 window 对象存储录音数据
|
|
|
- if (!window.recordingData) {
|
|
|
|
|
- window.recordingData = {};
|
|
|
|
|
- }
|
|
|
|
|
- window.recordingData.file = file;
|
|
|
|
|
- window.recordingData.text = this.transcriptionData.content;
|
|
|
|
|
- window.recordingData.textList = this.recordedForm.textList;
|
|
|
|
|
- console.log("录音数据已存储到全局对象:", window.recordingData);
|
|
|
|
|
|
|
+ return new Promise((resolve)=>{
|
|
|
|
|
+ if (!window.recordingData) {
|
|
|
|
|
+ window.recordingData = {};
|
|
|
|
|
+ }
|
|
|
|
|
+ window.recordingData.file = file;
|
|
|
|
|
+ window.recordingData.text = this.transcriptionData.content;
|
|
|
|
|
+ window.recordingData.textList = this.recordedForm.textList;
|
|
|
|
|
+ // 将录音文件转为base64并存入localStorage
|
|
|
|
|
+ const reader = new FileReader();
|
|
|
|
|
+ reader.onload = function(e) {
|
|
|
|
|
+ const base64data = e.target.result;
|
|
|
|
|
+ try {
|
|
|
|
|
+ localStorage.setItem("recordedFileBase64", base64data);
|
|
|
|
|
+ localStorage.setItem('recordedFileName', audioFile.name);
|
|
|
|
|
+ localStorage.setItem('recordedFileType', audioFile.type);
|
|
|
|
|
+ resolve(true)
|
|
|
|
|
+ console.log("录音数据已存储到全局对象:", window.recordingData);
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ resolve(false)
|
|
|
|
|
+ console.error("localStorage存储base64文件失败:", err);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ reader.readAsDataURL(file);
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
openObserveDialog(pptid) {
|
|
openObserveDialog(pptid) {
|
|
|
- this.observeDialogUrl = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
|
|
|
|
|
- this.showObserveDialog = true;
|
|
|
|
|
|
|
+ // this.observeDialogUrl = `https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`;
|
|
|
|
|
+ // this.showObserveDialog = true;
|
|
|
|
|
+
|
|
|
|
|
+ let _pageWindow = window.open(`https://observe.cocorobo.cn/#/newClassroom?userid=${this.userid}&oid=${this.oid}&org=${this.org}&pptid=${pptid}`,'_blank')
|
|
|
|
|
+ // _pageWindow.blur()
|
|
|
|
|
+ function openPageWindow(){
|
|
|
|
|
+ _pageWindow.focus()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
|
+ customClass:"pptEasyClassMessage",
|
|
|
|
|
+ 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>`
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
addPPTClass() {
|
|
addPPTClass() {
|
|
|
let params = {
|
|
let params = {
|
|
@@ -802,21 +829,21 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.refresh_icon {
|
|
.refresh_icon {
|
|
|
- width: 40px;
|
|
|
|
|
- height: 40px;
|
|
|
|
|
|
|
+ width: 35px;
|
|
|
|
|
+ height: 35px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
background-color: #fff7f5;
|
|
background-color: #fff7f5;
|
|
|
border-radius: 45%;
|
|
border-radius: 45%;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
- margin-left: 15px;
|
|
|
|
|
|
|
+ margin-right: 15px;
|
|
|
padding: 0 3px;
|
|
padding: 0 3px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.refresh_icon img {
|
|
.refresh_icon img {
|
|
|
- width: 20px;
|
|
|
|
|
- height: 20px;
|
|
|
|
|
|
|
+ width: 16px;
|
|
|
|
|
+ height: 16px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.name_box {
|
|
.name_box {
|