zengyicheng 1 anno fa
parent
commit
c40f4567b0
2 ha cambiato i file con 44 aggiunte e 11 eliminazioni
  1. 43 9
      src/components/components/englishEva.vue
  2. 1 2
      src/components/studyStudent.vue

+ 43 - 9
src/components/components/englishEva.vue

@@ -82,7 +82,7 @@
           <div v-if="type == 0">
             <el-button
               type="primary"
-              @click="isPj = true"
+              @click="getAiPj"
               v-if="!isPj"
               style="margin: 10px 0 0 0"
               >AI评价</el-button
@@ -146,7 +146,11 @@
         </div>
       </div>
     </div>
-    <span slot="footer" class="dialog-footer" style="z-index: 999;position: relative;">
+    <span
+      slot="footer"
+      class="dialog-footer"
+      style="z-index: 999; position: relative"
+    >
       <el-button @click="close()">取 消</el-button>
       <el-button type="primary">确 定</el-button>
     </span>
@@ -155,7 +159,7 @@
 
 <script>
 export default {
-  props: ["engEvaDialogVisible","evaEngJson"],
+  props: ["engEvaDialogVisible", "evaEngJson", "userid"],
   data() {
     return {
       topHeight: 0,
@@ -173,11 +177,11 @@ export default {
   },
   methods: {
     handleClose(done) {
-      this.close()
+      this.close();
       done();
     },
-    close(){
-      this.$emit("update:engEvaDialogVisible",false)
+    close() {
+      this.$emit("update:engEvaDialogVisible", false);
     },
     checkImg(list) {
       if (!list.length) {
@@ -206,6 +210,36 @@ export default {
       this.type = i;
       this.$forceUpdate();
     },
+    getAiPj() {
+      let param = [
+        {
+          model: "gpt-3.5-turbo",
+          temperature: 0,
+          max_tokens: 2048,
+          top_p: 1,
+          frequency_penalty: 0,
+          presence_penalty: 0,
+          message: [
+            {
+              role: "user",
+              content:
+                "英语写作批改是这样的:你的任务是为文字内容进行批注,请依照以下步骤完成任务,并仅显示第二步完成的内容:1.校对并更正:" + this.evaEngJson.studentJson.engText + "2.通过文本批注的形式,即将错误的单词用删除线划去,并将正确内容补充在后面,将前一段文字修改为后一段文字,并以markdown的形式呈现。",
+            },
+          ],
+          uid: this.userid,
+          stream: false,
+        },
+      ];
+      this.ajax.post("https://gpt.cocorobo.cn/chat", param).then(
+        (res) => {
+          console.log(res);
+          this.isPj = true;
+        },
+        (err) => {
+          console.log(err);
+        }
+      );
+    },
   },
   mounted() {
     this.topHeight = document.querySelectorAll(".engUpTop")[0].offsetHeight;
@@ -239,14 +273,14 @@ export default {
   background: #fafafa;
 }
 
-.fullStyle>>>.el-dialog__body {
+.fullStyle >>> .el-dialog__body {
   height: calc(100% - 125px) !important;
   box-sizing: border-box;
   padding: 30px 0 !important;
   background: #fff !important;
 }
 
-.fullStyle>>>.el-dialog {
+.fullStyle >>> .el-dialog {
   width: 100% !important;
   max-width: 100% !important;
   height: 100% !important;
@@ -260,7 +294,7 @@ export default {
   margin: 0 auto !important;
 }
 
-.fullStyle>>>.el-dialog__footer{
+.fullStyle >>> .el-dialog__footer {
   background: #fff !important;
 }
 .engUpBox {

+ 1 - 2
src/components/studyStudent.vue

@@ -3834,7 +3834,6 @@
                         >
                           {{ w.sName }}
                           <img
-                            v-show="false"
                             class="deleteImg1"
                             src="../assets/evaEnglish.png"
                             @click.stop="openEnglishEva(w.wid,toolIndex)"
@@ -11376,7 +11375,7 @@
         <el-button type="primary" @click="addCorrect">确 定</el-button>
       </span>
     </el-dialog>
-    <englishEva :evaEngJson="evaEngJson" :engEvaDialogVisible.sync="engEvaDialogVisible"></englishEva>
+    <englishEva :evaEngJson="evaEngJson" :engEvaDialogVisible.sync="engEvaDialogVisible" :uid="userid"></englishEva>
     <interVideo
       :dialogVisibleVideo.sync="dialogVisibleVideo"
       :videoJson="videoJson"