lsc 1 year ago
parent
commit
f30ff9f781
1 changed files with 50 additions and 1 deletions
  1. 50 1
      src/components/pages/addCourse.vue

+ 50 - 1
src/components/pages/addCourse.vue

@@ -103,7 +103,7 @@
                   <span style="color: rgb(15, 126, 255)">添加课程</span>
                 </el-breadcrumb-item>
               </el-breadcrumb>
-              <!-- <el-button type="primary" @click="pasteStage" size="small" v-if="steps == 3 && (!cid || cid && userid == courseUserid)" style="margin-left: 20px;">智能粘贴</el-button> -->
+              <el-button type="primary" @click="pasteStage" size="small" v-if="steps == 3 && (!cid || cid && userid == courseUserid)" style="margin-left: 20px;">智能粘贴</el-button>
               
             </div>
             <div v-if="steps == 1 || steps == 2 || steps == 3" class="stepsWord">
@@ -6086,6 +6086,55 @@ export default {
         this.$message.error("请使用AI共创生成")
         return;
       }
+      let stageTasksData = copyData.stageTasksData;
+      for(var i = 0;i<stageTasksData.length;i++){
+        let taskA = []
+        let tasks = stageTasksData[i].tasks
+        for(var j = 0;j < tasks.length;j++){
+          taskA.push({
+                  task: tasks[j].taskName,
+                  taskDetail: tasks[j].taskDecs,
+                  chapterData: [],
+                  toolText: "",
+                  toolChoose: [
+                    {
+                      tool: [],
+                      toolDetail: "",
+                      toolType: 0,
+                      askCount: 1,
+                      askTitle: "",
+                      askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+                    },
+                  ],
+                  isShowTools: false,
+                  askCount: 1,
+                  isFold: 0,
+                  askTitle: "",
+                  askJson: [{ askstitle: "", askItem: 1, checkList: [] }],
+                  checkJson: [{ checkCount: [], checkPerent: [] }],
+                  homeworkList: [],
+                })
+        }
+        this.unitJson.push({
+          dyName: stageTasksData[i].stage, //单元标题
+          easy: this.unitJson[this.unitJson.length - 1].easy ? 1 : 0,
+          chapterInfo: [
+            {
+              isread: false,
+              chapterid: this.guid(),
+              title: "",
+              courseName: "",
+              taskJson: taskA,
+              itemCount: 1,
+              fileList1: [],
+              video: [],
+              testData: [],
+              pData: [],
+              templateArray: [],
+            },
+          ],
+        });
+      }
     },
     addAnswer() {
       if (this.answerQ == "") {