|
@@ -787,10 +787,10 @@
|
|
|
<div class="whiteBg" style="border-radius: 0; margin-top: 15px">
|
|
|
<div class="c_info_title">
|
|
|
教案
|
|
|
- <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom" v-if="istemplate == 1">
|
|
|
+ <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom" v-if="istemplate == 1 && dArray.length">
|
|
|
<button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;"
|
|
|
@contextmenu.prevent="openAiDialog(1, 'aiTeacher2')"
|
|
|
- @click="openAiDialog(2, 'aiTeacher2')" v-if="istemplate == 1">生成教案</button>
|
|
|
+ @click="openAiDialog(2, 'aiTeacher2')" v-if="istemplate == 1 && dArray.length">生成教案</button>
|
|
|
</el-tooltip>
|
|
|
<!-- <button class="c_pub_button_confirm" style="margin: 0 20px 0 auto;">AI优化</button> -->
|
|
|
</div>
|
|
@@ -5619,7 +5619,7 @@ export default {
|
|
|
taskDetailLoading4: [],
|
|
|
taskDetailLoading5: [],
|
|
|
ttaskDetailLoading5: [],
|
|
|
- dArray: {},
|
|
|
+ dArray: [],
|
|
|
dialogVisibleAiD: false,
|
|
|
aitype: "",
|
|
|
aiJson: {
|
|
@@ -6363,6 +6363,14 @@ export default {
|
|
|
// if (this.cidType == 1) {
|
|
|
if (this.steps == 1) {
|
|
|
if (this.courseName != "") {
|
|
|
+ if (this.ttaskDetailLoading5.indexOf('task-') !== -1 || this.cpotetLoading.cpote1 || this.cpotetLoading.cpote2 || this.cpotetLoading.cpote3 || this.cpotetLoading.cpote4) {
|
|
|
+ this.$message({
|
|
|
+ message: "请回答完毕后再次发送",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (this.templateid != "4480d65a-1e48-11ef-bee5-005056b86db5" && !this.isOutline) {
|
|
|
this.openAiDialog(clickType, 'aiOutline')
|
|
|
return;
|
|
@@ -9042,6 +9050,7 @@ export default {
|
|
|
if(res.data[0].length){
|
|
|
this.tipsJson = res.data[0][0]
|
|
|
this.aiJson = JSON.parse(res.data[0][0].tips)
|
|
|
+ this.aiJson.teacherDetail2 = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
|
|
|
this.$forceUpdate();
|
|
|
}
|
|
|
})
|
|
@@ -13009,9 +13018,9 @@ export default {
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
openAiDialog(clickType, type, callback, index, tindex) {
|
|
|
- if(clickType == 1){
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if(clickType == 1){
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
if (this.courseName == "") {
|
|
|
this.$message.error("请补充填写课程名称");
|
|
|
return;
|
|
@@ -13121,7 +13130,7 @@ export default {
|
|
|
|
|
|
} else if (type == "aiTeacher2") {
|
|
|
this.aitype = "aiTeacher2"
|
|
|
- this.aiText = this.aiJson.teacherDetail2
|
|
|
+ this.aiText = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
|
|
|
} else if (type == "teacherDetail") {
|
|
|
if (this.ttaskDetailLoading5.indexOf('task-' + index) !== -1) {
|
|
|
this.$message({
|
|
@@ -13145,7 +13154,7 @@ export default {
|
|
|
}
|
|
|
this.aitype = "teacherDetail2"
|
|
|
// this.aiText = `请根据${callback}\n重新设计该教案。其中包括但不仅限于该任务的教学目标,教学过程,师生研讨,拓展,学生任务单,相关知识点的练习或Qui以及答案等。`
|
|
|
- this.aiText = this.aiJson.teacherDetail2
|
|
|
+ this.aiText = this.aiJson.teacherDetail2 ? this.aiJson.teacherDetail2 : '请根据<任务名>、<任务描述>,<课程简要描述>,为该任务设计详细的教案,教案需要包含该任务的教学目标,教学过程(包含分步骤的教师活动和学生活动,教师活动与学生活动应该一一对应),相关知识点的讲解,练习(练习需要包含示例答案)。'
|
|
|
this.aiCallBack = callback
|
|
|
this.aiIndex = index
|
|
|
} else if (type == "aiCpote1") {
|
|
@@ -14294,7 +14303,7 @@ ${this.teacherText[task].detail.replaceAll('#','').replaceAll('*','').replaceAll
|
|
|
if (data.message) {
|
|
|
console.log(data.message);
|
|
|
// let dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
|
|
|
- let dArray = {}
|
|
|
+ let dArray = []
|
|
|
try {
|
|
|
dArray = JSON.parse(data.message.replaceAll('```json','').replaceAll('```',''))
|
|
|
} catch (error) {
|