Browse Source

Merge branch 'beta'

lsc 1 year ago
parent
commit
55e61da25a
33 changed files with 3793 additions and 1981 deletions
  1. 1 1
      dist/index.html
  2. 0 0
      dist/static/css/app.a06a18e95256a854064ce808cc8889d7.css
  3. 0 0
      dist/static/css/app.a06a18e95256a854064ce808cc8889d7.css.map
  4. BIN
      dist/static/img/aiAvatar.237f433.png
  5. 0 0
      dist/static/js/app.c991c0447e92f0e6873f.js
  6. 0 0
      dist/static/js/app.c991c0447e92f0e6873f.js.map
  7. 0 0
      dist/static/js/manifest.571c38d63f24b1ae9e16.js.map
  8. 0 0
      dist/static/js/vendor.3cd0a0187ca1f70ded67.js
  9. 0 0
      dist/static/js/vendor.3cd0a0187ca1f70ded67.js.map
  10. 107 0
      package-lock.json
  11. 1 0
      package.json
  12. BIN
      src/assets/icon/classroomObservation/aiAvatar.png
  13. 1 1
      src/common/axios.config.js
  14. 223 159
      src/components/pages/aiAddCourse/addCourse.vue
  15. 780 472
      src/components/pages/aiAddCourse/aiBox.vue
  16. 167 0
      src/components/pages/aiAddCourse/aiDialog.vue
  17. 79 42
      src/components/pages/classroomObservation/components/addNewCourseDialog.vue
  18. 10 3
      src/components/pages/classroomObservation/components/analysis.vue
  19. 49 117
      src/components/pages/classroomObservation/components/analysisItem.vue
  20. 144 20
      src/components/pages/classroomObservation/components/baseMessage.vue
  21. 651 246
      src/components/pages/classroomObservation/components/chatArea.vue
  22. 343 254
      src/components/pages/classroomObservation/components/messageArea.vue
  23. 0 281
      src/components/pages/classroomObservation/components/pdf.vue
  24. 73 19
      src/components/pages/classroomObservation/components/sharePdf.vue
  25. 65 65
      src/components/pages/classroomObservation/components/tape.vue
  26. 12 4
      src/components/pages/classroomObservation/components/transcription.vue
  27. 252 0
      src/components/pages/classroomObservation/components/vpdf.vue
  28. 330 0
      src/components/pages/classroomObservation/components/wangEnduit.vue
  29. 500 290
      src/components/pages/classroomObservation/index.vue
  30. 1 1
      src/components/pages/course.vue
  31. 2 2
      src/components/pages/data.vue
  32. 0 2
      src/components/pages/sz/teacher.vue
  33. 2 2
      src/components/pages/tencent/data.vue

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.bfcc0c068c4fe674361c1181464a76e0.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.eb26ca5b19390ddf3503.js></script><script type=text/javascript src=./static/js/app.852f7a74d18233bca58e.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.a06a18e95256a854064ce808cc8889d7.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.3cd0a0187ca1f70ded67.js></script><script type=text/javascript src=./static/js/app.c991c0447e92f0e6873f.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.a06a18e95256a854064ce808cc8889d7.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.a06a18e95256a854064ce808cc8889d7.css.map


BIN
dist/static/img/aiAvatar.237f433.png


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.c991c0447e92f0e6873f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.c991c0447e92f0e6873f.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.3cd0a0187ca1f70ded67.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.3cd0a0187ca1f70ded67.js.map


+ 107 - 0
package-lock.json

@@ -32,6 +32,7 @@
         "jszip": "^3.10.1",
         "lamejs": "^1.2.1",
         "language-hk-loader": "^1.0.1",
+        "markdown-it": "^14.1.0",
         "pdfjs-dist": "^2.5.207",
         "qrcodejs2": "^0.0.2",
         "qs": "^6.10.1",
@@ -8151,6 +8152,14 @@
         "immediate": "~3.0.5"
       }
     },
+    "node_modules/linkify-it": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
+      "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
+      "dependencies": {
+        "uc.micro": "^2.0.0"
+      }
+    },
     "node_modules/load-json-file": {
       "version": "2.0.0",
       "resolved": "https://registry.npm.taobao.org/load-json-file/download/load-json-file-2.0.0.tgz",
@@ -8633,6 +8642,22 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/markdown-it": {
+      "version": "14.1.0",
+      "resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-14.1.0.tgz",
+      "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==",
+      "dependencies": {
+        "argparse": "^2.0.1",
+        "entities": "^4.4.0",
+        "linkify-it": "^5.0.0",
+        "mdurl": "^2.0.0",
+        "punycode.js": "^2.3.1",
+        "uc.micro": "^2.1.0"
+      },
+      "bin": {
+        "markdown-it": "bin/markdown-it.mjs"
+      }
+    },
     "node_modules/markdown-it-abbr": {
       "version": "1.0.4",
       "resolved": "https://registry.npmmirror.com/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz",
@@ -8703,6 +8728,22 @@
         "node": ">=0.8"
       }
     },
+    "node_modules/markdown-it/node_modules/argparse": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+      "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
+    },
+    "node_modules/markdown-it/node_modules/entities": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
+      "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+      "engines": {
+        "node": ">=0.12"
+      },
+      "funding": {
+        "url": "https://github.com/fb55/entities?sponsor=1"
+      }
+    },
     "node_modules/match-at": {
       "version": "0.1.1",
       "resolved": "https://registry.npmmirror.com/match-at/-/match-at-0.1.1.tgz",
@@ -8730,6 +8771,11 @@
       "integrity": "sha1-aZs8OKxvHXKAkaZGULZdOIUC/Vs=",
       "dev": true
     },
+    "node_modules/mdurl": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz",
+      "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w=="
+    },
     "node_modules/media-typer": {
       "version": "0.3.0",
       "resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz",
@@ -14007,6 +14053,14 @@
         "node": ">=6"
       }
     },
+    "node_modules/punycode.js": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
+      "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==",
+      "engines": {
+        "node": ">=6"
+      }
+    },
     "node_modules/q": {
       "version": "1.5.1",
       "resolved": "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz",
@@ -16298,6 +16352,11 @@
       "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
       "dev": true
     },
+    "node_modules/uc.micro": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
+      "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A=="
+    },
     "node_modules/uglify-js": {
       "version": "3.4.10",
       "resolved": "https://registry.npm.taobao.org/uglify-js/download/uglify-js-3.4.10.tgz?cache=0&sync_timestamp=1614626121570&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuglify-js%2Fdownload%2Fuglify-js-3.4.10.tgz",
@@ -25644,6 +25703,14 @@
         "immediate": "~3.0.5"
       }
     },
+    "linkify-it": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
+      "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
+      "requires": {
+        "uc.micro": "^2.0.0"
+      }
+    },
     "load-json-file": {
       "version": "2.0.0",
       "resolved": "https://registry.npm.taobao.org/load-json-file/download/load-json-file-2.0.0.tgz",
@@ -26060,6 +26127,31 @@
         "object-visit": "^1.0.0"
       }
     },
+    "markdown-it": {
+      "version": "14.1.0",
+      "resolved": "https://registry.npmmirror.com/markdown-it/-/markdown-it-14.1.0.tgz",
+      "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==",
+      "requires": {
+        "argparse": "^2.0.1",
+        "entities": "^4.4.0",
+        "linkify-it": "^5.0.0",
+        "mdurl": "^2.0.0",
+        "punycode.js": "^2.3.1",
+        "uc.micro": "^2.1.0"
+      },
+      "dependencies": {
+        "argparse": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+          "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
+        },
+        "entities": {
+          "version": "4.5.0",
+          "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
+          "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="
+        }
+      }
+    },
     "markdown-it-abbr": {
       "version": "1.0.4",
       "resolved": "https://registry.npmmirror.com/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz",
@@ -26156,6 +26248,11 @@
       "integrity": "sha1-aZs8OKxvHXKAkaZGULZdOIUC/Vs=",
       "dev": true
     },
+    "mdurl": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz",
+      "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w=="
+    },
     "media-typer": {
       "version": "0.3.0",
       "resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz",
@@ -30438,6 +30535,11 @@
       "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
       "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew="
     },
+    "punycode.js": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
+      "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA=="
+    },
     "q": {
       "version": "1.5.1",
       "resolved": "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz",
@@ -32338,6 +32440,11 @@
       "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
       "dev": true
     },
+    "uc.micro": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
+      "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A=="
+    },
     "uglify-js": {
       "version": "3.4.10",
       "resolved": "https://registry.npm.taobao.org/uglify-js/download/uglify-js-3.4.10.tgz?cache=0&sync_timestamp=1614626121570&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuglify-js%2Fdownload%2Fuglify-js-3.4.10.tgz",

+ 1 - 0
package.json

@@ -34,6 +34,7 @@
     "jszip": "^3.10.1",
     "lamejs": "^1.2.1",
     "language-hk-loader": "^1.0.1",
+    "markdown-it": "^14.1.0",
     "pdfjs-dist": "^2.5.207",
     "qrcodejs2": "^0.0.2",
     "qs": "^6.10.1",

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


+ 1 - 1
src/common/axios.config.js

@@ -1,6 +1,6 @@
 import axios from "axios"
 import qs from "qs"
-axios.defaults.timeout = 90000   //响应时间
+axios.defaults.timeout = 180000   //响应时间
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';        //配置请求头
 axios.defaults.baseURL = process.env.NODE_HOST;   //配置接口地址
 console.log(process.env)

File diff suppressed because it is too large
+ 223 - 159
src/components/pages/aiAddCourse/addCourse.vue


+ 780 - 472
src/components/pages/aiAddCourse/aiBox.vue

@@ -1,573 +1,881 @@
 <template>
-    <div class="ai_body">
-        <div class="ai_body_dialog" v-loading="loading">
-            <div class="dialog_content" :class="{ right: item.role == 2 }" v-for="(item, index) in array" :key="index">
-                <div class="role">
-                    <img src="../../../assets/icon/new/role1.png" v-if="item.role == 1">
-                    <img src="../../../assets/icon/new/role2.png" v-else>
-                </div>
-                <div class="content" :class="{ content2: item.role == 2 }">{{ item.text }}</div>
-            </div>
+  <div class="ai_body">
+    <div class="ai_body_dialog" v-loading="loading" ref="chatDialog">
+      <div
+        class="dialog_content"
+        v-for="(item, index) in array"
+        :key="item.uid"
+      >
+        <div v-if="item.content">
+          <div class="content content2" v-html="item.content"></div>
+          <div class="role">
+            <img src="../../../assets/icon/new/role2.png" />
+          </div>
+        </div>
+        <div style="margin-top:10px ;">
+          <div class="role">
+            <img src="../../../assets/icon/new/role1.png" />
+          </div>
+          <div
+            class="content"
+            v-loading="item.loading"
+            v-html="item.aiContent"
+          ></div>
+        </div>
+        <!-- <div class="role">
+          <img src="../../../assets/icon/new/role1.png"/>
+          <img src="../../../assets/icon/new/role2.png"/>
+        </div>
+        <div class="content content2" :class="{ content2: item.role == 2 }">
+          {{ item.text }}
+        </div>
+				<div class="role">
+          <img src="../../../assets/icon/new/role1.png"/>
         </div>
-        <div class="ai_body_select">
-            <div class="checkBox" v-if="checkBool">
-                <div class="task">
-                    <div class="title">选择需要优化的任务:</div>
-                    <div class="content">
-                        <div class="span" @click="addAllTask()">
-                            <div class="check">
-                                <img :src="checkImg" alt="" v-if="checkArray.length !== course.length">
-                                <img :src="checkIsImg" alt="" v-else>
-                            </div>
-                            <span>全选</span>
-                        </div>
-                        <div class="span" v-for="(item, index) in course" :key="index" @click="addTask(index)">
-                            <div class="check">
-                                <img :src="checkImg" alt="" v-if="checkArray.indexOf(index) === -1">
-                                <img :src="checkIsImg" alt="" v-else>
-                            </div>
-                            <span>任务{{ index + 1 }}</span>
-                        </div>
-                    </div>
-                </div>
-                <div class="part">
-                    <div class="title">选择优化的部分:</div>
-                    <div class="content">
-                        <div class="span" v-for="(item, index) in partArray" :key="index"
-                            :class="{ active: part == item.name }" @click="checkPart(item.name)">
-                            {{ item.name }}
-                        </div>
-                    </div>
-                </div>
+        <div class="content">
+          {{ item.text }}
+        </div> -->
+      </div>
+    </div>
+    <div class="ai_body_select">
+      <div class="checkBox" v-if="checkBool">
+        <div class="task">
+          <div class="title">选择需要优化的任务:</div>
+          <div class="content">
+            <div class="span" @click="addAllTask()">
+              <div class="check">
+                <img
+                  :src="checkImg"
+                  alt=""
+                  v-if="checkArray.length !== course.length"
+                />
+                <img :src="checkIsImg" alt="" v-else />
+              </div>
+              <span>全选</span>
+            </div>
+            <div
+              class="span"
+              v-for="(item, index) in course"
+              :key="index"
+              @click="addTask(index)"
+            >
+              <div class="check">
+                <img
+                  :src="checkImg"
+                  alt=""
+                  v-if="checkArray.indexOf(index) === -1"
+                />
+                <img :src="checkIsImg" alt="" v-else />
+              </div>
+              <span>任务{{ index + 1 }}</span>
             </div>
-            <span class="check" :class="{ isCheck: checkBool }" v-if="!checkArray.length && !part"
-                @click="checkBool = !checkBool">选择优化内容</span>
-            <span class="check" :class="{ isCheck: checkBool }" @click="checkBool = !checkBool" v-else>
-                <el-tooltip :content="taskName" placement="top" effect="dark">
-                    <!-- content to trigger tooltip here -->
-                    <span>{{ taskName }}</span>
-                </el-tooltip>
-
-            </span>
+          </div>
         </div>
-        <div class="ai_body_input">
-            <textarea rows="3" @keyup.enter="addContent" class="binfo_input binfo_textarea" cols v-model.trim="courseText" placeholder="在此输入您想了解的内容"
-            ></textarea>
-            <div class="c_pub_button_confirm" v-if="!loading && courseText"  @click="addContent">发送</div>
-            <div class="c_pub_button_confirm" @click="promptTit" v-else>发送</div>
+        <div class="part">
+          <div class="title">选择优化的部分:</div>
+          <div class="content">
+            <div
+              class="span"
+              v-for="(item, index) in partArray"
+              :key="index"
+              :class="{ active: part == item.name }"
+              @click="checkPart(item.name)"
+            >
+              {{ item.name }}
+            </div>
+          </div>
         </div>
+      </div>
+      <span
+        class="check"
+        :class="{ isCheck: checkBool }"
+        v-if="!checkArray.length && !part"
+        @click="checkBool = !checkBool"
+        >选择优化内容</span
+      >
+      <span
+        class="check"
+        :class="{ isCheck: checkBool }"
+        @click="checkBool = !checkBool"
+        v-else
+      >
+        <el-tooltip :content="taskName" placement="top" effect="dark">
+          <!-- content to trigger tooltip here -->
+          <span>{{ taskName }}</span>
+        </el-tooltip>
+      </span>
+    </div>
+    <div class="ai_body_input">
+      <textarea
+        rows="3"
+        @keyup.enter="addContent"
+        class="binfo_input binfo_textarea"
+        cols
+        v-model.trim="courseText"
+        placeholder="在此输入您想了解的内容"
+      ></textarea>
+      <div
+        class="c_pub_button_confirm"
+        v-if="!loading && courseText"
+        @click="addContent"
+      >
+        发送
+      </div>
+      <div class="c_pub_button_confirm" @click="promptTit" v-else>发送</div>
     </div>
+  </div>
 </template>
 
 <script>
-import checkImg from '../../../assets/icon/sourceFile/check.png'
-import checkIsImg from '../../../assets/icon/sourceFile/check_is.png'
-
+import checkImg from "../../../assets/icon/sourceFile/check.png";
+import checkIsImg from "../../../assets/icon/sourceFile/check_is.png";
+import { v4 as uuidv4 } from "uuid";
+import MarkdownIt from "markdown-it";
 export default {
-    props: {
-        unitJson: {
-            type: Array,
-        },
-    },
-    data() {
-        return {
-            array: [
-                { text: '你好,有说么可以帮你', role: 1 },
-
-            ],
-            courseText: '',
-            checkImg: checkImg,
-            checkIsImg: checkIsImg,
-            checkArray: [],
-            course: [
-                { title: '任务1' },
-                { title: '任务2' },
-                { title: '任务3' }
-            ],
-            partArray: [{ name: '全部内容' }, { name: '任务设计' }, { name: '评价设计' }],
-            part: '',
-            checkBool: false,
-            loading: false
-        }
+  props: {
+    unitJson: {
+      type: Array
     },
-    watch: {
-        unitJson: {
-            immediate: true,
-            deep: true,
-            handler(newValue, oldValue) {
-               this.course = this.unitJson[0].chapterInfo[0].taskJson
-            }
-        },
+		courseId:{
+			type:String,
+			default:""
+		},
+  },
+  data() {
+    return {
+      array: [],
+      courseText: "",
+      checkImg: checkImg,
+      checkIsImg: checkIsImg,
+			userid: this.$route.query.userid,
+      checkArray: [],
+      course: [{ title: "任务1" }, { title: "任务2" }, { title: "任务3" }],
+      partArray: [
+        { name: "全部内容" },
+        { name: "任务设计" },
+        { name: "评价设计" }
+      ],
+      part: "全部内容",
+      checkBool: false,
+      loading: false
+    };
+  },
+  watch: {
+    unitJson: {
+      immediate: true,
+      deep: true,
+      handler(newValue, oldValue) {
+        this.course = this.unitJson[0].chapterInfo[0].taskJson;
+      }
+    }
+  },
+  methods: {
+    promptTit() {
+      if (!this.loading && !this.courseText) {
+        this.$message({
+          message: "请输入您想要了解的内容",
+          type: "warning"
+        });
+      } else {
+        this.$message({
+          message: "请回答完毕后再次发送",
+          type: "warning"
+        });
+      }
     },
-    methods: {
-        promptTit(){
-            if (!this.loading && !this.courseText) {
-                this.$message({
-                    message: '请输入您想要了解的内容',
-                    type: 'warning'
-                });
-            }else{
-                this.$message({
-                    message: '请回答完毕后再次发送',
-                    type: 'warning'
-                });
+    addContent() {
+      let message = this.courseText
+      if (this.courseText) {
+        let msg = `
+          ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".`
+        if(this.checkArray.length){
+          let task = []
+          if(this.part == "全部内容"){
+            // msg += `--------
+            // ## 示例
+            // [
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1", "score": 5},
+            //       {"value":"评价名字2","detail":"评价维度2", "score": 5},
+            //       {"value":"评价名字3","detail":"评价维度3", "score": 5}
+            //     ],
+            //     toolChoose: [
+            //       {
+            //         tool:"电子白板", 
+            //         detail: "工具描述"
+            //       },
+            //       {
+            //         tool:"思维大图", 
+            //         detail: "工具描述"
+            //       }
+            //     ]
+            //   },
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1", "score": 5},
+            //       {"value":"评价名字2","detail":"评价维度2", "score": 5},
+            //       {"value":"评价名字3","detail":"评价维度3", "score": 5}
+            //     ],
+            //     toolChoose: []
+            //   },
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1", "score": 5},
+            //       {"value":"评价名字2","detail":"评价维度2", "score": 5},
+            //       {"value":"评价名字3","detail":"评价维度3", "score": 5}
+            //     ],
+            //     toolChoose: [
+            //       {
+            //         tool:"文档", 
+            //         detail: "工具描述"
+            //       }
+            //     ]
+            //   }
+            // ]
+            
+            // --------
+            // ## 输出格式与要求
+            // [
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1","score":5},
+            //       {"value":"评价名字2","detail":"评价维度2","score":5},
+            //       {"value":"评价名字3","detail":"评价维度3","score":5}
+            //     ],//至少3条评价标准,这个评价是教师用来评价学生表现的,需要包含评价维度,以及该维度中教师期待学生的表现,句式为学生应该能....
+            //     toolChoose: [
+            //       {
+            //         tool: "工具", //电子白板,文档,思维导图,表格,作业提交中选择其中一个工具
+            //         detail: "工具描述"
+            //       }
+            //     ] //可0~2个工具
+            //   }
+            // ]
+            // `
+            for(var i = 0; i < this.checkArray.length; i++){
+              let _index = this.checkArray[i]
+              task.push(this.course[_index])
             }
-        },
-        addContent() {
-            if (this.courseText) {
-
-                this.loading = true
-                this.array.push({ text: this.courseText, role: 2 })
-                this.courseText = ''
-
-                setTimeout(() => {
-                    this.loading = false
-                    if (this.courseText == '请告诉我任务四该具体如何实施?') {
-                        this.array.push({
-                            text: `任务四:设计保温杯的初步方案
-
-教学目标:
-•学会应用热传递原理设计保温杯。
-•掌握基本的设计思维和创新方法。
-•理解材料选择对保温效果的影响。
-
-教学过程:
-1.复习:回顾热传递的基本原理和不同材料的导热性能。
-2.需求分析:讨论保温杯的使用场景和功能需求,如保温时间、容量、便携性等。
-3.设计指导:教师介绍设计原则和考虑因素,如材料的导热性能、结构设计、成本和环保等。
-4.创意发散:学生团队进行头脑风暴,提出多种设计方案,并选出最可行的方案。
-5.方案绘制:学生绘制保温杯的设计图,包括尺寸、形状、结构和所用材料。
-
-师生研讨:
-•分享各组的设计方案,讨论设计的创新点和实用性。
-•教师提供专业意见和建议,帮助学生完善设计方案。
-•讨论如何将设计方案转化为实际操作的步骤。
-
-拓展:
-•学生研究市场上不同类型保温杯的设计和功能。
-•分析保温杯的改进空间和潜在的创新点。
-
-学生任务单:
-•列出保温杯的功能需求和设计目标。
-•绘制保温杯的设计方案图,并标注所用材料和尺寸。
-•简述所选材料的导热性能和对保温效果的影响。
-
-知识点练习:
-1.为什么保温杯通常使用不锈钢或陶瓷作为内胆材料?
-2.描述一个创新的保温杯设计方案,并解释其工作原理。
-3.讨论在设计保温杯时需要考虑的环境因素。
-
-答案:
-1.保温杯通常使用不锈钢或陶瓷作为内胆材料,因为这些材料是热的不良导体,可以有效减缓热量的散失。
-2.一个创新的保温杯设计方案可能是采用多层结构,内层为不锈钢,中间层为真空隔热层,外层为塑料保护层。这种设计可以有效隔绝外界温度对热水温度的影响。
-在设计保温杯时,需要考虑的环境因素包括材料的可回收性、生产过程中的能源消耗和废弃物处理等。`, role: 1
-                        })
-                    }else if(this.courseText == '请你重新设计该任务,我没有感温粉末。'){
-                        this.array.push({text:`任务一:探究热的传递方式
-
-任务名: 观察热在水中的传递
-
-任务描述:
-同学们,今天我们将通过一个有趣的实验来探究热是如何在水中传递的。你将需要加热水并观察温度是如何分布的。请准备好实验器材,并按照安全指南进行操作。在实验过程中,请注意观察热水和冷水之间的相互作用,以及水温是如何随时间和空间变化的。你将需要记录你的观察结果,并思考热是如何从一个地方传递到另一个地方的。
-
-工具名字: 电子白板
-
-工具指引:
-使用电子白板工具来绘制你的实验设置和观察到的热传递过程。你可以使用电子白板的绘图功能来创建一个温度分布图,展示热水和冷水相遇时的情况。同时,你可以用它来记录实验步骤和关键观察点,以便于你和同学们进行讨论和分享。
-
-评价维度:
-•实验观察和记录:学生应该能够准确地记录实验过程中的观察结果,包括水温变化和热传递的现象。
-•数据分析和解释:学生应该能够分析实验数据,解释热在水中的传递方式,并能够用自己的话描述热对流的原理。
-•实验报告撰写:学生应该能够撰写一份清晰的实验报告,包括实验目的、方法、结果和结论,以及对实验过程的反思。`,role: 1})
-                            this.$emit('setUnitJson')
-                    }else if(this.checkArray.indexOf(0) !== -1 && this.courseText == '请告诉该具体如何实施?'){
-                        this.array.push({text:`教学活动1:探究热的传递方式
-教学目标:
-•理解热的三种传递方式:传导、对流和辐射。
-•掌握热对流现象的基本概念。
-•学会通过实验观察和分析热在水中的传递过程。
-教学过程:
-1.引入:讨论日常生活中的热现象,如热水变凉、金属勺柄变热等,引出热传递的概念。
-2.实验准备:介绍实验材料(试管、大烧杯、滴管、三脚架、石棉网、酒精灯、火柴、铁架台、试管架、感温粉末、红墨水、清水等)和安全注意事项。
-3.实验操作:学生分组进行实验,加热试管和烧杯中的水,并加入感温粉末或红墨水以观察热的传递。
-4.观察记录:学生记录实验现象,包括水温的变化、感温粉末或红墨水的颜色变化等。
-5.结果分析:师生共同讨论实验结果,理解热对流的形成机制。
-师生研讨:
-•讨论实验中观察到的热在水中的传递方式。
-•分析为什么水受热后会产生对流现象。
-•探讨热对流在生活中的应用,如暖气系统、热水器等。
-拓展:
-•学生研究热在其他物质(如空气)中的传递方式。
-•设计并执行一个简单的实验,比较热在不同物质中的传递速度。
-学生任务单:
-•描述实验中观察到的热在水中的传递过程。
-•解释热对流的形成原理。
-•提出一个生活中热对流的应用实例。
-知识点练习:
-1.热传递的三种方式是什么?
-2.为什么加热试管底部的水会使试管上部的水也变热?
-3.描述热对流的一个实际应用,并解释其工作原理。
-答案:
-1.热传递的三种方式是传导、对流和辐射。
-2.加热试管底部的水会使试管上部的水也变热,因为热通过水的对流传递到了上部。
-一个热对流的实际应用是暖气系统。它通过加热空气,使热空气上升,冷空气下降,形成对流循环,从而使房间变暖。`,role:1})
-                    }else if(this.checkArray.indexOf(0) !== -1 && this.courseText == '我没有感温粉末怎么办'){
-                        this.array.push({text:`如果您没有感温粉末,不用担心,我们仍然可以探究热的传递方式,只是需要采用不同的方法来观察和记录热在水中的传递。以下是几种替代方案:
-
-1. **温度计**:您可以使用普通温度计或数字温度计来测量水在加热过程中的温度变化。通过在不同时间点记录水温,您可以绘制出温度随时间变化的曲线,从而理解热是如何在水中传播的。
-
-2. **红墨水或其他有色液体**:如果家里有红墨水或其他任何有颜色的液体,您可以在水加热前滴入几滴。当红墨水在加热的水中扩散时,您可以观察到颜色的变化,这可以帮助您可视化水的流动和混合。
-
-3. **视频记录**:您可以使用手机或相机录制水加热的过程,特别是观察加热区域与未加热区域之间的界面。通过回放视频,您可以分析和讨论热传递的现象。
-
-4. **实验日志**:在实验过程中,详细记录您的观察和思考。包括您使用的替代方法、观察到的现象、遇到的问题以及您对这些现象的解释。
-
-5. **讨论和交流**:与同学或老师讨论您的发现,即使没有感温粉末,您也可以通过交流想法和观察结果来增进对热传递现象的理解。
-
-记住,科学探究的本质在于提出问题、设计实验、收集数据、分析结果和得出结论。即使缺少某些工具或材料,创新和适应性也是科学探究的重要部分。`,role:1})
-                    } else {
-                        this.array.push({ text: '请输入正确的文案', role: 1 })
-                    }
-                    // this.array.push({text: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', role: 1})
-                }, 5000);
+          }else if(this.part == "任务设计"){
+            // msg += `
+            // --------
+            // ## 示例
+            // [
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     toolChoose: [
+            //       {
+            //         tool:"电子白板", 
+            //         detail: "工具描述"
+            //       },
+            //       {
+            //         tool:"思维大图", 
+            //         detail: "工具描述"
+            //       }
+            //     ]
+            //   },
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     toolChoose: []
+            //   },
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     toolChoose: [
+            //       {
+            //         tool:"文档", 
+            //         detail: "工具描述"
+            //       }
+            //     ]
+            //   }
+            // ]
+            
+            // --------
+            // ## 输出格式与要求
+            // [
+            //   {
+            //     detail: "面向学生的任务描述",
+            //     toolChoose: [
+            //       {
+            //         tool: "工具", //电子白板,文档,思维导图,表格,作业提交中选择其中一个工具
+            //         detail: "工具描述"
+            //       }
+            //     ] //可0~2个工具
+            //   }
+            // ]
+            // `
+            for(var i = 0; i < this.checkArray.length; i++){
+              let _index = this.checkArray[i]
+              task.push(this.course[_index])
             }
-        },
-        addTask(index) {
-            if (this.checkArray.indexOf(index) !== -1) {
-                this.checkArray.splice(this.checkArray.indexOf(index), 1)
-            } else {
-                this.checkArray.push(index)
+          }else if(this.part == "评价设计"){
+            // msg += `
+            // --------
+            // ## 示例
+            // [
+            //   {
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1", "score": 5},
+            //       {"value":"评价名字2","detail":"评价维度2", "score": 5},
+            //       {"value":"评价名字3","detail":"评价维度3", "score": 5}
+            //     ],
+            //   },
+            //   {
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1", "score": 5},
+            //       {"value":"评价名字2","detail":"评价维度2", "score": 5},
+            //       {"value":"评价名字3","detail":"评价维度3", "score": 5}
+            //     ],
+            //   },
+            //   {
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1", "score": 5},
+            //       {"value":"评价名字2","detail":"评价维度2", "score": 5},
+            //       {"value":"评价名字3","detail":"评价维度3", "score": 5}
+            //     ],
+            //   }
+            // ]
+            
+            // --------
+            // ## 输出格式与要求
+            // [
+            //   {
+            //     elist:[
+            //       {"value":"评价名字1","detail":"评价维度1","score":5},
+            //       {"value":"评价名字2","detail":"评价维度2","score":5},
+            //       {"value":"评价名字3","detail":"评价维度3","score":5}
+            //     ],//至少3条评价标准,这个评价是教师用来评价学生表现的,需要包含评价维度,以及该维度中教师期待学生的表现,句式为学生应该能....
+            //   }
+            // ]
+            // `
+            for(var i = 0; i < this.checkArray.length; i++){
+              let _index = this.checkArray[i]
+              task.push(this.course[_index].eList)
             }
-            console.log(index);
-        },
-        addAllTask() {
-            if (this.checkArray.length === this.course.length) {
-                this.checkArray = []
+          }
+          
+          msg += `
+          --------
+          ## 修改内容
+          ${JSON.stringify(task)}
+          `
+
+          msg += `
+          --------
+          ## 要求
+          ${this.courseText}
+          `
+          message = msg
+        }
+        let _uuid = uuidv4();
+        this.array.push({
+          role: "user",
+          content: `${this.courseText}`,
+          uid: _uuid,
+          AI: "AI",
+          aiContent: "",
+          oldContent: "",
+          isShowSynchronization: false,
+          filename: "",
+          index: this.array.length,
+          is_mind_map: false,
+          loading: true
+        });
+        this.$nextTick(() => {
+          this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
+        });
+        let params = JSON.stringify({
+          model: "gpt-3.5-turbo",
+          temperature: 0,
+          max_tokens: 4096,
+          top_p: 1,
+          frequency_penalty: 0,
+          presence_penalty: 0,
+          messages: [{ role: "user", content: message }],
+          uid: _uuid,
+          mind_map_question: ""
+        });
+        this.courseText = "";
+
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/chat", params)
+          .then(res => {
+            if (res.data.FunctionResponse.result == "发送成功") {
             } else {
-                this.checkArray = []
-                this.course.forEach((item, index) => {
-                    this.checkArray.push(index)
-                })
+              this.$message.warning(res.data.FunctionResponse.result);
             }
-        },
-        checkPart(name) {
-            this.part = name
+          })
+          .catch(e => {
+            console.log(e);
+          });
+        this.getAiContent(_uuid);
+      }
+    },
+    getAiContent(_uid) {
+      let _source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/     https://gpt4.cocorobo.cn/stream/
+      let _allText = "";
+      let _mdText = "";
+      const md = new MarkdownIt();
+      _source.onmessage = _e => {
+        if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
+          //对话已经完成
+          _mdText = _mdText.replace("_", "");
+          _source.close();
+          this.$nextTick(() => {
+            this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
+          });
+          this.array.find(i => i.uid == _uid).aiContent = _mdText;
+          this.array.find(i => i.uid == _uid).isalltext = true;
+          this.array.find(i => i.uid == _uid).isShowSynchronization = true;
+          this.array.find(i => i.uid == _uid).loading = false;
+          // 这里保存对话
+          this.insertChat(_uid);
+          return;
+        } else {
+          //对话还在继续
+          let _text = "";
+          _text = _e.data.replaceAll("'", "");
+          if (_allText == "") {
+            _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
+          } else {
+            _allText += _text;
+          }
+          _mdText = _allText + "_";
+          _mdText = _mdText.replace(/\\n/g, "\n");
+          _mdText = _mdText.replace(/\\/g, "");
+          if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
+          //转化返回的回复流数据
+          _mdText = md.render(_mdText);
+          this.array.find(i => i.uid == _uid).aiContent = _mdText;
+          this.array.find(i => i.uid == _uid).loading = false;
+          this.$nextTick(() => {
+            this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
+          });
+          // 处理流数据
         }
+      };
+    },
+    //保存消息
+    insertChat(_uid) {
+      let _data = this.array.find(i => i.uid == _uid);
+      if (!_data) return;
+      let params = {
+        userId: this.userid,
+        userName: "qgt",
+        groupId: "602def61-005d-11ee-91d8-005056b8q12w",
+        answer: _data.aiContent,
+        problem: _data.content,
+        file_id: _data.fileid ? _data.fileid : "",
+        alltext: _data.aiContent,
+        type: "chat",
+        filename: _data.filename,
+        session_name: `${this.courseId}-addCourse` //这是对话记录位置
+      };
+      this.ajax
+        .post("https://gpt4.cocorobo.cn/insert_chat", params)
+        .then(res => {});
     },
-    computed: {
-        courseTextLength() {
-            return this.courseText.length
-        },
-        taskName() {
-            let task = ''
-            if (this.checkArray.length) {
-                task = '任务'
-                this.checkArray = this.checkArray.sort((a, b) => a - b)
-                let a = JSON.parse(JSON.stringify(this.checkArray))
-                for (let index = 0; index < a.length; index++) {
-                    a[index]++;
-                }
-                task += a.join('/')
+    // 获取对应的聊天记录
+    getChatList() {
+      return new Promise((resolve, reject) => {
+        if (this.loading) return this.$message.info("请稍等...");
+        this.array = [];
+        this.loading = true;
+        let params = {
+          userid: this.userid,
+          groupid: "602def61-005d-11ee-91d8-005056b8q12w",
+          // session_name:``
+          session_name: `${this.courseId}-addCourse`
+        };
+        this.ajax
+          .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
+          .then(res => {
+            let _data = JSON.parse(res.data.FunctionResponse);
+            if (_data.length > 0) {
+              let _chatList = [];
+              for (let i = 0; i < _data.length; i++) {
+                _chatList.push({
+                  loading: false,
+                  role: "user",
+                  content: _data[i].problem,
+                  uid: _data[i].id,
+                  AI: "AI",
+                  aiContent: _data[i].answer,
+                  oldContent: _data[i].answer,
+                  isShowSynchronization: false,
+                  filename: _data[i].filename,
+                  index: i,
+                  is_mind_map: false,
+                  fileid: _data[i].fileid
+                });
+              }
+              this.array = _chatList;
+              this.loading = false;
+            } else {
+              //没有对话记录
+              this.loading = false;
             }
-            return task + ' ' + this.part
-        }
+            resolve();
+          })
+          .catch(err => {
+            console.log(err);
+            this.$message.error("获取对话记录失败");
+            this.loading = false;
+            resolve();
+          });
+      });
     },
-}
+    addTask(index) {
+      if (this.checkArray.indexOf(index) !== -1) {
+        this.checkArray.splice(this.checkArray.indexOf(index), 1);
+      } else {
+        this.checkArray.push(index);
+      }
+      console.log(index);
+    },
+    addAllTask() {
+      if (this.checkArray.length === this.course.length) {
+        this.checkArray = [];
+      } else {
+        this.checkArray = [];
+        this.course.forEach((item, index) => {
+          this.checkArray.push(index);
+        });
+      }
+    },
+    checkPart(name) {
+      this.part = name;
+    }
+  },
+  computed: {
+    courseTextLength() {
+      return this.courseText.length;
+    },
+    taskName() {
+      let task = "";
+      if (this.checkArray.length) {
+        task = "任务";
+        this.checkArray = this.checkArray.sort((a, b) => a - b);
+        let a = JSON.parse(JSON.stringify(this.checkArray));
+        for (let index = 0; index < a.length; index++) {
+          a[index]++;
+        }
+        task += a.join("/");
+      }
+      return task + " " + this.part;
+    }
+  },
+  mounted() {
+    this.getChatList().then(_ => {
+      this.$nextTick(() => {
+				console.log(this.$refs.chatDialog.scrollHeight)
+        this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
+      });
+    });
+  }
+};
 </script>
 
 <style scoped>
 .ai_body {
-    height: 100%;
-    width: calc(100% - 20px);
-    margin: 0 auto;
+  height: 100%;
+  width: calc(100% - 20px);
+  margin: 0 auto;
 }
 
 .binfo_input {
-    width: 100%;
-    margin: 0;
-    padding: 12px 14px;
-    display: block;
-    min-width: 0;
-    outline: none;
-    box-sizing: border-box;
-    background: none;
-    border: none;
-    border-radius: 4px;
-    background: #fff;
-    font-size: 14px;
-    resize: none;
-    font-family: "Microsoft YaHei";
-    min-height: 48px;
-    /* border: 1px solid #3682fc00; */
-    border: 1.5px solid #cad1dc;
+  width: 100%;
+  margin: 0;
+  padding: 12px 14px;
+  display: block;
+  min-width: 0;
+  outline: none;
+  box-sizing: border-box;
+  background: none;
+  border: none;
+  border-radius: 4px;
+  background: #fff;
+  font-size: 14px;
+  resize: none;
+  font-family: "Microsoft YaHei";
+  min-height: 48px;
+  /* border: 1px solid #3682fc00; */
+  border: 1.5px solid #cad1dc;
 }
 
 .binfo_textarea {
-    border: 1.5px solid #cad1dc;
-    font-size: 14px;
-    resize: none;
-    /* background: #f6f6f6; */
-    font-family: "Microsoft YaHei";
+  border: 1.5px solid #cad1dc;
+  font-size: 14px;
+  resize: none;
+  /* background: #f6f6f6; */
+  font-family: "Microsoft YaHei";
 }
 
 .binfo_textarea::-webkit-scrollbar {
-    /*滚动条整体样式*/
-    width: 6px;
-    /*高宽分别对应横竖滚动条的尺寸*/
-    height: 6px;
+  /*滚动条整体样式*/
+  width: 6px;
+  /*高宽分别对应横竖滚动条的尺寸*/
+  height: 6px;
 }
 
 /*定义滚动条轨道 内阴影+圆角*/
 .binfo_textarea::-webkit-scrollbar-track {
-    border-radius: 10px;
-    background-color: rgba(0, 0, 0, 0.1);
+  border-radius: 10px;
+  background-color: rgba(0, 0, 0, 0.1);
 }
 
 /*定义滑块 内阴影+圆角*/
 .binfo_textarea::-webkit-scrollbar-thumb {
-    border-radius: 10px;
-    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
-    background-color: rgba(0, 0, 0, 0.1);
+  border-radius: 10px;
+  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
+  background-color: rgba(0, 0, 0, 0.1);
 }
 
 .binfo_input:focus-visible {
-    border: 1.5px solid #3681fc !important;
+  border: 1.5px solid #3681fc !important;
 }
 
 .ai_body_input {
-    /* position: relative; */
-    display: flex;
-    flex-direction: column;
-    justify-content: center;
-    align-items: end;
+  /* position: relative; */
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: end;
 }
 
 .c_pub_button_confirm {
-    /* position: absolute;
+  /* position: absolute;
     bottom: 13px;
     right: 13px; */
-    margin-top: 10px;
-    width: 80px;
-    display: flex;
-    justify-content: center;
+  margin-top: 10px;
+  width: 80px;
+  display: flex;
+  justify-content: center;
 }
 
-
 .ai_body_dialog {
-    padding: 10px 0;
-    box-sizing: border-box;
-    height: calc(100% - 180px);
-    overflow: auto;
-    margin-bottom: 10px;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: calc(100% - 180px);
+  overflow: auto;
+  margin-bottom: 10px;
 }
 
-
 .dialog_content {
-    width: 100%;
-    display: flex;
+  width: 100%;
+  display: flex;
+  flex-direction: column;
 }
 
-.dialog_content+.dialog_content {
-    margin: 15px 0;
+.dialog_content > div {
+  display: flex;
+  align-items: flex-start;
 }
 
-.dialog_content.right {
-    flex-direction: row-reverse;
+.dialog_content + .dialog_content {
+  margin: 15px 0;
 }
 
-.dialog_content.right .role {
-    margin-right: 0;
-    margin-left: 10px;
+.dialog_content > div .right {
+  flex-direction: row-reverse;
 }
 
-.dialog_content .role {
-    min-width: 30px;
-    width: 30px;
-    height: 30px;
-    margin-right: 10px;
-    border-radius: 50%;
+.dialog_content > div .right .role {
+  margin-right: 0;
+  margin-left: 10px;
 }
 
-.dialog_content .role>img {
-    height: 100%;
-    width: 100%;
+.dialog_content > div .role {
+  min-width: 30px;
+  width: 30px;
+  height: 30px;
+  margin-right: 10px;
+  border-radius: 50%;
 }
 
-.dialog_content .content {
-    padding: 10px 5px;
-    border-radius: 5px;
-    width: 100%;
-    word-break: break-word;
-    box-sizing: border-box;
-    white-space: pre-line;
-    max-width: 100%;
-    background: #F7F7F7;
-    overflow: hidden;
+.dialog_content > div .role > img {
+  height: 100%;
+  width: 100%;
 }
 
-.dialog_content .content2 {
-    background: #3681fc;
-    color: #fff;
+.dialog_content > div .content {
+  padding: 10px 5px;
+  border-radius: 5px;
+  width: 100%;
+  word-break: break-word;
+  box-sizing: border-box;
+  /* white-space: pre-line; */
+  max-width: 100%;
+  background: #f7f7f7;
+  overflow: hidden;
+  margin: 0 10px;
 }
 
+.dialog_content > div .content2 {
+  background: #3681fc;
+  color: #fff;
+}
 
 .ai_body_select {
-    position: relative;
-}
-
-.ai_body_select>.check {
-    background: #e7e7e7;
-    display: flex;
-    width: fit-content;
-    padding: 0 10px;
-    height: 30px;
-    border-radius: 21px;
-    font-size: 14px;
-    align-items: center;
-    justify-content: center;
-    color: #0061FF;
-    font-weight: 700;
-    margin: 10px 0;
-    cursor: pointer;
-}
-
-.ai_body_select>.check::before {
-    content: '';
-    width: 15px;
-    height: 15px;
-    display: block;
-    background-image: url('../../../assets/icon/course/aiPart.png');
-    background-size: 100% 100%;
-    margin-right: 5px;
-}
-
-.ai_body_select>.check::after {
-    content: '';
-    width: 15px;
-    height: 15px;
-    display: block;
-    background-image: url('../../../assets/icon/course/aiPart_arrow.png');
-    background-size: 100% 100%;
-    margin-right: 5px;
-}
-
-.ai_body_select>.isCheck {
-    background: #0061FF;
-    display: flex;
-    width: fit-content;
-    padding: 0 10px;
-    height: 30px;
-    border-radius: 21px;
-    font-size: 14px;
-    align-items: center;
-    justify-content: center;
-    color: #fff;
-    font-weight: 700;
-    margin: 10px 0;
-    cursor: pointer;
-    max-width: 100%;
-    box-sizing: border-box;
-}
-
-.ai_body_select>.isCheck>span {
-    width: calc(100% - 40px);
-    display: block;
-    overflow: hidden;
-    white-space: nowrap;
-    text-overflow: ellipsis;
+  position: relative;
+}
+
+.ai_body_select > .check {
+  background: #e7e7e7;
+  display: flex;
+  width: fit-content;
+  padding: 0 10px;
+  height: 30px;
+  border-radius: 21px;
+  font-size: 14px;
+  align-items: center;
+  justify-content: center;
+  color: #0061ff;
+  font-weight: 700;
+  margin: 10px 0;
+  cursor: pointer;
+}
+
+.ai_body_select > .check::before {
+  content: "";
+  width: 15px;
+  height: 15px;
+  display: block;
+  background-image: url("../../../assets/icon/course/aiPart.png");
+  background-size: 100% 100%;
+  margin-right: 5px;
+}
+
+.ai_body_select > .check::after {
+  content: "";
+  width: 15px;
+  height: 15px;
+  display: block;
+  background-image: url("../../../assets/icon/course/aiPart_arrow.png");
+  background-size: 100% 100%;
+  margin-right: 5px;
+}
+
+.ai_body_select > .isCheck {
+  background: #0061ff;
+  display: flex;
+  width: fit-content;
+  padding: 0 10px;
+  height: 30px;
+  border-radius: 21px;
+  font-size: 14px;
+  align-items: center;
+  justify-content: center;
+  color: #fff;
+  font-weight: 700;
+  margin: 10px 0;
+  cursor: pointer;
+  max-width: 100%;
+  box-sizing: border-box;
+}
+
+.ai_body_select > .isCheck > span {
+  width: calc(100% - 40px);
+  display: block;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
 }
 
-.ai_body_select>.isCheck::before {
-    content: '';
-    width: 15px;
-    height: 15px;
-    display: block;
-    background-image: url('../../../assets/icon/course/aiPart_active.png');
-    background-size: 100% 100%;
-    margin-right: 5px;
+.ai_body_select > .isCheck::before {
+  content: "";
+  width: 15px;
+  height: 15px;
+  display: block;
+  background-image: url("../../../assets/icon/course/aiPart_active.png");
+  background-size: 100% 100%;
+  margin-right: 5px;
 }
 
-.ai_body_select>.isCheck::after {
-    content: '';
-    width: 15px;
-    height: 15px;
-    display: block;
-    background-image: url('../../../assets/icon/course/aiPart_arrow_active.png');
-    background-size: 100% 100%;
-    margin-right: 5px;
+.ai_body_select > .isCheck::after {
+  content: "";
+  width: 15px;
+  height: 15px;
+  display: block;
+  background-image: url("../../../assets/icon/course/aiPart_arrow_active.png");
+  background-size: 100% 100%;
+  margin-right: 5px;
 }
 
-
-.ai_body_select>.checkBox {
-    position: absolute;
-    bottom: 40px;
-    border: 1px solid #E0EAFB;
-    width: 100%;
-    height: 300px;
-    background: #fff;
-    border-radius: 5px;
-    padding: 10px;
-    box-sizing: border-box;
+.ai_body_select > .checkBox {
+  position: absolute;
+  bottom: 40px;
+  border: 1px solid #e0eafb;
+  width: 100%;
+  height: 300px;
+  background: #fff;
+  border-radius: 5px;
+  padding: 10px;
+  box-sizing: border-box;
 }
 
-.ai_body_select>.checkBox>.task>.title,
-.ai_body_select>.checkBox>.part>.title {
-    font-size: 14px;
-    font-weight: 700;
-    margin-bottom: 5px;
-}
-
-.ai_body_select>.checkBox>.task {
-    height: calc(100% - 60px);
-}
-
-.ai_body_select>.checkBox>.part {}
+.ai_body_select > .checkBox > .task > .title,
+.ai_body_select > .checkBox > .part > .title {
+  font-size: 14px;
+  font-weight: 700;
+  margin-bottom: 5px;
+}
+
+.ai_body_select > .checkBox > .task {
+  height: calc(100% - 60px);
+}
+
+.ai_body_select > .checkBox > .part {
+}
 
-.ai_body_select>.checkBox>.task>.content {
-    height: calc(100% - 40px);
-    overflow: auto;
+.ai_body_select > .checkBox > .task > .content {
+  height: calc(100% - 40px);
+  overflow: auto;
 }
 
-.ai_body_select>.checkBox>.task>.content>.span+.span {
-    margin-top: 5px;
+.ai_body_select > .checkBox > .task > .content > .span + .span {
+  margin-top: 5px;
 }
 
-.ai_body_select>.checkBox>.task>.content>.span {
-    display: flex;
-    align-items: center;
-    font-size: 14px;
-    cursor: pointer;
+.ai_body_select > .checkBox > .task > .content > .span {
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  cursor: pointer;
 }
 
-.ai_body_select>.checkBox>.task>.content>.span>.check {
-    width: 13px;
-    height: 13px;
-    display: flex;
-    align-items: center;
-    margin-right: 5px;
+.ai_body_select > .checkBox > .task > .content > .span > .check {
+  width: 13px;
+  height: 13px;
+  display: flex;
+  align-items: center;
+  margin-right: 5px;
 }
 
-.ai_body_select>.checkBox>.task>.content>.span>.check>img {
-    width: 100%;
-    height: 100%;
+.ai_body_select > .checkBox > .task > .content > .span > .check > img {
+  width: 100%;
+  height: 100%;
 }
 
-.ai_body_select>.checkBox>.part>.content {
-    display: flex;
-    align-items: center;
-    font-size: 14px;
-    justify-content: space-between;
+.ai_body_select > .checkBox > .part > .content {
+  display: flex;
+  align-items: center;
+  font-size: 14px;
+  justify-content: space-between;
 }
 
-.ai_body_select>.checkBox>.part>.content>.span {
-    padding: 3px 6px;
-    border: 1px solid #E0EAFB;
-    border-radius: 40px;
-    cursor: pointer;
+.ai_body_select > .checkBox > .part > .content > .span {
+  padding: 3px 6px;
+  border: 1px solid #e0eafb;
+  border-radius: 40px;
+  cursor: pointer;
 }
 
-.ai_body_select>.checkBox>.part>.content>.span.active {
-    color: #0061ff;
-    border-color: #0061ff;
+.ai_body_select > .checkBox > .part > .content > .span.active {
+  color: #0061ff;
+  border-color: #0061ff;
 }
-</style>
+</style>

+ 167 - 0
src/components/pages/aiAddCourse/aiDialog.vue

@@ -0,0 +1,167 @@
+<template>
+    <el-dialog title="提示词设置" :visible.sync="dialogVisibleAiD" :append-to-body="true" width="650px" :before-close="handleClose"
+        class="dialog_diy">
+        <div style="height: 100%;padding:15px">
+            <div class="ai_nav">
+                <span :class="{active: type == 1}">基础创建</span>
+            </div>
+            <div class="ai_detail" v-if="type == 1">
+                <span class="title">默认的提示词</span>
+                <textarea rows="10" class="binfo_input binfo_textarea" cols v-model="text"
+                      placeholder="请输入...."></textarea>
+            </div>
+        </div>
+        <span slot="footer" class="dialog-footer">
+            <el-button @click="confirm" type="primary">确 定</el-button>
+            <el-button @click="close">关 闭</el-button>
+        </span>
+    </el-dialog>
+</template>
+  
+<script>
+
+export default {
+    props: {
+        dialogVisibleAiD: {
+            type: Boolean,
+            default: false
+        },
+        aiText: {
+            type: String,
+        },
+        clickType: {
+            type: Number
+        }
+    },
+    data() {
+        return {
+            type: 1,
+            text: ""
+        }
+    },
+    watch:{
+        dialogVisibleAiD(newValue, oldValue) {
+            if(newValue){
+                this.text = JSON.parse(JSON.stringify(this.aiText))
+                if(this.clickType == 2){
+                    this.confirm();
+                }
+            }
+        },
+    },
+    methods: {
+        handleClose(done) {
+            this.close()
+            done();
+        },
+        close() {
+            this.$emit('update:dialogVisibleAiD', false)
+        },
+        confirm(){
+            this.$emit("aiConfirm",this.text);
+            this.$emit('update:dialogVisibleAiD', false)
+        }
+    },
+}
+</script>
+  
+<style scoped>
+.dialog_diy>>>.el-dialog {
+    height: auto;
+    margin: 15vh auto 0 !important;
+}
+
+.dialog_diy>>>.el-dialog__header {
+    background: #454545 !important;
+    padding: 15px 20px;
+}
+
+.dialog_diy>>>.el-dialog__body {
+    height: calc(100% - 124px);
+    box-sizing: border-box;
+    padding: 0px;
+}
+
+
+.dialog_diy>>>.el-dialog__title {
+    color: #fff;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn {
+    top: 19px;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
+    color: #fff;
+}
+
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
+    color: #fff;
+}
+
+
+.dialog_diy>>>.el-dialog__body,
+.dialog_diy>>>.el-dialog__footer {
+    background: #fafafa;
+}
+
+.ai_detail > .binfo_input {
+  width: 100%;
+  margin: 0;
+  padding: 12px 14px;
+  display: block;
+  min-width: 0;
+  outline: none;
+  box-sizing: border-box;
+  background: none;
+  border: none;
+  border-radius: 4px;
+  background: #fff;
+  font-size: 16px;
+  resize: none;
+  font-family: "Microsoft YaHei";
+  min-height: 48px;
+  /* border: 1px solid #3682fc00; */
+  border: 1.5px solid #cad1dc;
+}
+
+.ai_detail > .binfo_textarea {
+  border: 1.5px solid #cad1dc;
+  font-size: 16px;
+  resize: none;
+  /* background: #f6f6f6; */
+  font-family: "Microsoft YaHei";
+}
+
+.ai_detail > .binfo_input:focus-visible {
+  border: 1.5px solid #3681fc !important;
+}
+
+
+.ai_nav{
+    font-size: 16px;
+    margin-bottom: 10px;
+    display: flex;
+    align-items: center;
+}
+.ai_nav > span{
+    cursor: pointer;
+}
+
+.ai_nav > span + span{
+    margin-left: 15px;
+}
+.ai_nav > span.active{
+    color: #3681fc;
+}
+
+.ai_detail{
+    display: flex;
+    flex-direction: column;
+}
+
+.ai_detail > .title{
+    margin-bottom: 5px;
+}
+
+</style>

+ 79 - 42
src/components/pages/classroomObservation/components/addNewCourseDialog.vue

@@ -1,24 +1,22 @@
 <template>
 	<div class="addNewCourse">
-		<el-dialog
-			title="添加课堂"
-			:visible.sync="dialogVisible"
-			width="500px"		>
-		<div>
-			<el-form ref="form" :model="form" label-position="top">
-			  <el-form-item label="课堂编号">
-  			  <el-input v-model="form.no" placeholder="请输入课堂编号"></el-input>
-  			</el-form-item>
-				<el-form-item label="课堂名称">
-  			  <el-input v-model="form.name" placeholder="请输入课堂名称"></el-input>
-  			</el-form-item>
-			</el-form>
-		</div>
+		<el-dialog title="添加课堂" :visible.sync="dialogVisible" width="500px">
+			<div>
+				<el-form ref="form" :model="form" :rules="rules" label-position="top">
+					<el-form-item label="课堂编号" prop="no">
+						<el-input v-model="form.no" placeholder="请输入课堂编号,支持英文和数数字结合"></el-input>
+					</el-form-item>
+					<el-form-item label="课堂名称" prop="name">
+						<el-input
+							v-model="form.name"
+							placeholder="请输入课堂名称"
+						></el-input>
+					</el-form-item>
+				</el-form>
+			</div>
 			<span slot="footer" class="dialog-footer">
 				<el-button @click="dialogVisible = false">取 消</el-button>
-				<el-button type="primary" @click="submit()"
-					>确 定</el-button
-				>
+				<el-button type="primary" @click="submit('form')">确 定</el-button>
 			</span>
 		</el-dialog>
 	</div>
@@ -26,38 +24,77 @@
 
 <script>
 export default {
-	emits:["success"],
-	data(){
-		return{
-			dialogVisible:false,
-			form:{
-				no:"",
-				name:"",
+	emits: ["success"],
+	props: {
+		courseList: {
+			type: Array,
+			default: () => [],
+		},
+	},
+	data() {
+		let validateNo = (rule, value, callback) => {
+			console.log(this.courseList.findIndex(i=>i.value==value))
+			if (value.trim().length == 0) {
+				callback(new Error("请输入课堂编号"));
+			}else if(this.courseList.findIndex(i=>i.value==value.trim())!=-1){
+				callback(new Error("该课堂编号已存在"));
+			} else {
+				callback();
+			}
+		};
+		let validateName = (rule, value, callback) => {
+			console.log(this.courseList)
+			console.log(rule)
+			if (value.trim().length == 0) {
+				callback(new Error("请输入课堂名称"));
+			} else {
+				callback();
+			}
+		};
+		return {
+			dialogVisible: false,
+			form: {
+				no: "",
+				name: "",
+			},
+			rules: {
+				no: [{ validator: validateNo,trigger: "change" }],
+				name: [{ validator: validateName, trigger: "change" }],
 			},
-		}
+		};
 	},
-	methods:{
-		open(){
+	methods: {
+		open() {
 			this.form = {
-				name:"",
-				no:"",
-			}
+				name: "",
+				no: "",
+			};
 			this.dialogVisible = true;
 		},
-		submit(){
-			if(this.form.no.trim().length==0 || this.form.name.trim().length==0){
-				this.$message.error("请输入课堂编号和课堂名称")
-				return;
-			}
-			this.$emit("success",this.form)
-			this.dialogVisible = false;
-		}
-	}
+		submit(formName) {
+			this.$refs[formName].validate((valid) => {
+				if (valid) {
+					if (
+						this.form.no.trim().length == 0 ||
+						this.form.name.trim().length == 0
+					) {
+						//|| this.form.name.trim().length==0
+						this.$message.error("请填写完整信息");
+						return;
+					}
+					this.$emit("success", this.form);
+					this.dialogVisible = false;
+				} else {
+					console.log("error submit!!");
+					return false;
+				}
+			});
+		},
+	},
 };
 </script>
 
-<style  scoped>
-.addNewCourse{
-
+<style scoped>
+.addNewCourse {
 }
 </style>

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

@@ -17,6 +17,7 @@
 				ref="analysisItemRef"
 				v-if="analysisItemList.length > 0"
 				v-for="(item, index) in analysisItemList"
+				:dialogTagDataList="dialogTagDataList"
 				:key="item.id"
 				:data="item"
 				:tid="tid"
@@ -41,6 +42,12 @@ export default {
 			type: String,
 			default: "分析",
 		},
+		dialogTagDataList:{
+			type:Array,
+			default:()=>{
+				return [];
+			}
+		},
 		analysisItemList: {
 			type: Array,
 			default: () => {
@@ -82,14 +89,14 @@ export default {
 		editItem(id, _data) {
 			this.$emit("editItem", id, _data);
 		},
-		getReport(index) {
-			if (!index && index < 0) {
+		getReport(id) {
+			if (!id) {
 				this.$refs.analysisItemRef.forEach((i) => {
 					i.editBtn();
 				});
 			} else {
 				this.$nextTick(()=>{
-					this.$refs.analysisItemRef[index].editBtn();
+					this.$refs.analysisItemRef[this.analysisItemList.findIndex((i) => i.id == id)].editBtn();
 				})
 				
 			}

+ 49 - 117
src/components/pages/classroomObservation/components/analysisItem.vue

@@ -8,8 +8,6 @@
 				<span class="ai-h-l-text">{{ data.jsonData.name }}</span>
 			</div>
 			<div class="ai-h-right">
-				<!-- <span class="ai-h-r-icon1" @click.stop="backLeft()"></span> -->
-				<!-- <span class="ai-h-r-icon2" @click.stop="backRight()"></span> -->
 				<span style="width: 100px; color: red" v-if="loadNum == 2"
 					>优化失败
 				</span>
@@ -26,12 +24,12 @@
 				></span>
 				<span
 					v-if="loadNum == 0 && openItem"
-					class="ai-h-r-icon1"
+					:class="['ai-h-r-icon1',showIndex<=0?'ai_h_r_iconOpacity':'']"
 					@click.stop="changeShowIndex(-1)"
 				></span>
 				<span
 					v-if="loadNum != 1 && openItem"
-					class="ai-h-r-icon2"
+					:class="['ai-h-r-icon2',showIndex>=historyResult.length-1?'ai_h_r_iconOpacity':'']"
 					@click.stop="changeShowIndex(1)"
 				></span>
 				<span
@@ -43,15 +41,14 @@
 			</div>
 		</div>
 		<div class="ai-main" v-if="openItem">
-			<!-- <div class="a-m-title">
-				<span></span>
-				<div>{{ data.title }}分析</div>
-			</div> -->
+
 
 			<div class="a-m-brief">
-				<mdView :text="data.jsonData.result" />
+				{{ data.jsonData.result }}
+				<!-- <mdView :text="data.jsonData.result" /> -->
 				<!-- {{ data.jsonData.result }} -->
 			</div>
+			<mdView :text="data.jsonData.content" />
 			<div v-for="(item, index) in data.jsonData.dataFileList" :key="item.uid">
 				<div v-if="imgTypeList.includes(checkFileType(item.url))">
 					<img style="max-width: 100%" :src="item.url" alt="" />
@@ -95,6 +92,12 @@ export default {
 				return {};
 			},
 		},
+		dialogTagDataList:{
+			type:Array,
+			default:()=>{
+				return []
+			}
+		},
 		index: {
 			type: Number,
 			default: 0,
@@ -136,13 +139,12 @@ export default {
 		},
 	},
 	watch:{
-		showIndex(){
-			let _copyData = JSON.parse(JSON.stringify(this.data));
-			_copyData.jsonData = this.historyResult[this.showIndex];
-			_copyData.json_data = JSON.stringify(_copyData.jsonData);
-			console.log(_copyData)
-			this.$emit("editItem", this.data.id, _copyData);
-		}
+		// showIndex(){
+		// 	let _copyData = JSON.parse(JSON.stringify(this.data));
+		// 	_copyData.jsonData = this.historyResult[this.showIndex];
+		// 	_copyData.json_data = JSON.stringify(_copyData.jsonData);
+		// 	this.$emit("editItem", this.data.id, _copyData);
+		// }
 	},
 	methods: {
 		changeOpenItem(newValue) {
@@ -151,97 +153,19 @@ export default {
 			this.loadNum = 0;
 			this.openItem = newValue;
 		},
-		backLeft() {
-			this.$message.info("回退左");
-		},
-		backRight() {
-			this.$message.info("回退右");
-		},
 		editBtn() {
 			this.$nextTick(() => {
 				this.loading = true;
 				this.openItem = false;
 				this.loadNum = 1;
-				let assistant_id = {
-					课堂观察: { value: "8ab07d41-e143-11ee-aaca-12e77c4cb76b", type: 0 },
-					教学阶段九事件分析: {
-						value: "5e0466b3-0075-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					OMO智慧课堂分析: {
-						value: "4cc367c1-0076-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					布鲁姆问题分类: {
-						value: "eac63117-00a7-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					麦卡锡问题分类: {
-						value: "18545cf7-0125-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					学生回答统计: {
-						value: "2c6ede88-0125-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					课堂活动类型: {
-						value: "41d2d2d4-0125-11ef-aaca-12e77c4cb76b",
-						type: 1,
-					},
-					素养目标分析: {
-						value: "b13a98de-0125-11ef-aaca-12e77c4cb76b",
-						type: 1,
-					},
-					科学教育目标分析: {
-						value: "d6cd48ab-0125-11ef-aaca-12e77c4cb76b",
-						type: 1,
-					},
-					"5E课程改编": {
-						value: "f757826e-0125-11ef-aaca-12e77c4cb76b",
-						type: 2,
-					},
-					"5EX课程改编": {
-						value: "0b6b08b7-0126-11ef-aaca-12e77c4cb76b",
-						type: 2,
-					},
-					UTOP课程观察: {
-						value: "8e3a389b-014f-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					RST模型: {
-						value: "e649112e-0150-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					RTOP模型: {
-						value: "68265b18-0151-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					课堂质量评价: {
-						value: "25e53379-0152-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					SCOP课堂观察: {
-						value: "d0c76d35-0152-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					RTOP课堂观察: {
-						value: "2ace7ff6-0154-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-				};
-				let file_ids = {
-					"03": ["file-E8SvjCHbmhmjKczRWr11OuHx"],
-					"04": ["file-r5phg4I2oFqly4WpW7oOOTnA"],
-				};
+				let assistant = this.dialogTagDataList.find(i=>i.title==this.data.jsonData.name);
 				let parm = {
-					assistant_id: assistant_id[this.data.jsonData.name]
-						? assistant_id[this.data.jsonData.name].value
-						: null,
+					assistant_id: assistant?assistant.value:null,
 					message:
 						"请使用代码解析器获取文件,帮我根据要求完整的分析,输出请按照要求。",
 					session_name: new Date().getTime(),
 					userId: "1cf9dc4b-d95f-11ea-af4c-52540005ab01",
-					file_ids: this.fileId ? [this.fileId] : file_ids[this.tid],
+					file_ids: this.fileId?[this.fileId]:'',
 				};
 
 				if (!parm.assistant_id) {
@@ -253,7 +177,6 @@ export default {
 				this.ajax
 					.post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
 					.then((res) => {
-						console.log("👇👇");
 						let _data = res.data.FunctionResponse;
 						if (
 							!_data.message ||
@@ -263,29 +186,23 @@ export default {
 							return this.$message.error("AI无法识别优化");
 						}
 						let _copyData = JSON.parse(JSON.stringify(this.data));
-						_copyData.jsonData.result = _data.message;
+						// _copyData.jsonData.result = "";
+						_copyData.jsonData.content = _data.message;
 						_copyData.jsonData.dataFileList = [];
 						_copyData.jsonData.fileList = [];
 						_copyData.json_data = JSON.stringify(_copyData.jsonData);
-						// this.historyResult.push(_copyData.jsonData)
-						this.historyResult.splice(this.showIndex+1,0,_copyData.jsonData)
+						if(this.historyResult.length==0){
+							this.historyResult.push(_copyData.jsonData)
+						}else{
+							this.historyResult.splice(this.showIndex+1,0,_copyData.jsonData)
+						}
 						this.changeShowIndex(1);
-						// this.$emit("editItem", this.data.id, _copyData);
-						
-
 						this.loading = false;
-						
 					})
 					.catch((err) => {
 						this.$message.error("AI无法识别优化");
 						this.loading = false;
-						this.loadNum = 2;
 					});
-				// this.$emit
-				// setTimeout(()=>{
-				// 	this.loading = false;
-				// 	this.$emit("editItem", this.data);
-				// },1000)
 			});
 		},
 		delBtn() {
@@ -298,17 +215,26 @@ export default {
 			});
 		},
 		changeShowIndex(value){
+			if(this.historyResult.length==0)return;
 			if(value==-1){
-				if(this.showIndex<=0)return this.$message.info("已经是第一个了")
-				this.showIndex--;
+				if(this.showIndex>0)this.showIndex--;
 			}else if(value==1){
-				if(this.showIndex>=this.historyResult.length-1)return this.$message.info("已经是最后一个了");
-				this.showIndex++;
+				if(this.showIndex<this.historyResult.length-1)this.showIndex++;
 			}
+			let _copyData = JSON.parse(JSON.stringify(this.data));
+			let _oldCopyDate = JSON.parse(JSON.stringify(this.data));
+			_copyData.jsonData = this.historyResult[this.showIndex];
+			_copyData.json_data = JSON.stringify(_copyData.jsonData);
+			_oldCopyDate.json_data = JSON.stringify(_oldCopyDate.jsonData);
+			// 一样就不用更新了
+			if(JSON.stringify(_copyData)==JSON.stringify(_oldCopyDate))return;
+			this.$emit("editItem", this.data.id, _copyData);
 		}
 	},
 	mounted(){
-		this.historyResult.push(this.data.jsonData)
+		if(this.data.jsonData.content){
+			this.historyResult.push(this.data.jsonData)
+		}
 	},
 };
 </script>
@@ -390,6 +316,11 @@ export default {
 	background: url("../../../../assets/icon/classroomObservation/back.png");
 }
 
+.ai_h_r_iconOpacity{
+	opacity: 0.5;
+	cursor: not-allowed !important;
+}
+
 .ai-h-r-icon3 {
 	background: url("../../../../assets/icon/classroomObservation/edit.png");
 	/* background: url("../../../../assets/icon/classroomObservation/del.png"); */
@@ -424,8 +355,9 @@ export default {
 .a-m-brief {
 	font-size: 16px;
 	/* 斜体 */
-	/* font-style: italic; */
+	font-style: italic;
 	margin-bottom: 10px;
+	color: #6b798e;
 }
 
 td,

+ 144 - 20
src/components/pages/classroomObservation/components/baseMessage.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="message">
+	<div class="message" >
 		<div class="m-header" @click.stop="changeShowMain(!showMain)">
 			<span :class="['m-h-icon', showMain ? 'm-h-icon-active' : '']"></span>
 			<span class="m-h-title">{{ title }}</span>
@@ -12,6 +12,7 @@
 						<el-input
 							v-model="data.courseName"
 							placeholder="请输入课程名称"
+							@change="changeData()"
 						></el-input>
 					</div>
 				</div>
@@ -20,7 +21,7 @@
 					<div class="m-m-formItemBot">
 						<div class="m-m-fi-label">授课年级</div>
 						<div class="m-m-fi-input">
-							<el-select v-model="data.grade" placeholder="请选择年级">
+							<el-select v-model="data.grade" @change="changeData()" placeholder="请选择年级">
 								<el-option
 									v-for="(item, index) in gradeList"
 									:key="index"
@@ -34,7 +35,7 @@
 					<div class="m-m-formItemBot">
 						<div class="m-m-fi-label">授课科目</div>
 						<div class="m-m-fi-input">
-							<el-select v-model="data.subject" placeholder="请选择年级">
+							<el-select v-model="data.subject" @change="changeData()" placeholder="请选择年级">
 								<el-option
 									v-for="(item, index) in subjectList"
 									:key="index"
@@ -46,11 +47,12 @@
 					</div>
 
 					<div class="m-m-formItemBot">
-						<div class="m-m-fi-label">授课班级</div>
+						<div class="m-m-fi-label">教材版本</div>
 						<div class="m-m-fi-input">
 							<el-input
-								v-model="data.class"
-								placeholder="请输入班级"
+								v-model="data.textbook"
+								placeholder="请输入教材版本"
+								@change="changeData()"
 							></el-input>
 						</div>
 					</div>
@@ -65,6 +67,7 @@
 						<el-input
 							v-model="data.teacherName"
 							placeholder="请输入授课老师"
+							@change="changeData()"
 						></el-input>
 					</div>
 				</div>
@@ -75,6 +78,7 @@
 						<el-input
 							v-model.number="data.studentNum"
 							placeholder="请输入学生人数"
+							@change="changeData()"
 						></el-input>
 					</div>
 				</div>
@@ -83,23 +87,27 @@
 				<span>添加课堂图片</span>
 				<span>(建议图片比例16:9,最多上传3张图片)</span>
 			</div>
-			<div class="m-m-formImage">
+			<div class="m-m-formImage" v-loading="uploadImageLoading">
 				<div class="m-m-fi-imageList">
 					<div class="m-m-fi-imageList">
 						<div
 							class="m-m-fi-imageItem"
 							v-for="(value,key,index) in imageList"
 							:key="index"
-							v-if="key.indexOf('fileList')!=-1&&index!=0"
+							v-if="key.indexOf('fileList')!=-1&&index!=0 && value.length>0"
 							@click.stop="previewImg(value[0].url)"
 						>
-
-							<img class="itemUrl" :src="value[0].url" alt="" />
+						<el-image
+						class="itemUrl"
+      			:src="value[0].url"
+      			fit="cover"></el-image>
+						<span @click.stop="delImage(key)">x</span>
+							<!-- <img class="itemUrl" :src="value[0].url" alt="" /> -->
 						</div>
 						<!-- 图片区域 -->
 					</div>
 
-					<div class="m-m-fi-imageItem" @click.stop="addImage()">
+					<div class="m-m-fi-imageItem"  @click.stop="addImage()" v-if="imageList.fileList1&&(imageList.fileList1.length+imageList.fileList2.length+imageList.fileList3.length)<3">
 						<img
 							src="../../../../assets/icon/classroomObservation/Union.png"
 							alt=""
@@ -125,6 +133,7 @@
 
 <script>
 export default {
+	emits:["saveData","saveImage","delImage"],
 	props:{
 		data:{
 			type:Object,
@@ -143,11 +152,12 @@ export default {
 		return {
 			title: "基本信息",
 			showMain: true,
+			uploadImageLoading:false,
 			from: {
 				courseName: "",
 				teacherName: "",
-				grade: "小学五年级",
-				subject: "科学",
+				grade: "",
+				subject: "",
 				class: "",
 				studentNum: 0,
 			},
@@ -159,17 +169,104 @@ export default {
 				{ value: "小学五年级", label: "小学五年级" },
 				{ value: "小学六年级", label: "小学六年级" },
 			],
-			subjectList: [{ value: "科学", label: "科学" }],
+			subjectList: [
+				{ value: "语文", label: "语文" },
+				{ value: "数学", label: "数学" },
+				{ value: "英语", label: "英语" },
+				{ value: "科学", label: "科学" },
+				{ value: "信息技术", label: "信息技术" },
+				{ value: "心理", label: "心理" },
+				{ value: "物理", label: "物理" },
+				{ value: "化学", label: "化学" },
+				{ value: "生物", label: "生物" },
+				{ value: "历史", label: "历史" },
+				{ value: "地理", label: "地理" },
+				{ value: "通用技术", label: "通用技术" },
+				{ value: "政治", label: "政治" },
+				{ value: "STEM", label: "STEM" },
+				{ value: "美术", label: "美术" },
+				{ value: "音乐", label: "音乐" },
+				{ value: "其他", label: "其他" },
+			],
 		};
 	},
-	watch:{
-		data(newValue){
-			this.from = newValue;
-		}
-	},
 	methods: {
+		// 添加图片
 		addImage() {
-			this.$message.info("添加课堂图片");
+			// 上传录音
+			let input = document.createElement("input");
+			input.type = "file";
+			input.accept = "image/*";
+			input.click();
+			input.onchange = () => {
+				this.uploadImageLoading = true;
+				let file = input.files[0];
+				var credentials = {
+					accessKeyId: "AKIATLPEDU37QV5CHLMH",
+					secretAccessKey: "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",
+				}; //秘钥形式的登录上传
+				window.AWS.config.update(credentials);
+				window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+				var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+				var _this = this;
+
+				if (file) {
+					var params = {
+						Key:
+							file.name.split(".")[0] +
+							new Date().getTime() +
+							"." +
+							file.name.split(".")[file.name.split(".").length - 1],
+						ContentType: file.type,
+						Body: file,
+						"Access-Control-Allow-Credentials": "*",
+						ACL: "public-read",
+					}; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+					var options = {
+						partSize: 2048 * 1024 * 1024,
+						queueSize: 2,
+						leavePartsOnError: true,
+					};
+					bucket
+						.upload(params, options)
+						.on("httpUploadProgress", function (evt) {
+							//这里可以写进度条
+							// console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+						})
+						.send(function (err, data) {
+							if (err) {
+								_this.$message.error("上传失败");
+							} else {
+								_this.$emit("saveImage",{
+									name:data.key,
+									status:"success",
+									uid:"1",
+									url:data.Location
+								});
+								// _this.from.audioUrl = data.Location;
+								// _this.from.audioName = file.name;
+								// _this.from.audioSize = file.size;
+								// _this.from.audioTime = file.lastModified;
+
+								// console.log(data.Location)
+							}
+							_this.uploadImageLoading = false;
+						});
+				}
+			};
+			// this.mainBtnStatus = 1;
+			// this.barNum = 4;
+		},
+		// 删除图片
+		delImage(key){
+			this.$confirm('确定删除该图片吗?', '提示', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning'
+			}).then(() => {
+				this.$emit("delImage",key);
+			})
 		},
 		changeShowMain(newValue) {
 			this.showMain = newValue;
@@ -177,6 +274,9 @@ export default {
 		previewImg(url) {
 			this.$hevueImgPreview(url);
 		},
+		changeData(){
+			this.$emit("saveData");
+		},
 	},
 	mounted(){
 		
@@ -326,9 +426,33 @@ export default {
 	box-sizing: border-box;
 	font-size: 14px;
 	cursor: pointer;
+	position: relative;
 }
 .m-m-fi-imageItem > .itemUrl {
 	width: 100%;
+	height: 100%;
+}
+
+.m-m-fi-imageItem>span{
+	width:30px;
+	height: 30px;
+	position: absolute;
+	right: 0;
+	top: 0;
+	display: flex;
+	justify-content: flex-end;
+	align-items: flex-start;
+	box-sizing: border-box;
+	padding: 2px 10px;
+	color: white;
+	background-color: #e60012;
+	cursor: pointer;
+	border-radius: 0 0 0 100%;
+	display: none;
+}
+
+.m-m-fi-imageItem:hover>span{
+	display: flex;
 }
 
 .m-m-fi-i-icon {

File diff suppressed because it is too large
+ 651 - 246
src/components/pages/classroomObservation/components/chatArea.vue


+ 343 - 254
src/components/pages/classroomObservation/components/messageArea.vue

@@ -21,6 +21,9 @@
 			<baseMessage
 				:data="bmData.jsonData"
 				:imageList="imageList.jsonData"
+				@saveData="saveBaseData"
+				@saveImage="saveBaseImage"
+				@delImage="delBaseImageList"
 				v-loading="baseMessageLoading"
 			/>
 
@@ -30,6 +33,7 @@
 				@delItem="delAnalysisItem"
 				@editItem="editAnalysisItem"
 				title="通用课堂分析"
+				:dialogTagDataList="dialogTagDataList"
 				:analysisItemList="dataList.filter((i) => i.Type === 0)"
 				:type="0"
 				:tid="tid"
@@ -42,6 +46,7 @@
 				@delItem="delAnalysisItem"
 				@editItem="editAnalysisItem"
 				title="科学课堂分析"
+				:dialogTagDataList="dialogTagDataList"
 				:analysisItemList="dataList.filter((i) => i.Type === 1)"
 				:type="1"
 				:tid="tid"
@@ -54,24 +59,26 @@
 				@delItem="delAnalysisItem"
 				@editItem="editAnalysisItem"
 				title="扩展分析"
+				:dialogTagDataList="dialogTagDataList"
 				:analysisItemList="dataList.filter((i) => i.Type === 2)"
 				:type="2"
 				:tid="tid"
 				:fileId="fileId"
 				v-loading="extendLoading"
 			/>
-			<analysis
+			<!-- <analysis
 				@updateMessage="updateMessage"
 				ref="analysis3"
 				@delItem="delAnalysisItem"
 				@editItem="editAnalysisItem"
 				title="增值性分析"
+				:dialogTagDataList="dialogTagDataList"
 				:analysisItemList="dataList.filter((i) => i.Type === 3)"
 				:type="3"
 				:tid="tid"
 				:fileId="fileId"
 				v-loading="valueAddedLoading"
-			/>
+			/> -->
 			<!-- <currencyAnalysis
 				@updateMessage="updateMessage"
 				@delItem="delAnalysisItem"
@@ -112,6 +119,7 @@
 						placeholder="请输入内容"
 						prefix-icon="el-icon-search"
 						v-model="input2"
+						clearable
 					>
 					</el-input>
 				</div>
@@ -153,9 +161,7 @@
 					<div style="display: flex; flex-wrap: wrap">
 						<div
 							class="a-d-b-item"
-							v-for="(item, index) in dialogTagDataList.filter(
-								(i) => i.type == tagIndex
-							)"
+							v-for="(item, index) in searchDataList"
 							:key="index"
 						>
 							<div class="a-d-b-i-top">
@@ -169,7 +175,7 @@
 							</div>
 							<div class="a-d-b-i-bottom">{{ item.brief }}</div>
 							<div class="a-d-b-i-bottomPer" style="display: block">
-								3982人已使用
+								{{item.sum}}人已使用
 							</div>
 							<div class="a-d-b-i-bottomBtn" style="display: none">
 								<div
@@ -205,6 +211,7 @@ import baseMessage from "./baseMessage.vue"; //基本信息
 import analysis from "./analysis.vue";
 
 export default {
+	emits:["changeChatAreaAudioUrl","changeTranscription","changeOptionData"],
 	components: {
 		baseMessage,
 		// currencyAnalysis,
@@ -238,135 +245,188 @@ export default {
 				{ id: 0, name: "通用课堂分析" },
 				{ id: 1, name: "科学课堂分析" },
 				{ id: 2, name: "扩展分析" },
-				{ id: 3, name: "增值性分析" },
+				//{ id: 3, name: "增值性分析" },
 			],
 			dialogTagDataList: [
 				{
 					title: "OMO智慧课堂分析",
 					brief: "多维度分析课堂整体情况",
+					value: "4cc367c1-0076-11ef-aaca-12e77c4cb76b",
 					type: 0,
+					sum:157,
 				},
 				{
 					title: "教学阶段九事件分析",
 					brief: "使用加涅九事件分析教学环节",
+					value: "5e0466b3-0075-11ef-aaca-12e77c4cb76b",
 					type: 0,
+					sum:540
 				},
 				{
 					title: "布鲁姆问题分类",
 					brief: "多维度分析课堂整体情况",
+					value: "eac63117-00a7-11ef-aaca-12e77c4cb76b",
 					type: 0,
+					sum:405
 				},
 				{
 					title: "麦卡锡问题分类",
 					brief: "多维度分析课堂整体情况",
+					value: "18545cf7-0125-11ef-aaca-12e77c4cb76b",
 					type: 0,
+					sum:360
 				},
 				{
 					title: "学生回答情况",
 					brief: "多维度分析课堂整体情况",
+					value: "d3f75199-eb4e-11ee-aaca-12e77c4cb76b",
 					type: 0,
+					sum:206
 				},
-				{ title: "课堂时间分配", brief: "多维度分析课堂整体情况", type: 0 },
-				{ title: "师生互动分析", brief: "多维度分析课堂整体情况", type: 0 },
-				{ title: "教学模式分析", brief: "多维度分析课堂整体情况", type: 0 },
+				// {
+				// 	title: "课堂时间分配",
+				// 	brief: "多维度分析课堂整体情况",
+				// 	type: 0
+				// },
+				// {
+				// 	title: "师生互动分析",
+				// 	brief: "多维度分析课堂整体情况",
+				// 	type: 0
+				// },
+				// {
+				// 	title: "教学模式分析",
+				// 	brief: "多维度分析课堂整体情况",
+				// 	type: 0
+				// },
 				{
 					title: "课堂活动类型",
 					brief: "多维度分析课堂整体情况",
+					value: "41d2d2d4-0125-11ef-aaca-12e77c4cb76b",
 					type: 1,
+					sum:430
 				},
 				{
 					title: "学科核心素养发展",
-					brief: "使用加涅九事件分析教学环节",
+					brief: "学科核心素养发展",
+					value: "b13a98de-0125-11ef-aaca-12e77c4cb76b",
 					type: 1,
+					sum:234
 				},
 				{
 					title: "科学教育目标分析",
-					brief: "多维度分析课堂整体情况",
+					brief: "科学教育目标分析",
+					value: "b13a98de-0125-11ef-aaca-12e77c4cb76b",
 					type: 1,
+					sum:513
 				},
 				{
 					title: "PORTAAL课堂观察",
-					brief: "使用加涅九事件分析教学环节",
+					brief: "PORTAAL课堂观察",
+					value: "8ab07d41-e143-11ee-aaca-12e77c4cb76b",
 					type: 1,
+					sum:173
 				},
 				{
-					title: "5E课程改编",
-					brief: "多维度分析课堂整体情况",
-					type: 2,
-				},
-				{
-					title: "5EX课程改编",
-					brief: "使用加涅九事件分析教学环节",
-					type: 2,
-				},
-				{
-					title: "UTOP课程观察",
-					brief: "多维度分析课堂整体情况",
+					title: "UTOP课堂观察",
+					brief: "UTOP课堂观察",
 					value: "8e3a389b-014f-11ef-aaca-12e77c4cb76b",
-					type: 3,
+					type: 1,
+					sum:329
 				},
 				{
-					title: "RST模型",
-					brief: "多维度分析课堂整体情况",
+					title:"L-PST模型",
+					brief: "L-PST模型",
 					value: "e649112e-0150-11ef-aaca-12e77c4cb76b",
-					type: 3,
+					type: 1,
+					sum:421
 				},
+				// {
+				// 	title: "RST模型",
+				// 	brief: "多维度分析课堂整体情况",
+				// 	value: "e649112e-0150-11ef-aaca-12e77c4cb76b",
+				// 	type: 1,
+				// },
 				{
-					title: "RTOP模型",
+					title: "RTOP课堂观察",
 					brief: "多维度分析课堂整体情况",
 					value: "68265b18-0151-11ef-aaca-12e77c4cb76b",
-					type: 3,
+					type: 1,
+					sum:527
 				},
 				{
-					title: "课堂质量评价",
-					brief: "多维度分析课堂整体情况",
-					value: "25e53379-0152-11ef-aaca-12e77c4cb76b",
-					type: 3,
+					title: "课程质量评价",
+					brief: "多维度分析课堂整体情况", 
+				 	value:"25e53379-0152-11ef-aaca-12e77c4cb76b",
+					type: 1,
+					sum:391
 				},
 				{
 					title: "SCOP课堂观察",
 					brief: "多维度分析课堂整体情况",
 					value: "d0c76d35-0152-11ef-aaca-12e77c4cb76b",
-					type: 3,
+					type: 1,
+					sum:407
 				},
 				{
-					title: "RTOP课堂观察",
-					brief: "多维度分析课堂整体情况",
-					value: "2ace7ff6-0154-11ef-aaca-12e77c4cb76b",
-					type: 3,
+					title: "5E课程改编",
+					brief: "5E课程改编",
+					value: "f757826e-0125-11ef-aaca-12e77c4cb76b",
+					type: 2,
+					sum:510
+				},
+				{
+					title: "5EX课程改编",
+					brief: "5EX课程改编",
+					value: "0b6b08b7-0126-11ef-aaca-12e77c4cb76b",
+					type: 2,
+					sum:611
 				},
+
 			],
 			bmData: {},
 			dataList: [],
 			imageList: {},
 		};
 	},
+	computed: {
+		searchDataList() {
+			let _data = this.dialogTagDataList.filter((i) => i.type == this.tagIndex);
+			if (this.input2) {
+				return _data.filter((i) => i.title.indexOf(this.input2) > -1);
+			} else {
+				return _data;
+			}
+		},
+	},
 	methods: {
 		delAnalysisItem(id) {
 			let _index = this.dataList.findIndex((i) => i.id == id);
 			if (_index > -1) {
-				this.dataList.splice(_index, 1);
-				this.$message.success("删除成功");
+				let _data = this.dataList[_index];
+				let params = {
+					id: _data.id,
+					type: _data.Type,
+					tid: this.tid,
+				};
+				this.ajax
+					.post("https://gpt4.cocorobo.cn/delete_classroom_observation", params)
+					.then((res) => {
+						this.dataList.splice(_index, 1);
+						this.$message.success("删除成功");
+					})
+					.catch((e) => {
+						this.$message.error("删除失败");
+					});
 			} else {
 				this.$message.error("删除失败");
 			}
 		},
 		editAnalysisItem(id, _data) {
 			let _index = this.dataList.findIndex((i) => i.id == id);
-			if (_index > -1) {
+			if (_index != -1) {
 				this.dataList[_index] = _data;
-				if (this.dataList[_index].id) {
-					let pram2 = {
-						id: this.dataList[_index].id,
-						json_data: this.dataList[_index].json_data,
-					};
-					this.ajax.post(
-						"https://gpt4.cocorobo.cn/update_classroom_observation",
-						pram2
-					);
-				}
+				this.saveData(this.dataList[_index])
 				this.$forceUpdate();
-				this.$message.success("执行成功");
 			} else {
 				this.$message.info("执行错误");
 			}
@@ -397,177 +457,65 @@ export default {
 		addAnalysisItem(title) {
 			return new Promise((resolve, reject) => {
 				this.dialogVisible = false;
-				let assistant_id = {
-					课堂观察: { value: "8ab07d41-e143-11ee-aaca-12e77c4cb76b", type: 0 },
-					教学阶段九事件分析: {
-						value: "5e0466b3-0075-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					OMO智慧课堂分析: {
-						value: "4cc367c1-0076-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					布鲁姆问题分类: {
-						value: "eac63117-00a7-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					麦卡锡问题分类: {
-						value: "18545cf7-0125-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					学生回答统计: {
-						value: "2c6ede88-0125-11ef-aaca-12e77c4cb76b",
-						type: 0,
-					},
-					课堂活动类型: {
-						value: "41d2d2d4-0125-11ef-aaca-12e77c4cb76b",
-						type: 1,
-					},
-					素养目标分析: {
-						value: "b13a98de-0125-11ef-aaca-12e77c4cb76b",
-						type: 1,
-					},
-					科学教育目标分析: {
-						value: "d6cd48ab-0125-11ef-aaca-12e77c4cb76b",
-						type: 1,
-					},
-					"5E课程改编": {
-						value: "f757826e-0125-11ef-aaca-12e77c4cb76b",
-						type: 2,
-					},
-					"5EX课程改编": {
-						value: "0b6b08b7-0126-11ef-aaca-12e77c4cb76b",
-						type: 2,
-					},
-					UTOP课程观察: {
-						value: "8e3a389b-014f-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					RST模型: {
-						value: "e649112e-0150-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					RTOP模型: {
-						value: "68265b18-0151-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					课堂质量评价: {
-						value: "25e53379-0152-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					SCOP课堂观察: {
-						value: "d0c76d35-0152-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-					RTOP课堂观察: {
-						value: "2ace7ff6-0154-11ef-aaca-12e77c4cb76b",
-						type: 3,
-					},
-				};
-				let file_ids = {
-					"03": ["file-E8SvjCHbmhmjKczRWr11OuHx"],
-					"04": ["file-r5phg4I2oFqly4WpW7oOOTnA"],
-				};
+				let assistant = this.dialogTagDataList.find((i) => i.title == title);
+				
 				let parm = {
-					assistant_id: assistant_id[title] ? assistant_id[title].value : null,
+					assistant_id: assistant ? assistant.value : null,
 					message:
 						"请使用代码解析器获取文件,帮我根据要求完整的分析,输出请按照要求。",
 					session_name: new Date().getTime(),
 					userId: "1cf9dc4b-d95f-11ea-af4c-52540005ab01",
-					file_ids: this.fileId ? [this.fileId] : file_ids[this.tid],
+					file_ids: this.fileId,
 				};
 
 				if (!parm.assistant_id) {
 					resolve();
 					return this.$message.error("未找到对应的AI助手");
 				}
-				this.dataList.push({
-					id: assistant_id[title].value,
-					Type: assistant_id[title].type,
-					createTime: new Date(),
-					tId: this.tid,
-					tIndex: 2,
-					jsonData: {
-						dataFileList: [],
-						fileList: [],
-						fileList2: [],
-						name: title,
+				let newIndexData = this.dataList.filter((i) => i.Type == assistant.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?2:0;
+				let params = {
+					index: newIndex,
+					json_data: JSON.stringify({
+						name: assistant.title,
 						result: "",
-					},
-				});
+						fileList: [],
+						dataFileList: [],
+						content: "",
+					}),
+					tid: this.tid,
+					type: assistant.type.toString(),
+				};
 
-				if (assistant_id[title].type == 0) {
-					this.$refs.analysis0.getReport(
-						this.dataList.filter((i) => i.Type == 0).length - 1
-					);
-				} else if (assistant_id[title].type == 1) {
-					this.$refs.analysis1.getReport(
-						this.dataList.filter((i) => i.Type == 1).length - 1
-					);
-				} else if (assistant_id[title].type == 2) {
-					this.$refs.analysis1.getReport(
-						this.dataList.filter((i) => i.Type == 2).length - 1
-					);
-				} else if (assistant_id[title].type == 3) {
-					this.$refs.analysis1.getReport(
-						this.dataList.filter((i) => i.Type == 3).length - 1
-					);
-				}
-				this.$message.success("添加成功");
-				resolve();
-				// this.ajax
-				// 	.post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm)
-				// 	.then((res) => {
-				// 		let result = res.data.FunctionResponse;
-				// 		if(!result.message || result.message.indexOf('由于我无法直接访问您上传的文件内容')>-1){
-				// 			this.loading = false;
-				// 			resolve();
-				// 			return this.$message.error(`${title}无法生成`)
-				// 		}
-				// 		this.dataList.push({
-				// 			id:assistant_id[result.title].value,
-				// 			Type:assistant_id[result.title].type,
-				// 			createTime:new Date(),
-				// 			tId:this.tid,
-				// 			tIndex:2,
-				// 			jsonData:{
-				// 				dataFileList:[],
-				// 				fileList:[],
-				// 				fileList2:[],
-				// 				name:result.title,
-				// 				result:result.message
-				// 			}
-				// 		})
-				// 		resolve();
-				// 		this.loading = false;
-				// 	})
-				// 	.catch((e) => {
-				// 		this.$message.error(`${title}无法生成`)
-				// 		this.loading = false;
-				// 		resolve();
-				// 	});
+				// 这里调用添加
+				this.ajax
+					.post("https://gpt4.cocorobo.cn/insert_classroom_observation", params)
+					.then((res) => {
+						let _data = res.data.FunctionResponse;
+						if (_data.message && _data.message == "创建成功") {
+							let _result = JSON.parse(_data.result)[0];
+							_result.jsonData = JSON.parse(_result.jsonData);
+							this.dataList.push(_result);
+							if (_result.Type == 0) {
+								this.$refs.analysis0.getReport(_result.id);
+							} else if (_result.Type == 1) {
+								this.$refs.analysis1.getReport(_result.id);
+							} else if (_result.Type == 2) {
+								this.$refs.analysis2.getReport(_result.id);
+							} else if (_result.Type == 3) {
+								this.$refs.analysis3.getReport(_result.id);
+							}
+							this.$message.success("添加成功");
+							resolve();
+						} else {
+							this.$message.error("创建失败");
+						}
+					});
 			});
 		},
-		// getFileId() {
-		// 	let pram = {
-		// 		tid: this.tid,
-		// 		type: "10",
-		// 	};
-		// 	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)
-		// 				: [];
-		// 			this.$emit('updateFileIdid', _data[0].id)
-		// 			if(_data[0].jsonData !='' ){
-		// 				this.$emit("updateFileId", JSON.parse(_data[0].jsonData).file_ids)
-		// 			}else {
-		// 				this.$emit("updateFileId", '')
-		// 			}
-		// 		});
-		// },
 		getCurrencyAndBaseMessageData() {
+			if(!this.tid)return;
 			let pram = {
 				tid: this.tid,
 				// tid:'02',
@@ -599,14 +547,15 @@ export default {
 						? JSON.parse(res.data.FunctionResponse.result)
 						: [];
 					if (_data.length == 0) {
-						this.baseMessageLoading = false;
-						return (this.currencyLoading = false);
+						return this.insertBaseMessage().then(_=>{
+							this.getCurrencyAndBaseMessageData();
+						})
 					}
-					let _bmData = _data[0];
+					let _bmData = _data.find(i=>i.tIndex==0);
 					// 基础信息
 					_bmData.jsonData = JSON.parse(_bmData.jsonData);
 					// 图片
-					let _imageList = _data[1];
+					let _imageList = _data.find(i=>i.tIndex==1);
 					_imageList.jsonData = JSON.parse(_imageList.jsonData);
 					//通用分析
 					let currency = [];
@@ -618,12 +567,22 @@ export default {
 
 					this.dataList.push(...currency);
 					this.bmData = _bmData;
+					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.baseMessageLoading = false;
 					this.currencyLoading = false;
+				}).catch(e=>{
+					this.$message.error("获取通用分析失败");
+					console.log(e)
 				});
 		},
 		getScienceData() {
+			if(!this.tid)return;
 			let pram = {
 				tid: this.tid,
 				// tid:'02',
@@ -647,9 +606,13 @@ export default {
 					}
 					this.dataList.push(...science);
 					this.scienceLoading = false;
+				}).catch(e=>{
+					this.$message.error("获取科学分析失败");
+					console.log(e)
 				});
 		},
 		getExtendData() {
+			if(!this.tid)return;
 			let pram = {
 				tid: this.tid,
 				// tid:'02',
@@ -673,9 +636,13 @@ export default {
 					}
 					this.dataList.push(...extent);
 					this.extendLoading = false;
+				}).catch(e=>{
+					this.$message.error("获取扩展分析失败");
+					console.log(e)
 				});
 		},
 		getValueAddedData() {
+			if(!this.tid)return;
 			let pram = {
 				tid: this.tid,
 				// tid:'02',
@@ -699,6 +666,9 @@ export default {
 					}
 					this.dataList.push(...valueAdded);
 					this.valueAddedLoading = false;
+				}).catch(e=>{
+					this.$message.error("获取增值性分析失败");
+					console.log(e)
 				});
 		},
 		getData() {
@@ -706,63 +676,182 @@ export default {
 			this.getCurrencyAndBaseMessageData();
 			this.getScienceData();
 			this.getExtendData();
-			this.getValueAddedData();
+			// this.getValueAddedData();
 			// this.getFileId();
 		},
-		saveData(fn) {
+		saveData(data) {
+			return new Promise((resolve,reject)=>{
+				this.ajax.post(
+						"https://gpt4.cocorobo.cn/update_classroom_observation",
+						{
+							id: data.id,
+							json_data: JSON.stringify(data.jsonData),
+						}
+					).then(res=>{
+						resolve();
+					}).catch(e=>{
+						this.$message.error('保存失败');
+						resolve();
+					})
+			})
 			// return;
-			let saveDataList = [];
+			// let saveDataList = [];
 
-			// 保存基础信息
-			saveDataList.push({
-				id: this.bmData.id,
-				json_data: JSON.stringify(this.bmData.jsonData),
-			});
+			// // 保存基础信息
+			// saveDataList.push({
+			// 	id: this.bmData.id,
+			// 	json_data: JSON.stringify(this.bmData.jsonData),
+			// });
 
-			// 所有分析
-			this.dataList.forEach((i1) => {
-				i1.forEach((i2) => {
-					saveDataList.push({
-						id: i2.id,
-						json_data: JSON.stringify(i2.jsonData),
-					});
-				});
-			});
-			let promises = [];
-			saveDataList.forEach((i) => {
-				promises.push(
-					new Promise((resolve) => {
-						let pram = {
-							id: i.id,
-							json_data: i.json_data,
-						};
-						this.ajax
-							.post(
-								"https://gpt4.cocorobo.cn/update_classroom_observation",
-								pram
-							)
-							.then((res) => {
-								console.log(res);
-								resolve();
-							});
-					})
-				);
-			});
+			// // 所有分析
+			// this.dataList.forEach((i1) => {
+			// 	i1.forEach((i2) => {
+			// 		saveDataList.push({
+			// 			id: i2.id,
+			// 			json_data: JSON.stringify(i2.jsonData),
+			// 		});
+			// 	});
+			// });
+			// let promises = [];
+			// saveDataList.forEach((i) => {
+			// 	promises.push(
+			// 		new Promise((resolve) => {
+			// 			let pram = {
+			// 				id: i.id,
+			// 				json_data: i.json_data,
+			// 			};
+			// 			this.ajax
+			// 				.post(
+			// 					"https://gpt4.cocorobo.cn/update_classroom_observation",
+			// 					pram
+			// 				)
+			// 				.then((res) => {
+			// 					console.log(res);
+			// 					resolve();
+			// 				});
+			// 		})
+			// 	);
+			// });
 
-			Promise.all(promises).then((res) => {
-				this.$message.success("保存成功");
-				fn ? fn() : "";
+			// Promise.all(promises).then((res) => {
+			// 	this.$message.success("保存成功");
+			// 	fn ? fn() : "";
+			// });
+		},
+		saveBaseData(){
+			this.bmData.json_data = JSON.stringify(this.bmData.jsonData);
+			this.saveData(this.bmData).then(res=>{
+				this.$emit("changeOptionData",this.tid,{label:this.bmData.jsonData.courseName})
+			})
+		},
+		saveBaseImage(newImage){
+			if(this.imageList.jsonData.fileList1.length==0){
+				this.imageList.jsonData.fileList1.push(newImage);
+			}else if(this.imageList.jsonData.fileList2.length==0){
+				this.imageList.jsonData.fileList2.push(newImage)
+			}else if(this.imageList.jsonData.fileList3.length==0){
+				this.imageList.jsonData.fileList3.push(newImage)
+			}else{
+				this.$message.error("最多只能上传3张图片");
+				return;
+			}
+			this.imageList.json_data = JSON.stringify(this.imageList.jsonData);
+			this.saveData(this.imageList);
+		},
+		delBaseImageList(key){
+			this.imageList.jsonData[key] = [];
+			this.imageList.json_data = JSON.stringify(this.imageList.jsonData);
+			this.saveData(this.imageList).then(res=>{
+				this.$message.success("删除图片成功")
 			});
 		},
+		// 切换录音文件
+		changeAudioUrl(data){
+			this.imageList.jsonData.fileList = [];
+			let audio = {
+				name:data.key,
+				status:"success",
+				uid:"1",
+				url:data.Location
+			}
+			this.imageList.jsonData.fileList.push(audio)
+			this.saveData(this.imageList).then(res=>{
+				this.$message.success("更换录文件成功");
+				this.$emit("changeChatAreaAudioUrl",audio);
+			})
+		},
 		getReport() {
 			this.$refs.analysis0.getReport();
 			this.$refs.analysis1.getReport();
 			this.$refs.analysis2.getReport();
 			this.$refs.analysis3.getReport();
 		},
+		insertBaseMessage() {
+			return new Promise((resolve, reject) => {
+				// 添加基础信息
+				let params = {
+					index: "0",
+					json_data: JSON.stringify({
+						courseName: "",
+						studentNum: "0",
+						subject: "",
+						textbook: "",
+						classroom_resources: "",
+						activity_structure: "",
+						activity_methods: "",
+						name: "",
+					}),
+					tid: this.tid,
+					type: "0",
+				};
+				// 添加课堂图片
+				let params2 = {
+					index: "1",
+					tid: this.tid,
+					type: "0",
+					json_data: JSON.stringify({
+						fileList: [],
+						name: "课堂记录",
+						fileList1: [],
+						fileList2: [],
+						fileList3: [],
+					}),
+				};
+				this.ajax
+					.post("https://gpt4.cocorobo.cn/insert_classroom_observation", params)
+					.then((res) => {
+						let _data = res.data.FunctionResponse;
+						if (_data.message && _data.message == "创建成功") {
+							this.ajax
+								.post(
+									"https://gpt4.cocorobo.cn/insert_classroom_observation",
+									params2
+								)
+								.then((res2) => {
+									let _data2 = res2.data.FunctionResponse;
+									if (_data2.message && _data2.message == "创建成功") {
+									} else {
+										this.$message.error("创建课堂图片失败");
+									}
+									resolve();
+								});
+						} else {
+							this.$message.error("创建基础信息失败");
+						}
+					})
+			});
+		},
+		// 修改基本信息的原文速览和转录文稿
+		updateMessageTranscription({transcriptionData,editorBarData}){
+			this.bmData.jsonData['transcriptionData'] = transcriptionData;
+			this.bmData.jsonData['editorBarData'] = editorBarData;
+			this.saveData(this.bmData).then(res=>{
+				this.$message.success("保存成功");
+			})
+		},
 	},
 	mounted() {
-		this.getData();
+		
 	},
 };
 </script>

+ 0 - 281
src/components/pages/classroomObservation/components/pdf.vue

@@ -1,281 +0,0 @@
-<template>
-  <div class="pdf">
-    <div class="show">
-      <pdf
-        ref="pdf"
-        :src="pdfUrl"
-        :page="pageNum"
-        :rotate="pageRotate"
-        @password="password"
-        @progress="loadedRatio = $event"
-        @page-loaded="pageLoaded($event)"
-        @num-pages="pageTotalNum = $event"
-        @error="pdfError($event)"
-        @link-clicked="page = $event"
-      ></pdf>
-    </div>
-
-    <!-- <div class="pdf_footer">
-      <div class="info">
-        <div>当前页数/总页数:{{pageNum}}/{{pageTotalNum}}</div>
-      </div>
-      <div class="operate">
-        <div class="btn" @click.stop="prePage">上一页</div>
-        <div class="btn" @click.stop="nextPage">下一页</div>
-      </div>
-    </div>-->
-  </div>
-</template>
-
-<script>
-import pdf from "vue-pdf";
-export default {
-  name: "vue_pdf_preview",
-  props: {
-    // 当前pdf路径
-    pdfUrl: {
-      type: String,
-      default:
-        "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0629%E5%AE%9E%E6%97%B6%E8%AF%BE%E5%A0%82%E6%A8%A1%E6%8B%9F%E6%BC%94%E7%A4%BA%E8%AF%BE%E4%BB%B61656920880446.pdf",
-    },
-    ppage: {
-      type: Number,
-      default: 1,
-    },
-  },
-  components: {
-    pdf,
-  },
-  data() {
-    return {
-      // 总页数
-      pageTotalNum: 1,
-      // 当前页数
-      pageNum: 1,
-      // 加载进度
-      loadedRatio: 0,
-      // 页面加载完成
-      curPageNum: 0,
-      // 放大系数 默认百分百
-      scale: 69,
-      // 旋转角度 ‘90’的倍数才有效
-      pageRotate: 0,
-      // 单击内部链接时触发 (目前我没有遇到使用场景)
-      page: 0,
-      loading: null,
-    };
-  },
-  watch: {
-    ppage(val) {
-      this.pageNum = val;
-    },
-    pageTotalNum(val) {
-      if (val) {
-        this.loading.close();
-        // this.$parent.setData();
-        this.$parent.getRealTimeClass();
-      }
-      this.$emit("getPageTotal", val);
-    },
-  },
-  computed: {},
-  created() {},
-  mounted() {
-    this.loading = this.$loading.service({
-      background: "rgba(255, 255, 255, 0.7)",
-      target: document.querySelector(".pdf"),
-    });
-    this.pageNum = this.ppage;
-    let dwidth = document.body.offsetWidth;
-    let cwidth = document.getElementsByClassName("pdf")[0].offsetHeight * 1.77;
-    let owidth = "";
-    if (cwidth > dwidth) {
-      owidth = dwidth + "px";
-    } else {
-      owidth = cwidth + "px";
-    }
-    var a = document.getElementsByClassName("pdf")[0].offsetWidth;
-    let _this = this;
-    this.$refs.pdf.$el.style.width = owidth;
-    this.$emit("getWidth", owidth);
-    window.addEventListener("resize", () => {
-      dwidth = document.body.offsetWidth;
-      cwidth = document.getElementsByClassName("pdf")[0].offsetHeight * 1.77;
-      if (cwidth > dwidth) {
-        owidth = dwidth + "px";
-      } else {
-        owidth = cwidth + "px";
-      }
-      this.$refs.pdf.$el.style.width = owidth;
-      this.$emit("getWidth", owidth);
-    });
-  },
-  methods: {
-    //下载PDF
-    fileDownload(data, fileName) {
-      let blob = new Blob([data], {
-        //type类型后端返回来的数据中会有,根据自己实际进行修改
-        type: "application/pdf;charset-UTF-8",
-      });
-      let filename = fileName || "pdf.pdf";
-      if (typeof window.navigator.msSaveBlob !== "undefined") {
-        window.navigator.msSaveBlob(blob, filename);
-      } else {
-        var blobURL = window.URL.createObjectURL(blob);
-        // 创建隐藏<a>标签进行下载
-        var tempLink = document.createElement("a");
-        tempLink.style.display = "none";
-        tempLink.href = blobURL;
-        tempLink.setAttribute("download", filename);
-        if (typeof tempLink.download === "undefined") {
-          tempLink.setAttribute("target", "_blank");
-        }
-        document.body.appendChild(tempLink);
-        tempLink.click();
-        document.body.removeChild(tempLink);
-        window.URL.revokeObjectURL(blobURL);
-      }
-    },
-
-    //放大
-    scaleD() {
-      this.scale += 5;
-      this.$refs.pdf.$el.style.width = parseInt(this.scale) + "%";
-    },
-
-    //缩小
-    scaleX() {
-      // scale 是百分百展示 不建议缩放
-      if (this.scale == 100) {
-        return;
-      }
-      this.scale += -5;
-      console.log(parseInt(this.scale) + "%");
-      this.$refs.pdf.$el.style.width = parseInt(this.scale) + "%";
-    },
-    // 切换上一页
-    prePage() {
-      var p = this.pageNum;
-      p = p > 1 ? p - 1 : this.pageTotalNum;
-      this.pageNum = p;
-      // this.getPage(p);
-    },
-    // 切换下一页
-    nextPage() {
-      var p = this.pageNum;
-      p = p < this.pageTotalNum ? p + 1 : 1;
-      this.pageNum = p;
-      // this.getPage(p);
-    },
-    // 顺时针选中角度
-    clock() {
-      this.pageRotate += 90;
-    },
-    // 逆时针旋转角度
-    counterClock() {
-      this.pageRotate -= 90;
-    },
-    // pdf 有密码 则需要输入秘密
-    password(updatePassword, reason) {
-      updatePassword(prompt('password is "test"'));
-      console.log("...reason...");
-      console.log(reason);
-      console.log("...reason...");
-    },
-    // 页面加载成功  当前页数
-    pageLoaded(e) {
-      this.$emit("current", e);
-      this.curPageNum = e;
-    },
-    // 异常监听
-    pdfError(error) {
-      console.error(error);
-    },
-    // 打印所有
-    pdfPrintAll() {
-      this.$refs.pdf.print();
-    },
-    // 打印 第一页和第二页
-    pdfPrint() {
-      // 第一个参数 文档打印的分辨率
-      // 第二个参数 文档打印的页数
-      this.$refs.pdf.print(100, [1, 2]);
-    },
-    // 获取当前页面pdf的文字信息内容
-    logContent() {
-      this.$refs.pdf.pdf.forEachPage(function (page) {
-        return page.getTextContent().then(function (content) {
-          let text = content.items.map((item) => item.str);
-          let allStr = content.items.reduce(
-            (initVal, item) => (initVal += item.str),
-            ""
-          );
-          console.log(allStr); // 内容字符串
-          console.log(text); // 内容数组
-        });
-      });
-    },
-  },
-};
-</script>
-
-<style scoped>
-.pdf {
-  height: 100%;
-  position: relative;
-  box-sizing: border-box;
-}
-.pdf .show {
-  overflow: auto;
-  margin: auto;
-  width: 100%;
-  height: calc(100%);
-  display: flex;
-  align-items: center;
-  justify-content: center;
-}
-
-.pdf .pdf_footer {
-  position: absolute;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  padding: 10px 0;
-  width: 100%;
-  height: 75px;
-  background-color: rgba(255, 255, 255, 0.5);
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-}
-.pdf .pdf_footer .info {
-  display: flex;
-  flex-wrap: wrap;
-  width: 100%;
-  justify-content: center;
-}
-/* .pdf .pdf_footer .info div {
-  width: 30%;
-} */
-.pdf .pdf_footer .operate {
-  margin: 10px 0 0;
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: center;
-  width: 100%;
-}
-.pdf .pdf_footer .operate div {
-  text-align: center;
-  font-size: 15px;
-}
-.pdf .pdf_footer .operate .btn {
-  cursor: pointer;
-  margin: 5px 10px;
-  width: 100px;
-  border-radius: 10px;
-  padding: 5px;
-  color: #fff;
-  background-color: #066ebe;
-}
-</style>

+ 73 - 19
src/components/pages/classroomObservation/components/sharePdf.vue

@@ -14,13 +14,24 @@
           分享链接
         </div>
         <div class="url">
-          <el-tooltip :content="origin" placement="top" effect="dark">
-            <!-- content to trigger tooltip here -->
+					<el-input
+          class="sc_fu_input"
+          style="color: black"
+          disabled
+          v-model="origin"
+        >
+          <template slot="append"
+            ><div class="sc_fu_copyBtn" @click.stop="copy()">
+              复制链接
+            </div></template
+          >
+        </el-input>
+          <!-- <el-tooltip :content="origin" placement="top" effect="dark">
             <span>{{ origin }}</span>
           </el-tooltip>
           <span @click="copy" :data-clipboard-text="copyText" class="tag-read"
             >复制链接</span
-          >
+          > -->
         </div>
       </div>
       <div class="qrcode_box">
@@ -33,13 +44,13 @@
         </div>
       </div>
       <div class="btn_box">
-        <button
+        <!-- <button
           class="c_pub_button_confirm tag-read2"
           @click="copy2"
           :data-clipboard-text="copyText2"
         >
           复制信息
-        </button>
+        </button> -->
       </div>
     </div>
   </el-dialog>
@@ -53,7 +64,11 @@ export default {
     dialogVisibleShare: {
       type: Boolean,
       default: false
-    }
+    },
+		tid:{
+			type:String,
+			default:"",
+		}
   },
   data() {
     return {
@@ -77,7 +92,7 @@ export default {
     },
     setQr() {
       setTimeout(() => {
-        let url = 'https://beta.cloud.cocorobo.cn/#/classroomObservation';
+        let url = `https://beta.cloud.cocorobo.cn/aigpt/#/classroom_observation_board?tid=${this.tid}`;
         this.origin = url;
         this.$refs.qrCodeUrl.innerHTML = "";
         var qrcode = new QRCode(this.$refs.qrCodeUrl, {
@@ -100,17 +115,36 @@ export default {
       link.click();
     },
     copy() {
-      this.copyText = 'https://beta.cloud.cocorobo.cn/#/classroomObservation';
-      var clipboard = new Clipboard(".tag-read");
-      clipboard.on("success", e => {
-        this.$message.success("复制成功");
-        console.log("复制成功");
-        clipboard.destroy(); // 释放内存
-      });
-      clipboard.on("error", e => {
-        console.log("不支持复制,该浏览器不支持自动复制");
-        clipboard.destroy(); // 释放内存
-      });
+			const input = document.createElement("input");
+      // 设置 display为none会导致无法复制
+      // input.style.display = "none";
+      // 所以只能用其他方法隐藏
+      input.style.opacity = 0;
+      // 为了不影响布局
+      input.style.position = "fixed";
+      input.style.left = "-100%";
+      input.style.top = "-100%";
+      input.value = this.origin;
+      document.body.appendChild(input);
+      input.select();
+      const success = document.execCommand("copy");
+      document.body.removeChild(input);
+      if (!success) {
+        return this.$message.error("复制失败");
+      } else {
+        return this.$message.success("复制成功");
+      }
+      // this.copyText = `https://beta.cloud.cocorobo.cn/aigpt/#/classroom_observation_board?tid=${this.tid}`;
+      // var clipboard = new Clipboard(".tag-read");
+      // clipboard.on("success", e => {
+      //   this.$message.success("复制成功");
+      //   console.log("复制成功");
+      //   clipboard.destroy(); // 释放内存
+      // });
+      // clipboard.on("error", e => {
+      //   console.log("不支持复制,该浏览器不支持自动复制");
+      //   clipboard.destroy(); // 释放内存
+      // });
     },
     copy2() {
       let url = 'https://beta.cloud.cocorobo.cn/#/classroomObservation';
@@ -166,7 +200,12 @@ export default {
         // console.log(top.origin);
         // this.origin = top.origin
       }
-    }
+    },
+		tid(){
+			if(this.dialogVisibleShare){
+				this.setQr();
+			}
+		}
   },
   mounted() {
     // console.log("this.info", this.info);
@@ -322,4 +361,19 @@ export default {
   cursor: pointer;
   color: #0061ff;
 }
+
+.sc_fu_input /deep/.el-input__inner {
+  color: black !important;
+  cursor: text !important;
+}
+
+.sc_fu_input >>> .el-input__inner {
+  color: black !important;
+  cursor: text !important;
+}
+
+.sc_fu_copyBtn {
+  color: black;
+  cursor: pointer;
+}
 </style>

+ 65 - 65
src/components/pages/classroomObservation/components/tape.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="tape">
+	<div class="tape" v-loading="loading">
 		<!-- <div class="t-header">
 			<div class="t-h-title">课堂录音</div>
 			<div class="t-h-time">2024-04-13 17:30:00</div>
@@ -42,91 +42,77 @@
 			</div> -->
 		<!-- </div> -->
 		<div class="t-chartArea" ref="chartAreaRef">
-			<div class="t_ca_box" v-for="(item, index) in chatData" :key="index">
-				<div class="t_ca_b_roleAi" v-if="item.role == 'ai'">
-					<div class="t_ca_b_ai_avatar">
-						<el-avatar
-							size="medium"
-							:src="
-								require('../../../../assets/icon/classroomObservation/ai.png')
-							"
-						></el-avatar>
-					</div>
-					<div class="t_ca_b_ai_content">
-						<div class="t_ca_b_ai_c_name">{{ item.name }}</div>
-						<div class="t_ca_b_ai_c_main">
-							<div class="t_ca_b_ai_c_m_left">{{ item.content }}</div>
-							<div class="t_ca_b_ai_c_m_right">
-								<img
+			<div class="t_ca_box" v-for="(item, index) in chatData" :key="item.uid+index">
+			
+				<div class="t_ca_b_roleUser" v-if="item.content">
+					<div class="t_ca_b_u_content">
+						<div class="t_ca_b_u_c_main">
+							<div class="t_ca_b_u_c_m_left">
+								<!-- <img
 									:src="
 										require('../../../../assets/icon/classroomObservation/addWork.png')
 									"
 									@click="addWork()"
-								/>
-								<img
+								/> -->
+								<!-- <img
 									:src="
 										require('../../../../assets/icon/classroomObservation/copy.png')
 									"
 									@click="copyContent(item.content)"
-								/>
+								/> -->
 							</div>
+							<div class="t_ca_b_u_c_m_right" v-html="item.content"></div>
 						</div>
-						<div class="t_ca_b_ai_c_time">{{ item.create_at }}</div>
+						<div class="t_ca_b_u_c_time">{{ item.createtime }}</div>
+					</div>
+					<div class="t_ca_b_u_avatar">
+						<el-avatar
+							size="medium"
+							:src="
+								require('../../../../assets/icon/classroomObservation/userAvatar.png')
+							"
+						></el-avatar>
 					</div>
 				</div>
+				<div class="t_ca_b_roleAi">
+					<div class="t_ca_b_ai_avatar">
+						<el-avatar
+							size="medium"
+							:src="item.filename?item.filename:require('../../../../assets/icon/classroomObservation/ai.png')"
 
-				<div class="t_ca_b_roleUser" v-if="item.role == 'user'">
-					<div class="t_ca_b_u_content">
-						<div class="t_ca_b_u_c_main">
-							<div class="t_ca_b_u_c_m_left">
-								<img
+						></el-avatar>
+					</div>
+					<div class="t_ca_b_ai_content">
+						<div class="t_ca_b_ai_c_name">{{ item.fileid }}</div>
+						<div class="t_ca_b_ai_c_main">
+							<div class="t_ca_b_ai_c_m_left" v-loading="item.loading" v-html="item.aiContent"></div>
+							<div class="t_ca_b_ai_c_m_right">
+								<!-- <img
 									:src="
 										require('../../../../assets/icon/classroomObservation/addWork.png')
 									"
 									@click="addWork()"
-								/>
+								/> -->
 								<img
 									:src="
 										require('../../../../assets/icon/classroomObservation/copy.png')
 									"
-									@click="copyContent(item.content)"
+									@click="copyContent(item.aiContent)"
 								/>
 							</div>
-							<div class="t_ca_b_u_c_m_right" v-html="contentValue(item.content)"></div>
 						</div>
-						<div class="t_ca_b_u_c_time">{{ item.create_at }}</div>
-					</div>
-					<div class="t_ca_b_u_avatar">
-						<el-avatar
-							size="medium"
-							:src="
-								require('../../../../assets/icon/classroomObservation/userAvatar.png')
-							"
-						></el-avatar>
+						<div class="t_ca_b_ai_c_time">{{ item.createtime }}</div>
 					</div>
 				</div>
 			</div>
-			<!-- <div class="t-ca-item" v-for="(item,index) in chatData" :key="index">
-				<div class="t-ca-i-left">
-					<div class="t-ca-i-l-avatar">
-						<el-avatar size="medium" :src="require('../../../../assets/icon/classroomObservation/ai.png')"></el-avatar>
-					</div>
-				</div>
-				<div class="t-ca-i-right">
-					<div class="t-ca-i-r-name">{{ item.name }}</div>
-					<div class="t-ca-i-r-time">{{ item.create_at }}</div>
-					<div class="t-ca-i-r-content">{{ item.content }}</div>
-				</div>
-			</div> -->
 		</div>
 	</div>
 </template>
 
 <script>
-import pdf from "./pdf.vue";
 export default {
 	components: {
-		pdf,
+		
 	},
 	props: {
 		chatData: {
@@ -140,6 +126,10 @@ export default {
 			default:()=>{
 				return [];
 			}
+		},
+		loading:{
+			type:Boolean,
+			default:true,
 		}
 	},
 	data() {
@@ -154,14 +144,14 @@ export default {
 	},
 	computed:{
 		contentValue(){
-			return (text)=>{
-				let newText = text;
-				this.aiNameList.forEach(i=>{
-					const regex = new RegExp(`@(${i.name})`,"g");
-					newText = newText.replace(regex,`<span class='atName'>@$1</span>`);
-				})
-				return newText;
-			}
+			// return (text)=>{
+			// 	let newText = text;
+			// 	this.aiNameList.forEach(i=>{
+			// 		const regex = new RegExp(`@(${i.name})`,"g");
+			// 		newText = newText.replace(regex,`<span class='atName'>@$1</span>`);
+			// 	})
+			// 	return newText;
+			// }
 		},
 	},
 	methods: {
@@ -357,7 +347,7 @@ export default {
 
 .t-chartArea {
 	width: 100%;
-	height: calc(100vh - 290px);
+	height: calc(100vh - 280px);
 	overflow: auto;
 }
 
@@ -422,16 +412,17 @@ export default {
 }
 
 .t_ca_b_ai_c_m_left {
-	max-width: calc(100% - 60px);
+	min-width: 50px;
 	height: auto;
 	padding: 12px;
 	display: block;
 	border-radius: 2px 8px 8px 8px;
 	box-shadow: 0 4px 10px 0 #1d388354;
 	margin-top: 10px;
-	white-space: pre-line;
+	/* white-space: pre-line; */
 	word-break: break-all;
 	background-color: white;
+	overflow: hidden;
 }
 
 .t_ca_b_ai_c_m_right {
@@ -499,7 +490,6 @@ export default {
 	justify-content: flex-end;
 }
 .t_ca_b_u_c_m_right {
-	max-width: calc(100% - 60px);
 	height: auto;
 	padding: 12px;
 	display: block;
@@ -519,11 +509,21 @@ export default {
 	margin-top: 10px;
 	text-align: right;
 }
-.t_ca_b_u_c_m_right>>>.atName{
+.t_ca_b_u_c_m_right>>>.aite-name{
+	display: inline;
 	background-color: #063a708c;
 	border-radius: 5px;
 	box-sizing: border-box;
 	padding: 2px 5px;
 	color: white;
+	margin-right: 5px;
+}
+
+.t_ca_b_ai_c_m_left>>>ol{
+	margin-left: 25px;
+}
+
+.t_ca_b_ai_c_m_left>>>ul{
+	margin-left: 25px;
 }
 </style>

+ 12 - 4
src/components/pages/classroomObservation/components/transcription.vue

@@ -5,14 +5,16 @@
 			<div class="t-h-time">{{ data.time }}</div>
 		</div> -->
 		<div class="t-content">
-			<!-- {{ data.content }} -->
-			<div class="contentCon" v-for="(i, index) in chatList" :key="index">
+			{{ data.content?data.content:"暂无..." }}
+			<span v-if="showGetTextLoading">_(转译中...)</span>
+			<!-- <div class="contentCon" v-for="(i, index) in chatList" :key="index">
 				<div class="conTim">{{ i.timer }}</div>
 				<div class="conTxt">
 					{{ i.con }}
 				</div>
-			</div>
+			</div> -->
 		</div>
+		<slot></slot>
 	</div>
 </template>
 
@@ -25,6 +27,10 @@ export default {
 				return {};
 			},
 		},
+		showGetTextLoading:{
+			type:Boolean,
+			default:false,
+		}
 	},
 	data() {
 		return {
@@ -67,7 +73,9 @@ export default {
 .transcription {
 	width: 100%;
 	height: 100%;
-	max-height: calc(100% - 290px);
+	/* height: calc(100vh - 300px); */
+	max-height: calc(100vh - 300px);
+	position: relative;
 	/* display: flex; */
 	/* flex-direction: column; */
 	/* overflow: auto; */

+ 252 - 0
src/components/pages/classroomObservation/components/vpdf.vue

@@ -0,0 +1,252 @@
+<template>
+  <!--使用 pdfvuer 实现 滑动浏览 单印章-->
+  <div class="pdf">
+    <div class="loading" v-show="isloading">
+      <span>pdf可能会加载时间有点长,请耐心等待...</span>
+    </div>
+    <!-- <div id="contentArea" class="show" v-if="!loading">
+      <pdf :scale.sync="scale" :resize="true" ref="wrapper" class="p-pdf" :src="pdfData" v-for="i in numPages" :key="i"
+        :id="i" :page="i" style="width: 100%">
+      </pdf>
+    </div> -->
+    <iframe ref="viframe" style="width: 100%; height: 99%; border: none"
+      :src="'https://cloud.cocorobo.cn/pdf.js/web/viewer.html?file=' + pdfUrl"></iframe>
+    <!-- <div class="rightArea">
+      <div class="toolGroup">
+        <div class="page">第 {{ page }} / {{ numPages }} 页</div>
+        <el-button type="primary" @click.stop="prePage">上一页</el-button>
+        <el-button type="primary" @click.stop="nextPage">下一页</el-button>
+      </div>
+    </div> -->
+  </div>
+</template>
+
+<script>
+// import pdfvuer from "pdfvuer"; // pdfvuer 版本为@1.6.1
+// import "pdfjs-dist/build/pdf.worker.entry";
+// const PDF = require("pdfjs-dist");
+// PDF.GlobalWorkerOptions.workerSrc = "../../common/pdf.worker.js";
+
+export default {
+  name: "Pdfvuer",
+  components: {
+    // pdf: pdfvuer,
+  },
+  props: {
+    // 当前pdf路径
+    pdfUrl: {
+      type: String,
+      default:
+        "https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/0629%E5%AE%9E%E6%97%B6%E8%AF%BE%E5%A0%82%E6%A8%A1%E6%8B%9F%E6%BC%94%E7%A4%BA%E8%AF%BE%E4%BB%B61656920880446.pdf",
+    },
+    ppage: {
+      type: Number,
+      default: 1,
+    },
+  },
+  data() {
+    return {
+      page: 1, // 当前页
+      numPages: 0, // 总页数
+      pdfData: undefined,
+      inputPage: 1, // 输入的页码
+      isloading: false,
+      scale: "page-width",
+    };
+  },
+  mounted() {
+    // this.isloading = this.$loading.service({
+    //   background: "rgba(255, 255, 255, 0.7)",
+    //   target: document.querySelector(".loading"),
+    //   text: "加载中...",
+    //   spinner: "",
+    // });
+    this.isloading = false;
+    this.$refs.viframe.onload = function () {
+      this.isloading = false
+    }
+    console.log(this.isloading);
+    // this.getPdf();
+  },
+  beforeDestroy() { },
+  watch: {
+    pdfUrl: function (s) {
+      // this.isloading = this.$loading.service({
+      //   background: "rgba(255, 255, 255, 0.7)",
+      //   target: document.querySelector(".loading"),
+      //   text: "加载中...",
+      //   spinner: "",
+      // });
+      this.isloading = false;
+      this.$refs.viframe.onload = function () {
+        this.isloading = false
+      }
+      // this.getPdf();
+    },
+  },
+  methods: {
+    // 获取 pdf 信息
+    getPdf() {
+      this.pdfData = pdfvuer.createLoadingTask({
+        url: this.pdfUrl,
+        cMapUrl: "https://cdn.jsdelivr.net/npm/pdfjs-dist@2.16.105/cmaps/",
+        cMapPacked: true,
+      });
+      this.pdfData
+        .then((pdf) => {
+          // this.isloading.close();
+          this.isloading = false
+          this.numPages = pdf.numPages;
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
+    // 上一页
+    prePage() {
+      let page = this.page;
+      page = page > 1 ? page - 1 : 1;
+      this.page = page;
+    },
+    // 下一页
+    nextPage() {
+      let page = this.page;
+      page = page < this.numPages ? page + 1 : this.numPages;
+      this.page = page;
+    },
+  },
+};
+</script>
+<style scoped>
+.loading {
+  height: 100%;
+  width: 100%;
+  /* background: #000; */
+  position: absolute;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  /* background-color: rgba(255, 255, 255, 0.7); */
+  background-color: rgba(255, 255, 255, 1);
+  z-index: 9;
+  font-size: 20px;
+  color: #007fff;
+}
+
+.pdf {
+  height: 100%;
+  width: 100%;
+  position: relative;
+  box-sizing: border-box;
+  overflow-x: hidden;
+  overflow-y: auto;
+}
+
+.pdf .show {
+  margin: auto;
+  width: 100%;
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.pdf .show .p-pdf {
+  overflow: hidden;
+}
+
+.pdf .show .p-pdf .line {
+  position: absolute;
+  width: 50px;
+  right: -50px;
+  background: rgb(255, 186, 96);
+  height: 2px;
+}
+
+.pdf .show .p-pdf span {
+  width: 100%;
+  text-align: center;
+  color: #fff;
+}
+
+.pdf .show .p-pdf span+span {
+  margin-top: 10px;
+}
+
+.pdfbox {
+  /* border: 3px solid #000; */
+  /* box-sizing: border-box; */
+  /* border-radius: 4px; */
+  /* overflow: hidden; */
+}
+
+.pdf .pdf_footer {
+  position: sticky;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  padding: 10px 0;
+  width: 100%;
+  height: 75px;
+  background-color: rgba(255, 255, 255, 0.5);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+
+.pdf .pdf_footer .info {
+  display: flex;
+  flex-wrap: wrap;
+  width: 100%;
+  justify-content: center;
+}
+
+.pdf .p-pdf .viewerContainer {
+  width: 100%;
+}
+
+/* .pdf .pdf_footer .info div {
+  width: 30%;
+} */
+.pdf .pdf_footer .operate {
+  margin: 10px 0 0;
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: center;
+  width: 100%;
+}
+
+.pdf .pdf_footer .operate div {
+  text-align: center;
+  font-size: 15px;
+}
+
+.pdf .pdf_footer .operate .btn {
+  cursor: pointer;
+  margin: 5px 10px;
+  width: 100px;
+  border-radius: 10px;
+  padding: 5px;
+  color: #fff;
+  background-color: #066ebe;
+}
+
+.pdf::-webkit-scrollbar {
+  /*滚动条整体样式*/
+  width: 6px;
+  /*高宽分别对应横竖滚动条的尺寸*/
+  height: 6px;
+}
+
+/*定义滚动条轨道 内阴影+圆角*/
+.pdf::-webkit-scrollbar {
+  border-radius: 10px;
+  background-color: #b8bdc9;
+}
+
+/*定义滑块 内阴影+圆角*/
+.pdf::-webkit-scrollbar-thumb {
+  border-radius: 10px;
+  -webkit-box-shadow: inset 0 0 6px rgb(96, 125, 184);
+  background-color: #2c5ab3;
+}
+</style>

+ 330 - 0
src/components/pages/classroomObservation/components/wangEnduit.vue

@@ -0,0 +1,330 @@
+<template lang="html">
+  <div class="editor cont">
+    <div ref="toolbar" class="toolbar">
+    </div>
+    <div ref="editor" class="text">
+    </div>
+		<slot></slot>
+    <div v-if="proVisible" class="mask">
+      <div class="progressBox">
+        <div class="lbox">
+          <img src="../../../../assets/loading.gif" />上传中,请稍后
+        </div>
+      </div>
+    </div>
+  </div>
+</template>  
+  
+<script>
+import E from "wangeditor";
+import "../../../../common/aws-sdk-2.235.1.min";
+import { Loading } from 'element-ui';
+// import 'wangeditor/release/wangEditor.min.css'
+export default {
+  name: "editoritem",
+  data() {
+    return {
+      // uploadPath,
+      editor: null,
+      info_: null,
+      proVisible:false,
+      progress:0
+    };
+  },
+  model: {
+    prop: "value",
+    event: "change",
+  },
+  props: {
+    value: {
+      type: String,
+      default: "",
+    },
+    isClear: {
+      type: Boolean,
+      default: false,
+    },
+    placeholder: {
+      type: String,
+      default: "请输入正文"
+    },
+		showGetTextLoading:{
+			type:Boolean,
+			default:false,
+		}
+  },
+  watch: {
+    isClear(val) {
+      // 触发清除文本域内容
+      if (val) {
+        this.editor.txt.clear();
+        this.info_ = null;
+      }
+    },
+    value: function (value) {
+      if (value !== this.editor.txt.html()) {
+        this.editor.txt.html(this.value);
+      }
+    },
+    //value为编辑框输入的内容,这里我监听了一下值,当父组件调用得时候,如果给value赋值了,子组件将会显示父组件赋给的值
+  },
+  mounted() {
+    this.seteditor();
+    this.editor.txt.html(this.value);
+  },
+  methods: {
+    seteditor() {
+      this.editor = new E(this.$refs.toolbar, this.$refs.editor);
+      // 关闭菜单栏fixed
+      this.editor.config.menuFixed = false;
+      // 普通的自定义菜单
+      this.editor.config.menus = [
+        "head", //标题
+        "bold", //加粗
+        "fontSize", //字体大小
+        // "fontName", //字体
+        // "italic", //斜体
+        // "underline", //下划线
+        // "strikeThrough", //删除线
+        "indent", //缩进
+        // "lineHeight", //行高
+        // "foreColor",
+        // "backColor",
+        // "link",
+        // "list",
+        // "todo",
+        "justify",
+        // "quote",
+        // "emoticon",
+        "image",
+        // "video",
+        "table",
+        // "code",
+        // "splitLine",
+        "undo",
+        "redo",
+      ];
+      // 带格式粘贴
+      this.editor.config.pasteFilterStyle = false;
+      //忽略粘贴内容中的图片
+      this.editor.config.pasteIgnoreImg = false;
+      this.editor.config.showLinkImg = false;
+      this.editor.config.placeholder = this.placeholder;
+      var that = this;
+      this.editor.config.customUploadImg = function (files, insert) {
+        // const loading = Loading.service({
+        //   lock: true,
+        //   background: 'rgba(0, 0, 0, 0.7)'
+        // });
+        // 图片自定义上传方法
+        var kk = 0
+        for (var i = 0; i < files.length; i++) {
+          var file = files[i];
+          var credentials = {
+            accessKeyId: "AKIATLPEDU37QV5CHLMH",
+            secretAccessKey: "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",
+          }; //秘钥形式的登录上传
+          window.AWS.config.update(credentials);
+          window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+          var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+          that.proVisible = true
+          if (file) {
+            var params = {
+              Key:
+                file.name.split(".")[0] +
+                new Date().getTime() +
+                "." +
+                file.name.split(".")[file.name.split(".").length - 1],
+              ContentType: file.type,
+              Body: file,
+              "Access-Control-Allow-Credentials": "*",
+              ACL: "public-read",
+            }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+            var options = {
+              partSize: 2048 * 1024 * 1024,
+              queueSize: 2,
+              leavePartsOnError: true,
+            };
+            bucket
+              .upload(params, options)
+              .on("httpUploadProgress", function (evt) {
+                //这里可以写进度条
+                // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+              })
+              .send(function (err, data) {
+                kk++
+                if(kk == files.length - 1 || kk > files.length - 1){
+                  that.proVisible = false
+                }
+                // loading.close();
+                if (err) {
+                  that.$message.error("上传失败");
+                } else {
+                  //上传成功处理
+                  insert(data.Location);
+                }
+              });
+          }
+        }
+      };
+      //配置 自定义处理粘贴的文本内容
+      this.editor.config.pasteTextHandle = function (content) {
+        if (content == '' && !content) return ''
+        var str = content
+        str = str.replace(/<xml>[\s\S]*?<\/xml>/ig, '')
+        str = str.replace(/<style>[\s\S]*?<\/style>/ig, '')
+        str = str.replace(/<\/?[^>]*>/g, '')
+        str = str.replace(/[ | ]*\n/g, '\n')
+        str = str.replace(/&nbsp;/ig, '')
+        // console.log('****', content)
+        // console.log('****', str)
+        return str
+      };
+      this.editor.config.onchange = (html) => {
+        this.info_ = html; // 绑定当前逐渐地值
+        this.$emit("change", this.info_); // 将内容同步到父组件中
+      };
+      // 创建富文本编辑器
+      this.editor.create();
+    },
+  },
+};
+</script>  
+  
+<style lang="css" scoped>
+.editor {
+   width: 100%;
+   margin: 10px auto;
+   position: relative;
+   z-index: 0;
+ }
+
+ .toolbar {
+   border: 1px solid #ccc;
+ }
+
+ .text {
+   border: 1px solid #ccc;
+   height: 230px;
+   overflow: auto;
+ }
+
+
+ /* table 样式 */
+ .cont>>>table {
+  border-top: 1px solid #ccc;
+  border-left: 1px solid #ccc;
+}
+
+.cont>>>table td,
+.cont>>>table th {
+  border-bottom: 1px solid #ccc;
+  border-right: 1px solid #ccc;
+  /* padding: 20px 5px; */
+  padding: 5px 10px;
+  max-width: 0px;
+  height: 30px;
+  vertical-align: baseline;
+}
+
+.cont>>>table th {
+  border-bottom: 2px solid #ccc;
+  text-align: center;
+}
+
+ /* blockquote 样式 */
+ .cont>>>blockquote {
+   display: block;
+   border-left: 8px solid #d0e5f2;
+   padding: 5px 10px;
+   margin: 10px 0;
+   line-height: 1.4;
+   font-size: 100%;
+   background-color: #f1f1f1;
+ }
+
+ /* code 样式 */
+ .cont>>>code {
+   display: inline-block;
+   *display: inline;
+   *zoom: 1;
+   background-color: #f1f1f1;
+   border-radius: 3px;
+   padding: 3px 5px;
+   margin: 0 3px;
+ }
+
+ .cont>>>pre code {
+   display: block;
+ }
+
+ /* ul ol 样式 */
+ .cont>>>ul,
+ ol {
+   margin: 0 !important;
+ }
+
+ /* .cont>>>.w-e-droplist{
+  width: 80px !important;
+ } */
+
+ .mask {
+  background-color: rgb(0 0 0 / 30%);
+  /* position: fixed; */
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 99999;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.mask2 {
+  position: fixed !important;
+  z-index: 999999;
+}
+
+.progressBox {
+  width: 300px;
+  height: 150px;
+  background: #fff;
+  border-radius: 10px;
+  box-shadow: 0 0 6px 1px #bfbfbf;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  flex-direction: column;
+}
+
+.progressBox .lbox {
+  height: 100px;
+  font-size: 16px;
+  display: flex;
+  align-items: center;
+}
+
+.progressBox .lbox img {
+  width: 40px;
+  margin-right: 20px;
+}
+
+.progressBox>>>.el-progress-bar__outer {
+  background-color: #d1dfff !important;
+}
+
+.progressBox .lbox {
+  height: 100px;
+  font-size: 19px;
+  display: flex;
+  align-items: center;
+}
+
+.progressBox .lbox img {
+  width: 40px;
+  margin-right: 20px;
+}
+</style>  

+ 500 - 290
src/components/pages/classroomObservation/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <div class="classroomObservation" v-loading="loading">
-    <!-- <div class="co-header1">
+	<div class="classroomObservation" v-loading="loading">
+		<!-- <div class="co-header1">
 			<div class="co-h1-left">
 				<span class="co-h1-l-icon el-icon-s-home"></span>
 				<div class="co-h1-l-router">
@@ -10,80 +10,111 @@
 				 </div>
 			</div>
 		</div> -->
-    <div class="co-header2">
-      <div class="co-h2-left">
-        <span class="co-h2-l-icon" @click="$refs.addNewCourseDialogRef.open()"></span>
-        <span class="co-h2-l-hr"></span>
-        <span class="co-h2-l-text">
-          <el-select
-            class="co_h2_l_t_select"
-            v-model="tid"
-            placeholder="请选择"
-            @change="changeTid"
-          >
-            <el-option
-              v-for="item in optionData"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </span>
-      </div>
-      <div class="co-h2-right">
-        <div
-          class="co-h2-r-btn co-h2-r-blueBtn"
-          style="background: rgba(54, 129, 252, 1)"
-          @click.stop="getReport()"
-        >
-          <span class="co-h2-r-b-icon1"></span>
-          <div>生成报告</div>
-        </div>
-        <div class="co-h2-r-btn2" @click.stop="preview()">
-          <!-- <span class="co-h2-r-b-icon2"></span> -->
-          <img
-            src="../../../assets/icon/classroomObservation/Syan.png"
-            alt=""
-          />
-          <!-- <div>预览</div> -->
-        </div>
-        <div class="co-h2-r-btn2" @click.stop="shareBtn">
-          <!-- <span class="co-h2-r-b-icon3"></span> -->
-          <img
-            src="../../../assets/icon/classroomObservation/daoChu.png"
-            alt=""
-          />
-          <!-- <div>分享</div> -->
-        </div>
-      </div>
-    </div>
-    <div class="co-main">
-      <div class="co-m-left">
-        <chatArea
-          :tid="tid"
-          @updateFileId="updateFileId"
-          :fileIdid="fileIdid"
-        />
-      </div>
-      <div class="co-m-right">
-        <messageArea
-          :tid="tid"
-          :fileId="fileId"
-          ref="messageAreaRef"
-          @updateFileId="updateFileId"
-          @updateFileIdid="updateFileIdid"
-        />
-      </div>
-    </div>
-    <sharePdf
-      :dialogVisibleShare="dialogVisibleShare"
-      @shareBtn="shareBtn"
-    ></sharePdf>
-      
-
-		<addNewCourseDialog ref="addNewCourseDialogRef" @success="addNewCourse"/>
-  </div>
+		<div class="co-header2">
+			<div class="co-h2-left">
+				<span
+					class="co-h2-l-icon"
+					@click="$refs.addNewCourseDialogRef.open()"
+				></span>
+				<span class="co-h2-l-hr"></span>
+				<span class="co-h2-l-text">
+					<el-select
+						class="co_h2_l_t_select"
+						v-model="tid"
+						placeholder="请选择"
+						@change="changeTid"
+					>
+						<el-option
+							v-for="item in optionData"
+							:key="item.value"
+							:label="item.label"
+							:value="item.value"
+						>
+						<div class="selectBox">
+							<span style="float: left">{{ item.label }}</span>
+							<span
+								class="delSelect"
+								@click.stop="delCourse(item.value)"
+								style="float: right"
+							></span>
+						</div>
+							
+						</el-option>
+					</el-select>
+				</span>
+				<!-- <div
+					class="co_h2_l_del"
+					@click.stop="delCourse()"
+					v-if="optionData.length > 0"
+				>
+					<span></span>
+				</div> -->
+			</div>
+			<div class="co-h2-right">
+				<div
+					class="co-h2-r-btn co-h2-r-blueBtn"
+					style="background: rgba(54, 129, 252, 1)"
+					@click.stop="getReport()"
+				>
+					<span class="co-h2-r-b-icon1"></span>
+					<div>生成报告</div>
+				</div>
+				<div class="co-h2-r-btn2" @click.stop="preview()">
+					<!-- <span class="co-h2-r-b-icon2"></span> -->
+					<el-tooltip class="item" effect="light" content="预览" placement="top">
+						<img
+						src="../../../assets/icon/classroomObservation/Syan.png"
+						alt=""
+					/>
+    			</el-tooltip>
+					
+					<!-- <div>预览</div> -->
+				</div>
+				<div class="co-h2-r-btn2" @click.stop="shareBtn">
+					<!-- <span class="co-h2-r-b-icon3"></span> -->
+					<el-tooltip class="item" effect="light" content="分享" placement="top">
+						<img
+						src="../../../assets/icon/classroomObservation/daoChu.png"
+						alt=""
+					/>
+    </el-tooltip>
+					
+					<!-- <div>分享</div> -->
+				</div>
+			</div>
+		</div>
+		<div class="co-main">
+			<div class="co-m-left">
+				<chatArea
+					ref="chatAreaRef"
+					:tid="tid"
+					@updateFileId="updateFileId"
+					@changeAudioUrl="changeAudioUrl"
+					@updateTranscription="updateTranscription"
+					:fileId="fileId"
+					:fileIdId="fileIdId"
+				/>
+			</div>
+			<div class="co-m-right">
+				<messageArea
+					:tid="tid"
+					:fileId="fileId"
+					ref="messageAreaRef"
+					@changeAudioUrl="changeAudioUrl"
+					@changeChatAreaAudioUrl="changeChatAreaAudioUrl"
+					@changeTranscription="changeTranscription"
+					@changeOptionData="changeOptionData"
+				/>
+			</div>
+		</div>
+		<sharePdf
+			:dialogVisibleShare="dialogVisibleShare"
+			:tid="tid"
+			@shareBtn="shareBtn"
+		></sharePdf>
+
+		<addNewCourseDialog :courseList="optionData" ref="addNewCourseDialogRef" @success="addNewCourse" />
+	</div>
 </template>
 
 <script>
@@ -92,117 +123,251 @@ import chatArea from "./components/chatArea.vue";
 // 信息区域
 import messageArea from "./components/messageArea.vue";
 
-import sharePdf from './components/sharePdf.vue'
+import sharePdf from "./components/sharePdf.vue";
 // 添加课程弹窗
 import addNewCourseDialog from "./components/addNewCourseDialog.vue";
 export default {
-  components: {
-    chatArea,
-    messageArea,
-    sharePdf,
-		addNewCourseDialog
-  },
-  data() {
-    return {
-      title: "12月19日会议录音",
-      loading: false,
-      dialogVisibleShare: false,
-      tid: "03",
-      fileId: "",
-      fileIdid: "",
-      optionData: [
-        { label: "03课程", value: "03" },
-        { label: "04课程", value: "04" }
-      ]
-    };
-  },
-  methods: {
-    //切换了课堂
-    changeTid(newValue) {
-      // console.log(this.tid)
-      // console.log(newValue)
-      this.$nextTick(() => {
-        this.$refs.messageAreaRef.getData();
-      });
-		},
-		addNewCourse(form){
-			console.log("👇")
-			console.log(form)
-			this.optionData.push({
-				label:form.name,
-				value:form.no,
-			})
-			this.tid = form.no;
-			this.$nextTick(()=>{
+	components: {
+		chatArea,
+		messageArea,
+		sharePdf,
+		addNewCourseDialog,
+	},
+	data() {
+		return {
+			title: "12月19日会议录音",
+			loading: false,
+			dialogVisibleShare: false,
+			tid: "",
+			fileId: "",
+			fileIdId: "",
+			optionData: [],
+		};
+	},
+	methods: {
+		//切换了课堂
+		changeTid(newValue) {
+			this.$nextTick(() => {
 				this.$refs.messageAreaRef.getData();
+				this.$refs.chatAreaRef.getData();
+				this.getFileIdId();
+			});
+		},
+		addNewCourse(form) {
+			if(this.loading)return this.$message.info("请稍等")
+			this.loading = true;
+			let params = {
+				tid: form.no,
+				name:form.name
+			};
+			this.ajax
+				.post(
+					"https://gpt4.cocorobo.cn/insert_classroom_observation_tid",
+					params
+				)
+				.then((res) => {
+					let _data = res.data.FunctionResponse;
+					if (_data.message == "创建成功") {
+						this.tid = form.no;
+						// 设置该课程的tid
+						this.ajax
+							.post("https://gpt4.cocorobo.cn/insert_classroom_observation", {
+								tid: this.tid,
+								type: 10,
+								index: 0,
+								json_data: JSON.stringify({ file_ids: "" }),
+							})
+							.then((res2) => {
+								let _data2 = res2.data.FunctionResponse;
+								if (_data2.message == "创建成功") {
+									this.loading = false;
+									this.$nextTick(() => {
+										this.getCourseList().then((_) => {
+											this.getFileIdId();
+											this.$refs.messageAreaRef.getData();
+											this.$refs.chatAreaRef.getData();
+										});
+									});
+								} else {
+									this.$message.error("创建fileIds失败");
+								}
+							});
+					} else if (_data.message == "tid重复") {
+						this.$message.error("该课程已存在");
+						this.loading = false;
+					} else {
+						this.$message.error("创建失败");
+						this.loading = false;
+					}
+				});
+		},
+		updateFileId(newValue) {
+			this.fileId = newValue;
+		},
+		// 生成报告
+		getReport() {
+			this.$refs.messageAreaRef.getReport();
+			// let assistant_title = [
+			// 	"课堂观察",
+			// 	"教学阶段九事件分析",
+			// 	"OMO智慧课堂分析",
+			// 	"布鲁姆问题分类",
+			// 	"麦克锡问题分类",
+			// 	"学生回答统计",
+			// 	"课堂活动类型",
+			// 	"素养目标分析",
+			// 	"科学教育目标分析",
+			// 	"5E课程改编",
+			// 	"5EX课程改编",
+			// 	"UTOP课程观察",
+			// 	"RST模型",
+			// 	"RTOP模型",
+			// 	"课堂质量评价",
+			// 	"scop课堂观察",
+			// 	"rtop课堂观察",
+			// ]
+			// let _index = 0;
+			// let _this = this;
+			// function addValue(){
+			// 	_this.$refs.messageAreaRef.addAnalysisItem({title:assistant_title[_index]}).then(_=>{
+			// 		_index+=1;
+			// 		if(_index<assistant_title.length){
+			// 				addValue()
+			// 		}
+			// 	}).catch(_=>{
+			// 		_index+=1;
+			// 		if(_index<assistant_title.length){
+			// 			addValue()
+			// 		}
+			// 	})
+			// }
+			// addValue()
+		},
+		//预览
+		preview() {
+			window.parent.postMessage(
+				{
+					tools: "classroom_observation_board",
+					type: this.tid,
+				},
+				"*"
+			);
+		},
+		// 分享
+		shareBtn() {
+			this.dialogVisibleShare = !this.dialogVisibleShare;
+		},
+		delCourse(_value = this.tid) {
+			this.$confirm("此操作将永久删除该课程, 是否继续?", "提示", {
+				confirmButtonText: "确定",
+				cancelButtonText: "取消",
+				type: "warning",
 			})
-
-    },
-    updateFileId(newValue) {
-      this.fileId = newValue;
-    },
-    updateFileIdid(newValue) {
-      this.fileIdid = newValue;
-    },
-    // 跳转
-    goTo(path) {
-      this.$message.info(`去到:${path}`);
-    },
-    // 生成报告
-    getReport() {
-      this.$refs.messageAreaRef.getReport();
-      // let assistant_title = [
-      // 	"课堂观察",
-      // 	"教学阶段九事件分析",
-      // 	"OMO智慧课堂分析",
-      // 	"布鲁姆问题分类",
-      // 	"麦克锡问题分类",
-      // 	"学生回答统计",
-      // 	"课堂活动类型",
-      // 	"素养目标分析",
-      // 	"科学教育目标分析",
-      // 	"5E课程改编",
-      // 	"5EX课程改编",
-      // 	"UTOP课程观察",
-      // 	"RST模型",
-      // 	"RTOP模型",
-      // 	"课堂质量评价",
-      // 	"scop课堂观察",
-      // 	"rtop课堂观察",
-      // ]
-      // let _index = 0;
-      // let _this = this;
-      // function addValue(){
-      // 	_this.$refs.messageAreaRef.addAnalysisItem({title:assistant_title[_index]}).then(_=>{
-      // 		_index+=1;
-      // 		if(_index<assistant_title.length){
-      // 				addValue()
-      // 		}
-      // 	}).catch(_=>{
-      // 		_index+=1;
-      // 		if(_index<assistant_title.length){
-      // 			addValue()
-      // 		}
-      // 	})
-      // }
-      // addValue()
-    },
-    //预览
-    preview() {
-      window.parent.postMessage(
-        {
-          tools: "classroom_observation_board",
-          type: this.tid
-        },
-        "*"
-      );
-    },
-    // 分享
-    shareBtn() {
-      
-      this.dialogVisibleShare = !this.dialogVisibleShare;
-    }
-  }
+				.then(() => {
+					this.optionData.splice(
+						this.optionData.findIndex((item) => item.value == _value),
+						1
+					);
+					this.tid = this.optionData[0] ? this.optionData[0].value : "";
+					this.changeTid(this.tid);
+					this.$message({
+						type: "success",
+						message: "删除成功!",
+					});
+				})
+				.catch(() => {});
+		},
+		// 获取修改fileId的ID
+		getFileIdId() {
+			if (!this.tid) return;
+			let pram = {
+				tid: this.tid,
+				type: "10",
+			};
+			this.fileIdId = "";
+			this.fileId = "";
+			this.ajax
+				.post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
+				.then((res) => {
+					console.log(res);
+					let _data = res.data.FunctionResponse.result.length
+						? JSON.parse(res.data.FunctionResponse.result)
+						: [];
+					if (_data.length <= 0) return;
+					this.fileIdId = _data[0].id;
+					if (_data[0].jsonData != "") {
+						this.fileId = JSON.parse(_data[0].jsonData).file_ids;
+					} else {
+						this.fileId = "";
+					}
+				});
+		},
+		// 切换录音文件
+		changeAudioUrl(data) {
+			this.$refs.messageAreaRef.changeAudioUrl(data);
+		},
+		changeChatAreaAudioUrl(data) {
+			this.$refs.chatAreaRef.changeAudioUrl(data.url);
+		},
+		getCourseList() {
+			this.loading = true;
+			return new Promise((resolve, reject) => {
+				this.ajax
+					.post("https://gpt4.cocorobo.cn/get_classroom_observation_all")
+					.then((res) => {
+						let _data = res.data.FunctionResponse.result;
+						let _result = _data ? JSON.parse(_data) : [];
+						if (_result.length <= 0) return;
+						let _optionData = _result.map((item) => {
+							item.jsonData = item.jsonData ? JSON.parse(item.jsonData) : {};
+							return {
+								label: item.jsonData.courseName
+									? item.jsonData.courseName
+									: `${item.tId}课程`,
+								value: item.tId,
+							};
+						});
+						_optionData = _optionData.filter(
+							(i) => i.label != "" && i.tId != ""
+						);
+						this.optionData = _optionData;
+						if (this.optionData.length > 0) {
+							if (!this.tid) this.tid = this.optionData[0].value;
+						}
+						this.loading = false;
+						resolve();
+					});
+			});
+		},
+		updateTranscription({ transcriptionData, editorBarData }) {
+			this.$refs.messageAreaRef.updateMessageTranscription({
+				transcriptionData,
+				editorBarData,
+			});
+		},
+		changeTranscription({ transcriptionData, editorBarData }) {
+			this.$refs.chatAreaRef.changeEditorBar({
+				transcriptionData,
+				editorBarData,
+			});
+		},
+		changeOptionData(_tid,_newObj){
+			let _index = this.optionData.findIndex(i=>i.value==_tid);
+			if(_index!=-1){
+				this.optionData[_index] = {...this.optionData[_index],..._newObj}
+				this.$forceUpdate();
+			};
+			console.log(this.optionData)
+		},
+	},
+	mounted() {
+		this.getCourseList().then((_) => {
+			if(!this.tid)return;
+			this.getFileIdId();
+			this.$refs.messageAreaRef.getData();
+			this.$refs.chatAreaRef.getData();
+		});
+	},
 };
 </script>
 
@@ -217,147 +382,147 @@ export default {
 }
 
 .co-header1 {
-  width: 100%;
-  height: 46px;
-  background-color: #060e17;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  box-sizing: border-box;
-  padding: 0 20px;
+	width: 100%;
+	height: 46px;
+	background-color: #060e17;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	box-sizing: border-box;
+	padding: 0 20px;
 }
 
 .co-h1-left {
-  width: auto;
-  height: 22px;
-  display: flex;
-  align-items: center;
-  box-sizing: border-box;
-  padding: 0 20px;
+	width: auto;
+	height: 22px;
+	display: flex;
+	align-items: center;
+	box-sizing: border-box;
+	padding: 0 20px;
 }
 
 .co-h1-l-icon {
-  color: #5d6268;
-  width: 16px;
-  height: 16px;
-  margin-right: 10px;
+	color: #5d6268;
+	width: 16px;
+	height: 16px;
+	margin-right: 10px;
 }
 
 .co-h1-l-router {
-  display: flex;
-  align-items: center;
-  color: white;
-  font-size: 14px;
+	display: flex;
+	align-items: center;
+	color: white;
+	font-size: 14px;
 }
 
 .co-h1-l-router > span {
-  margin: 0 5px;
+	margin: 0 5px;
 }
 
 .co-h1-l-r-up {
-  color: #5d6268;
-  cursor: pointer;
+	color: #5d6268;
+	cursor: pointer;
 }
 
 .co-h1-l-r-up:hover {
-  color: white;
+	color: white;
 }
 
 .co-j1-l-r-down {
-  cursor: pointer;
+	cursor: pointer;
 }
 
 .co-h1-l-r-rightIcon {
-  font-size: 16px;
-  color: #5d6268;
+	font-size: 16px;
+	color: #5d6268;
 }
 
 .co-header2 {
-  width: 100%;
-  height: 42px;
-  min-height: 42px;
-  max-height: 42px;
-  background-color: white;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  box-sizing: border-box;
-  padding: 0 20px;
+	width: 100%;
+	height: 42px;
+	min-height: 42px;
+	max-height: 42px;
+	background-color: white;
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	box-sizing: border-box;
+	padding: 0 20px;
 }
 
 .co-h2-left {
-  width: auto;
-  height: 22px;
-  display: flex;
-  align-items: center;
-  font-size: 14px;
+	width: auto;
+	height: 22px;
+	display: flex;
+	align-items: center;
+	font-size: 14px;
 }
 
 .co-h2-l-icon {
-  width: 20px;
-  height: 20px;
-  position: relative;
-  background: url("../../../assets/icon/classroomObservation/close.png")
-    no-repeat;
+	width: 20px;
+	height: 20px;
+	position: relative;
+	background: url("../../../assets/icon/classroomObservation/close.png")
+		no-repeat;
 	transform: rotate(45deg);
 	cursor: pointer;
-		background-size: 100% 100%;
+	background-size: 100% 100%;
 }
 .co-h2-l-hr {
-  width: 2px;
-  height: 20px;
-  background-color: #e7e7e7;
-  border-radius: 10px;
-  margin: 0 10px;
+	width: 2px;
+	height: 20px;
+	background-color: #e7e7e7;
+	border-radius: 10px;
+	margin: 0 10px;
 }
 
 .co-h2-right {
-  width: auto;
-  height: 100%;
-  display: flex;
-  align-items: center;
+	width: auto;
+	height: 100%;
+	display: flex;
+	align-items: center;
 }
 
 .co-h2-r-btn {
-  width: auto;
-  box-sizing: border-box;
-  padding: 0 10px;
-  height: 30px;
-  display: flex;
-  align-items: center;
-  cursor: pointer;
-  font-size: 14px;
-  margin: 0 10px;
-  box-sizing: border-box;
-  border: 1px solid rgba(134, 179, 253, 1);
-  /* border: solid 1px #3681FC; */
-  border-radius: 5px;
+	width: auto;
+	box-sizing: border-box;
+	padding: 0 10px;
+	height: 30px;
+	display: flex;
+	align-items: center;
+	cursor: pointer;
+	font-size: 14px;
+	margin: 0 10px;
+	box-sizing: border-box;
+	border: 1px solid rgba(134, 179, 253, 1);
+	/* border: solid 1px #3681FC; */
+	border-radius: 5px;
 }
 .co-h2-r-btn2 {
-  width: auto;
-  box-sizing: border-box;
-  padding: 10px;
-  height: 30px;
-  display: flex;
-  align-items: center;
-  cursor: pointer;
-  margin: 0 10px;
-  box-sizing: border-box;
-  border-radius: 5px;
-  box-shadow: 0px 4px 10px 0px rgba(29, 57, 131, 0.08);
-
-  /* box-shadow: 1px 1px 20px 4px rgba(29, 57, 131, 0.05); */
+	width: auto;
+	box-sizing: border-box;
+	padding: 10px;
+	height: 30px;
+	display: flex;
+	align-items: center;
+	cursor: pointer;
+	margin: 0 10px;
+	box-sizing: border-box;
+	border-radius: 5px;
+	box-shadow: 0px 4px 10px 0px rgba(29, 57, 131, 0.08);
+
+	/* box-shadow: 1px 1px 20px 4px rgba(29, 57, 131, 0.05); */
 }
 
 .co-h2-r-btn > span:nth-child(1) {
-  width: 20px;
-  height: 20px;
-  margin-right: 8px;
+	width: 20px;
+	height: 20px;
+	margin-right: 8px;
 }
 
 .co-h2-r-b-icon1 {
-  background: url("../../../assets/icon/classroomObservation/six.png") no-repeat;
-  background-size: 100% 100%;
+	background: url("../../../assets/icon/classroomObservation/six.png") no-repeat;
+	background-size: 100% 100%;
 }
 
 /* .co-h2-r-b-icon2 {
@@ -372,39 +537,84 @@ export default {
 } */
 
 .co-h2-r-blueBtn {
-  background: rgba(134, 179, 253, 1);
+	background: rgba(134, 179, 253, 1);
 
-  color: white;
+	color: white;
 }
 
 .co-main {
-  width: 100%;
-  flex: 1;
-  display: flex;
+	width: 100%;
+	flex: 1;
+	display: flex;
 
-  /* align-items: center; */
-  /* justify-content: center; */
+	/* align-items: center; */
+	/* justify-content: center; */
 }
 
 .co-m-left {
-  box-sizing: border-box;
-  flex: 1;
-  min-width: 650px;
+	box-sizing: border-box;
+	flex: 1;
+	min-width: 650px;
 }
 
 .co-m-right {
-  height: 100%;
-  flex: 1;
-  box-sizing: border-box;
-  min-width: 450px;
+	height: 100%;
+	flex: 1;
+	box-sizing: border-box;
+	min-width: 450px;
 
-  overflow: auto;
+	overflow: auto;
 }
 
 .co_h2_l_t_select >>> .el-input__inner {
-  border: none;
+	border: none;
 }
-.co_h2_l_t_select >>> .el-input__suffix {
-  display: none;
+/* .co_h2_l_t_select >>> .el-input__suffix {
+	display: none;
+} */
+
+.co_h2_l_del {
+	width: 35px;
+	height: 35px;
+	margin-left: 10px;
+	border-radius: 5px;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	cursor: pointer;
+}
+
+.co_h2_l_del > span {
+	width: 20px;
+	height: 20px;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	background: url("../../../assets/icon/classroomObservation/del.png") no-repeat;
+	background-size: 100% 100%;
+}
+
+.co_h2_l_del:hover {
+	background-color: #eaeef1;
+}
+
+.selectBox{
+	width: 100%;
+	height: 100%;
+}
+.selectBox:hover .delSelect{
+	display: flex;
+}
+
+.delSelect {
+	width: 16px;
+	height: 16px;
+	display: none;
+	align-items: center;
+	justify-content: center;
+	background: url("../../../assets/icon/classroomObservation/del.png") no-repeat;
+	background-size: 100% 100%;
+	box-sizing: border-box;
+	transform: translateY(7px);
 }
 </style>

+ 1 - 1
src/components/pages/course.vue

@@ -32,7 +32,7 @@
               <!-- <div type="primary" @click="goToCourse2()">任务式课程</div> -->
               <!-- <div type="primary" @click="goToCourse()">阶段式课程</div> -->
               <div type="primary" @click="goToCourse4()">阶段式课程</div>
-              <!-- <div type="primary" @click="goToCourse5()">AI模式</div> -->
+              <div type="primary" @click="goToCourse5()" v-show="org == '1973f6c7-1561-11ee-91d8-005056b86db5'">AI模式</div>
             </div>
           </button>
         </div>

+ 2 - 2
src/components/pages/data.vue

@@ -36,7 +36,7 @@
         </div>
         <div class="data_nav">
           <span @click="type = 1" :class="{ active: type == 1 }">我的资料</span>
-          <span @click="type = 2" :class="{ active: type == 2 }">修改密码</span>
+          <span @click="type = 2" v-if="ruleForm.type !== '学生'" :class="{ active: type == 2 }">修改密码</span>
         </div>
         <el-form
           v-if="type == 1"
@@ -152,7 +152,7 @@
             ></el-input>
           </el-form-item> -->
           <el-form-item>
-            <el-button type="primary" @click="submitForm('ruleForm')"
+            <el-button type="primary"  v-if="ruleForm.type !== '学生'" @click="submitForm('ruleForm')"
               >保存</el-button
             >
           </el-form-item>

+ 0 - 2
src/components/pages/sz/teacher.vue

@@ -157,7 +157,6 @@
       :append-to-body="true"
       width="700px"
       :before-close="handleClose"
-      :close-on-click-modal="true"
       class="add_student"
     >
       <el-form class="inputClass">
@@ -227,7 +226,6 @@
       :append-to-body="true"
       width="700px"
       :before-close="handleClose"
-      :close-on-click-modal="true"
       class="add_student"
     >
       <!-- <div slot="title" class="header-title">

+ 2 - 2
src/components/pages/tencent/data.vue

@@ -33,7 +33,7 @@
         </div>
         <div class="data_nav">
           <span @click="type = 1" :class="{ active: type == 1 }">我的资料</span>
-          <span @click="type = 2" :class="{ active: type == 2 }">修改密码</span>
+          <span @click="type = 2"  v-if="ruleForm.type !== '学生'" :class="{ active: type == 2 }">修改密码</span>
         </div>
         <el-form
           v-if="type == 1"
@@ -119,7 +119,7 @@
             </el-select>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" @click="submitForm('ruleForm')"
+            <el-button type="primary"  v-if="ruleForm.type !== '学生'" @click="submitForm('ruleForm')"
               >修改</el-button
             >
           </el-form-item>

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