|
|
@@ -13,12 +13,14 @@
|
|
|
<div class="end-time">截止时间:{{ formatDate(aiSpeakingAssignmentInfo.endTime) }}</div>
|
|
|
|
|
|
</div>
|
|
|
- <div class="data-item">
|
|
|
- <span class="data-label">作业描述 </span>
|
|
|
- <span class="data-value">{{ aiSpeakingAssignmentInfo.description !== null ? aiSpeakingAssignmentInfo.description : '未设置' }}</span>
|
|
|
- </div>
|
|
|
- <div class="data-item">
|
|
|
- <span v-if="aiSpeakingAssignmentInfo.descriptionFile" class="data-label">作业附件</span>
|
|
|
+ <div class="data-item">
|
|
|
+ <span class="data-label">作业描述</span>
|
|
|
+ <div class="scrollable-description">
|
|
|
+ {{ aiSpeakingAssignmentInfo.description !== null ? aiSpeakingAssignmentInfo.description : '未设置' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="data-item" v-if="aiSpeakingAssignmentInfo.descriptionFile">
|
|
|
+ <span class="data-label">作业附件</span>
|
|
|
<el-icon @click="openEditor(aiSpeakingAssignmentInfo.descriptionFile, aiSpeakingAssignmentInfo.assignmentName)"><Document /></el-icon>
|
|
|
</div>
|
|
|
<div class="data-item">
|
|
|
@@ -702,22 +704,38 @@ const saveHomework = async () => {
|
|
|
const videoBlob = new Blob([...recordedChunks.value], { type: "video/webm" });
|
|
|
const fileName = `user_${userId}_${assignmentId}_${Date.now()}`;
|
|
|
let renameFile =new File([videoBlob], fileName +'.webm', { type: 'video/webm' })
|
|
|
- try {
|
|
|
- doubaoApis
|
|
|
- .saveSigment(userId, assignmentId,renameFile, duration)
|
|
|
- .then(res =>{
|
|
|
- recordedChunks.value = [];
|
|
|
- isHomeworkSaved.value = true;
|
|
|
- hasHomeworkSaved.value = true;
|
|
|
- isHomeworkStarted.value = false;
|
|
|
- ElMessage.success("视频片段暂存成功");
|
|
|
- loadingInstance.close();
|
|
|
- })
|
|
|
+ try{
|
|
|
+ fileApis.uploadChunkFile(renameFile, userId, assignmentId, duration)
|
|
|
+ .then(res => {
|
|
|
+ recordedChunks.value = [];
|
|
|
+ isHomeworkSaved.value = true;
|
|
|
+ hasHomeworkSaved.value = true;
|
|
|
+ isHomeworkStarted.value = false;
|
|
|
+ ElMessage.success("视频片段暂存成功");
|
|
|
+ loadingInstance.close();
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
console.error("视频片段上传失败:", error);
|
|
|
ElMessage.error("视频片段上传失败");
|
|
|
loadingInstance.close();
|
|
|
}
|
|
|
+
|
|
|
+ // try {
|
|
|
+ // doubaoApis
|
|
|
+ // .saveSigment(userId, assignmentId,renameFile, duration)
|
|
|
+ // .then(res =>{
|
|
|
+ // recordedChunks.value = [];
|
|
|
+ // isHomeworkSaved.value = true;
|
|
|
+ // hasHomeworkSaved.value = true;
|
|
|
+ // isHomeworkStarted.value = false;
|
|
|
+ // ElMessage.success("视频片段暂存成功");
|
|
|
+ // loadingInstance.close();
|
|
|
+ // })
|
|
|
+ // } catch (error) {
|
|
|
+ // console.error("视频片段上传失败:", error);
|
|
|
+ // ElMessage.error("视频片段上传失败");
|
|
|
+ // loadingInstance.close();
|
|
|
+ // }
|
|
|
};
|
|
|
} else {
|
|
|
ElMessage.error('状态出错啦')
|
|
|
@@ -795,9 +813,6 @@ const resetHomework = async() => {
|
|
|
return;
|
|
|
}
|
|
|
if (isHomeworkStarted.value) {
|
|
|
- if (mediaRecorder.value && mediaRecorder.value.state === "recording") {
|
|
|
- mediaRecorder.value.stop();
|
|
|
- }
|
|
|
// 停止录制时长计时器
|
|
|
if (recordingTimer) {
|
|
|
clearInterval(recordingTimer);
|
|
|
@@ -807,6 +822,10 @@ const resetHomework = async() => {
|
|
|
if (cameraPreview.value) {
|
|
|
cameraPreview.value.srcObject = null;
|
|
|
}
|
|
|
+ // 关闭摄像头和麦克风
|
|
|
+ if (mediaRecorder.value && mediaRecorder.value.stream) {
|
|
|
+ mediaRecorder.value.stream.getTracks().forEach((track) => track.stop());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 显示加载状态
|
|
|
@@ -823,6 +842,7 @@ const resetHomework = async() => {
|
|
|
isHomeworkSaved.value = false;
|
|
|
isHomeworkStarted.value = false;
|
|
|
initRecognitionValue()
|
|
|
+ recordingDuration.value = 0;
|
|
|
ElMessage.success("作业内容已清空");
|
|
|
getHistory()
|
|
|
|
|
|
@@ -1124,6 +1144,20 @@ onMounted(() => {
|
|
|
color: #777;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ .scrollable-description {
|
|
|
+ max-height: 12em; /* 10行高度(假设1em=1行) */
|
|
|
+ line-height: 1.3em; /* 行高设定 */
|
|
|
+ overflow-y: auto; /* 垂直滚动 */
|
|
|
+ white-space: pre-wrap; /* 保留换行符 */
|
|
|
+ color: #777;
|
|
|
+ margin-top: 10px;
|
|
|
+ scrollbar-width: none; /* Firefox */
|
|
|
+ -ms-overflow-style: none; /* IE/Edge */
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
.homework-button-group {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
@@ -1369,7 +1403,7 @@ progress {
|
|
|
}
|
|
|
|
|
|
.wechat-audio-button {
|
|
|
- margin-left: 20px;
|
|
|
+ margin-left: 25px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
background-color: #90caf9;
|
|
|
@@ -1378,6 +1412,7 @@ progress {
|
|
|
padding: 8px 15px;
|
|
|
cursor: pointer;
|
|
|
transition: background-color 0.3s;
|
|
|
+ margin-bottom:8px;
|
|
|
}
|
|
|
|
|
|
.wechat-audio-button:hover {
|