Przeglądaj źródła

merge "feature/1002298" into "main"
feature/1002298

Kevin 2 lat temu
rodzic
commit
16714bc61e

+ 4 - 2
src/views/report/ReportEditorView.vue

@@ -249,12 +249,14 @@ function duplicateCheck() {
     extract(report.value.chapters, report.value.id +"")
   }
  if (duplicateCheckRequest?.value) {
+  console.log(chapterEditors.value,"chapterEditors.value")
   reportService.duplicateCheck(duplicateCheckRequest.value).then((data: any) => {
     let index = 0;
     for (let item of data.repetitiveRate) {
-      console.log(item)
       if (item && item > 0) {
-        chapterEditors.value[index]?.notifyRepetitiveWarning();
+        chapterEditors.value[index]?.notifyRepetitiveWarning(true);
+      } else {
+        chapterEditors.value[index]?.notifyRepetitiveWarning(false);
       }
       index += 1;
     }

+ 10 - 3
src/views/report/components/ChapterEditor.vue

@@ -33,6 +33,8 @@ const keywordsEditor = ref<HTMLInputElement | null>(null);
 
 const keywordsEditing = ref(false);
 
+const repetitiveWarning = ref(false);
+ 
 const fullTitle = ref('');
 // 参考文献抽屉组件ref
 const referenceDraw = ref<InstanceType<typeof ReferenceDraw> | null>(null);
@@ -126,8 +128,8 @@ function onSectionRecordUse(sectionId: number) {
   emits("sectionRecordUse", sectionId)
 }
 
-function notifyRepetitiveWarning(){
-  contentEditor.value?.createErrorNotification()
+function notifyRepetitiveWarning(data: boolean){
+  repetitiveWarning.value = data;
 }
 
 defineExpose({
@@ -194,7 +196,7 @@ defineExpose({
         </a-dropdown>
       </a-col>
     </a-row>
-    <p v-if="contentEditorVisible">
+    <p v-if="contentEditorVisible" :class="{'repetitiveWarning': repetitiveWarning}">
       <ContentEditor :data="data.content || ''" @change="onContentChange" ref="contentEditor" />
     </p>
     <div class="chapter-button-group" v-if="contentEditorVisible">
@@ -245,5 +247,10 @@ defineExpose({
   .chapter-button-group {
     text-align: right;
   }
+
+  .repetitiveWarning{
+    border: 1px solid red;
+    border-radius: 8px;
+  }
 }
 </style>