SanHQin 1 month ago
parent
commit
bbe9c6cf0b

+ 1 - 0
src/assets/icon/classroomObservation/echartIcon.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1726640886428" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4312" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M63.5 145v735.3h895.7V145H63.5z m863.7 127.9v127.9H703.3V272.9h223.9zM383.4 496.7h287.9v127.9H383.4V496.7z m-32 127.9H95.5V496.7h255.9v127.9z m351.9-127.9h223.9v127.9H703.3V496.7z m-32-223.8v127.9H383.4V272.9h287.9z m-319.9 0v127.9H95.5V272.9h255.9zM95.5 848.4V720.5h255.9v127.9H95.5z m287.9 0V720.5h287.9v127.9H383.4z m319.9 0V720.5h223.9v127.9H703.3z" p-id="4313"></path></svg>

BIN
src/assets/icon/classroomObservation/recordLeft.png


BIN
src/assets/icon/classroomObservation/wordBg2.png


+ 50 - 14
src/components/pages/classroomObservation/components/addNewAnalysisDialog.vue

@@ -4,6 +4,7 @@
       :center="true"
       :visible.sync="dialogVisible"
       width="1200px"
+			style="z-index: 2172;"
       class="addTemplateDialog"
     >
       <!-- <div v-if="showDialog == true" class="a-dialog" v-el-drag-dialog> -->
@@ -399,7 +400,6 @@
                     >
                     </el-option>
                   </el-select>
-                  <!-- <el-input v-model="form.subject" placeholder="请输入所属学科" style="width: 300px;"></el-input> -->
                 </el-form-item>
 
                 <el-form-item
@@ -420,7 +420,26 @@
                     >
                     </el-option>
                   </el-select>
-                  <!-- <el-input v-model="form.subject" placeholder="请输入所属学科" style="width: 300px;"></el-input> -->
+                </el-form-item>
+
+								<el-form-item
+                  label="图表类型"
+                  prop="echartsType"
+                  style="margin-right: 50px;"
+                  class="d_d_b_at_input"
+                >
+                  <el-select
+                    v-model="form.echartsType"
+                    placeholder="请选择图表类型"
+                  >
+                    <el-option
+                      v-for="item in echartsList"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </el-select>
                 </el-form-item>
               </div>
               <el-form-item
@@ -525,8 +544,8 @@ export default {
       dialogVisible: false,
       userId: this.$route.query["userid"],
       input2: "",
-
       tagIndex: 0,
+			addTagIndex:0,
       tagSubject: "",
       boxType: 0, //0 新建  1修改
       dialogTagList: [
@@ -548,13 +567,20 @@ export default {
         { value: "10", label: "政治" },
         { value: "11", label: "其它" }
       ],
+			echartsList:[
+				{value:'0',label:"无"},
+				{value:'1',label:"词云图"},
+				{value:'2',label:"雷达图"},
+				{value:'3',label:"柱状图"},
+			],
       form: {
         name: "",
         detail: "",
         tips: "",
         type: "",
         subject: "",
-        open: false
+        open: false,
+				echartsType:0,
       },
       showModelDialog: "",
       formLoading: false,
@@ -626,6 +652,7 @@ export default {
 	},
   methods: {
     open(type) {
+			this.addTagIndex = type;
       this.tagIndex = type;
       this.input2 = "";
       this.tagSubject = "";
@@ -636,7 +663,8 @@ export default {
         tips: "",
         type: "",
         subject: "",
-        open: false
+        open: false,
+				echartsType:'0'
       };
       this.$emit("update");
     },
@@ -647,7 +675,7 @@ export default {
       this.tagSubject = "";
     },
     addAnalysisItem(title, id) {
-      this.$emit("success", title, id);
+      this.$emit("success", title, id,this.addTagIndex);
     },
     addNew() {
       this.$refs.newAnalysisModuleRef.open();
@@ -664,7 +692,8 @@ export default {
         tips: "",
         type: "",
         subject: "",
-        open: false
+        open: false,
+				echartsType:'0',
       };
       //新建模块
     },
@@ -684,7 +713,8 @@ export default {
                 ntype: this.form.type,
                 nopen: this.form.open ? 2 : 0,
                 nagentid: "",
-                ntips: this.form.tips
+                ntips: this.form.tips,
+								nctype:this.form.echartsType
               }
             ];
 
@@ -703,7 +733,8 @@ export default {
                     tips: "",
                     type: "",
                     subject: "",
-                    open: false
+                    open: false,
+										echartsType:'0',
                   };
                   this.$message.success("创建成功");
                 } else {
@@ -729,7 +760,8 @@ export default {
                 ntype: this.form.type,
                 nopen: this.form.open ? 2 : 0,
                 nagentid: this.form.agentid,
-                ntips: this.form.tips
+                ntips: this.form.tips,
+								nctype:this.form.echartsType
               }
             ];
             this.ajax
@@ -765,7 +797,8 @@ export default {
         tips: "",
         type: "",
         subject: "",
-        open: false
+        open: false,
+				echartsType:'0'
       };
     },
     editAnalysis(type, data) {
@@ -780,7 +813,8 @@ export default {
             ntype: data.type,
             nopen: 2,
             nagentid: data.agentid,
-            ntips: data.tips
+            ntips: data.tips,
+						echartsType:0,
           }
         ];
         this.formLoading = true;
@@ -812,7 +846,8 @@ export default {
             ntype: data.type,
             nopen: 0,
             nagentid: data.agentid,
-            ntips: data.tips
+            ntips: data.tips,
+						nctype:data.echartsType
           }
         ];
         this.formLoading = true;
@@ -846,7 +881,8 @@ export default {
           type: data.type,
           subject: data.subject,
           agentid: data.agentid,
-          open: data.open == 0 ? false : true
+          open: data.open == 0 ? false : true,
+					echartsType:data.echartsType,
         };
         this.showModelDialog = "";
       } else if (type == 4) {

+ 204 - 45
src/components/pages/classroomObservation/components/addNewTeacherVoiceprintDialog.vue

@@ -9,28 +9,71 @@
       <!-- <div v-if="showDialog == true" class="a-dialog" v-el-drag-dialog> -->
       <div class="a-d-top">
         <div class="a-d-topTit"><div>新增声纹</div></div>
-  
+
         <div class="a-d-t-right">
           <span @click.stop="close()">×</span>
         </div>
       </div>
       <div class="a_box">
-				<div class="a_b_form">
-					<div class="a_b_f_item"></div>
-				</div>
-				<div class="a_b_bottom">
-					<div class="a_b_b_top">
-						<span>请使用正常语速朗读以上内容</span>
-					</div>
-					<div class="a_b_b_bottom">
-						<div class="a_b_b_b_btn">
-							<svg width="16" height="22" viewBox="0 0 16 22" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00009 13.8098C10.5962 13.8098 12.6876 11.6655 12.6876 9.00351V5.30633C12.6876 2.64436 10.5962 0.5 8.00009 0.5C5.40393 0.5 3.31259 2.64436 3.31259 5.30633V9.00351C3.31259 11.6655 5.40393 13.8098 8.00009 13.8098ZM4.75489 5.30633C4.75489 3.45774 6.1972 1.97887 8.00009 1.97887C9.80297 1.97887 11.2453 3.45774 11.2453 5.30633V9.00351C11.2453 10.8521 9.80297 12.331 8.00009 12.331C6.1972 12.331 4.75489 10.8521 4.75489 9.00351V5.30633ZM15.5 10.1132C15.5 9.70651 15.1755 9.37377 14.7788 9.37377C14.4183 9.37377 14.0938 9.66954 14.0577 10.0393C13.5529 13.034 11.0288 15.2892 8 15.2892C4.97115 15.2892 2.44712 13.034 1.94231 10.0393C1.90625 9.66954 1.58173 9.37377 1.22115 9.37377C0.824519 9.37377 0.5 9.70651 0.5 10.1132V10.2241C1.07692 13.6995 3.85337 16.3984 7.27885 16.7311V19.9223H4.15379C3.72896 19.9223 3.38456 20.2755 3.38456 20.7111C3.38456 21.1467 3.72896 21.4998 4.15379 21.4998H11.8461C12.2709 21.4998 12.6153 21.1467 12.6153 20.7111C12.6153 20.2755 12.2709 19.9223 11.8461 19.9223H8.72115V16.7311C12.1466 16.3984 14.9231 13.6995 15.4639 10.2611C15.4639 10.2426 15.473 10.2149 15.482 10.1872L15.482 10.1871C15.491 10.1594 15.5 10.1317 15.5 10.1132Z" fill="white"/>
-</svg>
-点击录制
+        <div class="a_b_form">
+          <el-form label-position="top" :model="form" :rules="rules">
+            <el-form-item class="a_b_f_item" label="教师名称" prop="name">
+              <el-input v-model="form.name" :disabled="![0].includes(status)"></el-input>
+            </el-form-item>
+
+            <el-form-item class="a_b_f_item" label="声纹录制">
+              <div class="a_b_f_itemTextArea">
+                <div v-text="textAreaVale"></div>
+              </div>
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="a_b_bottom">
+          <div class="a_b_b_top">
+            <span>请使用正常语速朗读以上内容</span>
+          </div>
+          <div class="a_b_b_bottom">
+            <div class="a_b_b_b_btn" @click.stop="start()" v-if="status===0">
+              <svg
+                width="16"
+                height="22"
+                viewBox="0 0 16 22"
+                fill="none"
+                xmlns="http://www.w3.org/2000/svg"
+              >
+                <path
+                  fill-rule="evenodd"
+                  clip-rule="evenodd"
+                  d="M8.00009 13.8098C10.5962 13.8098 12.6876 11.6655 12.6876 9.00351V5.30633C12.6876 2.64436 10.5962 0.5 8.00009 0.5C5.40393 0.5 3.31259 2.64436 3.31259 5.30633V9.00351C3.31259 11.6655 5.40393 13.8098 8.00009 13.8098ZM4.75489 5.30633C4.75489 3.45774 6.1972 1.97887 8.00009 1.97887C9.80297 1.97887 11.2453 3.45774 11.2453 5.30633V9.00351C11.2453 10.8521 9.80297 12.331 8.00009 12.331C6.1972 12.331 4.75489 10.8521 4.75489 9.00351V5.30633ZM15.5 10.1132C15.5 9.70651 15.1755 9.37377 14.7788 9.37377C14.4183 9.37377 14.0938 9.66954 14.0577 10.0393C13.5529 13.034 11.0288 15.2892 8 15.2892C4.97115 15.2892 2.44712 13.034 1.94231 10.0393C1.90625 9.66954 1.58173 9.37377 1.22115 9.37377C0.824519 9.37377 0.5 9.70651 0.5 10.1132V10.2241C1.07692 13.6995 3.85337 16.3984 7.27885 16.7311V19.9223H4.15379C3.72896 19.9223 3.38456 20.2755 3.38456 20.7111C3.38456 21.1467 3.72896 21.4998 4.15379 21.4998H11.8461C12.2709 21.4998 12.6153 21.1467 12.6153 20.7111C12.6153 20.2755 12.2709 19.9223 11.8461 19.9223H8.72115V16.7311C12.1466 16.3984 14.9231 13.6995 15.4639 10.2611C15.4639 10.2426 15.473 10.2149 15.482 10.1872L15.482 10.1871C15.491 10.1594 15.5 10.1317 15.5 10.1132Z"
+                  fill="white"
+                />
+              </svg>
+              点击录制
+            </div>
+
+						<div class="a_b_b_b_record">
+							<div class="a_b_b_b_r_left">
+								<img src="../../../../assets/icon/classroomObservation/recordLeft.png" alt="">
+								<div>
+									<div>{{recordData.status==0?"录制中":recordData.status==1?"暂停":"结束"}}</div>
+									<span>{{ recordData.time }}</span>
+								</div>
+							</div>
+							<div class="a_b_b_b_r_right">
+								<div class="a_b_b_b_r_r_start">
+									<span></span>
+								</div>
+								<div class="a_b_b_b_r_r_stop">
+									<span></span>
+									<span></span>
+								</div>
+								<div class="a_b_b_b_r_r_end">
+									<span></span>
+								</div>
+							</div>
 						</div>
-					</div>
-				</div>
+          </div>
+        </div>
       </div>
       <!-- </div> -->
     </el-dialog>
@@ -38,25 +81,46 @@
 </template>
 
 <script>
-
 export default {
   data() {
     return {
       dialogVisible: false,
       userId: this.$route.query["userid"],
-			form: {
-				name: "",
+      status: 1, //0:初始状态   1:录制
+			recordData:{
+				time:0,
+				status:0,//0 录制中  1暂停  2结束
 			},
-			textAreaVale:"夏天来喽,又能吃上西瓜啦!我真的太喜欢在空调房吃西瓜了,这种感觉真的超爽!红彤彤的果肉和黑色的籽,西瓜就是夏天的标志。每次切开一个大大的西瓜,忍不住就想大口大口地吃,尤其在炎热的午后,这时候来一块冰镇西瓜,简直是人间美味,清凉透底!我也喜欢把西瓜切成小块,用小叉子一块一块品尝,仿佛在享受一场夏日盛宴,每一口都充满了甜蜜和清凉,仿佛所有的烦恼都被这清爽的滋味一扫而空。有时候我也会呼朋唤友,让朋友们来家里玩,大家围坐在一起吃着瓜,聊着天,笑声不断,再没有比这更惬意的日子了!这样的时光总让人觉得生活是如此美好。夏天来喽,又能吃上西瓜了,这种简单的快乐,真是让人难以抗拒!",
-		}
+      form: { 
+        name: ""
+      },
+      textAreaVale:
+        "夏天来喽,又能吃上西瓜啦!我真的太喜欢在空调房吃西瓜了,这种感觉真的超爽!红彤彤的果肉和黑色的籽,西瓜就是夏天的标志。每次切开一个大大的西瓜,忍不住就想大口大口地吃,尤其在炎热的午后,这时候来一块冰镇西瓜,简直是人间美味,清凉透底!我也喜欢把西瓜切成小块,用小叉子一块一块品尝,仿佛在享受一场夏日盛宴,每一口都充满了甜蜜和清凉,仿佛所有的烦恼都被这清爽的滋味一扫而空。有时候我也会呼朋唤友,让朋友们来家里玩,大家围坐在一起吃着瓜,聊着天,笑声不断,再没有比这更惬意的日子了!这样的时光总让人觉得生活是如此美好。夏天来喽,又能吃上西瓜了,这种简单的快乐,真是让人难以抗拒!",
+      rules: {
+        name: [
+          { required: true, trigger: "change", message: "请输入新的名称" },
+          {
+            min: 1,
+            max: 20,
+            trigger: "change",
+            message: "长度需在1-20个字符之间"
+          }
+        ]
+      }
+    };
   },
 
-
-  methods:{
-		open(){
-			this.dialogVisible = true;
-		},
-	}
+  methods: {
+    open() {
+      this.dialogVisible = true;
+    },
+    close() {
+      this.dialogVisible = false;
+    },
+		start(){
+			this.status = 1;
+		}
+  }
 };
 </script>
 
@@ -83,7 +147,7 @@ export default {
   box-sizing: border-box;
   /* padding: 5px; */
   line-height: 22px;
-	font-size: 18px;
+  font-size: 18px;
   justify-content: center;
   /* text-align: left; */
 }
@@ -136,34 +200,129 @@ export default {
   display: none;
 }
 
-.a_box{
-	width: 100%;
-	height: 100%;
-	box-sizing: border-box;
-	padding: 20px 0;
+.a_box {
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  padding: 20px 0;
 }
 
-.a_b_form{
-	width: 100%;
-	height: calc(100% - 70px);
-	background-color: yellow;
+.a_b_form {
+  width: 100%;
+  height: calc(100% - 70px);
 }
 
-.a_b_bottom{
-	width: 100%;
-	height: 70px;
-	background-color: red;
+.a_b_bottom {
+  width: 100%;
+  height: 70px;
 }
 
-.a_b_b_top{
+.a_b_b_top {
+  width: 100%;
+  height: 15px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 14px;
+  color: #5e9afc;
+  margin-top: 0px;
+  cursor: default;
+  box-sizing: border-box;
+  padding-top: 10px;
+}
+
+.a_b_b_bottom {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.a_b_b_b_btn {
+  padding: 10px 20px;
+  background-color: #3681fc;
+  border-radius: 20px;
+  font-size: 16px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: white;
+  cursor: pointer;
+}
+
+.a_b_b_b_btn > svg {
+  width: 20px;
+  height: 20px;
+  margin-right: 5px;
+}
+
+.a_b_f_item {
+  margin-bottom: 10px;
+}
+
+.a_b_f_item >>> .el-form-item__label {
+  padding: 0;
+  font-size: 20px;
+  font-weight: bold;
+}
+
+.a_b_f_itemTextArea {
+  width: 100%;
+  height: 390px;
+  border: 1px solid #e7e7e7;
+  border-radius: 4px;
+  box-sizing: border-box;
+  padding: 10px;
+  overflow: auto;
+}
+.a_b_f_itemTextArea > div {
+  background-color: #f0f2f566;
+  border: 1px dashed #f0f2f5;
+  border-radius: 4px;
+  color: #0000008e;
+  box-sizing: border-box;
+  padding: 5px;
+  font-size: 16px;
+	line-height: 30px;
+}
+
+.a_b_b_b_record{
 	width: 100%;
-	height: 15px;
-	background-color: blue;
+	height: 100%;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+}
+
+.a_b_b_b_r_left{
 	display: flex;
 	align-items: center;
 	justify-content: center;
-	font-size: 14px;
 }
 
+.a_b_b_b_r_left>div{
+	height: 100%;
+	width: auto;
+	display: flex;
+	flex-direction: column;
+	justify-content: space-between;
+	margin-left: 10px;
+}
+
+.a_b_b_b_r_left>div>div{
+	font-weight: bold;
+	margin-bottom: 5px;
+}
+
+.a_b_b_b_r_left>div>span{
+	color: #3681FC;
+}
+
+.a_b_b_b_r_right{
+	display: flex;
+	align-items: center;
+	justify-content: flex-end;
+}
 
 </style>

+ 3 - 1
src/components/pages/classroomObservation/components/analysis.vue

@@ -5,11 +5,12 @@
         <span :class="['a-h-l-icon', showItem ? 'a-h-l-showIcon' : '']"></span>
         <span class="a-h-l-title" v-if="!editTitle">{{ title }}</span>
         <div class="a_h_l_t_input" v-if="editTitle" @click.stop="() => {}">
-          <el-form ref="form" :model="form" :rules="rules" label-position="top">
+          <el-form ref="form" :model="form" :rules="rules" label-position="top" @submit.native.prevent>
             <el-form-item prop="name">
               <el-input
                 v-model="form.name"
                	@blur="editNameCheckFn()"
+								@keyup.enter.native="editNameCheckFn"
                 ref="editNameInputRef"
                 placeholder="请输入新的名称"
               ></el-input>
@@ -295,6 +296,7 @@ export default {
       // this.$refs.editNameDialogRef.open(this.title)
     },
     editNameCheckFn() {
+			if(!this.editTitle)return;
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.editTitle = false;

+ 37 - 1
src/components/pages/classroomObservation/components/analysisItem.vue

@@ -7,11 +7,12 @@
 				></span>
 				<span class="ai-h-l-text" v-if="!editTitle">{{ data.jsonData.anotherName?data.jsonData.anotherName:data.jsonData.name }}</span>
 				<div class="a_h_l_t_input" v-if="editTitle" @click.stop="() => {}">
-          <el-form ref="form" :model="form" :rules="rules" label-position="top">
+          <el-form ref="form" :model="form" :rules="rules" label-position="top" @submit.native.prevent>
             <el-form-item prop="name">
               <el-input
                 v-model="form.name"
                	@blur="editNameCheckFn()"
+								 @keyup.enter.native="editNameCheckFn()"
                 ref="editNameInputRef"
                 placeholder="请输入新的名称"
               ></el-input>
@@ -116,6 +117,21 @@
 					</el-tooltip>
 				</span>
 
+				<span v-if="loadNum != 1 && openItem && tid && ['1', '2', '3'].includes(data.jsonData.echartsType)" @click="editEcharts()">
+					<el-tooltip
+						class="item"
+						effect="light"
+						content="生成图表"
+						placement="top"
+					>
+						<img
+							:src="
+								require('../../../../assets/icon/classroomObservation/echartIcon.svg')
+							"
+						/>
+					</el-tooltip>
+				</span>
+
 				<!-- <span class="ai-h-r-icon4" @click.stop="delBtn()"></span> -->
 			</div>
 		</div>
@@ -279,6 +295,13 @@ export default {
 
 				let _msg = `使用文件检索的方式完整的去分析文件内容,并请完全按照要求输出。`
 
+				if(!assistant){
+					this.loading = false;
+					this.loadNum = 2;
+					type = 3;
+					return this.$message.error("未找到对应的AI助手");
+				}
+
 				if (assistant.agentid) {
 					type = 0
 				}else if(assistant.tips){
@@ -480,6 +503,7 @@ export default {
       // this.$refs.editNameDialogRef.open(this.title)
     },
     editNameCheckFn() {
+			if(!this.editTitle)return;
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.editTitle = false;
@@ -492,6 +516,18 @@ export default {
         }
       });
     },
+		editEcharts(){
+			console.log("生成图标")
+			if(this.data.jsonData.echartsType == "1"){
+				this.$message.info("词云图")
+			}else if(this.data.jsonData.echartsType == "2"){
+				this.$message.info("雷达图")
+			}else if(this.data.jsonData.echartsType == "3"){
+				this.$message.info("柱状图")
+			}else{
+				return this.$message.error("该模板不是图表模板")
+			}
+		}
 	},
 	mounted() {
 		if (this.data.jsonData.content) {

+ 3 - 1
src/components/pages/classroomObservation/components/analysisSpecialItem.vue

@@ -8,11 +8,12 @@
 				<span class="ai-h-l-text" v-if="!editTitle">{{ data.jsonData.anotherName?data.jsonData.anotherName:data.jsonData.name }}</span>
 
 				<div class="a_h_l_t_input" v-if="editTitle" @click.stop="() => {}">
-          <el-form ref="form" :model="form" :rules="rules" label-position="top">
+          <el-form ref="form" :model="form" :rules="rules" label-position="top" @submit.native.prevent>
             <el-form-item prop="name">
               <el-input
                 v-model="form.name"
                	@blur="editNameCheckFn()"
+								 @keyup.enter.native="editNameCheckFn()"
                 ref="editNameInputRef"
                 placeholder="请输入新的名称"
               ></el-input>
@@ -658,6 +659,7 @@ export default {
       // this.$refs.editNameDialogRef.open(this.title)
     },
     editNameCheckFn() {
+			if(!this.editTitle)return;
       this.$refs["form"].validate(valid => {
         if (valid) {
           this.editTitle = false;

File diff suppressed because it is too large
+ 0 - 46
src/components/pages/classroomObservation/components/analysisTemplateDialog.vue


+ 1 - 1
src/components/pages/classroomObservation/components/chatArea.vue

@@ -152,7 +152,7 @@
             <!-- <div class="ca-b-o-h-l-btn">
               <div class="ca-b-o-h-b-l-text" @click.stop="showTeacherVoiceprintBox = !showTeacherVoiceprintBox">{{choseTeacherVoiceprint?choseTeacherVoiceprint.name+'的':'教师'}}声纹</div>
               <div class="ca_teacherVoiceprintBox" style="cursor: default;" v-click-outside="()=>showTeacherVoiceprintBox = !showTeacherVoiceprintBox" v-if="showTeacherVoiceprintBox">
-                <div class="ca_tvb_itemHead" @click.stop="test()">
+                <div class="ca_tvb_itemHead" @click.stop="addNewTeacherVoiceprintBtn()">
                   <svg
                     width="12"
                     height="12"

+ 215 - 182
src/components/pages/classroomObservation/components/messageArea.vue

@@ -273,7 +273,11 @@
       @success="bindingForm"
     />
     <!-- 保存模板 -->
-    <saveTemplateDialog ref="saveTemplateDialogRef" :dataList="dataList" />
+    <saveTemplateDialog
+      ref="saveTemplateDialogRef"
+      :bmData="bmData"
+      :dataList="dataList"
+    />
     <!-- 分析模板 -->
     <analysisTemplateDialog
       ref="analysisTemplateDialogRef"
@@ -449,6 +453,7 @@ export default {
     useTemplate(json) {
       let _result = [];
       json.forEach(i => {
+				if(i.isOtherData)return _result.push(i);
         let _obj = {
           jsonData: i.jsonData,
           type: i.Type,
@@ -456,10 +461,12 @@ export default {
         };
         _result.push(_obj);
       });
+      // return console.log(_result);
       this.$parent
         .addNewCourseByTemplate(_result)
         .then(res => {
           this.$refs.analysisTemplateDialogRef.close();
+
           this.$refs.analysisTemplateDialogRef.loading = false;
         })
         .catch(e => {
@@ -474,7 +481,7 @@ export default {
       this.$refs.saveTemplateDialogRef.open();
       // this.$message.info("另存为模板");
     },
-    addAnalysisItem(name, id) {
+    addAnalysisItem(name, id, type) {
       return new Promise((resolve, reject) => {
         var OpenCC = require("opencc-js");
         let converter = OpenCC.Converter({
@@ -499,14 +506,14 @@ export default {
           return this.$message.error("未找到对应的AI助手");
         }
         let newIndexData = this.dataList
-          .filter(i => i.Type == assistant.type)
+          .filter(i => i.Type == type)
           .sort((a, b) => new Date(a.createtime) - new Date(b.createtime));
         newIndexData = newIndexData.length
           ? newIndexData[newIndexData.length - 1]
           : null;
         let newIndex = newIndexData
           ? newIndexData.tIndex + 1
-          : assistant.type == 0
+          : type == 0
           ? 2
           : 0;
         let params = {
@@ -516,13 +523,14 @@ export default {
             name: assistant.name,
             anotherName: assistant.name,
             mId: assistant.id,
+            echartsType: assistant.echartsType,
             result: assistant.detail,
             fileList: [],
             dataFileList: [],
             content: ""
           }),
           tid: this.tid,
-          type: assistant.type.toString()
+          type: type
         };
 
         // 这里调用添加
@@ -555,171 +563,183 @@ export default {
     },
     getCurrencyAndBaseMessageData() {
       if (!this.tid) return;
-      let pram = {
-        tid: this.tid,
-        // tid:'02',
-        type: "0"
-      };
-      this.currencyLoading = true;
-      this.dialogTagList.find(i => i.value == 0).loading = true;
-      this.baseMessageLoading = true;
-      this.bmData = {
-        id: "",
-        tId: this.tid,
-        tIndex: 0,
-        jsonData: {
-          activity_methods: "",
-          activity_structure: "",
-          classroom_resources: "",
-          courseName: "",
-          name: "",
-          studentNum: 0,
-          subject: "",
-          textbook: ""
-        }
-      };
-      this.imageList = [];
-      this.dataList = [];
-      this.dialogTagList = [
-        { value: 0, name: "通用课堂分析", loading: false },
-        { value: 1, name: "学科课堂分析", loading: false },
-        { value: 2, name: "扩展分析", loading: false }
-      ];
-      this.ajax
-        .post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
-        .then(res => {
-          let _data = res.data.FunctionResponse.result.length
-            ? JSON.parse(res.data.FunctionResponse.result)
-            : [];
-          if (_data.length == 0) {
-            return this.insertBaseMessage().then(_ => {
-              this.getCurrencyAndBaseMessageData();
-            });
+      return new Promise(resolve => {
+        let pram = {
+          tid: this.tid,
+          // tid:'02',
+          type: "0"
+        };
+        this.currencyLoading = true;
+        this.dialogTagList.find(i => i.value == 0).loading = true;
+        this.baseMessageLoading = true;
+        this.bmData = {
+          id: "",
+          tId: this.tid,
+          tIndex: 0,
+          jsonData: {
+            activity_methods: "",
+            activity_structure: "",
+            classroom_resources: "",
+            courseName: "",
+            name: "",
+            studentNum: 0,
+            subject: "",
+            textbook: ""
           }
-          let _bmData = _data.find(i => i.tIndex == 0);
-          let _dialogTagList = [];
-          // 基础信息
-          _bmData.jsonData = JSON.parse(_bmData.jsonData);
-          _dialogTagList = _bmData.jsonData.dialogTagList || [
-            { value: 0, name: "通用课堂分析", loading: false },
-            { value: 1, name: "学科课堂分析", loading: false },
-            { value: 2, name: "扩展分析", loading: false }
-          ];
-          // 图片
-          let _imageList = _data.find(i => i.tIndex == 1);
-          _imageList.jsonData = JSON.parse(_imageList.jsonData);
+        };
+        this.imageList = [];
+        this.dataList = [];
+        this.dialogTagList = [
+          { value: 0, name: "通用课堂分析", loading: false },
+          { value: 1, name: "学科课堂分析", loading: false },
+          { value: 2, name: "扩展分析", loading: false }
+        ];
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
+          .then(res => {
+            let _data = res.data.FunctionResponse.result.length
+              ? JSON.parse(res.data.FunctionResponse.result)
+              : [];
+            if (_data.length == 0) {
+              return this.insertBaseMessage().then(_ => {
+                this.getCurrencyAndBaseMessageData();
+              });
+            }
+            let _bmData = _data.find(i => i.tIndex == 0);
+            let _dialogTagList = [];
+            // 基础信息
+            _bmData.jsonData = JSON.parse(_bmData.jsonData);
+            _dialogTagList = _bmData.jsonData.dialogTagList || [
+              { value: 0, name: "通用课堂分析", loading: false },
+              { value: 1, name: "学科课堂分析", loading: false },
+              { value: 2, name: "扩展分析", loading: false }
+            ];
+            // 图片
+            let _imageList = _data.find(i => i.tIndex == 1);
+            _imageList.jsonData = JSON.parse(_imageList.jsonData);
 
-          if (!_imageList.jsonData.videoList) {
-            _imageList.jsonData.videoList = [];
-          }
-          if (!_imageList.jsonData.NephogramList) {
-            _imageList.jsonData.NephogramList = [];
-          }
-          //通用分析
-          let currency = [];
-          for (let i = 2; i < _data.length; i++) {
-            let _currency = _data[i];
-            _currency.jsonData = JSON.parse(_currency.jsonData);
-            currency.push(_currency);
-          }
+            if (!_imageList.jsonData.videoList) {
+              _imageList.jsonData.videoList = [];
+            }
+            if (!_imageList.jsonData.NephogramList) {
+              _imageList.jsonData.NephogramList = [];
+            }
+            //通用分析
+            let currency = [];
+            for (let i = 2; i < _data.length; i++) {
+              let _currency = _data[i];
+              _currency.jsonData = JSON.parse(_currency.jsonData);
+              currency.push(_currency);
+            }
 
-          this.dataList.push(...currency);
-          this.bmData = _bmData;
-          this.dialogTagList = _dialogTagList;
-          this.$emit("changeTranscription", {
-            transcriptionData: this.bmData.jsonData.transcriptionData
-              ? this.bmData.jsonData.transcriptionData
-              : "",
-            editorBarData: this.bmData.jsonData.editorBarData
-              ? this.bmData.jsonData.editorBarData
-              : { type: "0", content: "", url: "" }
+            this.dataList.push(...currency);
+            this.bmData = _bmData;
+            this.dialogTagList = _dialogTagList;
+            this.$emit("changeTranscription", {
+              transcriptionData: this.bmData.jsonData.transcriptionData
+                ? this.bmData.jsonData.transcriptionData
+                : "",
+              editorBarData: this.bmData.jsonData.editorBarData
+                ? this.bmData.jsonData.editorBarData
+                : { type: "0", content: "", url: "" }
+            });
+            this.imageList = _imageList;
+            if (this.imageList.jsonData.fileList.length > 0) {
+              this.$emit(
+                "changeChatAreaAudioUrl",
+                this.imageList.jsonData.fileList[0]
+              );
+            } else {
+              this.$emit("changeChatAreaAudioUrl", { name: "", url: "" });
+            }
+            this.$emit("updateTime", this.bmData.createtime);
+            this.baseMessageLoading = false;
+            this.dialogTagList.find(i => i.value == 0).loading = false;
+            this.currencyLoading = false;
+            resolve();
+          })
+          .catch(e => {
+            this.$message.error("获取通用分析失败");
+            console.log(e);
+            resolve();
           });
-          this.imageList = _imageList;
-          if (this.imageList.jsonData.fileList.length > 0) {
-            this.$emit(
-              "changeChatAreaAudioUrl",
-              this.imageList.jsonData.fileList[0]
-            );
-          } else {
-            this.$emit("changeChatAreaAudioUrl", { name: "", url: "" });
-          }
-          this.$emit("updateTime", this.bmData.createtime);
-          this.baseMessageLoading = false;
-          this.dialogTagList.find(i => i.value == 0).loading = false;
-          this.currencyLoading = false;
-        })
-        .catch(e => {
-          this.$message.error("获取通用分析失败");
-          console.log(e);
-        });
+      });
     },
     getScienceData() {
       if (!this.tid) return;
-      let pram = {
-        tid: this.tid,
-        // tid:'02',
-        type: "1"
-      };
-      this.scienceLoading = true;
-      this.dialogTagList.find(i => i.value == 1).loading = true;
-      this.ajax
-        .post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
-        .then(res => {
-          let _data = res.data.FunctionResponse.result.length
-            ? JSON.parse(res.data.FunctionResponse.result)
-            : [];
-          if (_data.length == 0) {
+      return new Promise(resolve => {
+        let pram = {
+          tid: this.tid,
+          // tid:'02',
+          type: "1"
+        };
+        this.scienceLoading = true;
+        this.dialogTagList.find(i => i.value == 1).loading = true;
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
+          .then(res => {
+            let _data = res.data.FunctionResponse.result.length
+              ? JSON.parse(res.data.FunctionResponse.result)
+              : [];
+            if (_data.length == 0) {
+              this.dialogTagList.find(i => i.value == 1).loading = false;
+              return (this.scienceLoading = false);
+            }
+            let science = [];
+            for (let i = 0; i < _data.length; i++) {
+              let _science = _data[i];
+              _science.jsonData = JSON.parse(_science.jsonData);
+              science.push(_science);
+            }
+            this.dataList.push(...science);
             this.dialogTagList.find(i => i.value == 1).loading = false;
-            return (this.scienceLoading = false);
-          }
-          let science = [];
-          for (let i = 0; i < _data.length; i++) {
-            let _science = _data[i];
-            _science.jsonData = JSON.parse(_science.jsonData);
-            science.push(_science);
-          }
-          this.dataList.push(...science);
-          this.dialogTagList.find(i => i.value == 1).loading = false;
-          this.scienceLoading = false;
-        })
-        .catch(e => {
-          this.$message.error("获取科学分析失败");
-          console.log(e);
-        });
+            this.scienceLoading = false;
+            resolve();
+          })
+          .catch(e => {
+            this.$message.error("获取科学分析失败");
+            resolve();
+            console.log(e);
+          });
+      });
     },
     getExtendData() {
       if (!this.tid) return;
-      let pram = {
-        tid: this.tid,
-        // tid:'02',
-        type: "2"
-      };
-      this.extendLoading = true;
-      this.dialogTagList.find(i => i.value == 2).loading = true;
-      this.ajax
-        .post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
-        .then(res => {
-          let _data = res.data.FunctionResponse.result.length
-            ? JSON.parse(res.data.FunctionResponse.result)
-            : [];
-          if (_data.length == 0) {
+      return new Promise(resolve => {
+        let pram = {
+          tid: this.tid,
+          // tid:'02',
+          type: "2"
+        };
+        this.extendLoading = true;
+        this.dialogTagList.find(i => i.value == 2).loading = true;
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
+          .then(res => {
+            let _data = res.data.FunctionResponse.result.length
+              ? JSON.parse(res.data.FunctionResponse.result)
+              : [];
+            if (_data.length == 0) {
+              this.dialogTagList.find(i => i.value == 2).loading = false;
+              return (this.extendLoading = false);
+            }
+            let extent = [];
+            for (let i = 0; i < _data.length; i++) {
+              let _extent = _data[i];
+              _extent.jsonData = JSON.parse(_extent.jsonData);
+              extent.push(_extent);
+            }
+            this.dataList.push(...extent);
             this.dialogTagList.find(i => i.value == 2).loading = false;
-            return (this.extendLoading = false);
-          }
-          let extent = [];
-          for (let i = 0; i < _data.length; i++) {
-            let _extent = _data[i];
-            _extent.jsonData = JSON.parse(_extent.jsonData);
-            extent.push(_extent);
-          }
-          this.dataList.push(...extent);
-          this.dialogTagList.find(i => i.value == 2).loading = false;
-          this.extendLoading = false;
-        })
-        .catch(e => {
-          this.$message.error("获取扩展分析失败");
-          console.log(e);
-        });
+            this.extendLoading = false;
+            resolve();
+          })
+          .catch(e => {
+            this.$message.error("获取扩展分析失败");
+            console.log(e);
+            resolve();
+          });
+      });
     },
     getValueAddedData() {
       if (!this.tid) return;
@@ -761,33 +781,42 @@ export default {
       }
     },
     getData() {
-      this.dataList = [];
-      if (this.tid) {
-        this.getCurrencyAndBaseMessageData();
-        this.getScienceData();
-        this.getExtendData();
-      } else {
-        this.getDefaultData();
-      }
+      return new Promise(resolve => {
+        this.dataList = [];
+        if (this.tid) {
+          Promise.all([
+            this.getCurrencyAndBaseMessageData(),
+            this.getScienceData(),
+            this.getExtendData()
+          ]).then(res => {
+            resolve();
+          });
+        } else {
+          this.getDefaultData()
+        }
+      });
       // this.getValueAddedData();
       // this.getFileId();
     },
     getDefaultData() {
       if (this.tid) return;
-      let params = {
-        uid: this.userId
-      };
-      this.loading = true;
-      this.ajax
-        .get(this.$store.state.api + "selectClassroomDefault", params)
-        .then(res => {
-          let _data = res.data[0][0];
-          if (_data) {
-            _data.tips = JSON.parse(_data.tips);
-            this.dataList = _data.tips;
-          }
-          this.loading = false;
-        });
+      return new Promise(resolve => {
+        let params = {
+          uid: this.userId
+        };
+        this.loading = true;
+        this.ajax
+          .get(this.$store.state.api + "selectClassroomDefault", params)
+          .then(res => {
+            let _data = res.data[0][0];
+            if (_data) {
+              _data.tips = JSON.parse(_data.tips);
+              this.dataList = _data.tips;
+            }
+            this.loading = false;
+						resolve();
+          });
+      });
     },
     saveData(data) {
       return new Promise((resolve, reject) => {
@@ -1078,8 +1107,12 @@ export default {
           this.$message.error("获取模块分析列表失败");
         });
     },
-    changeAnalysisName(data) {
-      this.dialogTagList.find(i => i.value == data.type).name = data.name;
+    changeAnalysisName(data,type = 0) {
+			if(type==0){
+				this.dialogTagList.find(i => i.value == data.type).name = data.name;
+			}else if(type==1){
+				this.dialogTagList = data;
+			}
       this.bmData.jsonData["dialogTagList"] = this.dialogTagList;
       this.saveData(this.bmData).then(res => {
         // this.$message.success("修改名称成功");

+ 17 - 9
src/components/pages/classroomObservation/components/saveTemplateDialog.vue

@@ -61,7 +61,11 @@ export default {
 		dataList:{
 			type:Array,
 			default:()=>{return []}
-		}
+		},
+		bmData:{
+			type:Object,
+			default:()=>{return {}}
+		},
 	},
 	data() {
 		return {
@@ -128,13 +132,7 @@ export default {
 						
 						_data.forEach(i=>{
 							if(converter(i.jsonData.name)==converter('词频词汇分析')){
-								i.jsonData.wordNum = 0;
-								i.jsonData.wordCountNum = 0;
-								i.createtime = "";
-								i.jsonData.content = "";
-								i.id = "",
-								i.tId = "",
-								i.userid = "";
+								return
 							}else{
 								i.jsonData.content = "";
 								i.jsonData.dataFileList = [];
@@ -143,10 +141,20 @@ export default {
 								i.id = "",
 								i.tId = "",
 								i.userid = "";
+								_result.push(i)
 							}
 							
-							_result.push(i)
+							
 						})
+
+						let otherData = {
+							isOtherData:true,
+							dialogTagList:this.bmData.jsonData.dialogTagList,
+						}
+						_result.push(otherData)
+						// console.log(_result)
+						// this.loading = false
+						// return
 						let params = [{
 							title:this.form.name,
 							subject:this.form.subject,

File diff suppressed because it is too large
+ 781 - 724
src/components/pages/classroomObservation/index.vue


Some files were not shown because too many files changed in this diff