From d3729efc4f7126f06d98bb7846887e583898800e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Sat, 20 Sep 2025 11:16:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=97=AE=E7=AD=94=E9=A2=98?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E7=9A=84=E8=80=83=E8=AF=95=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/examination/es-analysis.vue | 39 ++++++++----------- src/components/examination/subject.vue | 7 +++- .../image-preview/image-preview.vue | 2 +- src/pages/index/index.vue | 31 +++++---------- 4 files changed, 32 insertions(+), 47 deletions(-) diff --git a/src/components/examination/es-analysis.vue b/src/components/examination/es-analysis.vue index 375e7be7..169031ba 100644 --- a/src/components/examination/es-analysis.vue +++ b/src/components/examination/es-analysis.vue @@ -3,7 +3,7 @@ 维度评分: {{ dimension_all_score }} - + @@ -11,8 +11,9 @@ {{ item.gradeDimens }}: {{ item.anlyGrade }} - - + + 关键词:{{ passKeyword }} + @@ -33,13 +34,9 @@ type: Boolean, default: false, required: false - }, - answerText: { - type: String, - default: '', - required: false } }); + const passKeyword = computed(() => props.value.passKeyword); const evalSettingVos = computed(() => props.value.evalSettingVos); const status = computed(() => (props.judgeResult ? 'success' : 'error')); const select_status_icon = computed(() => { @@ -54,19 +51,19 @@ return props.value.relKeyword.split(/[,、]/).map((key) => key.trim()); }); - const highlightedText = computed(() => { - // 如果没有关键词,直接返回原文本 - if (!keywords.value.length) return '你的答案:' + props.answerText; - // 构建正则表达式,匹配所有关键词(不区分大小写) - // 对关键词进行转义,避免特殊字符影响正则 - const escapedKeywords = keywords.value.map((keyword) => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); + // const highlightedText = computed(() => { + // // 如果没有关键词,直接返回原文本 + // if (!keywords.value.length) return '你的答案:' + props.answerText; + // // 构建正则表达式,匹配所有关键词(不区分大小写) + // // 对关键词进行转义,避免特殊字符影响正则 + // const escapedKeywords = keywords.value.map((keyword) => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); - // 创建正则表达式,g表示全局匹配,i表示不区分大小写 - const regex = new RegExp(`(${escapedKeywords.join('|')})`, 'gi'); + // // 创建正则表达式,g表示全局匹配,i表示不区分大小写 + // const regex = new RegExp(`(${escapedKeywords.join('|')})`, 'gi'); - // 替换匹配到的关键词,用span包裹并添加高亮样式 - return '你的答案:' + props.answerText.replace(regex, (match) => `${match}`); - }); + // // 替换匹配到的关键词,用span包裹并添加高亮样式 + // return '你的答案:' + props.answerText.replace(regex, (match) => `${match}`); + // }); const dimension_all_score = computed(() => { return ( evalSettingVos.value @@ -76,9 +73,7 @@ .reduce((total, current) => total + current, 0) ); }); - watch(evalSettingVos.value, (newVal) => { - console.log('newVal2', newVal); - }); + const click_option = () => { emit('click_option', props.analysisVo); }; diff --git a/src/components/examination/subject.vue b/src/components/examination/subject.vue index f8ff04c1..ff06f6b0 100644 --- a/src/components/examination/subject.vue +++ b/src/components/examination/subject.vue @@ -90,11 +90,14 @@ {{ myResultLabel.join('') }} + + 你的答案: + {{ subject_data.anserResult ?? '' }} + @@ -174,7 +177,7 @@ get: () => props.modelValue, set: (val) => emit('update:modelValue', val) }); - + let answerText = props.item?.my_answer || props.item.anserResult || []; // item_answer 是答题结果,可以是对象 数组 字符串类型 const item_answer = ref(typeof answerText === 'string' ? answerText.split(',') : answerText); diff --git a/src/components/image-preview/image-preview.vue b/src/components/image-preview/image-preview.vue index 8f26911a..15329365 100644 --- a/src/components/image-preview/image-preview.vue +++ b/src/components/image-preview/image-preview.vue @@ -42,7 +42,7 @@ }, mode:{ type: String, - default: 'aspectFit' + default: 'scaleToFill' }, previewDetail: { default: '', diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index b1dc275f..198967b8 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -103,8 +103,7 @@ :useEasing="true" ref="accmExamCntRef" > - - + @@ -171,7 +170,7 @@ {{ item.crsName }} - - 更新:{{ (item.mtTime || '').substr(0, 10) }} - + 更新:{{ (item.mtTime || '').substr(0, 10) }} - - 已学:{{ item.accmStdyCnt }}人次 - + 已学:{{ item.accmStdyCnt }}人次 去学习 @@ -214,7 +209,7 @@ {{ item.crsName }} - - 更新:{{ (item.mtTime || '').substr(0, 10) }} - + 更新:{{ (item.mtTime || '').substr(0, 10) }} - - 已学:{{ item.accmStdyCnt }}人次 - + 已学:{{ item.accmStdyCnt }}人次 去学习 @@ -264,13 +255,9 @@ {{ item.crsName }} - - 更新:{{ (item.mtTime || '').substr(0, 10) }} - + 更新:{{ (item.mtTime || '').substr(0, 10) }} - - 已学:{{ item.accmStdyCnt }}人次 - + 已学:{{ item.accmStdyCnt }}人次 去学习