From 555c0d43a2a2916f9c636ad2e8b778c00b9f1163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Wed, 24 Sep 2025 10:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E7=AD=94=E9=A2=98?= =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request.js | 1 - src/components/examination/es-analysis.vue | 15 ++++++++++----- src/components/examination/subject.vue | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/api/request.js b/src/api/request.js index 1d2ff316..50e865f0 100644 --- a/src/api/request.js +++ b/src/api/request.js @@ -6,7 +6,6 @@ import common from '@/common/common.js' const ENV = import.meta.env export const get_base_url = (url = '') => { - return '' if (ENV.MODE === 'development') { // 开发环境 // #ifdef H5 if (url) { diff --git a/src/components/examination/es-analysis.vue b/src/components/examination/es-analysis.vue index 0e22662b..e1a82d6c 100644 --- a/src/components/examination/es-analysis.vue +++ b/src/components/examination/es-analysis.vue @@ -11,7 +11,7 @@ {{ item.gradeDimens }}: {{ item.anlyGrade }} - + @@ -33,9 +33,13 @@ type: Boolean, default: false, required: false + }, + anserResult: { + type: String, + required: true } }); - const passKeyword = computed(() => props.value.passKeyword); + const evalSettingVos = computed(() => props.value.evalSettingVos); const status = computed(() => (props.judgeResult ? 'success' : 'error')); const select_status_icon = computed(() => { @@ -45,14 +49,15 @@ return optionErrorIcon(); } }); + const keywords = computed(() => { if (!props.value.relKeyword) return []; - return props.value.relKeyword.split(/[,、]/).map((key) => key.trim()); + return props.value.relKeyword.split(/[,、/]/).map((key) => key.trim()); }); const highlightedText = computed(() => { // 如果没有关键词,直接返回原文本 - if (!keywords.value.length) return '你的答案:' + props.answerText; + if (!keywords.value.length) return '你的答案:' + props.anserResult; // 构建正则表达式,匹配所有关键词(不区分大小写) // 对关键词进行转义,避免特殊字符影响正则 const escapedKeywords = keywords.value.map((keyword) => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); @@ -61,7 +66,7 @@ const regex = new RegExp(`(${escapedKeywords.join('|')})`, 'gi'); // 替换匹配到的关键词,用span包裹并添加高亮样式 - return '你的答案:' + props.answerText.replace(regex, (match) => `${match}`); + return '你的答案:' + props.anserResult.replace(regex, (match) => `${match}`); }); const dimension_all_score = computed(() => { return ( diff --git a/src/components/examination/subject.vue b/src/components/examination/subject.vue index dfa8370b..1505cae6 100644 --- a/src/components/examination/subject.vue +++ b/src/components/examination/subject.vue @@ -98,6 +98,7 @@ v-if="qnsTyp === 'ES'" :value="subject_data.itemVos[0]" :judgeResult="judgeResultStatus" + :anserResult="subject_data.anserResult" >