|
|
@@ -9,13 +9,18 @@
|
|
|
</el-button>
|
|
|
<h2 class="task-name">{{ aiSpeakingAssignmentInfo.assignmentName }}</h2>
|
|
|
<div class="task-time">
|
|
|
- <div class="start-time">开始时间:{{ aiSpeakingAssignmentInfo.startTime }}</div>
|
|
|
- <div class="end-time">截止时间:{{ aiSpeakingAssignmentInfo.endTime }}</div>
|
|
|
+ <div class="start-time">开始时间:{{ formatDate(aiSpeakingAssignmentInfo.startTime) }}</div>
|
|
|
+ <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>
|
|
|
+ <el-icon @click="openEditor(aiSpeakingAssignmentInfo.descriptionFile, aiSpeakingAssignmentInfo.assignmentName)"><Document /></el-icon>
|
|
|
+ </div>
|
|
|
<div class="data-item">
|
|
|
<span class="data-label">最短交流时间 </span>
|
|
|
<span class="data-value">{{ aiSpeakingAssignmentInfo.minDuration !== null ? aiSpeakingAssignmentInfo.minDuration : '未设置' }} min</span>
|
|
|
@@ -202,6 +207,7 @@
|
|
|
<div class="recording-duration" v-if="isHomeworkStarted">
|
|
|
录制时长: {{ formatDuration(recordingDuration) }}
|
|
|
</div>
|
|
|
+ <ViewsWordEditor v-if="aiSpeakingAssignmentInfo.descriptionFile" :alert="alertProps" :docxInfo="docxInfo"></ViewsWordEditor>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -209,13 +215,15 @@
|
|
|
<script setup>
|
|
|
import { ref, onMounted, nextTick, onBeforeUnmount, reactive, useId } from "vue";
|
|
|
import { ElMessage, ElLoading } from "element-plus";
|
|
|
+import {useFormatDate} from "@/hooks/useFormatDate";
|
|
|
import doubaoApis from "@/apis/doubao";
|
|
|
import fileApis from "@/apis/file"
|
|
|
import aiSpeakingAssignmentApis from '@/apis/ai_speaking_assignment';
|
|
|
import mediaApis from "@/apis/media"
|
|
|
import engagementApis from "@/apis/engagement";
|
|
|
import Recorder from "js-audio-recorder";
|
|
|
-import { VideoPlay, VideoPause, CaretRight, CaretLeft,Back} from '@element-plus/icons-vue';
|
|
|
+import ViewsWordEditor from "@/components/ViewsWordEditor/ViewsWordEditor.vue";
|
|
|
+import { VideoPlay, VideoPause,Back, Document} from '@element-plus/icons-vue';
|
|
|
import VoiceAnalysis from "./component/VoiceAnalysis.vue";
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import {useStore} from "@/store";
|
|
|
@@ -229,6 +237,7 @@ import ashleighAvatar from "@/assets/ashleigh.png"
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
const store = useStore();
|
|
|
+const {formatDate} = useFormatDate()
|
|
|
const userId = Number(store.user.id);
|
|
|
const assignmentId = Number(route.params.assignmentId)
|
|
|
const voiceCode = ref(0);
|
|
|
@@ -738,6 +747,45 @@ const saveHomework = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// 文档预览相关
|
|
|
+const open = ref(false)
|
|
|
+const alertProps = reactive({
|
|
|
+ open: open.value,
|
|
|
+ onOk: () => (open.value = false),
|
|
|
+ onCancel: () => (open.value = false),
|
|
|
+});
|
|
|
+
|
|
|
+const docxInfo = reactive({
|
|
|
+ docxUrl: '',
|
|
|
+ docxTitle: '',
|
|
|
+});
|
|
|
+
|
|
|
+// 打开文档编辑器
|
|
|
+const openEditor = (url, title) => {
|
|
|
+ open.value = true;
|
|
|
+ docxInfo.docxUrl = url;
|
|
|
+ docxInfo.docxTitle = title;
|
|
|
+ Object.assign(alertProps, {
|
|
|
+ open: open.value,
|
|
|
+ onCancel: () => {
|
|
|
+ open.value = false
|
|
|
+ Object.assign(alertProps,{
|
|
|
+ open: open.value,
|
|
|
+ onOk: () => (open.value = false),
|
|
|
+ onCancel: () => (open.value = false),
|
|
|
+ })
|
|
|
+ Object.assign(docxInfo, {
|
|
|
+ docxUrl: url,
|
|
|
+ docxTitle: title,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ })
|
|
|
+ Object.assign(docxInfo, {
|
|
|
+ docxUrl: url,
|
|
|
+ docxTitle: title,
|
|
|
+ })
|
|
|
+};
|
|
|
+
|
|
|
// 格式化录制时长
|
|
|
const formatDuration = (duration) => {
|
|
|
const minutes = Math.floor(duration / 60);
|
|
|
@@ -870,7 +918,6 @@ const getStatusText = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
// 格式化时间戳为 "月-日 时:分:秒"
|
|
|
const formatTimestamp = (timestamp) => {
|
|
|
if(timestamp == null){
|