|
@@ -2403,9 +2403,21 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="rb_c_box_right">
|
|
<div class="rb_c_box_right">
|
|
- <!-- <div class="rb_c_box_btn">
|
|
|
|
- <button class="c_pub_button_add pub_btn_paste_img" @click="pasteTask" v-if="steps == 3">智能粘贴</button>
|
|
|
|
- </div> -->
|
|
|
|
|
|
+ <div class="rb_c_box_btn" style="justify-content: flex-end">
|
|
|
|
+ <!-- <button class="c_pub_button_add pub_btn_paste_img" @click="pasteTask" v-if="steps == 3">智能粘贴</button> -->
|
|
|
|
+ <button class="c_pub_button_return pub_btn_last_img"
|
|
|
|
+ v-if="steps > 1 && steps != 5 && istemplate != 1" @click="lastSteps" style="background: #dbdbdb">
|
|
|
|
+ {{ steps == 4 ? "返回课程" : "上一步" }}
|
|
|
|
+ </button>
|
|
|
|
+ <button class="c_pub_button_confirm" v-if="steps < 4 && istemplate != 1" @click="nextSteps" :class="{
|
|
|
|
+ pub_btn_next_img: steps != 3,
|
|
|
|
+ pub_btn_finish_img: steps == 3,
|
|
|
|
+ }">
|
|
|
|
+ {{ steps == 3 ? "确认上传" : "下一步" }}
|
|
|
|
+ </button>
|
|
|
|
+ <button class="c_pub_button_confirm" style="margin: 0 0 0 20px;" @click="openAiDialog2(2, 'aiTask3','all'), addCourseBehavior('courseBehavior', `点击学历案-重新生成所有任务按钮`)">重新生成所有任务</button>
|
|
|
|
+ <button class="c_pub_button_confirm" style="margin: 0 0 0 20px;" @click="allEvaCan(), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有评价按钮`)" v-if="panTaskElist() == 0 && panEvaCont() == 0">一键生成所有评价</button>
|
|
|
|
+ </div>
|
|
<div class="basic_box" ref="unitBox" @scroll="taskScroll">
|
|
<div class="basic_box" ref="unitBox" @scroll="taskScroll">
|
|
<div v-if="false" style="
|
|
<div v-if="false" style="
|
|
display: flex;
|
|
display: flex;
|
|
@@ -2808,7 +2820,6 @@
|
|
@contextmenu.prevent="openAiDialog2(1, 'aiTask3',itemTaskIndex), addCourseBehavior('courseBehavior', `右键学历案-任务${itemTaskIndex + 1}-重新生成任务按钮`)"
|
|
@contextmenu.prevent="openAiDialog2(1, 'aiTask3',itemTaskIndex), addCourseBehavior('courseBehavior', `右键学历案-任务${itemTaskIndex + 1}-重新生成任务按钮`)"
|
|
@click="openAiDialog2(2, 'aiTask3',itemTaskIndex), addCourseBehavior('courseBehavior', `点击学历案-任务${itemTaskIndex + 1}-重新生成任务按钮`)">重新生成任务</button>
|
|
@click="openAiDialog2(2, 'aiTask3',itemTaskIndex), addCourseBehavior('courseBehavior', `点击学历案-任务${itemTaskIndex + 1}-重新生成任务按钮`)">重新生成任务</button>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
- <button v-if="itemTaskIndex == 0" class="c_pub_button_confirm" style="margin: 0 0 0 20px;" @click="openAiDialog2(2, 'aiTask3','all'), addCourseBehavior('courseBehavior', `点击学历案-重新生成所有任务按钮`)">重新生成所有任务</button>
|
|
|
|
</div>
|
|
</div>
|
|
<!-- <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
|
|
<!-- <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
|
|
<button class="c_pub_button_confirm" style="margin: 0 0 0 20px;"
|
|
<button class="c_pub_button_confirm" style="margin: 0 0 0 20px;"
|
|
@@ -5427,7 +5438,7 @@
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="info_btnBox3">
|
|
|
|
|
|
+ <div class="info_btnBox3" v-show="istemplate == 1">
|
|
<button class="c_pub_button_return pub_btn_return_img" v-if="steps == 1" @click="
|
|
<button class="c_pub_button_return pub_btn_return_img" v-if="steps == 1" @click="
|
|
goTo(
|
|
goTo(
|
|
'/course?userid=' +
|
|
'/course?userid=' +
|
|
@@ -7816,6 +7827,23 @@ export default {
|
|
return count;
|
|
return count;
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ panEvaCont(){
|
|
|
|
+ return function () {
|
|
|
|
+ let count = 0;
|
|
|
|
+ for(var i = 0; i < this.unitJson.length; i++){
|
|
|
|
+ let _task = this.unitJson[i].chapterInfo[0].taskJson
|
|
|
|
+ for(var j = 0; j < _task.length; j++){
|
|
|
|
+ let tool = _task[j].toolChoose
|
|
|
|
+ for(var k = 0; k < tool.length; k++){
|
|
|
|
+ if(tool[k].eList && tool[k].eList.length){
|
|
|
|
+ count++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return count;
|
|
|
|
+ };
|
|
|
|
+ },
|
|
dataCheckPan(){
|
|
dataCheckPan(){
|
|
return function (fileid) {
|
|
return function (fileid) {
|
|
for(let i = 0; i < this.infoData.length; i++){
|
|
for(let i = 0; i < this.infoData.length; i++){
|
|
@@ -8308,6 +8336,24 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ let pan2 = 1
|
|
|
|
+ let taskJson = this.unitJson[0].chapterInfo[0].taskJson
|
|
|
|
+ for(var index = 0; index < taskJson.length; index++){
|
|
|
|
+ for (var j = 0; j < taskJson[index].toolChoose.length; j++) {
|
|
|
|
+ if(this.panTaskElist() == 0 && this.pjIndex.indexOf(taskJson[index].toolChoose[j].tool[0]) != -1){
|
|
|
|
+ if(this.$refs['evalist'+index+j][0].loading){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请等待任务${index+1}回答完毕后再继续`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ pan2 = 2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(pan2 == 2){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
if (this.courseName == "") {
|
|
if (this.courseName == "") {
|
|
this.$message.error("请补充填写课程名称");
|
|
this.$message.error("请补充填写课程名称");
|
|
@@ -8764,6 +8810,24 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ let pan2 = 1
|
|
|
|
+ let taskJson = this.unitJson[0].chapterInfo[0].taskJson
|
|
|
|
+ for(var index = 0; index < taskJson.length; index++){
|
|
|
|
+ for (var j = 0; j < taskJson[index].toolChoose.length; j++) {
|
|
|
|
+ if(this.panTaskElist() == 0 && this.pjIndex.indexOf(taskJson[index].toolChoose[j].tool[0]) != -1){
|
|
|
|
+ if(this.$refs['evalist'+index+j][0].loading){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请等待任务${index+1}回答完毕后再继续`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ pan2 = 2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(pan2 == 2){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
if (this.cid == "" || this.cid == undefined) {
|
|
if (this.courseName == "") {
|
|
if (this.courseName == "") {
|
|
this.$message.error("请补充填写课程名称");
|
|
this.$message.error("请补充填写课程名称");
|
|
@@ -9468,7 +9532,9 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
// 创建文件流
|
|
// 创建文件流
|
|
|
|
|
|
const file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
const file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
- return file
|
|
|
|
|
|
+ // 执行下载
|
|
|
|
+ saveAs(file, dname);
|
|
|
|
+ // return file
|
|
},
|
|
},
|
|
async generateExport2(a, html, index) {
|
|
async generateExport2(a, html, index) {
|
|
return new Promise((resolve) => {
|
|
return new Promise((resolve) => {
|
|
@@ -16747,6 +16813,46 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
console.error(err);
|
|
console.error(err);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ allEvaCan(){
|
|
|
|
+ if (this.taskLoading.length) {
|
|
|
|
+ let _pan = 1
|
|
|
|
+ for(var k = 0; k < this.taskLoading.length; k++){
|
|
|
|
+ if(this.taskLoading[k]){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请等待任务${k+1}回答完毕后再继续`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ _pan = 2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(_pan == 2){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.taskGLoading.length){
|
|
|
|
+ let _pan = 1
|
|
|
|
+ for(var k = 0; k < this.taskGLoading.length; k++){
|
|
|
|
+ if(this.taskGLoading[k] && (this.taskGLoading[k][0] || this.taskGLoading[k][1] || this.taskGLoading[k][2])){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请等待任务${k+1}回答完毕后再继续`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ _pan = 2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(_pan == 2){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let taskJson = this.unitJson[0].chapterInfo[0].taskJson
|
|
|
|
+ for(var index = 0; index < taskJson.length; index++){
|
|
|
|
+ for (var j = 0; j < taskJson[index].toolChoose.length; j++) {
|
|
|
|
+ if(this.panTaskElist() == 0 && this.pjIndex.indexOf(taskJson[index].toolChoose[j].tool[0]) != -1){
|
|
|
|
+ this.$refs['evalist'+index+j][0].openAiDialog('elist');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
setAiJson(pan,string,string2,string3){
|
|
setAiJson(pan,string,string2,string3){
|
|
if(pan == 'aiTeacher2'){
|
|
if(pan == 'aiTeacher2'){
|
|
this.aiJson['teacherDetail2'] = string
|
|
this.aiJson['teacherDetail2'] = string
|
|
@@ -16847,38 +16953,107 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
this.openAiDialog(2, 'aitargetTextDetail',1)
|
|
this.openAiDialog(2, 'aitargetTextDetail',1)
|
|
}, 500);
|
|
}, 500);
|
|
},
|
|
},
|
|
|
|
+ async getUserName() {
|
|
|
|
+ let params = { uid: this.userid };
|
|
|
|
+ try {
|
|
|
|
+ let res = await this.ajax.get(
|
|
|
|
+ this.$store.state.api + "getUser",
|
|
|
|
+ params
|
|
|
|
+ );
|
|
|
|
+ return res.data[0][0].name;
|
|
|
|
+ } catch (err) {
|
|
|
|
+ console.error(err);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getCGN(type){
|
|
|
|
+ let sub = [] //学科
|
|
|
|
+ let mclass = [] //年纪
|
|
|
|
+ let theme = []
|
|
|
|
+ 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['34629907-d02f-11ec-8c78-005056b86db5'].length; j++) {
|
|
|
|
+ if (_sid == this.CourseTypeJson['34629907-d02f-11ec-8c78-005056b86db5'][j].id) {
|
|
|
|
+ sub.push(this.CourseTypeJson['34629907-d02f-11ec-8c78-005056b86db5'][j].name)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (var j = 0; j < this.CourseTypeJson['34629bcc-d02f-11ec-8c78-005056b86db5'].length; j++) {
|
|
|
|
+ if (_sid == this.CourseTypeJson['34629bcc-d02f-11ec-8c78-005056b86db5'][j].id) {
|
|
|
|
+ theme.push(this.CourseTypeJson['34629bcc-d02f-11ec-8c78-005056b86db5'][j].name)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(type == 1){
|
|
|
|
+ return sub.join(",")
|
|
|
|
+ }else if(type == 2){
|
|
|
|
+ return mclass.join(",")
|
|
|
|
+ }else if(type == 3){
|
|
|
|
+ return theme.join(",")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async exportTeachPlan(){
|
|
async exportTeachPlan(){
|
|
this.loading = true
|
|
this.loading = true
|
|
const zip = new JSZip();
|
|
const zip = new JSZip();
|
|
let md = new MarkdownIt();
|
|
let md = new MarkdownIt();
|
|
|
|
+ let courseText = this.courseText ? this.courseText : this.teacherCourseText
|
|
|
|
+ let target = this.targetCourseText2 ? this.targetCourseText2 : this.targetcoursetext
|
|
|
|
+ let String = ''
|
|
|
|
+ String += `<h1 style="text-align: center;">${this.courseName}</h1>`
|
|
|
|
+ String += `<h2>课程基本信息</h2>`
|
|
|
|
+ String += `<div><strong>设计者:</strong><span>${await this.getUserName()}</span></div>`
|
|
|
|
+ String += `<div><strong>年级:</strong><span></span>${this.getCGN(2)}</div>`
|
|
|
|
+ String += `<div><strong>主题:</strong><span></span>${this.getCGN(3)}</div>`
|
|
|
|
+ String += `<div><strong>学科:</strong><span></span>${this.getCGN(1)}</div>`
|
|
|
|
+ if(courseText){
|
|
|
|
+ String += `<h2>课程概况</h2>`
|
|
|
|
+ String += md.render(courseText)
|
|
|
|
+ }
|
|
|
|
+ if(target){
|
|
|
|
+ String += `<h2>课程目标</h2>`
|
|
|
|
+ String += md.render(target)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String += `<h2>课程教案</h2>`
|
|
for(var i = 0; i < this.unitJson[0].chapterInfo[0].taskJson.length; i++){
|
|
for(var i = 0; i < this.unitJson[0].chapterInfo[0].taskJson.length; i++){
|
|
let _task = this.unitJson[0].chapterInfo[0].taskJson[i]
|
|
let _task = this.unitJson[0].chapterInfo[0].taskJson[i]
|
|
- let name = _task.task+'-教案'
|
|
|
|
|
|
+ // let name = _task.task+'-教案'
|
|
let _html = _task.taskDetail3 ? md.render(_task.taskDetail3) : ''
|
|
let _html = _task.taskDetail3 ? md.render(_task.taskDetail3) : ''
|
|
if(!this.cid || !this.unitJson[0].chapterInfo[0].taskJson[i].chapterData.length){
|
|
if(!this.cid || !this.unitJson[0].chapterInfo[0].taskJson[i].chapterData.length){
|
|
await this.generate(name, _html, i)
|
|
await this.generate(name, _html, i)
|
|
}
|
|
}
|
|
- let file = await this.generateExport(name, _html, i)
|
|
|
|
|
|
+ String += `<h3>任务${i+1}</h3>`
|
|
|
|
+ String += `<h4>${_task.task}</h4>`
|
|
|
|
+ String += _html
|
|
|
|
+ // let file = await this.generateExport(name, _html, i)
|
|
|
|
|
|
- zip.file(`${name}.docx`, file, { binary: true })
|
|
|
|
|
|
+ // zip.file(`${name}.docx`, file, { binary: true })
|
|
}
|
|
}
|
|
- zip.generateAsync({ type: "blob" }).then((content) => {
|
|
|
|
- // 生成二进制流
|
|
|
|
- saveAs(
|
|
|
|
- content,
|
|
|
|
- this.courseName + "-" + "教案.zip"
|
|
|
|
- ); // 利用file-saver保存文件 自定义文件名
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
|
+ await this.generateExport(this.courseName, String, i)
|
|
|
|
+ setTimeout(() => {
|
|
this.loading = false
|
|
this.loading = false
|
|
- // if(!this.cid){
|
|
|
|
- // this.addWork(3)
|
|
|
|
- // }else{
|
|
|
|
- // this.updateWork();
|
|
|
|
- // this.steps = 4;
|
|
|
|
- // }
|
|
|
|
- }, 2000);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
|
|
+ }, 2000);
|
|
|
|
+ // zip.generateAsync({ type: "blob" }).then((content) => {
|
|
|
|
+ // // 生成二进制流
|
|
|
|
+ // saveAs(
|
|
|
|
+ // content,
|
|
|
|
+ // this.courseName + "-" + "教案.zip"
|
|
|
|
+ // ); // 利用file-saver保存文件 自定义文件名
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // this.loading = false
|
|
|
|
+ // // if(!this.cid){
|
|
|
|
+ // // this.addWork(3)
|
|
|
|
+ // // }else{
|
|
|
|
+ // // this.updateWork();
|
|
|
|
+ // // this.steps = 4;
|
|
|
|
+ // // }
|
|
|
|
+ // }, 2000);
|
|
|
|
+ // });
|
|
|
|
|
|
},
|
|
},
|
|
clickGenTT2(){
|
|
clickGenTT2(){
|
|
@@ -16963,6 +17138,54 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
this.interSetting = false
|
|
this.interSetting = false
|
|
},
|
|
},
|
|
openAiDialog2(clickType, type, callback, index, tindex){
|
|
openAiDialog2(clickType, type, callback, index, tindex){
|
|
|
|
+ if (this.taskLoading.length) {
|
|
|
|
+ let _pan = 1
|
|
|
|
+ for(var k = 0; k < this.taskLoading.length; k++){
|
|
|
|
+ if(this.taskLoading[k]){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请等待任务${k+1}回答完毕后再继续`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ _pan = 2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(_pan == 2){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.taskGLoading.length){
|
|
|
|
+ let _pan = 1
|
|
|
|
+ for(var k = 0; k < this.taskGLoading.length; k++){
|
|
|
|
+ if(this.taskGLoading[k] && (this.taskGLoading[k][0] || this.taskGLoading[k][1] || this.taskGLoading[k][2])){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请等待任务${k+1}回答完毕后再继续`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ _pan = 2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(_pan == 2){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let pan2 = 1
|
|
|
|
+ let taskJson = this.unitJson[0].chapterInfo[0].taskJson
|
|
|
|
+ for(var index = 0; index < taskJson.length; index++){
|
|
|
|
+ for (var j = 0; j < taskJson[index].toolChoose.length; j++) {
|
|
|
|
+ if(this.panTaskElist() == 0 && this.pjIndex.indexOf(taskJson[index].toolChoose[j].tool[0]) != -1){
|
|
|
|
+ if(this.$refs['evalist'+index+j][0].loading){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请等待任务${index+1}回答完毕后再继续`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ pan2 = 2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(pan2 == 2){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.$confirm("重新生成会影响已生成内容,确定重新生成吗?", "提示", {
|
|
this.$confirm("重新生成会影响已生成内容,确定重新生成吗?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
@@ -28178,7 +28401,7 @@ ol {
|
|
.rb_c_box_right>.basic_box {
|
|
.rb_c_box_right>.basic_box {
|
|
/* background: #fff; */
|
|
/* background: #fff; */
|
|
border-radius: 0;
|
|
border-radius: 0;
|
|
- height: calc(100% - 0px);
|
|
|
|
|
|
+ height: calc(100% - 50px);
|
|
overflow: auto;
|
|
overflow: auto;
|
|
padding: 0;
|
|
padding: 0;
|
|
}
|
|
}
|