浏览代码

智能助手-优化2

lzw 7 月之前
父节点
当前提交
a4cf755241
共有 2 个文件被更改,包括 101 次插入47 次删除
  1. 60 36
      src/components/pages/test/checkAi/aiLeader.vue
  2. 41 11
      src/components/pages/test/smarter.vue

+ 60 - 36
src/components/pages/test/checkAi/aiLeader.vue

@@ -22,7 +22,7 @@
           }" class="content">
             <div class="loadingDiv" v-if="item.loading">
               <span>小可努力生成中,请稍等片刻</span>
-              <img :src="loadingImg" class="loadingImg"/>
+              <img :src="loadingImg" class="loadingImg" />
             </div>
             <span class="vditor-reset" v-html="item.aiContent"></span>
             <span class="createTime" v-text="item.createtime"></span>
@@ -30,7 +30,7 @@
 
           <div class="ai_btn_box" v-if="!pan(item.aiContent).length && !item.loading">
             <img src="../../../../assets/icon/course/pasete.png" @click="onCopy(item.aiContent)" />
-            <!-- <img src="../../../../assets/icon/test/test_bianji.png" v-if="index >= 2" @click="edit(index)"/> -->
+            <!-- <img src="../../../../assets/icon/test/test_bianji.png" v-if="index >= 2" @click="edit(index)" /> -->
           </div>
         </div>
         <div style="margin-top:20px;margin-bottom:20px ; margin-right: auto;" v-if="item.content === 0">
@@ -46,7 +46,7 @@
           }" class="content">
             <div v-if="getWangLoading" class="loadingDiv">
               <span>小可努力生成中,请稍等片刻</span>
-              <img :src="loadingImg"class="loadingImg"/>
+              <img :src="loadingImg" class="loadingImg" />
             </div>
             <div v-else>
               <div class="guess_title">
@@ -109,7 +109,7 @@
           </div>
           <el-table ref="table" :data="course" border :key="1"
             :header-cell-style="{ color: '#00000066', fontSize: '16px', fontWeight: 'unset' }"
-            :row-class-name="tableRowClassName2" v-if="stype == 1" class="tableClass"  v-loading="isLoading">
+            :row-class-name="tableRowClassName2" v-if="stype == 1" class="tableClass" v-loading="isLoading">
             <el-table-column type="selection" :selectable="selectable" width="55"></el-table-column>
             <el-table-column label="序号" width="100px" align="center">
               <template slot-scope="scope">
@@ -140,13 +140,19 @@
           <!-- 遮罩层 -->
           <div v-if="isLoading2" class="mask"></div>
           <div v-if="isLoading2" class="loadingDiv2">
-              <span>小可努力生成中,请稍等片刻</span>
-              <img :src="loadingImg"class="loadingImg" />
+            <span>小可努力生成中,请稍等片刻</span>
+            <img :src="loadingImg" class="loadingImg" />
           </div>
         </div>
-        <div class="confirm_btn">
-          <el-button type="primary" @click="confirmSelection">确认</el-button>
+        <div class="student_bottom">
+            <div class="pageCount">
+              <span>共{{ course.length }}条</span>
+              <el-pagination background layout="prev, pager, next" :page-size="pageSize" :current-page="page" :total="total"
+                @current-change="handleCurrentChange"></el-pagination>
+            </div>
+            <el-button type="primary" @click="confirmSelection">确认</el-button>
         </div>
+        
 
       </el-dialog>
     </div>
@@ -351,7 +357,7 @@ export default {
       array: [],
       jArray: [],
       course: [],
-      loadingImg:require('../../../../assets/KekeLoading.gif'),
+      loadingImg: require('../../../../assets/KekeLoading.gif'),
       courseText: "",
       checkImg: checkImg,
       checkIsImg: checkIsImg,
@@ -370,14 +376,14 @@ export default {
       part: "全部内容",
       checkBool: false,
       loading: false,
+      pageSize:10,
+      page: 1,
+      total: 0,
       selectedForms: [],
       textareaHeight: 50,
       publicRoleList: [],
       roleList: [],
-      page: 1,
-      pageSize: 20,
       page2: 1,
-      pageSize2: 20,
       textList: [
         {
           title: "项目式学习",
@@ -445,6 +451,7 @@ export default {
       showjList: false,
       faloading: false,
       fasource: null,
+      // aiText: "",
       saveUid: "",
       isVoice: false,
       isTalk: false,
@@ -509,7 +516,10 @@ export default {
     delFileList(index) {
       this.fileList.splice(index, 1)
     },
-
+    handleCurrentChange(newPage) {
+            this.page = newPage;
+            this.getCourse();
+    },
     selectable(row, index) {
       return row.worksCount > 0
     },
@@ -517,7 +527,7 @@ export default {
       // 获取用户选择的表单
       const selectedForms = this.$refs.table.selection; // 获取选中的行
       console.log("用户选择的表单:", selectedForms); // 打印用户选择的表单
-      
+
       // this.cid = selectedForms.reduce((lastArr, item) => {
       //   lastArr.push(item.courseId);
       //   return lastArr
@@ -537,12 +547,12 @@ export default {
       });
       this.guessAskJson()
       this.addChat(names)
-      setTimeout(()=>{
+      setTimeout(() => {
         this.dialogTableVisible = false;
         this.isLoading = false;
         this.isLoading2 = false;
-      },500)
-      
+      }, 500)
+
       // this.getChatList()
 
 
@@ -1128,6 +1138,7 @@ export default {
             this.insertChat(_uuid);
             // this.$emit("pushAiContent",this.array)
             // }
+            console.log("array👉", this.array)
           })
           .catch(err => {
             console.log(err);
@@ -1699,9 +1710,11 @@ export default {
         type: "success"
       });
     },
-    // edit(index){
-    //   console.log("👉",index);
-
+    // edit(index) {
+    //   console.log("👉", this.array[index].content);
+    //   const userAsk = this.array[index].content
+    //   this.aiText = this.array[index].aiContent
+    //   this.$emit("pushAiContent", this.aiText, userAsk)
     // },
     stopSend() {
       if (this.fasource) {
@@ -2224,14 +2237,18 @@ export default {
   line-height: 14px;
   font-size: 14px;
 }
+
 /* 禁用过渡动画 */
 .el-dialog__wrapper {
-  animation: none !important;  /* 禁用外部包裹层的过渡动画 */
+  animation: none !important;
+  /* 禁用外部包裹层的过渡动画 */
 }
 
 .el-dialog {
-  transition: none !important; /* 禁用弹窗内部的动画 */
+  transition: none !important;
+  /* 禁用弹窗内部的动画 */
 }
+
 .c_pub_button_confirm {
   /* position: absolute;
     bottom: 13px;
@@ -2378,11 +2395,13 @@ export default {
   margin: 0 10px;
   position: relative;
 }
-.loadingDiv{
+
+.loadingDiv {
   display: flex;
   justify-content: center;
   align-items: center;
 }
+
 /* 遮罩层样式 */
 .mask {
   position: fixed;
@@ -2390,16 +2409,19 @@ export default {
   left: 0;
   right: 0;
   bottom: 0;
-  background: rgba(0, 0, 0, 0.5); /* 半透明黑色 */
-  z-index: 10;  /* 层级 */
+  background: rgba(0, 0, 0, 0.5);
+  /* 半透明黑色 */
+  z-index: 10;
+  /* 层级 */
 }
-.loadingDiv2{
+
+.loadingDiv2 {
   background-color: #f6f9ff;
   border-radius: 8px;
   box-shadow: 10px 10px 15px rgba(0, 0, 0, 0.3);
-  z-index:20;
+  z-index: 20;
   position: fixed;
-  padding:10px;
+  padding: 10px;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%) !important;
@@ -2408,6 +2430,7 @@ export default {
   align-items: center;
   transition: none !important;
 }
+
 .loadingImg {
   width: 30px;
   height: 30px;
@@ -2483,14 +2506,12 @@ export default {
 }
 
 .dialog_contentArea {
+  margin-top: -17px;
   min-height: 70vh;
   max-height: 70vh;
   /* 设置内容区域的最大高度 */
   overflow-y: auto;
-  /* 允许垂直滚动 */
-  padding-left: 20px;
-  padding-right: 20px;
-  margin-top: -17px;
+
 }
 
 .custom-icon {
@@ -2505,6 +2526,7 @@ export default {
   margin-top: 10px;
   z-index: 5;
 }
+
 .tableClass>>>.el-dialog__body {
   padding: 13px 20px;
 }
@@ -2540,13 +2562,15 @@ export default {
   /* border: 1.5px solid; */
   padding: 3px 8px;
 }
-
-.confirm_btn {
+.student_bottom{
   display: flex;
-  justify-content: flex-end;
-  margin-top: 5px;
+  justify-content: space-between;
 }
+.pageCount {
+    display: flex;
+    align-items: center;
 
+  }
 .student_head {
   display: flex;
   justify-content: space-between;

+ 41 - 11
src/components/pages/test/smarter.vue

@@ -87,8 +87,8 @@
                         <!-- <div style="display: flex;">
                             <div :class="['preview_file', { active: fileMenu === 1 }]" @click="fileMenu = 1">文档预览</div>
                             <div :class="['bianji_file', { active: fileMenu === 2 }]" @click="fileMenu = 2">文档编辑</div>
-                        </div> -->
-                        <!-- <div v-if="fileMenu == 1" style="margin:10px;"> -->
+                        </div> 
+                        <div v-if="fileMenu == 1" style="margin: -2px 10px;">  -->
                         <div class="cc_b_r_menu">
                             <div v-for="(item, index) in menuList" @click="changeMenuIndex(index)" :key="index"
                                 :class="{ 'cc_b_r_menu_active': menuIndex == index }">
@@ -107,10 +107,12 @@
                         <!-- </div> -->
                         <!-- <div v-if="fileMenu == 2">
                             <div class="bianji_area">
-                                <span></span>
+                                <span contenteditable="true" class="userAsk">{{ userAsk }}</span>
+                                <span class="aiText" contenteditable="true" v-html="bianjiText"></span>
+                                <span v-if="!userAsk" style="display: flex;justify-content: center;">暂无数据</span>
                             </div>
 
-                        </div> -->
+                        </div>  -->
                     </div>
                     <div v-else style="margin: 40px 0px 0px 20px">
                         <div>--官方能力演示--</div>
@@ -248,6 +250,8 @@ export default {
             fileMenu: 1,
             cutNumber: 1,
             dialogVisibleUpdate: false,
+            // bianjiText:"",
+            // userAsk:"",
             examineData: [],
             tableData: [],
             options: [{
@@ -399,6 +403,15 @@ export default {
             console.log("menuList", this.menuList);
 
         },
+        // pushAiContent(aitext,userText){
+        //     this.bianjiText = aitext
+        //     this.userAsk = userText
+        //     console.log("ai回答👉",this.bianjiText);
+        //     if(this.bianjiText){
+        //         this.fileMenu = 2
+        //     }
+            
+        // },
         // pushAiContent(data){
         //     this.aiContentArea.push(...data),
         //     console.log("aiContentArea",this.aiContentArea);
@@ -935,13 +948,31 @@ export default {
 .bianji_file.active {
     border-bottom: 2px solid blue;
 }
-
+[contenteditable="true"]:focus {
+  outline: none;
+  border: none;
+}
 .bianji_area {
-    background-color: #e5e4e4;
-    height: 600px;
-    margin: 10px;
+    margin: 10px 36px;
+    display: flex;
+    flex-direction: column;
 }
-
+.aiText{
+    margin-top:10px;
+}
+.userAsk{
+    font-size: 20px;
+    font-weight: bold;
+}
+/* .aiText>p{
+    margin-top: 0;
+    margin-bottom: 16px;
+}
+.aiText>ol{
+    padding-left: 2em;
+    margin-top: 0;
+    margin-bottom: 0;
+} */
 .cc_b_r_menu {
     width: 100%;
     height: 50px;
@@ -985,10 +1016,9 @@ export default {
 
 .cc_b_r_content {
     width: 100%;
-    height: calc(100% - 50px);
     overflow-y: auto;
     overflow-x: auto;
-    max-height: 83vh;
+    max-height: 79vh;
 }
 
 .cc_b_r_btn {