SanHQin 11 months ago
parent
commit
e3cf737a6d

+ 1 - 0
src/api/classObserve.js

@@ -166,3 +166,4 @@ export function upload_file_knowledgeRequest(data){//删除模板数据
     hideloading: true
     hideloading: true
 	})
 	})
 }
 }
+

+ 7 - 2
src/views/classObserve/addTel.vue

@@ -74,7 +74,8 @@ export default {
 			this.choiceList = [];
 			this.choiceList = [];
     },
     },
     close() {
     close() {
-      this.show = false
+      this.show = false;
+			this.$emit("close");
     },
     },
     addYes() {
     addYes() {
       if (this.choiceList.length == 0) return this.$toast('请选择你需要添加的分析')
       if (this.choiceList.length == 0) return this.$toast('请选择你需要添加的分析')
@@ -117,7 +118,7 @@ export default {
   height: 100vh;
   height: 100vh;
   top: 0;
   top: 0;
   left: 0;
   left: 0;
-  z-index: 1000;
+  z-index: 2005;
   background-color: #fff;
   background-color: #fff;
   padding-top: 55px;
   padding-top: 55px;
   .telCon {
   .telCon {
@@ -312,4 +313,8 @@ export default {
     }
     }
   }
   }
 }
 }
+
+:deep(.van-dialog){
+	z-index: 3000;
+}
 </style>
 </style>

+ 207 - 10
src/views/classObserve/homePage.vue

@@ -64,12 +64,12 @@
           ></div>
           ></div>
           <div v-show="showTranscriptType == 1" class="editorBarData">
           <div v-show="showTranscriptType == 1" class="editorBarData">
             <template v-if="bmData.jsonData">
             <template v-if="bmData.jsonData">
-              <div class="ebd_save" v-if="false">
+              <div class="ebd_save">
                 <van-popover placement="left" v-model="showEditorBarDataPopover" trigger="click">
                 <van-popover placement="left" v-model="showEditorBarDataPopover" trigger="click">
                   <div class="ebd_s_btnArea">
                   <div class="ebd_s_btnArea">
-                    <el-button size="small" type="primary" @click.stop="speakerCodingFn">说话人编码</el-button>
+                    <!-- <el-button size="small" type="primary" @click.stop="speakerCodingFn">说话人编码</el-button> -->
 
 
-                    <el-button size="small" type="primary" @click.stop="behaviorCodingFn">行为编码</el-button>
+                    <!-- <el-button size="small" type="primary" @click.stop="behaviorCodingFn">行为编码</el-button> -->
 
 
                     <el-button size="small" type="primary" @click.stop="saveEditorBarFn">保存</el-button>
                     <el-button size="small" type="primary" @click.stop="saveEditorBarFn">保存</el-button>
                   </div>
                   </div>
@@ -295,6 +295,28 @@ import { upload_file_knowledgeRequest } from '@/api/classObserve.js'
 let OpenCC = require('opencc-js')
 let OpenCC = require('opencc-js')
 import EditorBar from './components/wangEnduit.vue'
 import EditorBar from './components/wangEnduit.vue'
 
 
+const OPTIONS_GROUP = {
+  default: [
+    "老师讲课",
+    "老师提问或点名",
+    "老师板书或操作",
+    "老师评价或反馈",
+    "老师其他",
+    "学生发言",
+    "学生小组活动",
+    "学生自主学习",
+    "学生汇报分享",
+    "学生其他",
+  ],
+};
+const ATTENTION_GROUP = {
+  default:
+    "- 先根据说话人角色判断,再在对应角色的选项中选择选项\n- 如果没有合适的选项,默认使用`老师其他`或者`学生其他`",
+};
+const ROLE_OPTIONS_GROUP = {
+  default: ["老师", "学生"],
+};
+
 const getFile = url => {
 const getFile = url => {
   return new Promise((resolve, reject) => {
   return new Promise((resolve, reject) => {
     var credentials = {
     var credentials = {
@@ -349,7 +371,11 @@ export default {
     imageList: {
     imageList: {
       type: Object,
       type: Object,
       default: () => {}
       default: () => {}
-    }
+    },
+		actionTypesMap:{
+			type:Object,
+			default:()=>{}
+		},
   },
   },
   components: {
   components: {
     EditorBar
     EditorBar
@@ -358,6 +384,7 @@ export default {
     return {
     return {
       isParse: false,
       isParse: false,
       loading: false,
       loading: false,
+			userId:this.$store.state.user.id,
       showTranscriptType: 0, //0:原文速览   1;转录文稿
       showTranscriptType: 0, //0:原文速览   1;转录文稿
       showEditorBarDataPopover: false,
       showEditorBarDataPopover: false,
       recordedForm: {
       recordedForm: {
@@ -382,7 +409,8 @@ export default {
         { index: 3, label: '粤语' },
         { index: 3, label: '粤语' },
         { index: 2, label: '普通话' }
         { index: 2, label: '普通话' }
       ],
       ],
-      choiceLanguageIndex: 2
+      choiceLanguageIndex: 2,
+			jobContext:null,
     }
     }
   },
   },
   methods: {
   methods: {
@@ -395,8 +423,9 @@ export default {
         message: `确定保存转录文稿?`
         message: `确定保存转录文稿?`
       })
       })
         .then(() => {
         .then(() => {
-          console.log('保存')
-          this.showEditorBarDataPopover = false
+					this.$parent.saveEditorBar(true).then(_=>{
+						this.$toast.success("保存成功")
+					});
         })
         })
         .catch(() => {
         .catch(() => {
           console.log('不保存')
           console.log('不保存')
@@ -410,6 +439,7 @@ export default {
       })
       })
         .then(() => {
         .then(() => {
           console.log('获取说话人编码')
           console.log('获取说话人编码')
+					this.startContinuousJobs('role');
           this.showEditorBarDataPopover = false
           this.showEditorBarDataPopover = false
         })
         })
         .catch(() => {
         .catch(() => {
@@ -424,12 +454,178 @@ export default {
       })
       })
         .then(() => {
         .then(() => {
           console.log('获取行为编码')
           console.log('获取行为编码')
+					this.startContinuousJobs('actionType');
           this.showEditorBarDataPopover = false
           this.showEditorBarDataPopover = false
         })
         })
         .catch(() => {
         .catch(() => {
           console.log('不获取')
           console.log('不获取')
           this.showEditorBarDataPopover = true
           this.showEditorBarDataPopover = true
         })
         })
+    },
+		async startContinuousJobs(type /* role, actionType */) {
+      const key = "default";
+      const { appToken, options, attention } = {
+        role: {
+          appToken: "app-TonzLPv7rPG0EtnFKszOWjwt",
+          options: ROLE_OPTIONS_GROUP[key],
+          attention: undefined,
+        },
+        actionType: {
+          appToken: "app-zOMxBqyEKoJSvW10e5SS0kgj",
+          options: OPTIONS_GROUP[key],
+          attention: ATTENTION_GROUP[key],
+        },
+      }[type];
+      const config = {
+        headers: {
+          Authorization: `Bearer ${appToken}`,
+          "Content-Type": "application/json",
+        },
+      };
+      const content = this.bmData.jsonData.editorBarData.content;
+      const div = document.createElement("div");
+      div.innerHTML = content;
+      const tableRows = _.slice(div.querySelectorAll(`table tbody tr`), 1);
+      if (!tableRows.length || tableRows[0].cells.length < 7) {
+        this.$toast.fail("没有可编码的内容");
+        return;
+      }
+      const ctrl = new AbortController();
+      this.jobContext = {
+        ctrl,
+        status: "running",
+        restart: () => {},
+        pause: () => {},
+        stop: () => {
+          const err = new Error();
+          err.name = "StopError";
+          this.jobContext.ctrl.abort(err);
+        },
+        progress: {
+          current: 0,
+          currentSize: 0,
+          total: tableRows.length,
+          percentage: 0,
+        },
+      };
+      // large chunk size will cause token limit and slower
+      const chunkSize = 10;
+      this.actionTypesMap.jsonData[key] = Array.from({ length: tableRows.length }).fill(
+        ""
+      );
+
+      const jobsResult = [];
+      const jobs = _.chunk(tableRows, chunkSize).map((rows, index) => {
+        return async (pauseSignal) => {
+          this.jobContext.progress.current = index * chunkSize;
+          this.jobContext.progress.currentSize = rows.length;
+          this.jobContext.progress.percentage =
+            ((index * chunkSize) / tableRows.length) * 100;
+          const res = await fetch('https://dify.cocorobo.cn/v1/workflows/run',{
+            signal: AbortSignal.any([this.jobContext.ctrl.signal, pauseSignal]),
+            method: "POST",
+            body: JSON.stringify({
+              inputs: {
+                // PERF better to just include `role` and `content` to minimize token cost
+                rows: JSON.stringify(
+                  rows.map((r) => ({
+                    content: r.cells[3].textContent,
+                    role: r.cells[5].textContent,
+                  }))
+                ),
+                options: options.join(","),
+                attention,
+              },
+              response_mode: "blocking",
+              user: this.userId,
+            }),
+            ...config,
+          }).then((res) => res.json());
+          const error = _.get(res, ["data", "error"], null);
+          // test
+          // throw new Error('mock error');
+          if (error) {
+            const err = new Error(error);
+            err.name = "DifyError";
+            throw err;
+          }
+          const chunkResult = _.get(res, ["data", "outputs", "result"], []);
+          jobsResult.splice(
+            index * chunkSize,
+            rows.length,
+            ...Object.assign(new Array(rows.length), chunkResult.slice(0, rows.length))
+          );
+          // PERF dom更新太卡了
+          // this.changeEditorBar({
+          //   transcriptionData: this.transcriptionData.content,
+          //   editorBarData: this.editorBarData,
+          // });
+        };
+      });
+      while (!this.jobContext.ctrl.signal.aborted && jobs.length > 0) {
+        const job = jobs.shift();
+        while (!this.jobContext.ctrl.signal.aborted) {
+          const pauseCtrl = new AbortController();
+          this.jobContext.pause = () => {
+            const err = new Error();
+            err.name = "PauseError";
+            pauseCtrl.abort(err);
+          };
+          try {
+            await job(pauseCtrl.signal);
+            break;
+          } catch (err) {
+            // console.error(err);
+            if (err.name === "StopError") {
+              break;
+            }
+            this.jobContext.status = "paused";
+            if (err.name === "PauseError") {
+              this.jobContext.error = `用户暂停`;
+            } else {
+              this.jobContext.error = `部分生成失败。点击按钮可继续尝试生成`;
+            }
+            try {
+              const restartPromise = new Promise((resolve, reject) => {
+                this.jobContext.restart = resolve;
+                this.jobContext.ctrl.signal.addEventListener("abort", reject);
+              });
+              await restartPromise;
+              this.jobContext.status = "running";
+              this.jobContext.error = null;
+            } catch (_err) {
+              // nothing to do, just continue
+            }
+          }
+        }
+      }
+      if (type === "actionType") {
+        this.actionTypesMap.jsonData[key] = jobsResult;
+      } else if (type === "role") {
+        const _div = document.createRange().createContextualFragment(this.bmData.jsonData.editorBarData.content);
+        const _table = _div.querySelector('table')
+        const _rows = _table.querySelectorAll(`tbody tr`);
+        const _actionTypes = []
+        _rows.forEach((i, index) => {
+          while (i.cells.length > 7) {
+            i.removeChild(i.lastElementChild);
+          }
+          if (index == 0) return;
+          const actionTypeCell = i.cells[6] && i.removeChild(i.cells[6]);
+          i.cells[5].textContent = jobsResult[index - 1]
+          _actionTypes.push(_.get(actionTypeCell, "textContent", ""));
+        });
+        this.actionTypesMap.jsonData[key] = _actionTypes;
+        this.bmData.jsonData.editorBarData.content = _table.outerHTML;
+      }
+			this.$parent.saveData(this.bmData).then(_=>{
+				console.log("保存成功")
+			})
+      // this.changeEditorBar({
+      //   transcriptionData: this.transcriptionData.content,
+      //   editorBarData: this.editorBarData,
+      // });
+      this.jobContext = null;
     },
     },
     changeLanguageFn(newIndex) {
     changeLanguageFn(newIndex) {
       if (this.isParse) return this.$toast('正在录音中...')
       if (this.isParse) return this.$toast('正在录音中...')
@@ -437,7 +633,8 @@ export default {
       this.changeLanguageShow = false
       this.changeLanguageShow = false
     },
     },
     goChat() {
     goChat() {
-      this.$router.push({ path: '/aiChat', query: {} })
+			this.cutPage(9)
+      // this.$router.push({ path: '/aiChat', query: {} })
     },
     },
     historyBtn() {
     historyBtn() {
       this.historyShow = true
       this.historyShow = true
@@ -445,7 +642,7 @@ export default {
     // 绑定表单
     // 绑定表单
     cutPage(val) {
     cutPage(val) {
       if (this.isParse) return
       if (this.isParse) return
-      if ([2, 3, 8].includes(val) && !this.tid) {
+      if ([2, 3, 8,9].includes(val) && !this.tid) {
         return this.$toast('请先选择或创建课堂')
         return this.$toast('请先选择或创建课堂')
       }
       }
       this.$emit('cutPage', val)
       this.$emit('cutPage', val)
@@ -1048,7 +1245,7 @@ export default {
         console.log(e)
         console.log(e)
         this.$toast.success('转译完成')
         this.$toast.success('转译完成')
         // _this.showGetTextLoading = false;
         // _this.showGetTextLoading = false;
-        this.saveEditorBar()
+        this.$parent.saveEditorBar()
       }
       }
 
 
       iiframe.contentWindow.doContinuousPronunciationAssessment('', {
       iiframe.contentWindow.doContinuousPronunciationAssessment('', {

+ 62 - 56
src/views/classObserve/index.vue

@@ -10,6 +10,7 @@
       :tid="tid"
       :tid="tid"
       :bmData="bmData"
       :bmData="bmData"
       :imageList="imageList"
       :imageList="imageList"
+			:actionTypesMap="actionTypesMap"
     ></homePage>
     ></homePage>
     <bindFrom
     <bindFrom
       ref="bindFromRef"
       ref="bindFromRef"
@@ -28,7 +29,7 @@
       :bmData="bmData"
       :bmData="bmData"
       :imageList="imageList"
       :imageList="imageList"
     ></classInfo>
     ></classInfo>
-    <stencilled ref="stencilledRef" @cutPage="cutPage" :page="page" v-if="page == 5 && userId"></stencilled>
+    <stencilled ref="stencilledRef" @cutPage="cutPage" :page="page" :analysisList="analysisList" v-if="page == 5 && userId"></stencilled>
     <editTel ref="editTelRef" @cutPage="cutPage" :dataList="dataList" :page="page" v-if="page == 6"></editTel>
     <editTel ref="editTelRef" @cutPage="cutPage" :dataList="dataList" :page="page" v-if="page == 6"></editTel>
     <!-- <addTel ref="addTelRef" @cutPage="cutPage" :page="page" v-if="page == 7"></addTel> -->
     <!-- <addTel ref="addTelRef" @cutPage="cutPage" :page="page" v-if="page == 7"></addTel> -->
     <outcome
     <outcome
@@ -43,6 +44,7 @@
       :dataList="dataList"
       :dataList="dataList"
       :tid="tid"
       :tid="tid"
     />
     />
+		<aiChat ref="aiChatRef" @cutPage="cutPage" :tid="tid" v-if="page==9"/>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -54,6 +56,7 @@ import stencilled from './stencilled'
 import editTel from './editTel'
 import editTel from './editTel'
 import addTel from './addTel'
 import addTel from './addTel'
 import outcome from './outcome.vue'
 import outcome from './outcome.vue'
+import aiChat from './aiChat.vue'
 import { v4 as uuidv4 } from 'uuid'
 import { v4 as uuidv4 } from 'uuid'
 import _ from 'lodash'
 import _ from 'lodash'
 import {
 import {
@@ -68,7 +71,7 @@ import {
 } from '@/api/classObserve'
 } from '@/api/classObserve'
 
 
 export default {
 export default {
-  components: { homePage, bindFrom, classInfo, stencilled, editTel, addTel, outcome },
+  components: { homePage, bindFrom, classInfo, stencilled, editTel, addTel, outcome,aiChat },
   data() {
   data() {
     return {
     return {
       userId: this.$store.state.user.id,
       userId: this.$store.state.user.id,
@@ -794,47 +797,48 @@ export default {
     },
     },
     // 保存转录文稿和原文速览
     // 保存转录文稿和原文速览
     saveEditorBar(flag = false) {
     saveEditorBar(flag = false) {
-      if (!this.tid) return this.$toast.fail('请选择课堂')
-      if (this.bmData.jsonData.editorBarData.type == '0' && flag && this.bmData.jsonData.editorBarData.content) {
-        // 如果是文本则转成txt并保存
-        let _result = JSON.parse(JSON.stringify(this.bmData.jsonData.editorBarData))
-        var text = _result.content
+      return new Promise(resolve => {
+        if (!this.tid) return this.$toast.fail('请选择课堂')
+        if (this.bmData.jsonData.editorBarData.type == '0' && flag && this.bmData.jsonData.editorBarData.content) {
+          // 如果是文本则转成txt并保存
+          let _result = JSON.parse(JSON.stringify(this.bmData.jsonData.editorBarData))
+          var text = _result.content
 
 
-        // 创建一个Blob实例
-        var blob = new Blob([text], { type: 'text/plain;charset=utf-8' })
-        blob.lastModifiedDate = new Date()
-        blob.name = `${this.tid}-classroomObservation.txt`
-        return this.$refs.homePageRef.uploadFile(blob, { changeText: false, flag: false })
-      } else {
-        // this.loading = true;
-        // let div = document.createElement("div");
-        // div.innerHTML = this.editorBarData.content;
-        // return this.loading = false;
+          // 创建一个Blob实例
+          var blob = new Blob([text], { type: 'text/plain;charset=utf-8' })
+          blob.lastModifiedDate = new Date()
+          blob.name = `${this.tid}-classroomObservation.txt`
+          return this.$refs.homePageRef.uploadFile(blob, { changeText: false, flag: false })
+        } else {
+          // this.loading = true;
+          // let div = document.createElement("div");
+          // div.innerHTML = this.editorBarData.content;
+          // return this.loading = false;
 
 
-        let _sentence = 0
-        let _words = 0
-        let _editorBarDataContentRows = []
-        let _actionTypes = []
+          let _sentence = 0
+          let _words = 0
+          let _editorBarDataContentRows = []
+          let _actionTypes = []
 
 
-        if (this.bmData.jsonData.editorBarData.type == 0) {
-          let _data = this.bmData.jsonData.editorBarData.content
-          let _div = document.createRange().createContextualFragment(_data)
-          let _tableRows = _div.querySelectorAll(`table tbody tr`)
-          _tableRows.forEach((i, index) => {
-            while (i.cells.length > 7) {
-              i.removeChild(i.lastElementChild)
-            }
-            const actionTypeCell = i.cells[6] && i.removeChild(i.cells[6])
-            _editorBarDataContentRows.push(i.outerHTML)
-            if (index == 0) return
-            if (i.cells[3].textContent != '') {
-              _sentence += 1
-              _words += i.cells[3].textContent.length
-            }
-            _actionTypes.push(_.get(actionTypeCell, 'textContent', ''))
-          })
-        }
-        const _editorBarDataContent = `<table
+          if (this.bmData.jsonData.editorBarData.type == 0) {
+            let _data = this.bmData.jsonData.editorBarData.content
+            let _div = document.createRange().createContextualFragment(_data)
+            let _tableRows = _div.querySelectorAll(`table tbody tr`)
+            _tableRows.forEach((i, index) => {
+              while (i.cells.length > 7) {
+                i.removeChild(i.lastElementChild)
+              }
+              const actionTypeCell = i.cells[6] && i.removeChild(i.cells[6])
+              _editorBarDataContentRows.push(i.outerHTML)
+              if (index == 0) return
+              if (i.cells[3].textContent != '') {
+                _sentence += 1
+                _words += i.cells[3].textContent.length
+              }
+              _actionTypes.push(_.get(actionTypeCell, 'textContent', ''))
+            })
+          }
+          const _editorBarDataContent = `<table
 					border="0"
 					border="0"
 					width="100%"
 					width="100%"
 					cellpadding="0"
 					cellpadding="0"
@@ -847,24 +851,26 @@ export default {
 				</table>
 				</table>
 				`
 				`
 
 
-        this.bmData.jsonData.editorBarData.sentenceNum = _sentence
-        this.bmData.jsonData.editorBarData.wordsNum = _words
-        let _saveWordData = this.dataList.find(i => i.Type == 0 && i.tIndex == 2)
-        if (_saveWordData) {
-          _saveWordData.jsonData.wordCountNum = _sentence
-          _saveWordData.jsonData.wordNum = _words
-          this.saveData(_saveWordData).then(_ => {
-            console.log('词频词汇分析已保存')
+          this.bmData.jsonData.editorBarData.sentenceNum = _sentence
+          this.bmData.jsonData.editorBarData.wordsNum = _words
+          let _saveWordData = this.dataList.find(i => i.Type == 0 && i.tIndex == 2)
+          if (_saveWordData) {
+            _saveWordData.jsonData.wordCountNum = _sentence
+            _saveWordData.jsonData.wordNum = _words
+            this.saveData(_saveWordData).then(_ => {
+              console.log('词频词汇分析已保存')
+            })
+          }
+          this.saveData(this.bmData).then(_ => {
+            console.log('转录问稿已保存')
+            this.loading = false
+						resolve();
           })
           })
+          // // TODO 不同板块用id做key
+          this.actionTypesMap.jsonData['default'] = _actionTypes
+          this.saveActionTypesMap()
         }
         }
-        this.saveData(this.bmData).then(_ => {
-          console.log('转录问稿已保存')
-          this.loading = false
-        })
-        // // TODO 不同板块用id做key
-        this.actionTypesMap.jsonData['default'] = _actionTypes
-        this.saveActionTypesMap()
-      }
+      })
     },
     },
     async loadActionTypesMap() {
     async loadActionTypesMap() {
       const res = await getObsRequest({ tid: this.tid, type: '11' })
       const res = await getObsRequest({ tid: this.tid, type: '11' })

+ 70 - 10
src/views/classObserve/stencilled.vue

@@ -62,7 +62,10 @@
       <div class="actionTel" v-if="templateShow && analysisDetail">
       <div class="actionTel" v-if="templateShow && analysisDetail">
         <div class="telCon">
         <div class="telCon">
           <div class="telConCell">
           <div class="telConCell">
-            <div class="tit"><div>通用课堂分析</div></div>
+            <div class="tit">
+              <div>通用课堂分析</div>
+              <span v-if="isEditTel" @click.stop="addTemplate(0)">+</span>
+            </div>
             <div class="list">
             <div class="list">
               <div
               <div
                 class="cell"
                 class="cell"
@@ -81,6 +84,7 @@
           <div class="telConCell">
           <div class="telConCell">
             <div class="tit">
             <div class="tit">
               <div>学科课堂分析</div>
               <div>学科课堂分析</div>
+              <span v-if="isEditTel" @click.stop="addTemplate(1)">+</span>
             </div>
             </div>
             <div class="list">
             <div class="list">
               <div
               <div
@@ -99,7 +103,10 @@
           </div>
           </div>
 
 
           <div class="telConCell">
           <div class="telConCell">
-            <div class="tit"><div>扩展课堂分析</div></div>
+            <div class="tit">
+              <div>扩展课堂分析</div>
+              <span v-if="isEditTel" @click.stop="addTemplate(2)">+</span>
+            </div>
             <div class="list">
             <div class="list">
               <div
               <div
                 class="cell"
                 class="cell"
@@ -130,6 +137,7 @@
         </div>
         </div>
       </div>
       </div>
     </van-action-sheet>
     </van-action-sheet>
+		<addTel ref="addTelRef" :data="analysisList" @success="addAnalysisByList" @close="()=>{templateShow = true}"/>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -145,17 +153,24 @@ import {
   updateClassroomTemplateDataRequest,
   updateClassroomTemplateDataRequest,
   updateClassroomDefaultRequest
   updateClassroomDefaultRequest
 } from '../../api/classObserve'
 } from '../../api/classObserve'
+import addTel from './addTel.vue'
+
 
 
 export default {
 export default {
   components: {
   components: {
     bar,
     bar,
-    stencilledCon
+    stencilledCon,
+		addTel
   },
   },
   props: {
   props: {
     page: {
     page: {
       type: Number,
       type: Number,
       default: 1
       default: 1
-    }
+    },
+		analysisList:{
+			type:Array,
+			default:()=>[]
+		}
   },
   },
   data() {
   data() {
     return {
     return {
@@ -240,6 +255,7 @@ export default {
             _data.tips = JSON.parse(_data.tips)
             _data.tips = JSON.parse(_data.tips)
             this.analysisDetail = _data
             this.analysisDetail = _data
             this.templateShow = true
             this.templateShow = true
+						this.isEditTel = false
           } else {
           } else {
             this.$toast.fail('获取模板详细为空')
             this.$toast.fail('获取模板详细为空')
           }
           }
@@ -350,8 +366,8 @@ export default {
       }
       }
     },
     },
     closeSheet() {
     closeSheet() {
-      this.analysisDetail = null
-      this.isEditTel = false
+      // this.analysisDetail = null
+      // this.isEditTel = false
     },
     },
     collect(type = 0, data) {
     collect(type = 0, data) {
       this.loading = true
       this.loading = true
@@ -417,7 +433,7 @@ export default {
       updateClassroomTemplateDataRequest(params)
       updateClassroomTemplateDataRequest(params)
         .then(res => {
         .then(res => {
           this.$toast.success('保存成功')
           this.$toast.success('保存成功')
-					this.isEditTel = false;
+          this.isEditTel = false
           // this.getData();
           // this.getData();
         })
         })
         .catch(e => {
         .catch(e => {
@@ -452,9 +468,9 @@ export default {
                 to: 'cn'
                 to: 'cn'
               })
               })
               let _data = res[0][0]
               let _data = res[0][0]
-							
+
               _data.tips = JSON.parse(_data.tips)
               _data.tips = JSON.parse(_data.tips)
-							
+
               let _result = []
               let _result = []
               _data.tips.forEach(i => {
               _data.tips.forEach(i => {
                 if (converter('词频词汇分析') == converter(i.jsonData.name)) return
                 if (converter('词频词汇分析') == converter(i.jsonData.name)) return
@@ -522,7 +538,44 @@ export default {
           console.log('不设置')
           console.log('不设置')
           // on cancel
           // on cancel
         })
         })
-    }
+    },
+		addTemplate(type=0){
+			this.templateShow = false;
+			this.$refs.addTelRef.open(type)
+			// console.log("添加模块",type)
+		},
+		addAnalysisByList(data){
+			this.templateShow = true;
+			this.$refs.addTelRef.close();
+			let _list = this.analysisList.filter(i=>data.includes(i.value));
+			console.log(_list);
+			_list.forEach(i=>{
+				this.analysisDetail.tips.push({
+					id: "",
+				jsonData: {
+					name: i.title,
+					result: i.brief,
+					fileList: [],
+					dataFileList: [],
+					wordNum: "",
+					wordCountNum: "",
+					fileList2: [],
+					content: "",
+				},
+				Type: i.type,
+				tIndex: this.analysisDetail.tips.filter((i2) => i2.Type == i.type).length?this.analysisDetail.tips.filter((i2) => i2.Type == i.type).map(i3=>i3.tIndex).sort((a,b)=>b-a)[0]+1:i.type==0?3:0,
+				tId: "",
+				createtime: "",
+				like_num: 0,
+				like_data: null,
+				userid: "",
+				isdel: 0,
+				})
+			})
+			console.log(this.analysisDetail)
+			
+			console.log("上")
+		}
   },
   },
   mounted() {
   mounted() {
     this.getData()
     this.getData()
@@ -554,6 +607,13 @@ export default {
       font-size: 12px;
       font-size: 12px;
       font-weight: 400;
       font-weight: 400;
       box-sizing: border-box;
       box-sizing: border-box;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			span{
+				transform: scale(1.7,1.7);
+				margin-right: 10px;
+			}
     }
     }
     .list {
     .list {
       padding: 0 10px;
       padding: 0 10px;