|
@@ -30,16 +30,25 @@
|
|
:label="item.label"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
: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-option>
|
|
</el-select>
|
|
</el-select>
|
|
</span>
|
|
</span>
|
|
- <div
|
|
|
|
|
|
+ <!-- <div
|
|
class="co_h2_l_del"
|
|
class="co_h2_l_del"
|
|
@click.stop="delCourse()"
|
|
@click.stop="delCourse()"
|
|
v-if="optionData.length > 0"
|
|
v-if="optionData.length > 0"
|
|
>
|
|
>
|
|
<span></span>
|
|
<span></span>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
</div>
|
|
</div>
|
|
<div class="co-h2-right">
|
|
<div class="co-h2-right">
|
|
<div
|
|
<div
|
|
@@ -75,6 +84,7 @@
|
|
:tid="tid"
|
|
:tid="tid"
|
|
@updateFileId="updateFileId"
|
|
@updateFileId="updateFileId"
|
|
@changeAudioUrl="changeAudioUrl"
|
|
@changeAudioUrl="changeAudioUrl"
|
|
|
|
+ @updateTranscription="updateTranscription"
|
|
:fileId="fileId"
|
|
:fileId="fileId"
|
|
:fileIdId="fileIdId"
|
|
:fileIdId="fileIdId"
|
|
/>
|
|
/>
|
|
@@ -86,6 +96,8 @@
|
|
ref="messageAreaRef"
|
|
ref="messageAreaRef"
|
|
@changeAudioUrl="changeAudioUrl"
|
|
@changeAudioUrl="changeAudioUrl"
|
|
@changeChatAreaAudioUrl="changeChatAreaAudioUrl"
|
|
@changeChatAreaAudioUrl="changeChatAreaAudioUrl"
|
|
|
|
+ @changeTranscription="changeTranscription"
|
|
|
|
+ @changeOptionData="changeOptionData"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -130,12 +142,14 @@ export default {
|
|
changeTid(newValue) {
|
|
changeTid(newValue) {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.messageAreaRef.getData();
|
|
this.$refs.messageAreaRef.getData();
|
|
|
|
+ this.$refs.chatAreaRef.getData();
|
|
this.getFileIdId();
|
|
this.getFileIdId();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
addNewCourse(form) {
|
|
addNewCourse(form) {
|
|
let params = {
|
|
let params = {
|
|
tid: form.no,
|
|
tid: form.no,
|
|
|
|
+ type: "10",
|
|
};
|
|
};
|
|
this.ajax
|
|
this.ajax
|
|
.post(
|
|
.post(
|
|
@@ -143,17 +157,34 @@ export default {
|
|
params
|
|
params
|
|
)
|
|
)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
|
+ console.log(res);
|
|
let _data = res.data.FunctionResponse;
|
|
let _data = res.data.FunctionResponse;
|
|
if (_data.message == "创建成功") {
|
|
if (_data.message == "创建成功") {
|
|
- this.optionData.push({
|
|
|
|
- label: `${form.no}课程`,
|
|
|
|
- value: form.no,
|
|
|
|
- });
|
|
|
|
this.tid = form.no;
|
|
this.tid = form.no;
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs.messageAreaRef.getData();
|
|
|
|
- this.getFileIdId();
|
|
|
|
- });
|
|
|
|
|
|
+ // 设置该课程的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.$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("该课程已存在");
|
|
} else {
|
|
} else {
|
|
this.$message.error("创建失败");
|
|
this.$message.error("创建失败");
|
|
}
|
|
}
|
|
@@ -215,7 +246,7 @@ export default {
|
|
shareBtn() {
|
|
shareBtn() {
|
|
this.dialogVisibleShare = !this.dialogVisibleShare;
|
|
this.dialogVisibleShare = !this.dialogVisibleShare;
|
|
},
|
|
},
|
|
- delCourse() {
|
|
|
|
|
|
+ delCourse(_value = this.tid) {
|
|
this.$confirm("此操作将永久删除该课程, 是否继续?", "提示", {
|
|
this.$confirm("此操作将永久删除该课程, 是否继续?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
@@ -223,7 +254,7 @@ export default {
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
this.optionData.splice(
|
|
this.optionData.splice(
|
|
- this.optionData.findIndex((item) => item.value == this.tid),
|
|
|
|
|
|
+ this.optionData.findIndex((item) => item.value == _value),
|
|
1
|
|
1
|
|
);
|
|
);
|
|
this.tid = this.optionData[0] ? this.optionData[0].value : "";
|
|
this.tid = this.optionData[0] ? this.optionData[0].value : "";
|
|
@@ -247,6 +278,7 @@ export default {
|
|
this.ajax
|
|
this.ajax
|
|
.post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
|
|
.post("https://gpt4.cocorobo.cn/get_classroom_observation_new", pram)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
|
+ console.log(res);
|
|
let _data = res.data.FunctionResponse.result.length
|
|
let _data = res.data.FunctionResponse.result.length
|
|
? JSON.parse(res.data.FunctionResponse.result)
|
|
? JSON.parse(res.data.FunctionResponse.result)
|
|
: [];
|
|
: [];
|
|
@@ -277,7 +309,9 @@ export default {
|
|
let _optionData = _result.map((item) => {
|
|
let _optionData = _result.map((item) => {
|
|
item.jsonData = item.jsonData ? JSON.parse(item.jsonData) : {};
|
|
item.jsonData = item.jsonData ? JSON.parse(item.jsonData) : {};
|
|
return {
|
|
return {
|
|
- label: item.jsonData.courseName,
|
|
|
|
|
|
+ label: item.jsonData.courseName
|
|
|
|
+ ? item.jsonData.courseName
|
|
|
|
+ : `${item.tId}课程`,
|
|
value: item.tId,
|
|
value: item.tId,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
@@ -285,19 +319,40 @@ export default {
|
|
(i) => i.label != "" && i.tId != ""
|
|
(i) => i.label != "" && i.tId != ""
|
|
);
|
|
);
|
|
this.optionData = _optionData;
|
|
this.optionData = _optionData;
|
|
- if(this.optionData.length>0){
|
|
|
|
- this.tid = this.optionData[0].value;
|
|
|
|
|
|
+ if (this.optionData.length > 0) {
|
|
|
|
+ if (!this.tid) this.tid = this.optionData[0].value;
|
|
}
|
|
}
|
|
resolve();
|
|
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() {
|
|
mounted() {
|
|
this.getCourseList().then((_) => {
|
|
this.getCourseList().then((_) => {
|
|
|
|
+ if(!this.tid)return;
|
|
this.getFileIdId();
|
|
this.getFileIdId();
|
|
this.$refs.messageAreaRef.getData();
|
|
this.$refs.messageAreaRef.getData();
|
|
|
|
+ this.$refs.chatAreaRef.getData();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -501,9 +556,9 @@ export default {
|
|
.co_h2_l_t_select >>> .el-input__inner {
|
|
.co_h2_l_t_select >>> .el-input__inner {
|
|
border: none;
|
|
border: none;
|
|
}
|
|
}
|
|
-.co_h2_l_t_select >>> .el-input__suffix {
|
|
|
|
|
|
+/* .co_h2_l_t_select >>> .el-input__suffix {
|
|
display: none;
|
|
display: none;
|
|
-}
|
|
|
|
|
|
+} */
|
|
|
|
|
|
.co_h2_l_del {
|
|
.co_h2_l_del {
|
|
width: 35px;
|
|
width: 35px;
|
|
@@ -529,4 +584,24 @@ export default {
|
|
.co_h2_l_del:hover {
|
|
.co_h2_l_del:hover {
|
|
background-color: #eaeef1;
|
|
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>
|
|
</style>
|