123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <template>
- <el-dialog :visible="dialogVisible" :width="dialogWidth" @close="dialogClose">
- <div class="completion">
- <img src="../../assets/course_details/courseware.png" />
- <div class="completion-info">
- <div>{{ material_name }}</div>
- <div>
- {{ student_name }} {{ finish_time_view_txt }} {{ $t('Key320') }}:{{ duration }}{{ $t('Key321') }}
- <template v-if="category !== 'NPC'">
- | {{ $t('Key194') }} {{ count_right }} |
- {{ $t('Key195') }}
- {{ count_error }}
- </template>
- </div>
- </div>
- </div>
- <template v-if="category === 'NPC'">
- <booknpc
- v-if="context"
- :context="context"
- task-model="ANSWER"
- :is-show-save="false"
- :book-answer-content="bookAnswerContent"
- :theme-color="themeColor"
- :preview-type="previewType"
- :preview-group-id="previewGroupId"
- />
- </template>
- <template v-if="category === 'NNPE'">
- <booknnpe
- v-if="context"
- :context="context"
- :theme-color="themeColor"
- task-model="ANSWER"
- :is-show-title="true"
- :is-show-save="false"
- :preview-type="previewType"
- :preview-group-id="previewGroupId"
- :book-answer-content="bookAnswerContent"
- />
- </template>
- <template v-if="category === 'RLC'">
- <bookrlc v-if="context" :context="context" :theme-color="themeColor" :book-font-size="bookFontSize" />
- </template>
- <div slot="footer"></div>
- </el-dialog>
- </template>
- <script>
- import { GetTaskMaterialStudentExamAnswer, GetCoursewareContent_View } from '@/api/course';
- export default {
- props: {
- dialogVisible: {
- default: false,
- type: Boolean
- },
- curCoursewareId: {
- default: '',
- type: String
- },
- taskId: {
- default: '',
- type: String
- },
- curStudentId: {
- default: '',
- type: String
- },
- previewGroupId: {
- default: '[]',
- type: String
- }
- },
- data() {
- return {
- student_id: '',
- student_name: '',
- material_name: '',
- finish_time_view_txt: '',
- duration: 0,
- count_not_done: 0,
- count_right: 0,
- count_error: 0,
- context: null,
- bookAnswerContent: '',
- category: '',
- dialogWidth: '820px',
- themeColor: '',
- bookFontSize: '',
- previewType: 'previewCheckShow'
- };
- },
- watch: {
- curCoursewareId(newVal) {
- if (!newVal) {
- this.context = null;
- this.bookAnswerContent = '';
- return;
- }
- this.getTaskMaterialStudentExamAnswer().then(() => {
- GetCoursewareContent_View({ id: this.curCoursewareId }).then(
- ({ content, category, book_theme_color, book_font_size }) => {
- if (!content) {
- this.context = null;
- return;
- }
- this.category = category;
- if (category === 'OC' || category.length === 0 || category === 'AILP') {
- return this.$message.warning('该课件类型已被废弃');
- }
- if (category === 'NPC') {
- this.themeColor = book_theme_color;
- this.dialogWidth = '900px';
- this.context = JSON.parse(content);
- return;
- }
- if (category === 'NNPE') {
- this.dialogWidth = '900px';
- this.themeColor = book_theme_color;
- this.context = JSON.parse(content);
- return;
- }
- if (category === 'RLC') {
- this.dialogWidth = '900px';
- this.themeColor = book_theme_color;
- this.bookFontSize = book_font_size;
- this.context = JSON.parse(content);
- return;
- }
- }
- );
- });
- }
- },
- methods: {
- getTaskMaterialStudentExamAnswer() {
- return GetTaskMaterialStudentExamAnswer({
- material_id: this.curCoursewareId,
- task_id: this.taskId,
- material_type: 'COURSEWARE',
- student_id: this.curStudentId
- }).then(
- ({
- duration,
- count_not_done,
- count_right,
- count_error,
- content,
- student_id,
- student_name,
- material_name,
- finish_time_view_txt
- }) => {
- this.material_name = material_name;
- this.finish_time_view_txt = finish_time_view_txt;
- this.student_id = student_id;
- this.student_name = student_name;
- this.duration = duration;
- this.count_not_done = count_not_done;
- this.count_right = count_right;
- this.count_error = count_error;
- this.bookAnswerContent = content;
- }
- );
- },
- dialogClose() {
- this.$emit('dialogClose');
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .completion {
- display: flex;
- padding: 0 32px 24px;
- &-info {
- margin-left: 24px;
- > div {
- height: 20px;
- line-height: 20px;
- &:first-child {
- font-size: 18px;
- font-weight: bold;
- }
- }
- }
- }
- </style>
|