|
@@ -48,7 +48,12 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</span>
|
|
|
- <el-tooltip class="item" effect="light" content="添加课堂" placement="top">
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="light"
|
|
|
+ content="添加课堂"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
<span class="co_h2_add" @click="addNewCourse()">
|
|
|
<svg
|
|
|
t="1730428938505"
|
|
@@ -266,13 +271,23 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ fileIdId(newValue){
|
|
|
+ let needUpdateFileId = window.localStorage.getItem("needUpdateFileId")?window.localStorage.getItem("needUpdateFileId"):null;
|
|
|
+ if(needUpdateFileId && newValue){
|
|
|
+ console.log("查询到needUpdateFileId,更新fileId👉",needUpdateFileId)
|
|
|
+ this.updateFileId(needUpdateFileId);
|
|
|
+ window.localStorage.removeItem("needUpdateFileId");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
//切换了课堂
|
|
|
changeTid(newValue) {
|
|
|
- this.$nextTick(() => {
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ this.getFileIdId();
|
|
|
this.$refs.messageAreaRef.getData();
|
|
|
this.$refs.chatAreaRef.getData();
|
|
|
- this.getFileIdId();
|
|
|
|
|
|
// setTimeout(()=>{
|
|
|
// this.$refs.messageAreaRef.init();
|
|
@@ -455,7 +470,7 @@ export default {
|
|
|
if (converter(_data2.message) == converter("创建成功")) {
|
|
|
this.loading = false;
|
|
|
this.$nextTick(() => {
|
|
|
- this.getCourseList().then(_ => {
|
|
|
+ this.getCourseList().then(async _ => {
|
|
|
this.getFileIdId();
|
|
|
this.$refs.messageAreaRef
|
|
|
.getData(tagList ? tagList.dialogTagList : [])
|
|
@@ -486,6 +501,22 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
updateFileId(newValue) {
|
|
|
+ if(!this.fileIdId){
|
|
|
+ console.log("未查询到fileIdId,先保存到localStorage👉",newValue)
|
|
|
+ return window.localStorage.setItem("needUpdateFileId",newValue);
|
|
|
+ }
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/update_classroom_observation", {
|
|
|
+ id: this.fileIdId,
|
|
|
+ json_data: JSON.stringify({ file_ids: newValue })
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log("保存fileId成功✌");
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ console.log("保存fileId失败");
|
|
|
+ });
|
|
|
this.fileId = newValue;
|
|
|
},
|
|
|
// 生成报告
|
|
@@ -1052,7 +1083,7 @@ export default {
|
|
|
this.tid = "";
|
|
|
this.fileIdId = "";
|
|
|
this.fileId = "";
|
|
|
- this.getCourseList().then(_ => {
|
|
|
+ this.getCourseList().then(async _ => {
|
|
|
if (!this.tid) {
|
|
|
this.$refs.messageAreaRef.init();
|
|
|
this.$refs.chatAreaRef.init();
|
|
@@ -1352,7 +1383,7 @@ export default {
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
cursor: pointer;
|
|
|
- margin-left: 20px;
|
|
|
+ margin-left: 20px;
|
|
|
}
|
|
|
|
|
|
.co_h2_add > svg {
|