lsc 2 years ago
parent
commit
ec112be8e4
1 changed files with 627 additions and 29 deletions
  1. 627 29
      src/components/pages/addCourse.vue

+ 627 - 29
src/components/pages/addCourse.vue

@@ -56,7 +56,7 @@
               <div>上传完成</div>
             </div>
           </div>
-          <div class="stepsBottom" v-if="steps == 3">
+          <div class="stepsBottom" v-if="steps == 3 && !unitJson[unitIndex].easy" >
             <div class="navTop">辅助导航</div>
             <div class="navBottom">
               <div class="navTask" :class="{
@@ -412,7 +412,7 @@
                     新建项目
                   </div>
                 </div>
-                <div class="wordTeacher" @click="checkTemplate1()">
+                <div class="wordTeacher" @click="checkTemplate3()">
                   <div class="wordPic">
                     <img src="../../assets/icon/wordMub.png" alt />
                   </div>
@@ -425,9 +425,25 @@
                         white-space: nowrap;
                         padding: 0 20px;
                       ">
-                    我的项目
+                    简易模板
                   </div>
                 </div>
+                <!-- <div class="wordTeacher" @click="checkTemplate1()">
+                  <div class="wordPic">
+                    <img src="../../assets/icon/wordMub.png" alt />
+                  </div>
+
+                  <div style="
+                        margin-top: 10px;
+                        line-height: 19px;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                        white-space: nowrap;
+                        padding: 0 20px;
+                      ">
+                    我的项目
+                  </div>
+                </div> -->
               </div>
             </div>
           </div>
@@ -470,7 +486,7 @@
                     <div v-if="unitJson.length > 1" @click="deleteUnit(unitIndex)"></div>
                   </div>
                 </div>
-                <div style="
+                <div  v-if="!unitJson[unitIndex].easy" style="
                       margin: 50px 0px 10px;
                       font-size: 1.5em;
                       font-weight: 700;
@@ -478,8 +494,8 @@
                     ">
                   添加任务
                 </div>
-                <div class="taskBorder" v-for="(itemTask, itemTaskIndex) in item.taskJson" :key="itemTaskIndex">
-                  <div>
+                <div class="taskBorder" :style="{minHeight:unitJson[unitIndex].easy && 'unset'}" v-for="(itemTask, itemTaskIndex) in item.taskJson" :key="itemTaskIndex">
+                  <div v-if="!unitJson[unitIndex].easy">
                     <div>
                       <div style="font-size: 22px; color: #8e8e8e" :id="'task' + itemTaskIndex">
                         任务{{ itemTaskIndex + 1 }}
@@ -540,11 +556,11 @@
                       </div>
                     </div>
                   </div>
-                  <div class="basic_box" style="
+                  <div  v-if="!unitJson[unitIndex].easy" class="basic_box" style="
                         margin: 0;
                         min-height: 0;
                         width: 90% !important;
-                        paddint-top: 10px !important;
+                        padding-top: 10px !important;
                       ">
                     <div style="
                           display: flex;
@@ -562,7 +578,339 @@
                         itemTask.chapterData.length == 0
                       " style="height: 185px"></div>
                       <div v-else class="add_chapters_box" style="display: flex; flex-direction: column">
-                        <div class="chapter_upload" v-for="(item1, index1) in itemTask.chapterData" :key="item1.id"
+                        <div class="chapter_upload" v-for="(item1, index1) in itemTask.chapterData" :key="item1.id"
+                          @click="
+                            getChapterData(
+                              $event,
+                              unitIndex,
+                              index,
+                              index1,
+                              item1.type
+                            )
+                          ">
+                          <div class="chapter_upload_t" style="width: 100%"></div>
+                          <div class="chapter_upload_o" style="
+                                position: relative;
+                                display: flex;
+                                align-items: center;
+                              ">
+                            <div class="chapter_upload_l" style="padding: 1px 0 0 10px">
+                              <div v-if="item1.type == 2" class="chapter_upload_l_i1"></div>
+                              <div v-if="
+                                item1.type == 3 ||
+                                item1.type == 6 ||
+                                item1.type == 7
+                              " class="chapter_upload_l_i5" style="margin-left: 1px"></div>
+                              <div v-if="item1.type == 8" class="chapter_upload_l_i8" style="margin-left: 1px"></div>
+                            </div>
+                            <div class="chapter_upload_ic" style="
+                                  cursor: pointer;
+                                  position: absolute;
+                                  width: 45px;
+                                  right: 0;
+                                  top: 0;
+                                ">
+                              <div class="chapter_upload_ic_l"></div>
+                              <div class="chapter_upload_ic_r" style="position: absolute" @click.stop="
+                                deleteChapterData(
+                                  $event,
+                                  unitIndex,
+                                  index,
+                                  index1,
+                                  itemTaskIndex
+                                )
+                              ">
+                                <div></div>
+                              </div>
+                            </div>
+                            <div class="chapter_upload_n">
+                              <input v-if="
+                                item1.type == 2 ||
+                                item1.type == 3 ||
+                                item1.type == 7
+                              " :placeholder="item1.name" @change="
+  updataVideoT(
+    $event,
+    unitIndex,
+    chapterIndex,
+    index1
+  )
+" style="
+                                    border: none;
+                                    outline: none;
+                                    width: 80%;
+                                    minwidth: 215px;
+                                    z-index: 99;
+                                    font-size: 14px;
+                                    white-space: nowrap;
+                                    overflow: hidden;
+                                    text-overflow: ellipsis;
+                                  " />
+                              <input :placeholder="item1.name" v-if="item1.type == 6" style="
+                                    border: none;
+                                    outline: none;
+                                    width: 80%;
+                                    white-space: nowrap;
+                                    overflow: hidden;
+                                    text-overflow: ellipsis;
+                                  " readonly="true" @click="selectAttText(itemTaskIndex, index1)" />
+                              <input :placeholder="
+                                item1.title ? item1.title : '链接'
+                              " v-if="item1.type == 8" style="
+                                    border: none;
+                                    outline: none;
+                                    width: 80%;
+                                    white-space: nowrap;
+                                    overflow: hidden;
+                                    text-overflow: ellipsis;
+                                  " readonly="true" @click="selectLine(itemTaskIndex, index1)" />
+                              <div class="chapter_upload_ud" style="z-index: 99">
+                                <div class="chapter_upload_up" @click="
+                                  upCd($event, unitIndex, index, index1)
+                                "></div>
+                                <div class="chapter_upload_down" @click="
+                                  downCd($event, unitIndex, index, index1)
+                                "></div>
+                              </div>
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                    <div class="add_info_box">
+                      <button class="info_btn" @click="addImg($event)">
+                        添加教学视频
+                        <input type="file" accept="video/mp4, video/quicktime, video/x-msvideo" style="display: none"
+                          capture="camera" v-if="inputShow" @change="
+                            beforeUpload2($event, unitIndex, 2, itemTaskIndex)
+                          " />
+                      </button>
+                      <button class="info_btn" @click="addImg($event)">
+                        添加教学附件
+                        <input type="file"
+                          accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
+                          style="display: none" v-if="inputShow" @change="
+                            beforeUpload2($event, unitIndex, 3, itemTaskIndex)
+                          " />
+                      </button>
+                      <button class="info_btn" @click="addAttText(itemTaskIndex)" v-if="!unitJson[unitIndex].easy">
+                        添加图文
+                      </button>
+                      <button class="info_btn" @click="openLine(itemTaskIndex)" v-if="!unitJson[unitIndex].easy">
+                        添加链接
+                      </button>
+                    </div>
+                    <div v-if="
+                      unitJson[unitIndex].chapterInfo[0].taskJson[
+                        itemTaskIndex
+                      ].proVisible
+                    " class="mask">
+                      <div class="progressBox">
+                        <!-- <div id="closePro" class="closeCss">
+                                            <img src="../../../assets/icon/close.png" alt />
+                                        </div> -->
+                        <div class="lbox">
+                          <img src="../../assets/loading.gif" />上传中,请稍后
+                        </div>
+                        <div>
+                          <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
+                            itemTaskIndex
+                          ].isFinishSize }}M</span> / <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
+  itemTaskIndex
+].isAllSize }}M</span>
+                        </div>
+                        <el-progress :text-inside="true" :stroke-width="20" :percentage="
+                          unitJson[unitIndex].chapterInfo[0].taskJson[
+                            itemTaskIndex
+                          ].progress
+                            ? unitJson[unitIndex].chapterInfo[0].taskJson[
+                              itemTaskIndex
+                            ].progress
+                            : 0
+                        " style="width: 80%"></el-progress>
+                      </div>
+                    </div>
+                  </div>
+                  <div class="basic_box" style="
+                        margin: 0 auto;
+                        min-height: 0;
+                        width: 95% !important;
+                        padding: 20px 10px 10px  !important;
+                      ">
+                    <div style="
+                          display: flex;
+                          margin: 10px 0 20px 0;
+                          flex-direction: row;
+                          justify-content: flex-start;
+                          align-items: center;
+                        ">
+                      <div class="lineTitle">学习内容</div>
+                      <div class="line"></div>
+                    </div>
+                    <div>
+                      <div class="add_chapters_box" v-if="
+                        itemTask.chapterData &&
+                        itemTask.chapterData.length == 0
+                      " style="height: 185px"></div>
+                      <div v-else class="add_chapters_box" style="display: flex; flex-direction: column">
+                        <div v-for="(item1, index1) in itemTask.chapterData" :key="item1.id">
+                          <div class="chapter_upload"
+                          v-if="item1.type == 2"
+                          @click="
+                            getChapterData(
+                              $event,
+                              unitIndex,
+                              index,
+                              index1,
+                              item1.type
+                            )
+                          ">
+                          <div class="chapter_upload_t" style="width: 100%"></div>
+                          <div class="chapter_upload_o" style="
+                                position: relative;
+                                display: flex;
+                                align-items: center;
+                              ">
+                            <div class="chapter_upload_l" style="padding: 1px 0 0 10px">
+                              <div v-if="item1.type == 2" class="chapter_upload_l_i1"></div>
+                              <div v-if="
+                                item1.type == 3 ||
+                                item1.type == 6 ||
+                                item1.type == 7
+                              " class="chapter_upload_l_i5" style="margin-left: 1px"></div>
+                              <div v-if="item1.type == 8" class="chapter_upload_l_i8" style="margin-left: 1px"></div>
+                            </div>
+                            <div class="chapter_upload_ic" style="
+                                  cursor: pointer;
+                                  position: absolute;
+                                  width: 45px;
+                                  right: 0;
+                                  top: 0;
+                                ">
+                              <div class="chapter_upload_ic_l"></div>
+                              <div class="chapter_upload_ic_r" style="position: absolute" @click.stop="
+                                deleteChapterData(
+                                  $event,
+                                  unitIndex,
+                                  index,
+                                  index1,
+                                  itemTaskIndex
+                                )
+                              ">
+                                <div></div>
+                              </div>
+                            </div>
+                            <div class="chapter_upload_n">
+                              <input v-if="
+                                item1.type == 2 ||
+                                item1.type == 3 ||
+                                item1.type == 7
+                              " :placeholder="item1.name" @change="
+  updataVideoT(
+    $event,
+    unitIndex,
+    chapterIndex,
+    index1
+  )
+" style="
+                                    border: none;
+                                    outline: none;
+                                    width: 80%;
+                                    minwidth: 215px;
+                                    z-index: 99;
+                                    font-size: 14px;
+                                    white-space: nowrap;
+                                    overflow: hidden;
+                                    text-overflow: ellipsis;
+                                  " />
+                              <input :placeholder="item1.name" v-if="item1.type == 6" style="
+                                    border: none;
+                                    outline: none;
+                                    width: 80%;
+                                    white-space: nowrap;
+                                    overflow: hidden;
+                                    text-overflow: ellipsis;
+                                  " readonly="true" @click="selectAttText(itemTaskIndex, index1)" />
+                              <input :placeholder="
+                                item1.title ? item1.title : '链接'
+                              " v-if="item1.type == 8" style="
+                                    border: none;
+                                    outline: none;
+                                    width: 80%;
+                                    white-space: nowrap;
+                                    overflow: hidden;
+                                    text-overflow: ellipsis;
+                                  " readonly="true" @click="selectLine(itemTaskIndex, index1)" />
+                              <div class="chapter_upload_ud" style="z-index: 99">
+                                <!-- <div class="chapter_upload_up" @click="
+                                  upCd($event, unitIndex, index, index1)
+                                "></div>
+                                <div class="chapter_upload_down" @click="
+                                  downCd($event, unitIndex, index, index1)
+                                "></div> -->
+                              </div>
+                            </div>
+                          </div>
+                        </div>
+                        </div>
+    
+                      </div>
+                    </div>
+                    <div class="add_info_box" style="margin:10px 0 0">
+                      <button class="info_btn" @click="addImg($event)">
+                        添加教学设计
+                        <input type="file" accept="video/mp4, video/quicktime, video/x-msvideo" style="display: none"
+                          capture="camera" v-if="inputShow2" @change="
+                            beforeUpload3($event, unitIndex, 2, itemTaskIndex)
+                          " />
+                      </button>
+                    </div>
+                    <div v-if="
+                      unitJson[unitIndex].chapterInfo[0].taskJson[
+                        itemTaskIndex
+                      ].proVisible2
+                    " class="mask">
+                      <div class="progressBox">
+                        <!-- <div id="closePro" class="closeCss">
+                                            <img src="../../../assets/icon/close.png" alt />
+                                        </div> -->
+                        <div class="lbox">
+                          <img src="../../assets/loading.gif" />上传中,请稍后
+                        </div>
+                        <div>
+                          <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
+                            itemTaskIndex
+                          ].isFinishSize2 }}M</span> / <span>{{ unitJson[unitIndex].chapterInfo[0].taskJson[
+  itemTaskIndex
+].isAllSize2 }}M</span>
+                        </div>
+                        <el-progress :text-inside="true" :stroke-width="20" :percentage="
+                          unitJson[unitIndex].chapterInfo[0].taskJson[
+                            itemTaskIndex
+                          ].progress2
+                            ? unitJson[unitIndex].chapterInfo[0].taskJson[
+                              itemTaskIndex
+                            ].progress2
+                            : 0
+                        " style="width: 80%"></el-progress>
+                      </div>
+                    </div>
+                  </div>
+                  <div class="basic_box" style="
+                        margin: 0 auto;
+                        min-height: 0;
+                        width: 95% !important;
+                        padding: 20px 10px 10px;
+                      ">
+                    <div>
+                      <div class="add_chapters_box" v-if="
+                        itemTask.chapterData &&
+                        itemTask.chapterData.length == 0
+                      " style="height: 185px"></div>
+                      <div v-else class="add_chapters_box" style="display: flex; flex-direction: column">
+                        <div v-for="(item1, index1) in itemTask.chapterData" :key="item1.id">
+                          <div class="chapter_upload"
+                          v-if="item1.type == 3"
                           @click="
                             getChapterData(
                               $event,
@@ -649,40 +997,29 @@
                                     text-overflow: ellipsis;
                                   " readonly="true" @click="selectLine(itemTaskIndex, index1)" />
                               <div class="chapter_upload_ud" style="z-index: 99">
-                                <div class="chapter_upload_up" @click="
+                                <!-- <div class="chapter_upload_up" @click="
                                   upCd($event, unitIndex, index, index1)
                                 "></div>
                                 <div class="chapter_upload_down" @click="
                                   downCd($event, unitIndex, index, index1)
-                                "></div>
+                                "></div> -->
                               </div>
                             </div>
                           </div>
                         </div>
+                        </div>
+    
                       </div>
                     </div>
-                    <div class="add_info_box">
-                      <button class="info_btn" @click="addImg($event)">
-                        添加教学视频
-                        <input type="file" accept="video/mp4, video/quicktime, video/x-msvideo" style="display: none"
-                          capture="camera" v-if="inputShow" @change="
-                            beforeUpload2($event, unitIndex, 2, itemTaskIndex)
-                          " />
-                      </button>
+                    <div class="add_info_box" style="margin:10px 0 0">
                       <button class="info_btn" @click="addImg($event)">
-                        添加教学
+                        添加教学课件
                         <input type="file"
                           accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document"
                           style="display: none" v-if="inputShow" @change="
                             beforeUpload2($event, unitIndex, 3, itemTaskIndex)
                           " />
                       </button>
-                      <button class="info_btn" @click="addAttText(itemTaskIndex)">
-                        添加图文
-                      </button>
-                      <button class="info_btn" @click="openLine(itemTaskIndex)">
-                        添加链接
-                      </button>
                     </div>
                     <div v-if="
                       unitJson[unitIndex].chapterInfo[0].taskJson[
@@ -728,11 +1065,11 @@
                           align-items: center;
                           margin-bottom: 20px;
                         ">
-                      <div class="lineTitle">练习内容</div>
+                      <div class="lineTitle">{{  !unitJson[unitIndex].easy ? '练习内容' : '评价内容'}}</div>
                       <div class="line" style="width: 90%"></div>
                     </div>
                   </div>
-                  <div class="toolChoose" style="padding: 0 0 0 30px">
+                  <div v-if="!unitJson[unitIndex].easy" class="toolChoose" style="padding: 0 0 0 30px">
                     <div class="tools">
                       <div class="leftTools" style="
                             width: 95%;
@@ -1289,6 +1626,33 @@
                       </div>
                     </div>
                   </div>
+                  <div v-else class="toolChoose" style="padding: 0 0 0 30px">
+                    <div class="tools">
+                      <div class="leftTools" style="
+                            width: 95%;
+                            padding: 0 0 15px 0;
+                            border-bottom: 1px solid #efefef;
+                            margin-bottom: 15px;
+                          " v-for="(itemTool, toolIndex) in itemTask.toolChoose" :key="toolIndex">
+                        <div style="min-height: 163px">
+                          <div class="toolSort">
+                            <div class="tool">
+                              <div class="whiteBIcon" @click="openTools(itemTaskIndex, 50, toolIndex)">
+                                <img src="../../assets/icon/thirdToolList/plwork.png" alt />
+                                <div style="margin: 5px 0">批量上传</div>
+                              </div>
+                              <div class="check" @click="addTools(50, itemTaskIndex, toolIndex)">
+                                <img src="../../assets/icon/checkNo.png" alt v-if="itemTool.tool.indexOf(50) == -1" />
+                                <div class="checkDiv" v-else>
+                                  <img src="../../assets/icon/checkedIs.png" alt /><span>已选择</span>
+                                </div>
+                              </div>
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
                   <div class="elist_css">
                     <div class="elist_title">
                       <div style="
@@ -1399,7 +1763,7 @@
                     </div>
                   </div>
                 </div>
-                <div class="addTaskBorder" @click="addTaskBorder">
+                <div class="addTaskBorder" @click="addTaskBorder" v-if="!unitJson[unitIndex].easy">
                   <div>
                     <img src="../../assets/icon/addHw.png" alt />
                     <span>添加任务</span>
@@ -2427,6 +2791,7 @@ export default {
       loading: false,
       toolType: 0,
       inputShow: true,
+      inputShow2: true,
       toolIndex: 0,
       cidType: 0,
       answerQ: "",
@@ -3424,10 +3789,176 @@ export default {
           });
       }
     },
+    beforeUpload3(event, unitIndex, type, itemTaskIndex) {
+      // const loading = this.openLoading();
+      var file = event.target.files[0];
+      var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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",
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+      var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+      var _this = this;
+      if (type == 3) {
+        var b = [
+          "DOC",
+          "DOCX",
+          "DOCM",
+          "DOTM",
+          "DOTX",
+          "PPTX",
+          "PPSX",
+          "PPT",
+          "PPS",
+          "PPTM",
+          "POTM",
+          "PPAM",
+          "POTX",
+          "PPSM",
+        ];
+        if (
+          b.indexOf(
+            file.name
+              .split(".")
+            [file.name.split(".").length - 1].toLocaleUpperCase()
+          ) != -1
+        ) {
+          if (file.size / 1024 / 1024 > 10) {
+            this.$message.error("上传文件大于10兆,请重新选择文件!");
+            this.inputShow2 = true;
+            var a = _this.$refs.upload1.uploadFiles;
+            a.splice(a.length - 1, a.length);
+            // loading.close();
+            return;
+          }
+        } else if (
+          file.name
+            .split(".")
+          [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF"
+        ) {
+          if (file.size / 1024 / 1024 > 5) {
+            this.$message.error("添加成上传文件大于5兆,请重新选择文件!");
+            this.inputShow2 = true;
+            var a = _this.$refs.upload1.uploadFiles;
+            a.splice(a.length - 1, a.length);
+            // loading.close();
+            return;
+          }
+        }
+      }
+      this.inputShow2 = false;
+   
+        _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+          itemTaskIndex
+        ].progress2 = 0;
+        _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+          itemTaskIndex
+        ].proVisible2 = true;
+        _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+          itemTaskIndex
+        ].isFinishSize2 = 0;
+        _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+          itemTaskIndex
+        ].isAllSize2 = (file.size / 1024 / 1024).toFixed(2);
+        _this.$forceUpdate();
+      if (file) {
+        var params = {
+          Key:
+            file.name.split(".")[0] +
+            new Date().getTime() +
+            "." +
+            file.name.split(".")[file.name.split(".").length - 1],
+          ContentType: file.type,
+          Body: file,
+          "Access-Control-Allow-Credentials": "*",
+          ACL: "public-read",
+        }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+        var options = {
+          partSize: 2048 * 1024 * 1024,
+          queueSize: 2,
+          leavePartsOnError: true,
+        };
+        bucket
+          .upload(params, options)
+          .on("httpUploadProgress", function (evt) {
+            //这里可以写进度条
+            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+            _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+              itemTaskIndex
+            ].progress2 = parseInt(evt.loaded / evt.total * 100);
+            _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+              itemTaskIndex
+            ].isFinishSize2 = (
+              evt.loaded /
+              1024 /
+              1024
+            ).toFixed(2)
+            this.$forceUpdate();
+          })
+          .send(function (err, data) {
+            // loading.close();
+            _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+              itemTaskIndex
+            ].progress2 = 100;
+            _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+              itemTaskIndex
+            ].isFinishSize2 = _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+              itemTaskIndex
+            ].isAllSize
+            _this.$forceUpdate();
+            setTimeout(() => {
+              _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+                itemTaskIndex
+              ].proVisible2 = false;
+              _this.$forceUpdate();
+            }, 1000);
+            _this.inputShow2 = true;
+            if (err) {
+              var a = _this.$refs.upload1.uploadFiles;
+              a.splice(a.length - 1, a.length);
+              _this.$message.error("上传失败");
+            } else {
+              if (type == 2 || type == 3) {
+                _this.unitJson[unitIndex].chapterInfo[0].taskJson[
+                  itemTaskIndex
+                ].chapterData.push({
+                  name: file.name,
+                  url: data.Location,
+                  uid: file.uid,
+                  type: type,
+                });
+                _this.imgChange1(null, null, type, itemTaskIndex);
+              } else if (type == 4) {
+                _this.unitJson[_this.unitIndex].chapterInfo[0].taskJson[
+                  itemTaskIndex
+                ].fileList1.push({
+                  name: file.name,
+                  url: data.Location,
+                  uid: file.uid,
+                });
+                _this.imgChange1(null, null, type, itemTaskIndex);
+              } else if (type == 5) {
+                _this.unitJson[_this.unitIndex].chapterInfo[0].taskJson[
+                  itemTaskIndex
+                ].homeworkList.push({
+                  name: file.name,
+                  url: data.Location,
+                  uid: file.uid,
+                });
+                _this.imgChange1(null, null, type, itemTaskIndex);
+              }
+              console.log(data.Location);
+            }
+          });
+      }
+    },
     addunit() {
       this.unitJson.push({
         dyName: "", //单元标题
         isUpdate: 1,
+        easy:this.unitJson[this.unitJson.length - 1].easy ? 1 : 0,
         chapterInfo: [
           {
             isread: false,
@@ -3469,6 +4000,7 @@ export default {
         ],
       });
       this.addindex = this.unitJson.length - 1;
+
       setTimeout(() => {
         this.unitIndex = this.unitJson.length - 1;
         this.unitSet(this.unitIndex);
@@ -4024,9 +4556,74 @@ export default {
           type: "warning",
         })
         .then(() => {
+          _this.unitIndex = 0
+          _this.unitJson = [
+            {
+              dyName: "", //单元标题
+              chapterInfo: [
+                {
+                  isread: false,
+                  chapterid: this.guid(),
+                  title: "",
+                  courseName: "",
+                  taskJson: [
+                    {
+                      task: "",
+                      taskDetail: "",
+                      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: [],
+                    },
+                  ],
+                  itemCount: 1,
+                  fileList1: [],
+                  video: [],
+                  testData: [],
+                  pData: [],
+                  templateArray: [],
+                },
+              ],
+            },
+          ];
+          this.steps++;
+          this.updateWork();
+        })
+        .catch(() => {
+          return;
+        });
+    },
+    checkTemplate3(){
+      let _this = this;
+      _this
+        .$confirm("确定选择简易模板吗?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then(() => {
+          _this.unitIndex = 0
           _this.unitJson = [
             {
               dyName: "", //单元标题
+              easy:1,
               chapterInfo: [
                 {
                   isread: false,
@@ -4071,6 +4668,7 @@ export default {
             },
           ];
           this.steps++;
+          this.updateWork();
         })
         .catch(() => {
           return;