Browse Source

1、新增英语写作批注功能
2、修改英语写作无法修改批注问题
3、修改英语写作保存批注问题

zengyicheng 1 year ago
parent
commit
07caa84760

+ 9 - 4
package-lock.json

@@ -5699,10 +5699,9 @@
       "dev": true
     },
     "diff": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npm.taobao.org/diff/download/diff-1.4.0.tgz?cache=0&sync_timestamp=1604803664325&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdiff%2Fdownload%2Fdiff-1.4.0.tgz",
-      "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=",
-      "dev": true
+      "version": "5.1.0",
+      "resolved": "https://registry.npmmirror.com/diff/-/diff-5.1.0.tgz",
+      "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw=="
     },
     "diffie-hellman": {
       "version": "5.0.3",
@@ -9411,6 +9410,12 @@
             "ms": "0.7.1"
           }
         },
+        "diff": {
+          "version": "1.4.0",
+          "resolved": "https://registry.npmmirror.com/diff/-/diff-1.4.0.tgz",
+          "integrity": "sha512-VzVc42hMZbYU9Sx/ltb7KYuQ6pqAw+cbFWVy4XKdkuEL2CFaRLGEnISPs7YdzaUGpi+CpIqvRmu7hPQ4T7EQ5w==",
+          "dev": true
+        },
         "glob": {
           "version": "7.0.5",
           "resolved": "https://registry.npmmirror.com/glob/download/glob-7.0.5.tgz?cache=0&sync_timestamp=1632353796482&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fglob%2Fdownload%2Fglob-7.0.5.tgz",

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
     "axios": "^0.21.3",
     "big.js": "^6.2.1",
     "dayjs": "^1.11.7",
+    "diff": "^5.1.0",
     "echarts": "^5.2.2",
     "element-ui": "^2.15.6",
     "file-saver": "^2.0.5",

+ 64 - 14
src/components/easy2/studyStudent.vue

@@ -11375,7 +11375,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList.engText" />
-                  <div v-else v-html="newEnglishList.engText"></div>
+                  <div v-else v-html="Correct(newEnglishList.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11397,7 +11397,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="oldEnglishJson1.engText" />
-                  <div v-else v-html="oldEnglishJson1.engText"></div>
+                  <div v-else v-html="Correct(oldEnglishJson1.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11412,7 +11412,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList.engText" />
-                  <div v-else v-html="newEnglishList.engText"></div>
+                  <div v-else v-html="Correct(newEnglishList.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11421,18 +11421,18 @@
               <div class="detailBox" style="position: relative;">
                 <div class="oldDetail">
                   <div>标题:</div>
-                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle"></div>
+                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
                   <div v-else>
-                    <el-input v-if="greyType" v-model="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle" />
-                    <div v-else v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle"></div>
+                    <el-input v-if="greyType" v-model="newEnglishList1[newEngIndex].cWork.engTitle" />
+                    <div v-else v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
                   </div>
                 </div>
                 <div class="oldDetail">
                   <div>正文:</div>
-                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engText"></div>
+                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="newEnglishList1[newEngIndex].cWork.engText"></div>
                   <div v-else>
-                    <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="JSON.parse(newEnglishList1[newEngIndex].cWork).engText" />
-                    <div v-else v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engText"></div>
+                    <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList1[newEngIndex].cWork.engText" />
+                    <div v-else v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
                   </div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
@@ -11940,9 +11940,13 @@ export default {
       pzStype: 1,
       downLoading: false,
       greyType: false,
+      correctWord: [],
     };
   },
   methods: {
+    gx(){
+      this.$forceUpdate();
+    },
     setEnglishList(engList) {
       this.myAnList = engList;
     },
@@ -19013,7 +19017,7 @@ export default {
             tool: this.toolindex,
             wid: this.engWid,
             c: this.userid,
-            w: (this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length) ? JSON.stringify(this.oldEnglishJson1) : JSON.stringify(this.newEnglishList),
+            w: this.userMes[0].type == 2 ? JSON.parse(this.newEnglishList) : (this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length) ? JSON.stringify(this.oldEnglishJson1) : this.newEngIndex == -1 ? JSON.stringify(this.newEnglishList) : (this.newEngIndex > -1 && this.newEnglishList1.length > 0) ? JSON.stringify(this.newEnglishList1[this.newEngIndex].cWork) : "",
           };
           this.ajax
             .get(this.$store.state.api + "addEngC", params)
@@ -19075,12 +19079,13 @@ export default {
                   return 0; // 保持默认顺序
                 }
               });
+              for(var p = 0;p<b.length;p++){
+                b[p].cWork = JSON.parse(b[p].cWork)
+              }
               this.newEnglishList1 = b;
             }
           }
           this.greyType = false;
-          this.engUpdateDialogVisible = true;
-          this.$forceUpdate();
           setTimeout(() => {
             this.topHeight = document.querySelectorAll(".engUpTop")[0].offsetHeight;
             if(this.newEnglishList1.length > 0){
@@ -19092,8 +19097,18 @@ export default {
                 this.newEngIndex = 0;
               }
             }
+            if(this.userMes[0].type == 2){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList.engText);
+            }else if(this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.oldEnglishJson1.engText);
+            }else if(this.newEngIndex == -1){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList.engText);
+            }else if(this.newEngIndex > -1 && this.newEnglishList1.length > 0){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList1[this.newEngIndex].cWork.engText);
+            }
           }, 500);
-          
+          this.engUpdateDialogVisible = true;
+          this.$forceUpdate();
         })
         .catch((err) => {
           console.error(err);
@@ -19271,7 +19286,42 @@ export default {
         var _tool = document.querySelectorAll('#'+tool)[0]
         return _tool ? document.querySelectorAll('#'+tool)[0].children[0].offsetHeight + 30 + 'px' : 0;
       };
-    }
+    },
+    Correct() {
+      return function (c) {
+        let w = "";
+        let a = this.correctWord;
+        for(var k = 0;k<a.length;k++){
+          if(w == ""){
+            if(a.length > 1){
+              if(a[k].added == true){
+                w = '<span>' + a[k - 1].value + '</span>' + '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w = '<span>' + a[k - 1].value + '</span>' + '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }else{
+              w = c
+            }
+          }else{
+            if(k == a.length - 1){
+              if(a[k].added == true){
+                w += '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w += '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }else{
+              if(a[k].added == true){
+                w += '<span>' + a[k - 1].value + '</span>' + '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w += '<span>' + a[k - 1].value + '</span>' + '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }
+          }
+        }
+        c = w;
+        return c;
+      };
+    },
   },
   mounted() {
     document.body.addEventListener("click", (e) => {

+ 65 - 14
src/components/easy3/studyStudent.vue

@@ -11362,7 +11362,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList.engText" />
-                  <div v-else v-html="newEnglishList.engText"></div>
+                  <div v-else v-html="Correct(newEnglishList.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11384,7 +11384,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="oldEnglishJson1.engText" />
-                  <div v-else v-html="oldEnglishJson1.engText"></div>
+                  <div v-else v-html="Correct(oldEnglishJson1.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11399,7 +11399,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList.engText" />
-                  <div v-else v-html="newEnglishList.engText"></div>
+                  <div v-else v-html="Correct(newEnglishList.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11408,18 +11408,19 @@
               <div class="detailBox" style="position: relative;">
                 <div class="oldDetail">
                   <div>标题:</div>
-                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle"></div>
+                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
                   <div v-else>
-                    <el-input v-if="greyType" v-model="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle" />
-                    <div v-else v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle"></div>
+                    <el-input v-if="greyType" v-model="newEnglishList1[newEngIndex].cWork.engTitle" />
+                    <div v-else v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
+                    
                   </div>
                 </div>
                 <div class="oldDetail">
                   <div>正文:</div>
-                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engText"></div>
+                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="newEnglishList1[newEngIndex].cWork.engText"></div>
                   <div v-else>
-                    <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="JSON.parse(newEnglishList1[newEngIndex].cWork).engText" />
-                    <div v-else v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engText"></div>
+                    <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList1[newEngIndex].cWork.engText" />
+                    <div v-else v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
                   </div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
@@ -11928,9 +11929,13 @@ export default {
       myAnList: {},
       downLoading: false,
       greyType: false,
+      correctWord: [],
     };
   },
   methods: {
+    gx(){
+      this.$forceUpdate();
+    },
     setEnglishList(engList) {
       this.myAnList = engList;
     },
@@ -19004,7 +19009,7 @@ export default {
             tool: this.toolindex,
             wid: this.engWid,
             c: this.userid,
-            w: (this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length) ? JSON.stringify(this.oldEnglishJson1) : JSON.stringify(this.newEnglishList),
+            w: this.userMes[0].type == 2 ? JSON.parse(this.newEnglishList) : (this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length) ? JSON.stringify(this.oldEnglishJson1) : this.newEngIndex == -1 ? JSON.stringify(this.newEnglishList) : (this.newEngIndex > -1 && this.newEnglishList1.length > 0) ? JSON.stringify(this.newEnglishList1[this.newEngIndex].cWork) : "",
           };
           this.ajax
             .get(this.$store.state.api + "addEngC", params)
@@ -19066,12 +19071,13 @@ export default {
                   return 0; // 保持默认顺序
                 }
               });
+              for(var p = 0;p<b.length;p++){
+                b[p].cWork = JSON.parse(b[p].cWork)
+              }
               this.newEnglishList1 = b;
             }
           }
           this.greyType = false;
-          this.engUpdateDialogVisible = true;
-          this.$forceUpdate();
           setTimeout(() => {
             this.topHeight = document.querySelectorAll(".engUpTop")[0].offsetHeight;
             if(this.newEnglishList1.length > 0){
@@ -19083,8 +19089,18 @@ export default {
                 this.newEngIndex = 0;
               }
             }
+            if(this.userMes[0].type == 2){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList.engText);
+            }else if(this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.oldEnglishJson1.engText);
+            }else if(this.newEngIndex == -1){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList.engText);
+            }else if(this.newEngIndex > -1 && this.newEnglishList1.length > 0){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList1[this.newEngIndex].cWork.engText);
+            }
           }, 500);
-          
+          this.engUpdateDialogVisible = true;
+          this.$forceUpdate();
         })
         .catch((err) => {
           console.error(err);
@@ -19262,7 +19278,42 @@ export default {
         var _tool = document.querySelectorAll('#'+tool)[0]
         return _tool ? document.querySelectorAll('#'+tool)[0].children[0].offsetHeight + 30 + 'px' : 0;
       };
-    }
+    },
+    Correct() {
+      return function (c) {
+        let w = "";
+        let a = this.correctWord;
+        for(var k = 0;k<a.length;k++){
+          if(w == ""){
+            if(a.length > 1){
+              if(a[k].added == true){
+                w = '<span>' + a[k - 1].value + '</span>' + '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w = '<span>' + a[k - 1].value + '</span>' + '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }else{
+              w = c
+            }
+          }else{
+            if(k == a.length - 1){
+              if(a[k].added == true){
+                w += '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w += '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }else{
+              if(a[k].added == true){
+                w += '<span>' + a[k - 1].value + '</span>' + '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w += '<span>' + a[k - 1].value + '</span>' + '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }
+          }
+        }
+        c = w;
+        return c;
+      };
+    },
   },
   mounted() {
     document.body.addEventListener("click", (e) => {

+ 65 - 14
src/components/studyStudent.vue

@@ -11347,7 +11347,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList.engText" />
-                  <div v-else v-html="newEnglishList.engText"></div>
+                  <div v-else v-html="Correct(newEnglishList.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11369,7 +11369,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="oldEnglishJson1.engText" />
-                  <div v-else v-html="oldEnglishJson1.engText"></div>
+                  <div v-else v-html="Correct(oldEnglishJson1.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11384,7 +11384,7 @@
                 <div class="oldDetail">
                   <div>正文:</div>
                   <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList.engText" />
-                  <div v-else v-html="newEnglishList.engText"></div>
+                  <div v-else v-html="Correct(newEnglishList.engText)"></div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
               </div>
@@ -11393,18 +11393,18 @@
               <div class="detailBox" style="position: relative;">
                 <div class="oldDetail">
                   <div>标题:</div>
-                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle"></div>
+                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
                   <div v-else>
-                    <el-input v-if="greyType" v-model="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle" />
-                    <div v-else v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engTitle"></div>
+                    <el-input v-if="greyType" v-model="newEnglishList1[newEngIndex].cWork.engTitle" @input="gx"/>
+                    <div v-else v-html="newEnglishList1[newEngIndex].cWork.engTitle"></div>
                   </div>
                 </div>
                 <div class="oldDetail">
                   <div>正文:</div>
-                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engText"></div>
+                  <div v-if="userMes[0].userid != newEnglishList1[newEngIndex].correct" v-html="newEnglishList1[newEngIndex].cWork.engText"></div>
                   <div v-else>
-                    <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="JSON.parse(newEnglishList1[newEngIndex].cWork).engText" />
-                    <div v-else v-html="JSON.parse(newEnglishList1[newEngIndex].cWork).engText"></div>
+                    <el-input v-if="greyType" type="textarea" :rows="10" resize="none" v-model="newEnglishList1[newEngIndex].cWork.engText" @input="gx"/>
+                    <div v-else v-html="Correct(newEnglishList1[newEngIndex].cWork.engText)"></div>
                   </div>
                 </div>
                 <el-button @click="greyType = !greyType" style="position: absolute;bottom: -50px;right: 0;background: #409eff;color: #fff;">{{ greyType == false ? '编辑' : '取消编辑' }}</el-button>
@@ -11489,6 +11489,7 @@ import JSZip from "jszip";
 import FileSaver from "file-saver";
 import onlineWrite from "./components/onlineWrite";
 import englishEva from "./components/englishEva";
+import * as Diff from 'diff'
 
 const getFile = (url) => {
   return new Promise((resolve, reject) => {
@@ -11910,9 +11911,13 @@ export default {
       userMes:{},
       downLoading: false,
       greyType: false,
+      correctWord: [],
     };
   },
   methods: {
+    gx(){
+      this.$forceUpdate();
+    },
     setEnglishList(engList) {
       this.myAnList = engList;
     },
@@ -18980,7 +18985,7 @@ export default {
             tool: this.toolindex,
             wid: this.engWid,
             c: this.userid,
-            w: (this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length) ? JSON.stringify(this.oldEnglishJson1) : JSON.stringify(this.newEnglishList),
+            w: this.userMes[0].type == 2 ? JSON.parse(this.newEnglishList) : (this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length) ? JSON.stringify(this.oldEnglishJson1) : this.newEngIndex == -1 ? JSON.stringify(this.newEnglishList) : (this.newEngIndex > -1 && this.newEnglishList1.length > 0) ? JSON.stringify(this.newEnglishList1[this.newEngIndex].cWork) : "",
           };
           this.ajax
             .get(this.$store.state.api + "addEngC", params)
@@ -19042,12 +19047,13 @@ export default {
                   return 0; // 保持默认顺序
                 }
               });
+              for(var p = 0;p<b.length;p++){
+                b[p].cWork = JSON.parse(b[p].cWork)
+              }
               this.newEnglishList1 = b;
             }
           }
           this.greyType = false;
-          this.engUpdateDialogVisible = true;
-          this.$forceUpdate();
           setTimeout(() => {
             this.topHeight = document.querySelectorAll(".engUpTop")[0].offsetHeight;
             if(this.newEnglishList1.length > 0){
@@ -19059,8 +19065,18 @@ export default {
                 this.newEngIndex = 0;
               }
             }
+            if(this.userMes[0].type == 2){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList.engText);
+            }else if(this.newEngIndex == -1 && this.isNoUserid == true && this.newEnglishList1.length){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.oldEnglishJson1.engText);
+            }else if(this.newEngIndex == -1){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList.engText);
+            }else if(this.newEngIndex > -1 && this.newEnglishList1.length > 0){
+              this.correctWord = Diff.diffChars(this.oldEnglishJson.engText,this.newEnglishList1[this.newEngIndex].cWork.engText);
+            }
           }, 500);
-          
+          this.engUpdateDialogVisible = true;
+          this.$forceUpdate();
         })
         .catch((err) => {
           console.error(err);
@@ -19235,7 +19251,42 @@ export default {
         var _tool = document.querySelectorAll('#'+tool)[0]
         return _tool ? document.querySelectorAll('#'+tool)[0].children[0].offsetHeight + 30 + 'px' : 0;
       };
-    }
+    },
+    Correct() {
+      return function (c) {
+        let w = "";
+        let a = this.correctWord;
+        for(var k = 0;k<a.length;k++){
+          if(w == ""){
+            if(a.length > 1){
+              if(a[k].added == true){
+                w = '<span>' + a[k - 1].value + '</span>' + '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w = '<span>' + a[k - 1].value + '</span>' + '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }else{
+              w = c
+            }
+          }else{
+            if(k == a.length - 1){
+              if(a[k].added == true){
+                w += '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w += '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }else{
+              if(a[k].added == true){
+                w += '<span>' + a[k - 1].value + '</span>' + '<span style="background-color: green;color:#fff">' + a[k].value + '</span>';
+              }else if(a[k].removed == true){
+                w += '<span>' + a[k - 1].value + '</span>' + '<span style="text-decoration: line-through;">' + a[k].value + '</span>';
+              }
+            }
+          }
+        }
+        c = w;
+        return c;
+      };
+    },
   },
   mounted() {
     document.body.addEventListener("click", (e) => {