Ver Fonte

课程中心循环添加loading,修改ai应用作业展示

11wqe1 há 1 mês atrás
pai
commit
678c8a90e2

+ 15 - 5
src/components/components/cocoFlowDia.vue

@@ -15,7 +15,7 @@
             </div>
            
             <div class="markDialog">
-                <template v-if="listData.length && listData[0].messages.length">
+                <template v-if="listData.length && showListData(listData)">
                     <div v-for="(item,index) in listData" :key="index">
                         <div class="BodyCon" v-if="item.messages.length"  >
                             <div class="BodyConTit">节点{{ index + 1}}</div>
@@ -62,13 +62,23 @@ import MarkdownIt from "markdown-it";
             }
         },
         computed: {
+            showListData(){
+                return function (val) {
+                   let kk = val.map(e=> e.messages).flat()
+                   console.log('kk',kk);
+                   if (kk.length == 0) {
+                    return false
+                   }
+                   return true
+                };
+            },
             MarkdownT() {
                 return function (c) {
                     let md = new MarkdownIt({
-  html: true, // 允许渲染 HTML
-  linkify: true, // 自动将URL链接转化为可点击链接
-  typographer: true, // 启用排版规则(如替换 `"` 为 “)
-});
+                        html: true, // 允许渲染 HTML
+                        linkify: true, // 自动将URL链接转化为可点击链接
+                        typographer: true, // 启用排版规则(如替换 `"` 为 “)
+                    });
                     return c
                     ? md.render(c) : "";
                 };

+ 46 - 1
src/components/easy2/studyStudent.vue

@@ -16820,7 +16820,14 @@ export default {
       },
       confirmOpenDig:false,
       confirmOpenDigData:'',
-      diffKey:"1"
+      diffKey:"1",
+      getCourseGroupLoading: false,
+      selectSWorksLoading:false,
+      selectStudentLoading:false,
+      selectSLookLoading:false,
+      getPickLoading:false,
+      selectPzLoading:false,
+      getSplitScreenDataLoading:false,
     };
   },
   watch:{
@@ -19012,6 +19019,8 @@ export default {
         });
     },
     selectStudent() {
+      if (this.selectStudentLoading) return
+      this.selectStudentLoading = true
       //学生查看自己作业
       let params = {
         uid: this.userid,
@@ -19333,8 +19342,12 @@ export default {
               }
             }
           }
+          this.selectStudentLoading = false
+          
         })
         .catch(err => {
+          this.selectStudentLoading = false
+
           console.error(err);
         });
     },
@@ -19773,6 +19786,8 @@ export default {
       return lang;
     },
     selectSWorks(gindex) {
+      if (this.selectSWorksLoading) return
+      this.selectSWorksLoading = true
       //教师查看全部作业
       let params = {
         cid: this.id,
@@ -20891,8 +20906,12 @@ export default {
               }, 0);
             });
           }
+          this.selectSWorksLoading = false
+
         })
         .catch(err => {
+          this.selectSWorksLoading = false
+
           console.error(err);
         });
     },
@@ -22477,6 +22496,8 @@ export default {
         });
     },
     getCourseGroup(gindex) {
+      if(this.getCourseGroupLoading) return
+      this.getCourseGroupLoading = true
       let params = {
         cid: this.id,
         classid: this.tcid ? this.tcid : "1"
@@ -22526,8 +22547,10 @@ export default {
             this.selectSWorks(gindex);
             this.isGroup = false;
           }
+          this.getCourseGroupLoading = false
         })
         .catch(err => {
+          this.getCourseGroupLoading = false
           // this.$message.error("网络不佳");
           console.error(err);
         });
@@ -22699,6 +22722,8 @@ export default {
       this.selectPz();
     },
     selectPz() {
+      if(this.selectPzLoading) return
+      this.selectPzLoading = true
       let params = {
         cid: this.id,
         s: this.courseType,
@@ -22721,8 +22746,12 @@ export default {
               }
             }
           }
+          this.selectPzLoading = false
+
         })
         .catch(err => {
+          this.selectPzLoading = false
+
           console.error(err);
         });
     },
@@ -22876,6 +22905,8 @@ export default {
         });
     },
     selectSLook() {
+      if(this.selectSLookLoading) return
+      this.selectSLookLoading = true
       let params = {
         cid: this.id
       };
@@ -22909,8 +22940,12 @@ export default {
               this.getCourseDetail(2);
             }
           }
+          this.selectSLookLoading = false
+
         })
         .catch(err => {
+          this.selectSLookLoading = false
+
           console.error(err);
         });
     },
@@ -25758,6 +25793,8 @@ export default {
         });
     },
     getPick() {
+      if(this.getPickLoading) return
+      this.getPickLoading = true
       let params = {
         cid: this.id
       };
@@ -25795,8 +25832,10 @@ export default {
               })
               .catch(() => {});
           }
+          this.getPickLoading = false
         })
         .catch(err => {
+          this.getPickLoading = false
           this.$message.error("网络不佳");
           console.error(err);
         });
@@ -25993,6 +26032,8 @@ export default {
     getSplitScreenData() {
       // return;
       // if (this.tType != 1) return;
+      if(this.getSplitScreenDataLoading) return
+      this.getSplitScreenDataLoading = true
       let params = {
         cid: this.id
       };
@@ -26060,8 +26101,12 @@ export default {
                 .catch(() => {});
             }
           }
+          this.getSplitScreenDataLoading = false
+          
         })
         .catch(e => {
+          this.getSplitScreenDataLoading = false
+
           console.log("获取分屏数出错:", e);
         });
     },

+ 51 - 1
src/components/easy3/studyStudent.vue

@@ -13139,7 +13139,14 @@ export default {
       },
       confirmOpenDig:false,
       confirmOpenDigData:'',
-      diffKey:"1"
+      diffKey:"1",
+      getCourseGroupLoading: false,
+      selectSWorksLoading:false,
+      selectStudentLoading:false,
+      selectSLookLoading:false,
+      getPickLoading:false,
+      selectPzLoading:false,
+      getSplitScreenDataLoading:false,
     };
   },
   methods: {
@@ -14609,6 +14616,8 @@ export default {
         });
     },
     selectStudent() {
+      if(this.selectStudentLoading) return
+      this.selectStudentLoading = true
       //学生查看自己作业
       let params = {
         uid: this.userid,
@@ -14931,8 +14940,12 @@ export default {
               }
             }
           }
+          this.selectStudentLoading = false
+
         })
         .catch((err) => {
+          this.selectStudentLoading = false
+
           console.error(err);
         });
     },
@@ -15288,6 +15301,8 @@ export default {
         .catch(() => {});
     },
     selectSWorks(gindex) {
+      if(this.selectSWorksLoading) return
+      this.selectSWorksLoading = true
       //教师查看全部作业
       let params = {
         cid: this.id,
@@ -16387,8 +16402,12 @@ export default {
               }, 0)
             })
           }
+          this.selectSWorksLoading = false
+          
         })
         .catch((err) => {
+          this.selectSWorksLoading = false
+
           console.error(err);
         });
     },
@@ -17883,6 +17902,8 @@ export default {
         });
     },
     getCourseGroup(gindex) {
+      if(this.getCourseGroupLoading) return
+      this.getCourseGroupLoading = true
       let params = {
         cid: this.id,
         classid: this.tcid ? this.tcid : "1",
@@ -17932,8 +17953,12 @@ export default {
             this.selectSWorks(gindex);
             this.isGroup = false;
           }
+          this.getCourseGroupLoading = false
+
         })
         .catch((err) => {
+          this.getCourseGroupLoading = false
+
           // this.$message.error("网络不佳");
           console.error(err);
         });
@@ -18103,6 +18128,8 @@ export default {
       this.selectPz();
     },
     selectPz() {
+      if(this.selectPzLoading) return
+      this.selectPzLoading = true
       let params = {
         cid: this.id,
         s: this.courseType,
@@ -18125,8 +18152,12 @@ export default {
               }
             }
           }
+          this.selectPzLoading = false
+
         })
         .catch((err) => {
+          this.selectPzLoading = false
+
           console.error(err);
         });
     },
@@ -18280,6 +18311,8 @@ export default {
         });
     },
     selectSLook() {
+      if(this.selectSLookLoading) return
+      this.selectSLookLoading = true
       let params = {
         cid: this.id,
       };
@@ -18312,8 +18345,12 @@ export default {
               this.getCourseDetail(2);
             }
           }
+          this.selectSLookLoading = false
+
         })
         .catch((err) => {
+          this.selectSLookLoading = false
+
           console.error(err);
         });
     },
@@ -21102,6 +21139,9 @@ export default {
         });
     },
     getPick() {
+      if(this.getPickLoading) return
+      this.getPickLoading = true
+
       let params = {
         cid: this.id,
       };
@@ -21139,8 +21179,12 @@ export default {
               })
               .catch(() => {});
           }
+          this.getPickLoading = false
+
         })
         .catch((err) => {
+          this.getPickLoading = false
+
           this.$message.error("网络不佳");
           console.error(err);
         });
@@ -21327,6 +21371,8 @@ export default {
     getSplitScreenData() {
       // return;
       // if (this.tType != 1) return;
+      if(this.getSplitScreenDataLoading) return
+      this.getSplitScreenDataLoading = true
       let params = {
         cid: this.id
       };
@@ -21393,8 +21439,12 @@ export default {
                 .catch(() => {});
             }
           }
+          this.getSplitScreenDataLoading = false
+
         })
         .catch(e => {
+          this.getSplitScreenDataLoading = false
+
           console.log("获取分屏数出错:", e);
         });
     },

+ 49 - 0
src/components/studyStudent.vue

@@ -13067,6 +13067,13 @@ export default {
       confirmOpenDigData:'',
       canUseCourseId: ['bfbe1913-2f87-11ef-bf55-005056b86db5','3a64b199-d2eb-11ef-a2d1-005056b86db5', 'bb0b1995-0207-11ef-b534-005056b86db5', 'f77921c8-d2f1-11ef-a2d1-005056b86db5'],
       diffKey:"1",
+      getCourseGroupLoading: false,
+      selectSWorksLoading:false,
+      selectStudentLoading:false,
+      selectSLookLoading:false,
+      getPickLoading:false,
+      selectPzLoading:false,
+      getSplitScreenDataLoading:false,
     };
   },
   methods: {
@@ -14531,6 +14538,8 @@ export default {
         });
     },
     selectStudent() {
+      if(this.selectStudentLoading) return
+      this.selectStudentLoading = true
       //学生查看自己作业
       let params = {
         uid: this.userid,
@@ -14853,8 +14862,12 @@ export default {
               }
             }
           }
+          this.selectStudentLoading = false
+
         })
         .catch((err) => {
+          this.selectStudentLoading = false
+
           console.error(err);
         });
     },
@@ -15213,6 +15226,8 @@ export default {
         .catch(() => {});
     },
     selectSWorks(gindex) {
+      if(this.selectSWorksLoading) return
+      this.selectSWorksLoading = true
       //教师查看全部作业
       let params = {
         cid: this.id,
@@ -16313,8 +16328,12 @@ export default {
               }, 0)
             })
           }
+          this.selectSWorksLoading = false
+
         })
         .catch((err) => {
+          this.selectSWorksLoading = false
+
           console.error(err);
         });
     },
@@ -17816,6 +17835,8 @@ export default {
         });
     },
     getCourseGroup(gindex) {
+      if(this.getCourseGroupLoading) return
+      this.getCourseGroupLoading = true
       let params = {
         cid: this.id,
         classid: this.tcid ? this.tcid : "1",
@@ -17865,8 +17886,12 @@ export default {
             this.selectSWorks(gindex);
             this.isGroup = false;
           }
+          this.getCourseGroupLoading = false
+
         })
         .catch((err) => {
+          this.getCourseGroupLoading = false
+
           // this.$message.error("网络不佳");
           console.error(err);
         });
@@ -18037,6 +18062,8 @@ export default {
       this.selectPz();
     },
     selectPz() {
+      if(this.selectPzLoading) return
+      this.selectPzLoading = true
       let params = {
         cid: this.id,
         s: this.courseType,
@@ -18059,8 +18086,12 @@ export default {
               }
             }
           }
+          this.selectPzLoading = false
+
         })
         .catch((err) => {
+          this.selectPzLoading = false
+
           console.error(err);
         });
     },
@@ -18214,6 +18245,8 @@ export default {
         });
     },
     selectSLook() {
+      if(this.selectSLookLoading) return
+      this.selectSLookLoading = true
       let params = {
         cid: this.id,
       };
@@ -18246,8 +18279,12 @@ export default {
               this.getCourseDetail(2);
             }
           }
+          this.selectSLookLoading = false
+
         })
         .catch((err) => {
+          this.selectSLookLoading = false
+
           console.error(err);
         });
     },
@@ -21030,6 +21067,8 @@ export default {
         });
     },
     getPick() {
+      if(this.getPickLoading) return
+      this.getPickLoading = true
       let params = {
         cid: this.id,
       };
@@ -21067,8 +21106,12 @@ export default {
               })
               .catch(() => {});
           }
+          this.getPickLoading = false
+
         })
         .catch((err) => {
+          this.getPickLoading = false
+
           this.$message.error("网络不佳");
           console.error(err);
         });
@@ -21255,6 +21298,8 @@ export default {
     getSplitScreenData() {
       // return;
       // if (this.tType != 1) return;
+      if(this.getSplitScreenDataLoading) return
+      this.getSplitScreenDataLoading = true
       let params = {
         cid: this.id
       };
@@ -21321,8 +21366,12 @@ export default {
                 .catch(() => {});
             }
           }
+          this.getSplitScreenDataLoading = false
+
         })
         .catch(e => {
+          this.getSplitScreenDataLoading = false
+
           console.log("获取分屏数出错:", e);
         });
     },

+ 51 - 1
src/components/studySutdentClass/studyStudent.vue

@@ -16399,7 +16399,14 @@ export default {
       languageSetting: 0, //0中文 1繁体 2英文
       toolListS: [],
       commentDetailCopy: "",
-      diffKey:"1"
+      diffKey:"1",
+      getCourseGroupLoading: false,
+      selectSWorksLoading:false,
+      selectStudentLoading:false,
+      selectSLookLoading:false,
+      getPickLoading:false,
+      selectPzLoading:false,
+      getSplitScreenDataLoading:false,
     };
   },
   watch:{
@@ -18557,6 +18564,8 @@ export default {
         });
     },
     selectStudent() {
+      if(this.selectStudentLoading) return
+      this.selectStudentLoading = true
       //学生查看自己作业
       let params = {
         uid: this.userid,
@@ -18879,8 +18888,12 @@ export default {
               }
             }
           }
+          this.selectStudentLoading = false
+
         })
         .catch((err) => {
+          this.selectStudentLoading = false
+
           console.error(err);
         });
     },
@@ -19250,6 +19263,8 @@ export default {
       return lang;
     },
     selectSWorks(gindex) {
+      if(this.selectSWorksLoading) return
+      this.selectSWorksLoading = true
       //教师查看全部作业
       let params = {
         cid: this.id,
@@ -20361,8 +20376,12 @@ export default {
               }, 0);
             });
           }
+          this.selectSWorksLoading = false
+
         })
         .catch(err => {
+          this.selectSWorksLoading = false
+
           console.error(err);
         });
     },
@@ -21934,6 +21953,8 @@ export default {
         });
     },
     getCourseGroup(gindex) {
+      if(this.getCourseGroupLoading) return
+      this.getCourseGroupLoading = true
       let params = {
         cid: this.id,
         classid: this.tcid ? this.tcid : "1",
@@ -21983,8 +22004,12 @@ export default {
             this.selectSWorks(gindex);
             this.isGroup = false;
           }
+          this.getCourseGroupLoading = false
+
         })
         .catch((err) => {
+          this.getCourseGroupLoading = false
+
           // this.$message.error("网络不佳");
           console.error(err);
         });
@@ -22154,6 +22179,8 @@ export default {
       this.selectPz();
     },
     selectPz() {
+      if(this.selectPzLoading) return
+      this.selectPzLoading = true
       let params = {
         cid: this.id,
         s: this.courseType,
@@ -22176,8 +22203,12 @@ export default {
               }
             }
           }
+          this.selectPzLoading = false
+
         })
         .catch((err) => {
+          this.selectPzLoading = false
+
           console.error(err);
         });
     },
@@ -22331,6 +22362,8 @@ export default {
         });
     },
     selectSLook() {
+      if(this.selectSLookLoading) return
+      this.selectSLookLoading = true
       let params = {
         cid: this.id,
       };
@@ -22363,8 +22396,12 @@ export default {
               this.getCourseDetail(2);
             }
           }
+          this.selectSLookLoading = false
+
         })
         .catch((err) => {
+          this.selectSLookLoading = false
+
           console.error(err);
         });
     },
@@ -25154,6 +25191,9 @@ export default {
         });
     },
     getPick() {
+      if(this.getPickLoading) return
+      this.getPickLoading = true
+
       let params = {
         cid: this.id,
       };
@@ -25191,8 +25231,12 @@ export default {
               })
               .catch(() => {});
           }
+          this.getPickLoading = false
+
         })
         .catch((err) => {
+          this.getPickLoading = false
+
           this.$message.error("网络不佳");
           console.error(err);
         });
@@ -25379,6 +25423,8 @@ export default {
     getSplitScreenData() {
       // return;
       // if (this.tType != 1) return;
+      if(this.getSplitScreenDataLoading) return
+      this.getSplitScreenDataLoading = true
       let params = {
         cid: this.id
       };
@@ -25445,8 +25491,12 @@ export default {
                 .catch(() => {});
             }
           }
+          this.getSplitScreenDataLoading = false
+
         })
         .catch(e => {
+          this.getSplitScreenDataLoading = false
+
           console.log("获取分屏数出错:", e);
         });
     },