|
@@ -1471,6 +1471,9 @@
|
|
|
<button class="c_pub_button_add pub_btn_add_img" @click="openSource(0)">
|
|
|
资源
|
|
|
</button>
|
|
|
+ <!-- <button class="c_pub_button_add pub_btn_add_img" @click="openAiCreate(0)">
|
|
|
+ AI生成
|
|
|
+ </button> -->
|
|
|
</div>
|
|
|
<div v-if="
|
|
|
unitJson[unitIndex].chapterInfo[0].taskJson[
|
|
@@ -5188,6 +5191,7 @@
|
|
|
</aiDialog>
|
|
|
<tipsDialog :dialogVisibleTips.sync="dialogVisibleTips" :tipsJson.sync="tipsJson" :aiJson="aiJson" :userid="userid"
|
|
|
@retrunCourse="retrunCourse" :templateid="templateid"></tipsDialog>
|
|
|
+ <aiCreateDialog :dialogVisibleAiCreate.sync="dialogVisibleAiCreate"></aiCreateDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -5214,6 +5218,7 @@ import aiTips from './aiTips.vue'
|
|
|
import tipsDialog from './tipsDialog.vue'
|
|
|
import { v4 as uuidv4 } from "uuid";
|
|
|
import MarkdownIt from "markdown-it";
|
|
|
+import aiCreateDialog from './aiCreateDialog.vue'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -5231,7 +5236,8 @@ export default {
|
|
|
aiBox,
|
|
|
aiDialog,
|
|
|
aiTips,
|
|
|
- tipsDialog
|
|
|
+ tipsDialog,
|
|
|
+ aiCreateDialog
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -5583,6 +5589,7 @@ export default {
|
|
|
cpote4: false,
|
|
|
},
|
|
|
cpoteType: 0,
|
|
|
+ dialogVisibleAiCreate: false,
|
|
|
};
|
|
|
},
|
|
|
directives: {
|
|
@@ -6810,6 +6817,9 @@ export default {
|
|
|
this.dialogVisibleSource = true;
|
|
|
this.updateSourcePan = false;
|
|
|
},
|
|
|
+ openAiCreate(){
|
|
|
+ this.dialogVisibleAiCreate = true;
|
|
|
+ },
|
|
|
addSource() {
|
|
|
if (!Object.keys(this.sourceData).length) {
|
|
|
this.$message.error("请选择要上传的资源");
|
|
@@ -7509,21 +7519,26 @@ export default {
|
|
|
_this.infoisFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
|
|
|
_this.$forceUpdate();
|
|
|
})
|
|
|
- .send(function (err, data) {
|
|
|
+ .send(async function (err, data) {
|
|
|
// loading.close();
|
|
|
_this.infoprogress = 100;
|
|
|
_this.infoisFinishSize = _this.infoisAllSize;
|
|
|
_this.$forceUpdate();
|
|
|
- setTimeout(() => {
|
|
|
- _this.infoproVisible = false;
|
|
|
- _this.$forceUpdate();
|
|
|
- }, 1000);
|
|
|
_this.inputShow = true;
|
|
|
if (err) {
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.infoproVisible = false;
|
|
|
+ _this.$forceUpdate();
|
|
|
+ }, 1000);
|
|
|
// var a = _this.$refs.upload1.uploadFiles;
|
|
|
// a.splice(a.length - 1, a.length);
|
|
|
_this.$message.error("上传失败");
|
|
|
} else {
|
|
|
+ let fileid = await _this.createFileid(data.Location)
|
|
|
+ if(fileid){
|
|
|
+ _this.infoproVisible = false;
|
|
|
+ _this.$forceUpdate();
|
|
|
+ }
|
|
|
if (type == 13) {
|
|
|
let _type = 2;
|
|
|
var imgA = [
|
|
@@ -7620,12 +7635,14 @@ export default {
|
|
|
url: data.Location,
|
|
|
uid: file.uid,
|
|
|
type: _type,
|
|
|
+ fileid: fileid,
|
|
|
});
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[0].chapterData.push({
|
|
|
name: file.name,
|
|
|
url: data.Location,
|
|
|
uid: file.uid,
|
|
|
type: _type,
|
|
|
+ fileid: fileid,
|
|
|
})
|
|
|
} else if (type == 2 || type == 3 || type == 12) {
|
|
|
_this.infoData.push({
|
|
@@ -7633,15 +7650,18 @@ export default {
|
|
|
url: data.Location,
|
|
|
uid: file.uid,
|
|
|
type: type,
|
|
|
+ fileid: fileid,
|
|
|
});
|
|
|
_this.unitJson[0].chapterInfo[0].taskJson[0].chapterData.push({
|
|
|
name: file.name,
|
|
|
url: data.Location,
|
|
|
uid: file.uid,
|
|
|
type: type,
|
|
|
+ fileid: fileid,
|
|
|
})
|
|
|
}
|
|
|
console.log(data.Location);
|
|
|
+ console.log(fileid);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -12760,6 +12780,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ let mclass = []
|
|
|
+ if (this.courseTypeId.length) {
|
|
|
+ for (var i = 0; i < this.courseTypeId.length; i++) {
|
|
|
+ let _sid = this.courseTypeId[i]
|
|
|
+ for (var j = 0; j < this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'].length; j++) {
|
|
|
+ if (_sid == this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].id) {
|
|
|
+ mclass.push(this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (type == "aiDetail") {
|
|
|
if (this.ttextLoading) {
|
|
|
this.$message({
|
|
@@ -12913,6 +12944,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ let mclass = []
|
|
|
+ if (this.courseTypeId.length) {
|
|
|
+ for (var i = 0; i < this.courseTypeId.length; i++) {
|
|
|
+ let _sid = this.courseTypeId[i]
|
|
|
+ for (var j = 0; j < this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'].length; j++) {
|
|
|
+ if (_sid == this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].id) {
|
|
|
+ mclass.push(this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
let url = []
|
|
|
if (this.infoData.length) {
|
|
|
for (var i = 0; i < this.infoData.length; i++) {
|
|
@@ -12923,6 +12965,7 @@ export default {
|
|
|
this.detailYou(msg)
|
|
|
} else if (this.aitype == "aiOutline") {
|
|
|
this.loading = true
|
|
|
+// ${this.getListClassC(this.checkboxList2) ? '班级:' + this.getListClassC(this.checkboxList2) : "无"}
|
|
|
let message = `NOTICE
|
|
|
Role: 作为学生的学习指导Agent,你熟悉熟悉PBL(基于问题的学习)和5EX教学模型,能够根据学生的学情数据(当前的学习任务设计、学习表现数据、作业数据等)生成自适应的学习任务和对应的5道考核题目。
|
|
|
ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
@@ -12930,15 +12973,14 @@ Instruction: Based on the context, follow "Format example", write content.
|
|
|
|
|
|
# Context
|
|
|
## 要求
|
|
|
-${msg} **你需要使用C-POTE教学活动设计框架,其定义参考#补充参考资料 中的C-POTE**。以及##补充参考资料和##参考资料,
|
|
|
+${msg} 以及##补充参考资料和##参考资料,
|
|
|
然后根据Format example的要求返回要以数组的格式
|
|
|
|
|
|
## 参考资料
|
|
|
课程名字:${this.courseName}
|
|
|
-课程简要描述:${this.courseText ? this.courseText : '暂无'}
|
|
|
-学科:${sub.length ? sub.join(",") : "无"}
|
|
|
-班级:${this.getListClassC(this.checkboxList2)}
|
|
|
-
|
|
|
+${this.courseText ? '课程简要描述:' + this.courseText : ''}
|
|
|
+${sub.length ? '学科:' + sub.join(",") : ''}
|
|
|
+${mclass.length ? '面向年级:' + mclass.join(",") : ''}
|
|
|
|
|
|
## 补充参考资料
|
|
|
补充资料:${url.join(",")}
|
|
@@ -13128,21 +13170,32 @@ ${_text}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ let mclass = []
|
|
|
+ if (this.courseTypeId.length) {
|
|
|
+ for (var i = 0; i < this.courseTypeId.length; i++) {
|
|
|
+ let _sid = this.courseTypeId[i]
|
|
|
+ for (var j = 0; j < this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'].length; j++) {
|
|
|
+ if (_sid == this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].id) {
|
|
|
+ mclass.push(this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
let url = []
|
|
|
if (this.infoData.length) {
|
|
|
for (var i = 0; i < this.infoData.length; i++) {
|
|
|
url.push(this.infoData[i].url)
|
|
|
}
|
|
|
}
|
|
|
+// ${this.getListClassC(this.checkboxList2) ? '班级:' + this.getListClassC(this.checkboxList2) : "无"}
|
|
|
let msg = `
|
|
|
ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
|
|
|
--------
|
|
|
## 参考资料
|
|
|
课程名字:${this.courseName}
|
|
|
-课程简要描述:${this.courseText ? this.courseText : '暂无'}
|
|
|
-学科:${sub.length ? sub.join(",") : "无"}
|
|
|
-班级:${this.getListClassC(this.checkboxList2)}
|
|
|
+${sub.length ? '学科:' + sub.join(",") : ''}
|
|
|
+${mclass.length ? '面向年级:' + mclass.join(",") : ''}
|
|
|
|
|
|
--------
|
|
|
## 补充参考资料
|
|
@@ -14108,6 +14161,18 @@ ${_this.aiCallBack}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ let mclass = []
|
|
|
+ if (this.courseTypeId.length) {
|
|
|
+ for (var i = 0; i < this.courseTypeId.length; i++) {
|
|
|
+ let _sid = this.courseTypeId[i]
|
|
|
+ for (var j = 0; j < this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'].length; j++) {
|
|
|
+ if (_sid == this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].id) {
|
|
|
+ mclass.push(this.CourseTypeJson['34628934-d02f-11ec-8c78-005056b86db5'][j].name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+// ${this.getListClassC(this.checkboxList2) ? '班级:' + this.getListClassC(this.checkboxList2) : "无"}
|
|
|
let messages = `
|
|
|
ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".
|
|
|
|
|
@@ -14117,9 +14182,9 @@ ${this.cpote[_index] ? '## 优化内容\n'+this.cpote[_index] : ''}
|
|
|
|
|
|
## 参考资料
|
|
|
课程名字:${this.courseName}
|
|
|
-课程简要描述:${this.courseText ? this.courseText : '暂无'}
|
|
|
-学科:${sub.length ? sub.join(",") : "无"}
|
|
|
-班级:${this.getListClassC(this.checkboxList2)}`
|
|
|
+${this.courseText ? '课程简要描述:' + this.courseText : ''}
|
|
|
+${sub.length ? '学科:' + sub.join(",") : ''}
|
|
|
+${mclass.length ? '面向年级:' + mclass.join(",") : ''}`
|
|
|
_this.cpoteLoading[_index] = true
|
|
|
_this.cpotetLoading[_index] = true
|
|
|
let _uuid = uuidv4();
|
|
@@ -14209,6 +14274,21 @@ ${this.cpote[_index] ? '## 优化内容\n'+this.cpote[_index] : ''}
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ createFileid(url) {
|
|
|
+ let _this = this
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ _this.ajax
|
|
|
+ .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
|
|
|
+ url: url,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let _data = res.data.FunctionResponse;
|
|
|
+ if (_data.result && _data.result.id) {
|
|
|
+ resolve(_data.result.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearTimeout(this.timer);
|