Browse Source

新增英语写作工具

zengyicheng 1 year ago
parent
commit
ebb18d376c

BIN
src/assets/icon/english/delete.png


BIN
src/assets/icon/english/uploadImg.png


+ 377 - 0
src/components/components/onlineWrite.vue

@@ -0,0 +1,377 @@
+<template>
+  <div class="engBox">
+    <div class="engTitle">
+      <div>作文题目:</div>
+      <div>{{ englishList.engTitle }}</div>
+    </div>
+    <div class="engText">
+      <div>作文题目:</div>
+      <div v-html="englishList.englishText"></div>
+    </div>
+
+    <div
+      v-for="(item, index) in myAnswerList.imgList"
+      :key="index"
+      class="imgListCss"
+    >
+      <div class="itemImg">
+        <img :src="item.url" alt="" />
+        <div class="itemDeleteImg" @click="deleteImgList">
+          <img src="../../assets/icon/english/delete.png" alt="" />
+        </div>
+      </div>
+    </div>
+
+    <div class="chooseUpload" @click="type = 1" v-if="type == 0 || type == 2">+在线编写</div>
+    <div
+      class="chooseUpload"
+      @click="(type = 2), (uploadDialogVisible = true)"
+      v-if="type == 0 || type == 2"
+    >
+      +图片上传
+    </div>
+
+    <div v-if="type == 1">
+      <div class="ftypeBox">
+        <div class="ftypeTitle">
+          <div>标题:</div>
+          <div>
+            <el-input
+              v-model="myAnswerList.engTitle"
+              placeholder="请填写你的作文题目"
+              @change="setEngList"
+            ></el-input>
+          </div>
+        </div>
+        <div class="ftypeText">
+          <div>正文:</div>
+          <div>
+            <el-input
+              type="textarea"
+              :rows="20"
+              resize="none"
+              v-model="myAnswerList.engText"
+              @change="setEngList"
+            ></el-input>
+          </div>
+        </div>
+
+        <div class="upImg" @click="uploadDialogVisible = true">
+          <img src="../../assets/icon/english/uploadImg.png" alt="" />
+        </div>
+      </div>
+    </div>
+
+    <el-dialog
+      title="图片上传"
+      :visible.sync="uploadDialogVisible"
+      :append-to-body="true"
+      width="30%"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <div
+        class="chapter_add"
+        @click="addImg($event)"
+        v-if="myAnswerList.imgList.length == 0"
+      >
+        <div class="up_photo2">
+          <img src="../../assets/icon/plwork.png" alt />
+          <span>点击上传文件</span>
+        </div>
+        <input
+          type="file"
+          accept="video/mp4, video/quicktime, video/x-msvideo,application/pdf, application/.ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, image/*"
+          multiple="multiple"
+          style="display: none"
+          @change="beforeUpload($event)"
+        />
+      </div>
+      <div class="chapter_add" v-else>
+        <div class="isUpImg">
+          <img :src="myAnswerList.imgList[0].url" alt="" />
+        </div>
+        <div class="deleteImg" @click="deleteImgList">
+          <img src="../../assets/icon/english/delete.png" alt="" />
+        </div>
+      </div>
+      <div style="text-align: center">如已进行填写,确认后讲清空内容噢。</div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="uploadDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="uploadIsType">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["englishList"],
+  data() {
+    return {
+      type: 0,
+      myAnswerList: {
+        engTitle: "",
+        engText: "",
+        imgList: [],
+      },
+      uploadDialogVisible: false,
+      noneBtnImg: false,
+    };
+  },
+  methods: {
+    handleClose(done) {
+      done();
+    },
+    imgChange() {
+      var _tmp = this.myAnswerList.imgList;
+      this.noneBtnImg = _tmp.length >= 1;
+    },
+    addImg(e) {
+      var el = e.currentTarget;
+      el.getElementsByTagName("input")[0].click();
+      e.target.value = "";
+    },
+    deleteImgList() {
+      this.myAnswerList.imgList = [];
+      this.setEngList();
+    },
+    uploadIsType() {
+      if (this.type == 2) {
+        this.type = 1;
+      }
+      this.uploadDialogVisible = false;
+    },
+    setEngList() {
+      this.$emit("setEnglish", this.myAnswerList);
+    },
+    async beforeUpload(event) {
+      // this.$message.success('进入上传')
+      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;
+      // _this.progress = 0;
+      var photoA = [
+        "BMP",
+        "GIF",
+        "PNG",
+        "JPGE",
+        "JPG",
+        "TIF",
+        "PCX",
+        "TGA",
+        "EXIF",
+        "FPX",
+        "SVG",
+        "APNG",
+      ];
+      if (
+        photoA.indexOf(
+          file.name
+            .split(".")
+            [file.name.split(".").length - 1].toLocaleUpperCase()
+        ) == -1
+      ) {
+        _this.$message.error("请上传图片!");
+        return;
+      }
+
+      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,
+          partSize: 1024 * 1024 * 1024,
+          queueSize: 2,
+          leavePartsOnError: true,
+        };
+        bucket
+          .upload(params, options)
+          .on("httpUploadProgress", function (evt) {
+            //这里可以写进度条
+            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+            // _this.progress = parseInt((evt.loaded * 80) / evt.total);
+          })
+          .send(function (err, data) {
+            // _this.progress = 100;
+
+            if (err) {
+              var a = _this.$refs.upload1.uploadFiles;
+              a.splice(a.length - 1, a.length);
+              _this.$message.error("上传失败");
+            } else {
+              // _this.$message.success('上传成功')
+              _this.myAnswerList.imgList.push({
+                name: file.name,
+                url: data.Location,
+              });
+              _this.imgChange();
+              this.setEngList();
+              console.log(data.Location);
+              // _this.$message.success('上传成功'+data.Location)
+            }
+          });
+      }
+    },
+  },
+  created() {},
+};
+</script>
+
+<style scoped>
+.engBox {
+  width: 50%;
+  margin: 0 auto;
+}
+
+.engTitle,
+.engText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  margin-bottom: 20px;
+}
+
+.chooseUpload {
+  width: 100%;
+  height: 300px;
+  text-align: center;
+  line-height: 300px;
+  border: 1px dashed #c4c4c4;
+  border-radius: 5px;
+  margin-bottom: 20px;
+  cursor: pointer;
+}
+
+.ftypeBox {
+  margin: 20px auto 0;
+}
+.ftypeTitle {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+.ftypeTitle > div:first-child {
+  min-width: 42px;
+  font-weight: bold;
+}
+.ftypeTitle > div:last-child {
+  width: calc(100% - 42px);
+}
+.ftypeText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+  margin-top: 20px;
+}
+.ftypeText > div:first-child {
+  min-width: 42px;
+  margin-top: 10px;
+  font-weight: bold;
+}
+.ftypeText > div:last-child {
+  width: 100%;
+}
+.upImg {
+  width: 30px;
+  height: 30px;
+  float: right;
+  cursor: pointer;
+}
+.upImg > img,
+.isUpImg > img,
+.deleteImg > img,
+.itemImg > img,
+.itemDeleteImg > img {
+  width: 100%;
+  height: 100%;
+}
+
+.chapter_add {
+  width: 180px;
+  margin: 0 auto;
+  position: relative;
+  text-align: center;
+}
+
+.up_photo2 {
+  width: 180px;
+  box-sizing: border-box;
+  min-width: 180px;
+  height: 180px;
+  max-height: 180px;
+  min-height: 180px;
+  cursor: pointer;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  background: rgb(242, 246, 255);
+  /* padding: 25px; */
+  margin-bottom: 10px;
+}
+
+.up_photo2 img {
+  width: 50%;
+  height: auto;
+}
+
+.up_photo2 span {
+  color: #898989;
+}
+
+.isUpImg {
+  width: 180px;
+  min-width: 180px;
+  height: 180px;
+  max-height: 180px;
+  min-height: 180px;
+}
+
+.deleteImg {
+  width: 20px;
+  height: 20px;
+  cursor: pointer;
+  position: absolute;
+  top: 0;
+  right: 0;
+}
+
+.imgListCss {
+  margin: 10px 0;
+}
+
+.itemImg {
+  width: 50px;
+  height: 50px;
+  position: relative;
+}
+
+.itemDeleteImg {
+  width: 15px;
+  height: 15px;
+  cursor: pointer;
+  position: absolute;
+  top: -5px;
+  right: -5px;
+}
+</style>

+ 8 - 8
src/components/courseDetail.vue

@@ -1911,12 +1911,12 @@ export default {
       // );
     },
     uploadCourse() {
-      this.$confirm("确定导出课件吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
+      // this.$confirm("确定导出课件吗?", "提示", {
+      //   confirmButtonText: "确定",
+      //   cancelButtonText: "取消",
+      //   type: "warning",
+      // })
+      //   .then(() => {
           const loading = this.$loading.service({
             background: "rgba(255, 255, 255, 0.7)",
             target: document.body,
@@ -1945,8 +1945,8 @@ export default {
           }
           console.log(url);
           this.downLoadAll(url, loading);
-        })
-        .catch(() => {});
+        // })
+        // .catch(() => {});
     },
     downLoadAll(url, loading) {
       const data = url; // 需要下载打包的路径, 可以是本地相对路径, 也可以是跨域的全路径

+ 377 - 0
src/components/easy2/commpont/onlineWrite.vue

@@ -0,0 +1,377 @@
+<template>
+  <div class="engBox">
+    <div class="engTitle">
+      <div>作文题目:</div>
+      <div>{{ englishList.engTitle }}</div>
+    </div>
+    <div class="engText">
+      <div>作文题目:</div>
+      <div v-html="englishList.englishText"></div>
+    </div>
+
+    <div
+      v-for="(item, index) in myAnswerList.imgList"
+      :key="index"
+      class="imgListCss"
+    >
+      <div class="itemImg">
+        <img :src="item.url" alt="" />
+        <div class="itemDeleteImg" @click="deleteImgList">
+          <img src="../../../assets/icon/english/delete.png" alt="" />
+        </div>
+      </div>
+    </div>
+
+    <div class="chooseUpload" @click="type = 1" v-if="type == 0 || type == 2">+在线编写</div>
+    <div
+      class="chooseUpload"
+      @click="(type = 2), (uploadDialogVisible = true)"
+      v-if="type == 0 || type == 2"
+    >
+      +图片上传
+    </div>
+
+    <div v-if="type == 1">
+      <div class="ftypeBox">
+        <div class="ftypeTitle">
+          <div>标题:</div>
+          <div>
+            <el-input
+              v-model="myAnswerList.engTitle"
+              placeholder="请填写你的作文题目"
+              @change="setEngList"
+            ></el-input>
+          </div>
+        </div>
+        <div class="ftypeText">
+          <div>正文:</div>
+          <div>
+            <el-input
+              type="textarea"
+              :rows="20"
+              resize="none"
+              v-model="myAnswerList.engText"
+              @change="setEngList"
+            ></el-input>
+          </div>
+        </div>
+
+        <div class="upImg" @click="uploadDialogVisible = true">
+          <img src="../../../assets/icon/english/uploadImg.png" alt="" />
+        </div>
+      </div>
+    </div>
+
+    <el-dialog
+      title="图片上传"
+      :visible.sync="uploadDialogVisible"
+      :append-to-body="true"
+      width="30%"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <div
+        class="chapter_add"
+        @click="addImg($event)"
+        v-if="myAnswerList.imgList.length == 0"
+      >
+        <div class="up_photo2">
+          <img src="../../../assets/icon/plwork.png" alt />
+          <span>点击上传文件</span>
+        </div>
+        <input
+          type="file"
+          accept="video/mp4, video/quicktime, video/x-msvideo,application/pdf, application/.ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, image/*"
+          multiple="multiple"
+          style="display: none"
+          @change="beforeUpload($event)"
+        />
+      </div>
+      <div class="chapter_add" v-else>
+        <div class="isUpImg">
+          <img :src="myAnswerList.imgList[0].url" alt="" />
+        </div>
+        <div class="deleteImg" @click="deleteImgList">
+          <img src="../../../assets/icon/english/delete.png" alt="" />
+        </div>
+      </div>
+      <div style="text-align: center">如已进行填写,确认后讲清空内容噢。</div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="uploadDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="uploadIsType">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["englishList"],
+  data() {
+    return {
+      type: 0,
+      myAnswerList: {
+        engTitle: "",
+        engText: "",
+        imgList: [],
+      },
+      uploadDialogVisible: false,
+      noneBtnImg: false,
+    };
+  },
+  methods: {
+    handleClose(done) {
+      done();
+    },
+    imgChange() {
+      var _tmp = this.myAnswerList.imgList;
+      this.noneBtnImg = _tmp.length >= 1;
+    },
+    addImg(e) {
+      var el = e.currentTarget;
+      el.getElementsByTagName("input")[0].click();
+      e.target.value = "";
+    },
+    deleteImgList() {
+      this.myAnswerList.imgList = [];
+      this.setEngList();
+    },
+    uploadIsType() {
+      if (this.type == 2) {
+        this.type = 1;
+      }
+      this.uploadDialogVisible = false;
+    },
+    setEngList() {
+      this.$emit("setEnglish", this.myAnswerList);
+    },
+    async beforeUpload(event) {
+      // this.$message.success('进入上传')
+      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;
+      // _this.progress = 0;
+      var photoA = [
+        "BMP",
+        "GIF",
+        "PNG",
+        "JPGE",
+        "JPG",
+        "TIF",
+        "PCX",
+        "TGA",
+        "EXIF",
+        "FPX",
+        "SVG",
+        "APNG",
+      ];
+      if (
+        photoA.indexOf(
+          file.name
+            .split(".")
+            [file.name.split(".").length - 1].toLocaleUpperCase()
+        ) == -1
+      ) {
+        _this.$message.error("请上传图片!");
+        return;
+      }
+
+      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,
+          partSize: 1024 * 1024 * 1024,
+          queueSize: 2,
+          leavePartsOnError: true,
+        };
+        bucket
+          .upload(params, options)
+          .on("httpUploadProgress", function (evt) {
+            //这里可以写进度条
+            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+            // _this.progress = parseInt((evt.loaded * 80) / evt.total);
+          })
+          .send(function (err, data) {
+            // _this.progress = 100;
+
+            if (err) {
+              var a = _this.$refs.upload1.uploadFiles;
+              a.splice(a.length - 1, a.length);
+              _this.$message.error("上传失败");
+            } else {
+              // _this.$message.success('上传成功')
+              _this.myAnswerList.imgList.push({
+                name: file.name,
+                url: data.Location,
+              });
+              _this.imgChange();
+              this.setEngList();
+              console.log(data.Location);
+              // _this.$message.success('上传成功'+data.Location)
+            }
+          });
+      }
+    },
+  },
+  created() {},
+};
+</script>
+
+<style scoped>
+.engBox {
+  width: 50%;
+  margin: 0 auto;
+}
+
+.engTitle,
+.engText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  margin-bottom: 20px;
+}
+
+.chooseUpload {
+  width: 100%;
+  height: 300px;
+  text-align: center;
+  line-height: 300px;
+  border: 1px dashed #c4c4c4;
+  border-radius: 5px;
+  margin-bottom: 20px;
+  cursor: pointer;
+}
+
+.ftypeBox {
+  margin: 20px auto 0;
+}
+.ftypeTitle {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+.ftypeTitle > div:first-child {
+  min-width: 42px;
+  font-weight: bold;
+}
+.ftypeTitle > div:last-child {
+  width: calc(100% - 42px);
+}
+.ftypeText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+  margin-top: 20px;
+}
+.ftypeText > div:first-child {
+  min-width: 42px;
+  margin-top: 10px;
+  font-weight: bold;
+}
+.ftypeText > div:last-child {
+  width: 100%;
+}
+.upImg {
+  width: 30px;
+  height: 30px;
+  float: right;
+  cursor: pointer;
+}
+.upImg > img,
+.isUpImg > img,
+.deleteImg > img,
+.itemImg > img,
+.itemDeleteImg > img {
+  width: 100%;
+  height: 100%;
+}
+
+.chapter_add {
+  width: 180px;
+  margin: 0 auto;
+  position: relative;
+  text-align: center;
+}
+
+.up_photo2 {
+  width: 180px;
+  box-sizing: border-box;
+  min-width: 180px;
+  height: 180px;
+  max-height: 180px;
+  min-height: 180px;
+  cursor: pointer;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  background: rgb(242, 246, 255);
+  /* padding: 25px; */
+  margin-bottom: 10px;
+}
+
+.up_photo2 img {
+  width: 50%;
+  height: auto;
+}
+
+.up_photo2 span {
+  color: #898989;
+}
+
+.isUpImg {
+  width: 180px;
+  min-width: 180px;
+  height: 180px;
+  max-height: 180px;
+  min-height: 180px;
+}
+
+.deleteImg {
+  width: 20px;
+  height: 20px;
+  cursor: pointer;
+  position: absolute;
+  top: 0;
+  right: 0;
+}
+
+.imgListCss {
+  margin: 10px 0;
+}
+
+.itemImg {
+  width: 50px;
+  height: 50px;
+  position: relative;
+}
+
+.itemDeleteImg {
+  width: 15px;
+  height: 15px;
+  cursor: pointer;
+  position: absolute;
+  top: -5px;
+  right: -5px;
+}
+</style>

+ 487 - 2
src/components/easy2/studyStudent.vue

@@ -206,6 +206,7 @@
                       <div v-if="t.tool == 66">公式编辑</div>
                       <div v-if="t.tool == 67">分子结构</div>
                       <div v-if="t.tool == 68">时间轴</div>
+                      <div v-if="t.tool == 69">英语写作</div>
                       <div v-if="t.tool == 25">目标管理</div>
                       <div v-if="t.tool == 26">课程设计</div>
                       <div v-if="t.tool == 62">交互视频</div>
@@ -1294,6 +1295,14 @@
                             />
                             <div style="margin: 5px 0">时间轴</div>
                           </div>
+                          <div v-if="tooC == 69">
+                            <img
+                              @click="addTools(tooC, toolIndex, taskCount)"
+                              src="../../assets/icon/secondToolList/timeAxis.png"
+                              alt
+                            />
+                            <div style="margin: 5px 0">英语写作</div>
+                          </div>
                         </div>
                       </div>
                     </div>
@@ -1802,6 +1811,45 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      tType == 2 &&
+                      !sIsOpen &&
+                      tool.tool.indexOf(69) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <span class="worksTitle">作业预览</span>
+                      <!-- <el-button type="text" @click="jump()" v-if="tType == 2" class="buttonA">我的评价</el-button> -->
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <div
+                        class="isWorksName2"
+                        v-for="(w, wIndex) in workStudent[toolIndex]"
+                        :key="wIndex"
+                        @click="
+                          openTools(69, toolIndex, taskCount, w.works, w.sName)
+                        "
+                      >
+                        {{ w.sName }}
+                        <img
+                          class="deleteImg deleteImg2"
+                          src="../../assets/deleteworks.png"
+                          v-if="w.userid == userid || tType == 1 || tType == 4"
+                          @click.stop="deleteWorks(w.wid)"
+                          alt
+                        />
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="
                       tType &&
@@ -3687,6 +3735,102 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) ||
+                        tType == 1 ||
+                        tType == 4) &&
+                      tool.tool.indexOf(69) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      <div class="worksTop">
+                        <div>作业预览</div>
+                        <div
+                          class="corOpen"
+                          @click="contract(toolIndex)"
+                          v-if="
+                            worksStudent[toolIndex].length > 6 &&
+                            isCloseList[toolIndex].isClose == 0
+                          "
+                        >
+                          收缩
+                        </div>
+                        <div
+                          class="corOpen"
+                          @click="contract(toolIndex)"
+                          v-if="isCloseList[toolIndex].isClose == 1"
+                        >
+                          展开
+                        </div>
+                      </div>
+                      <!-- <el-button type="text" @click="jump()" v-if="tType == 2" class="buttonA">我的评价</el-button> -->
+                    </div>
+                    <div>
+                      <div
+                        class="worksDetailBox"
+                        v-if="
+                          worksStudent.length &&
+                          worksStudent[toolIndex].length > 0
+                        "
+                      >
+                        <div
+                          v-for="(w, wIndex) in isCloseList[toolIndex]
+                            .isClose == 0
+                            ? worksStudent[toolIndex]
+                            : worksStudent[toolIndex].slice(0, 6)"
+                          :key="wIndex"
+                          class="isWorksName2"
+                          @click="
+                            openTools(
+                              69,
+                              toolIndex,
+                              taskCount,
+                              w.works,
+                              w.sName,
+                              w.wid
+                            )
+                          "
+                        >
+                          {{ w.sName }}
+                          <img
+                            class="deleteImg deleteImg2"
+                            src="../../assets/deleteworks.png"
+                            v-if="
+                              w.userid == userid || tType == 1 || tType == 4
+                            "
+                            @click.stop="deleteWorks(w.wid)"
+                            alt
+                          />
+                        </div>
+                      </div>
+                    </div>
+
+                    <div style="font-size: 18px" v-if="courseDetail.juri != ''">
+                      未提交
+                    </div>
+                    <div
+                      class="noWorksS"
+                      v-if="noWorksS && noWorksS[toolIndex].length"
+                    >
+                      <div
+                        v-for="(s, sIndex) in noWorksS[toolIndex]"
+                        :key="sIndex"
+                        class="noWorksName"
+                        @click="teacherWorkSubmit(69, toolIndex, taskCount, s)"
+                      >
+                        {{ s.student }}
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="
                       tType &&
@@ -8117,6 +8261,23 @@
                 <div v-else class="isChoose"></div>
               </div>
             </div>
+            <div
+              class="tool"
+              :class="{ isToolChoose: checktoolArray.indexOf(69) != -1 }"
+              @click="addTools2(69)"
+            >
+              <div class="whiteBIcon">
+                <img src="../../assets/icon/secondToolList/timeAxis.png" alt />
+                <div style="margin: 5px 0">英语写作</div>
+              </div>
+              <div class="check">
+                <div
+                  v-if="checktoolArray.indexOf(69) == -1"
+                  class="noChoose"
+                ></div>
+                <div v-else class="isChoose"></div>
+              </div>
+            </div>
           </div>
           <div class="toolSort" v-if="toolType == 4">
             <div
@@ -11067,6 +11228,81 @@
         <el-button type="primary" @click="updateName">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+      title="英语写作"
+      :visible.sync="engDialogVisible"
+      :append-to-body="true"
+      width="800px"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <onlineWrite
+        @setEnglish="setEnglishList"
+        :englishList="englishList"
+      ></onlineWrite>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="engDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addEnglishWork">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="英语写作"
+      :visible.sync="engUpdateDialogVisible"
+      :append-to-body="true"
+      width="800px"
+      :before-close="handleClose"
+      class="dialog_diy fullStyle"
+    >
+      <div class="engUpBox">
+        <div class="engTitle">
+          <div>作文题目:</div>
+          <div>{{ englishList1.engTitle }}</div>
+        </div>
+        <div class="engText">
+          <div>作文题目:</div>
+          <div v-html="englishList1.englishText"></div>
+        </div>
+
+        <div class="correctBox">
+          <div class="oldBox">
+            <div class="oldMes">原文( 作者:{{ noteName }} )</div>
+            <div class="oldText">
+              <div class="detailBox">
+                <div class="oldDetail">
+                  <div>标题:</div>
+                  <div>{{ oldEnglishJson.engTitle }} </div>
+                </div>
+                <div class="oldDetail">
+                  <div>正文:</div>
+                  <div>{{ oldEnglishJson.engText }} </div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="oldBox">
+            <div class="oldMes" style="background: #aacaff;">{{ userMes[0].username }}</div>
+            <div class="oldText">
+              <div class="detailBox">
+                <div class="oldDetail">
+                  <div>标题:</div>
+                  <el-input v-model="newEnglishList.engTitle" />
+                </div>
+                <div class="oldDetail">
+                  <div>正文</div>
+                  <el-input type="textarea"
+                  :rows="10"
+                  resize="none" v-model="newEnglishList.engText" />
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="engUpdateDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addCorrect">确 定</el-button>
+      </span>
+    </el-dialog>
     <interVideo
       :dialogVisibleVideo.sync="dialogVisibleVideo"
       :videoJson="videoJson"
@@ -11135,6 +11371,7 @@ import wordCloud from "../wordCloud/index.vue";
 import axios from "axios";
 import JSZip from "jszip";
 import FileSaver from "file-saver";
+import onlineWrite from "./commpont/onlineWrite";
 
 const getFile = (url) => {
   return new Promise((resolve, reject) => {
@@ -11170,6 +11407,7 @@ export default {
     interVideo,
     UpdateMore,
     wordCloud,
+    onlineWrite,
   },
   data() {
     return {
@@ -11203,6 +11441,17 @@ export default {
       dialogVisibleSname: false,
       dialogVisibleVideo: false,
       dialogVisiblePickPeople: false,
+      engDialogVisible: false,
+      engUpdateDialogVisible:false,
+      engWid:"",
+      newEnglishList:{
+        engTitle:"",
+        engText:"",
+      },
+      oldEnglishJson:{},
+      englishList1:{},
+      userMes:{},
+      englishToolIndex:0,
       worksSName: "",
       classJuri: [],
       uploadStudentJuri: [],
@@ -11215,6 +11464,7 @@ export default {
       selectAnswer: [],
       videoDetail: {},
       selectJson: {},
+      englishList: {},
       eScore: { eBzText: "", eStar: [] },
       id: this.$route.query.courseId,
       userid: this.$route.query.userid,
@@ -11496,6 +11746,9 @@ export default {
     };
   },
   methods: {
+    setEnglishList(engList) {
+      this.myAnList = engList;
+    },
     addToolChoose() {
       if (!this.checktoolArray.length) {
         this.$message.error("请选择要添加的任务");
@@ -12212,6 +12465,42 @@ export default {
           console.error(err);
         });
     },
+    addEnglishWork() {
+      if (!this.myAnList.engTitle || !this.myAnList.engText || this.myAnList.engTitle == "" || this.myAnList.engText == "") {
+        this.$message.error("请输入作文标题和正文!");
+        return;
+      }
+      let params = [
+        {
+          uid: this.userid,
+          cid: this.id,
+          stage: this.courseType,
+          task: this.taskCount,
+          tool: this.englishToolIndex,
+          content: JSON.stringify(this.myAnList),
+          type: 16,
+          atool: 69,
+          text: "",
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addCourseWorks5", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.myAnList = {};
+          this.englishToolIndex = 0;
+          this.engDialogVisible = false;
+          this.selectSWorks();
+          this.selectStudent();
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+    },
     addCourseWorksGong(i, data, tool) {
       let params = [
         {
@@ -12671,7 +12960,8 @@ export default {
                   a[i].tool[0] != 50 &&
                   a[i].tool[0] != 32 &&
                   a[i].tool[0] != 57 &&
-                  a[i].tool[0] != 52
+                  a[i].tool[0] != 52 &&
+                  a[i].tool[0] != 69
                 ) {
                   if (
                     c.indexOf(
@@ -12874,6 +13164,18 @@ export default {
                     userid: b[j].userid,
                     wid: b[j].id,
                   });
+                } else if (b[j].type == 16 && a[i].tool[0] == 69) {
+                  //英语写作
+                  this.workStudent[i].push({
+                    works: b[j].content,
+                    sName: b[j].name,
+                    score: b[j].score,
+                    img: b[j].img,
+                    type: 16,
+                    time: b[j].time,
+                    userid: b[j].userid,
+                    wid: b[j].id,
+                  });
                 }
               }
             }
@@ -13928,6 +14230,26 @@ export default {
                   _worksStudent[i].push(_work);
                   _worksStudent2[i].push(_work);
                   this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
+                } else if (b[j].type == 16 && a[i].tool[0] == 69) {
+                  //选择题
+                  let _work = {
+                    userid: b[j].userid,
+                    ateacher: b[j].ateacher,
+                    wid: b[j].id,
+                    works: b[j].content,
+                    sName: b[j].name,
+                    type: 16,
+                    time: b[j].time,
+                    score: b[j].score,
+                    img: b[j].img,
+                    likesCount: likesCount,
+                    commentCount: commentCount,
+                    isLikes: isLikes,
+                    commentJson: commentJson,
+                  };
+                  _worksStudent[i].push(_work);
+                  _worksStudent2[i].push(_work);
+                  this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
                 } else if (b[j].type == 11 && a[i].tool[0] == 49) {
                   let _gindex = JSON.parse(b[j].content);
                   if (
@@ -16526,7 +16848,7 @@ export default {
           console.error(err);
         });
     },
-    openTools(t, i, index, c, sName) {
+    openTools(t, i, index, c, sName,id) {
       var z = JSON.parse(c);
       this.noteName = sName;
       if (t == 4) {
@@ -16545,6 +16867,12 @@ export default {
         this.testJson = z[0].testJson;
         this.isAnswer = true;
         this.dialogVisibleChoice = true;
+      }else if(t == 69){
+        this.englishList1 = this.chapInfoList[this.courseType].chapterInfo[0].taskJson[index]
+              .toolChoose[i].englishList;
+        this.oldEnglishJson = z;
+        this.engWid = id;
+        this.selectEngC(z);
       }
       //  else if (t == 15) {
       //   this.answerQ = "";
@@ -16857,6 +17185,14 @@ export default {
         window.parent.postMessage({ tools: "61" }, "*");
       } else if (t == 63) {
         window.parent.postMessage({ tools: "63" }, "*");
+      } else if (t == 69) {
+        this.englishList = this.chapInfoList[this.courseType].chapterInfo[0]
+          .taskJson[index].toolChoose[i].englishList
+          ? this.chapInfoList[this.courseType].chapterInfo[0].taskJson[index]
+              .toolChoose[i].englishList
+          : {};
+        this.englishToolIndex = i;
+        this.engDialogVisible = true;
       } else if (t == 65) {
         if (this.tType == 2) {
           this.$message.error("不支持学生使用");
@@ -18243,6 +18579,64 @@ export default {
         })
         .catch(() => {});
     },
+    selectUser(){
+      let params = {
+        userid: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectUser", params)
+        .then((res) => {
+          this.userMes = res.data[0];
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    addCorrect(){
+      this.$confirm("你确定提交批改嘛?", "提示", {
+        confirmButtonText: "确定",
+        showCancelButton: false,
+        closeOnClickModal: false,
+        type: "warning",
+      })
+        .then(() => {
+          let params = {
+            wid: this.engWid,
+            c: this.userid,
+            w: JSON.stringify(this.newEnglishList),
+          };
+          this.ajax
+            .get(this.$store.state.api + "addEngC", params)
+            .then((res) => {
+              this.$message.success("提交成功");
+              this.engUpdateDialogVisible = false;
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        })
+        .catch(() => {});
+    },
+    selectEngC(z){
+      let params = {
+        wid: this.engWid,
+        c: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectEngC", params)
+        .then((res) => {
+          if(res.data[0].length == 0){
+            this.newEnglishList.engTitle = z.engTitle;
+            this.newEnglishList.engText = z.engText;
+          }else{
+            this.newEnglishList = JSON.parse(res.data[0][0].cWork);
+          }
+          this.engUpdateDialogVisible = true;
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     getPick() {
       let params = {
         cid: this.id,
@@ -18389,6 +18783,7 @@ export default {
     this.getCourseDetail();
     this.selectCount();
     this.getHomeWork();
+    this.selectUser();
     this.contentDialog = true;
     this.setContent2(true);
     if (this.tType == 4) {
@@ -22595,4 +22990,94 @@ ol {
   width: 100%;
   height: 100%;
 }
+
+.fullStyle>>>.el-dialog__body {
+  height: calc(100% - 125px) !important;
+  box-sizing: border-box;
+  padding: 30px 0 !important;
+  background: #fff !important;
+}
+
+.fullStyle>>>.el-dialog {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 !important;
+}
+
+.fullStyle {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 auto !important;
+}
+
+.fullStyle>>>.el-dialog__footer{
+  background: #fff !important;
+}
+
+.engUpBox {
+  width: 100%;
+  height: 100%;
+}
+
+.engTitle,
+.engText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;    
+  padding: 0 20px 20px 20px;
+  box-sizing: border-box;
+}
+.correctBox{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+}
+
+.oldBox{
+  width: 50%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+  border-top: 1px solid #d9d9d9;
+  border-left: 1px solid #d9d9d9;
+  border-right: 1px solid #d9d9d9;
+}
+.oldBox>div:first-child{
+  width: 100%;
+  text-align: center;
+  background: #d9d9d9;
+  height: 35px;
+  line-height: 35px;
+  font-weight: bold;
+}
+
+.oldText{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-content: center;
+  justify-content: center;
+  align-items: center;
+}
+
+.detailBox{
+  width: 50%;
+  padding: 10px;
+  background: #f6f6f6;
+  border-radius: 5px;
+}
+
+.oldDetail{
+  padding-bottom: 30px;
+}
 </style>

+ 377 - 0
src/components/easy3/commpont/onlineWrite.vue

@@ -0,0 +1,377 @@
+<template>
+  <div class="engBox">
+    <div class="engTitle">
+      <div>作文题目:</div>
+      <div>{{ englishList.engTitle }}</div>
+    </div>
+    <div class="engText">
+      <div>作文题目:</div>
+      <div v-html="englishList.englishText"></div>
+    </div>
+
+    <div
+      v-for="(item, index) in myAnswerList.imgList"
+      :key="index"
+      class="imgListCss"
+    >
+      <div class="itemImg">
+        <img :src="item.url" alt="" />
+        <div class="itemDeleteImg" @click="deleteImgList">
+          <img src="../../../assets/icon/english/delete.png" alt="" />
+        </div>
+      </div>
+    </div>
+
+    <div class="chooseUpload" @click="type = 1" v-if="type == 0 || type == 2">+在线编写</div>
+    <div
+      class="chooseUpload"
+      @click="(type = 2), (uploadDialogVisible = true)"
+      v-if="type == 0 || type == 2"
+    >
+      +图片上传
+    </div>
+
+    <div v-if="type == 1">
+      <div class="ftypeBox">
+        <div class="ftypeTitle">
+          <div>标题:</div>
+          <div>
+            <el-input
+              v-model="myAnswerList.engTitle"
+              placeholder="请填写你的作文题目"
+              @change="setEngList"
+            ></el-input>
+          </div>
+        </div>
+        <div class="ftypeText">
+          <div>正文:</div>
+          <div>
+            <el-input
+              type="textarea"
+              :rows="20"
+              resize="none"
+              v-model="myAnswerList.engText"
+              @change="setEngList"
+            ></el-input>
+          </div>
+        </div>
+
+        <div class="upImg" @click="uploadDialogVisible = true">
+          <img src="../../../assets/icon/english/uploadImg.png" alt="" />
+        </div>
+      </div>
+    </div>
+
+    <el-dialog
+      title="图片上传"
+      :visible.sync="uploadDialogVisible"
+      :append-to-body="true"
+      width="30%"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <div
+        class="chapter_add"
+        @click="addImg($event)"
+        v-if="myAnswerList.imgList.length == 0"
+      >
+        <div class="up_photo2">
+          <img src="../../../assets/icon/plwork.png" alt />
+          <span>点击上传文件</span>
+        </div>
+        <input
+          type="file"
+          accept="video/mp4, video/quicktime, video/x-msvideo,application/pdf, application/.ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, image/*"
+          multiple="multiple"
+          style="display: none"
+          @change="beforeUpload($event)"
+        />
+      </div>
+      <div class="chapter_add" v-else>
+        <div class="isUpImg">
+          <img :src="myAnswerList.imgList[0].url" alt="" />
+        </div>
+        <div class="deleteImg" @click="deleteImgList">
+          <img src="../../../assets/icon/english/delete.png" alt="" />
+        </div>
+      </div>
+      <div style="text-align: center">如已进行填写,确认后讲清空内容噢。</div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="uploadDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="uploadIsType">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["englishList"],
+  data() {
+    return {
+      type: 0,
+      myAnswerList: {
+        engTitle: "",
+        engText: "",
+        imgList: [],
+      },
+      uploadDialogVisible: false,
+      noneBtnImg: false,
+    };
+  },
+  methods: {
+    handleClose(done) {
+      done();
+    },
+    imgChange() {
+      var _tmp = this.myAnswerList.imgList;
+      this.noneBtnImg = _tmp.length >= 1;
+    },
+    addImg(e) {
+      var el = e.currentTarget;
+      el.getElementsByTagName("input")[0].click();
+      e.target.value = "";
+    },
+    deleteImgList() {
+      this.myAnswerList.imgList = [];
+      this.setEngList();
+    },
+    uploadIsType() {
+      if (this.type == 2) {
+        this.type = 1;
+      }
+      this.uploadDialogVisible = false;
+    },
+    setEngList() {
+      this.$emit("setEnglish", this.myAnswerList);
+    },
+    async beforeUpload(event) {
+      // this.$message.success('进入上传')
+      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;
+      // _this.progress = 0;
+      var photoA = [
+        "BMP",
+        "GIF",
+        "PNG",
+        "JPGE",
+        "JPG",
+        "TIF",
+        "PCX",
+        "TGA",
+        "EXIF",
+        "FPX",
+        "SVG",
+        "APNG",
+      ];
+      if (
+        photoA.indexOf(
+          file.name
+            .split(".")
+            [file.name.split(".").length - 1].toLocaleUpperCase()
+        ) == -1
+      ) {
+        _this.$message.error("请上传图片!");
+        return;
+      }
+
+      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,
+          partSize: 1024 * 1024 * 1024,
+          queueSize: 2,
+          leavePartsOnError: true,
+        };
+        bucket
+          .upload(params, options)
+          .on("httpUploadProgress", function (evt) {
+            //这里可以写进度条
+            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+            // _this.progress = parseInt((evt.loaded * 80) / evt.total);
+          })
+          .send(function (err, data) {
+            // _this.progress = 100;
+
+            if (err) {
+              var a = _this.$refs.upload1.uploadFiles;
+              a.splice(a.length - 1, a.length);
+              _this.$message.error("上传失败");
+            } else {
+              // _this.$message.success('上传成功')
+              _this.myAnswerList.imgList.push({
+                name: file.name,
+                url: data.Location,
+              });
+              _this.imgChange();
+              this.setEngList();
+              console.log(data.Location);
+              // _this.$message.success('上传成功'+data.Location)
+            }
+          });
+      }
+    },
+  },
+  created() {},
+};
+</script>
+
+<style scoped>
+.engBox {
+  width: 50%;
+  margin: 0 auto;
+}
+
+.engTitle,
+.engText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  margin-bottom: 20px;
+}
+
+.chooseUpload {
+  width: 100%;
+  height: 300px;
+  text-align: center;
+  line-height: 300px;
+  border: 1px dashed #c4c4c4;
+  border-radius: 5px;
+  margin-bottom: 20px;
+  cursor: pointer;
+}
+
+.ftypeBox {
+  margin: 20px auto 0;
+}
+.ftypeTitle {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+.ftypeTitle > div:first-child {
+  min-width: 42px;
+  font-weight: bold;
+}
+.ftypeTitle > div:last-child {
+  width: calc(100% - 42px);
+}
+.ftypeText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+  margin-top: 20px;
+}
+.ftypeText > div:first-child {
+  min-width: 42px;
+  margin-top: 10px;
+  font-weight: bold;
+}
+.ftypeText > div:last-child {
+  width: 100%;
+}
+.upImg {
+  width: 30px;
+  height: 30px;
+  float: right;
+  cursor: pointer;
+}
+.upImg > img,
+.isUpImg > img,
+.deleteImg > img,
+.itemImg > img,
+.itemDeleteImg > img {
+  width: 100%;
+  height: 100%;
+}
+
+.chapter_add {
+  width: 180px;
+  margin: 0 auto;
+  position: relative;
+  text-align: center;
+}
+
+.up_photo2 {
+  width: 180px;
+  box-sizing: border-box;
+  min-width: 180px;
+  height: 180px;
+  max-height: 180px;
+  min-height: 180px;
+  cursor: pointer;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  background: rgb(242, 246, 255);
+  /* padding: 25px; */
+  margin-bottom: 10px;
+}
+
+.up_photo2 img {
+  width: 50%;
+  height: auto;
+}
+
+.up_photo2 span {
+  color: #898989;
+}
+
+.isUpImg {
+  width: 180px;
+  min-width: 180px;
+  height: 180px;
+  max-height: 180px;
+  min-height: 180px;
+}
+
+.deleteImg {
+  width: 20px;
+  height: 20px;
+  cursor: pointer;
+  position: absolute;
+  top: 0;
+  right: 0;
+}
+
+.imgListCss {
+  margin: 10px 0;
+}
+
+.itemImg {
+  width: 50px;
+  height: 50px;
+  position: relative;
+}
+
+.itemDeleteImg {
+  width: 15px;
+  height: 15px;
+  cursor: pointer;
+  position: absolute;
+  top: -5px;
+  right: -5px;
+}
+</style>

+ 448 - 10
src/components/easy3/studyStudent.vue

@@ -1798,6 +1798,45 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      tType == 2 &&
+                      !sIsOpen &&
+                      tool.tool.indexOf(69) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <span class="worksTitle">作业预览</span>
+                      <!-- <el-button type="text" @click="jump()" v-if="tType == 2" class="buttonA">我的评价</el-button> -->
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <div
+                        class="isWorksName2"
+                        v-for="(w, wIndex) in workStudent[toolIndex]"
+                        :key="wIndex"
+                        @click="
+                          openTools(69, toolIndex, taskCount, w.works, w.sName)
+                        "
+                      >
+                        {{ w.sName }}
+                        <img
+                          class="deleteImg deleteImg2"
+                          src="../../assets/deleteworks.png"
+                          v-if="w.userid == userid || tType == 1 || tType == 4"
+                          @click.stop="deleteWorks(w.wid)"
+                          alt
+                        />
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="
                       tType &&
@@ -3683,6 +3722,102 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) ||
+                        tType == 1 ||
+                        tType == 4) &&
+                      tool.tool.indexOf(69) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      <div class="worksTop">
+                        <div>作业预览</div>
+                        <div
+                          class="corOpen"
+                          @click="contract(toolIndex)"
+                          v-if="
+                            worksStudent[toolIndex].length > 6 &&
+                            isCloseList[toolIndex].isClose == 0
+                          "
+                        >
+                          收缩
+                        </div>
+                        <div
+                          class="corOpen"
+                          @click="contract(toolIndex)"
+                          v-if="isCloseList[toolIndex].isClose == 1"
+                        >
+                          展开
+                        </div>
+                      </div>
+                      <!-- <el-button type="text" @click="jump()" v-if="tType == 2" class="buttonA">我的评价</el-button> -->
+                    </div>
+                    <div>
+                      <div
+                        class="worksDetailBox"
+                        v-if="
+                          worksStudent.length &&
+                          worksStudent[toolIndex].length > 0
+                        "
+                      >
+                        <div
+                          v-for="(w, wIndex) in isCloseList[toolIndex]
+                            .isClose == 0
+                            ? worksStudent[toolIndex]
+                            : worksStudent[toolIndex].slice(0, 6)"
+                          :key="wIndex"
+                          class="isWorksName2"
+                          @click="
+                            openTools(
+                              69,
+                              toolIndex,
+                              taskCount,
+                              w.works,
+                              w.sName,
+                              w.wid
+                            )
+                          "
+                        >
+                          {{ w.sName }}
+                          <img
+                            class="deleteImg deleteImg2"
+                            src="../../assets/deleteworks.png"
+                            v-if="
+                              w.userid == userid || tType == 1 || tType == 4
+                            "
+                            @click.stop="deleteWorks(w.wid)"
+                            alt
+                          />
+                        </div>
+                      </div>
+                    </div>
+
+                    <div style="font-size: 18px" v-if="courseDetail.juri != ''">
+                      未提交
+                    </div>
+                    <div
+                      class="noWorksS"
+                      v-if="noWorksS && noWorksS[toolIndex].length"
+                    >
+                      <div
+                        v-for="(s, sIndex) in noWorksS[toolIndex]"
+                        :key="sIndex"
+                        class="noWorksName"
+                        @click="teacherWorkSubmit(69, toolIndex, taskCount, s)"
+                      >
+                        {{ s.student }}
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="
                       tType &&
@@ -11088,12 +11223,71 @@
       :before-close="handleClose"
       class="dialog_diy"
     >
-      <div>
-        111
-      </div>
+      <onlineWrite
+        @setEnglish="setEnglishList"
+        :englishList="englishList"
+      ></onlineWrite>
       <span slot="footer" class="dialog-footer">
         <el-button @click="engDialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="addEngLish">确 定</el-button>
+        <el-button type="primary" @click="addEnglishWork">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="英语写作"
+      :visible.sync="engUpdateDialogVisible"
+      :append-to-body="true"
+      width="800px"
+      :before-close="handleClose"
+      class="dialog_diy fullStyle"
+    >
+      <div class="engUpBox">
+        <div class="engTitle">
+          <div>作文题目:</div>
+          <div>{{ englishList1.engTitle }}</div>
+        </div>
+        <div class="engText">
+          <div>作文题目:</div>
+          <div v-html="englishList1.englishText"></div>
+        </div>
+
+        <div class="correctBox">
+          <div class="oldBox">
+            <div class="oldMes">原文( 作者:{{ noteName }} )</div>
+            <div class="oldText">
+              <div class="detailBox">
+                <div class="oldDetail">
+                  <div>标题:</div>
+                  <div>{{ oldEnglishJson.engTitle }} </div>
+                </div>
+                <div class="oldDetail">
+                  <div>正文:</div>
+                  <div>{{ oldEnglishJson.engText }} </div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="oldBox">
+            <div class="oldMes" style="background: #aacaff;">{{ userMes[0].username }}</div>
+            <div class="oldText">
+              <div class="detailBox">
+                <div class="oldDetail">
+                  <div>标题:</div>
+                  <el-input v-model="newEnglishList.engTitle" />
+                </div>
+                <div class="oldDetail">
+                  <div>正文</div>
+                  <el-input type="textarea"
+                  :rows="10"
+                  resize="none" v-model="newEnglishList.engText" />
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="engUpdateDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addCorrect">确 定</el-button>
       </span>
     </el-dialog>
     <interVideo
@@ -11164,6 +11358,7 @@ import wordCloud from "../wordCloud/index.vue";
 import axios from "axios";
 import JSZip from "jszip";
 import FileSaver from "file-saver";
+import onlineWrite from "./commpont/onlineWrite";
 
 const getFile = (url) => {
   return new Promise((resolve, reject) => {
@@ -11199,6 +11394,7 @@ export default {
     interVideo,
     UpdateMore,
     wordCloud,
+    onlineWrite,
   },
   data() {
     return {
@@ -11418,6 +11614,16 @@ export default {
       replyDialogVisible: false,
       toolDialogVisible: false,
       engDialogVisible: false,
+      engUpdateDialogVisible:false,
+      engWid:"",
+      newEnglishList:{
+        engTitle:"",
+        engText:"",
+      },
+      oldEnglishJson:{},
+      englishList1:{},
+      userMes:{},
+      englishToolIndex:0,
       replyIndex: 0,
       replyPid: "",
       radio: [],
@@ -11524,9 +11730,13 @@ export default {
       wordCloudData: [],
       isPickStudent: [],
       pzStype: 1,
+      myAnList: {},
     };
   },
   methods: {
+    setEnglishList(engList) {
+      this.myAnList = engList;
+    },
     addToolChoose() {
       if (!this.checktoolArray.length) {
         this.$message.error("请选择要添加的任务");
@@ -12243,6 +12453,43 @@ export default {
           console.error(err);
         });
     },
+    addEnglishWork() {
+      if (!this.myAnList.engTitle || !this.myAnList.engText || this.myAnList.engTitle == "" || this.myAnList.engText == "") {
+        this.$message.error("请输入作文标题和正文!");
+        return;
+      }
+      let params = [
+        {
+          uid: this.userid,
+          cid: this.id,
+          stage: this.courseType,
+          task: this.taskCount,
+          tool: this.englishToolIndex,
+          content: JSON.stringify(this.myAnList),
+          type: 16,
+          atool: 69,
+          text: "",
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addCourseWorks5", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.myAnList = {};
+          this.englishToolIndex = 0;
+          this.engDialogVisible = false;
+          this.selectSWorks();
+          this.selectStudent();
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+    },
+
     addCourseWorksGong(i, data, tool) {
       let params = [
         {
@@ -12702,7 +12949,8 @@ export default {
                   a[i].tool[0] != 50 &&
                   a[i].tool[0] != 32 &&
                   a[i].tool[0] != 57 &&
-                  a[i].tool[0] != 52
+                  a[i].tool[0] != 52 &&
+                  a[i].tool[0] != 69
                 ) {
                   if (
                     c.indexOf(
@@ -12905,6 +13153,18 @@ export default {
                     userid: b[j].userid,
                     wid: b[j].id,
                   });
+                } else if (b[j].type == 16 && a[i].tool[0] == 69) {
+                  //英语写作
+                  this.workStudent[i].push({
+                    works: b[j].content,
+                    sName: b[j].name,
+                    score: b[j].score,
+                    img: b[j].img,
+                    type: 16,
+                    time: b[j].time,
+                    userid: b[j].userid,
+                    wid: b[j].id,
+                  });
                 }
               }
             }
@@ -13959,6 +14219,26 @@ export default {
                   _worksStudent[i].push(_work);
                   _worksStudent2[i].push(_work);
                   this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
+                } else if (b[j].type == 16 && a[i].tool[0] == 69) {
+                  //选择题
+                  let _work = {
+                    userid: b[j].userid,
+                    ateacher: b[j].ateacher,
+                    wid: b[j].id,
+                    works: b[j].content,
+                    sName: b[j].name,
+                    type: 16,
+                    time: b[j].time,
+                    score: b[j].score,
+                    img: b[j].img,
+                    likesCount: likesCount,
+                    commentCount: commentCount,
+                    isLikes: isLikes,
+                    commentJson: commentJson,
+                  };
+                  _worksStudent[i].push(_work);
+                  _worksStudent2[i].push(_work);
+                  this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
                 } else if (b[j].type == 11 && a[i].tool[0] == 49) {
                   let _gindex = JSON.parse(b[j].content);
                   if (
@@ -16272,6 +16552,7 @@ export default {
           console.error(err);
         });
     },
+
     addStudentAsk() {
       if (!this.radio.length) {
         this.$message.error("请选择选项");
@@ -16560,7 +16841,7 @@ export default {
           console.error(err);
         });
     },
-    openTools(t, i, index, c, sName) {
+    openTools(t, i, index, c, sName,id) {
       var z = JSON.parse(c);
       this.noteName = sName;
       if (t == 4) {
@@ -16579,6 +16860,12 @@ export default {
         this.testJson = z[0].testJson;
         this.isAnswer = true;
         this.dialogVisibleChoice = true;
+      }else if(t == 69){
+        this.englishList1 = this.chapInfoList[this.courseType].chapterInfo[0].taskJson[index]
+              .toolChoose[i].englishList;
+        this.oldEnglishJson = z;
+        this.engWid = id;
+        this.selectEngC(z);
       }
       //  else if (t == 15) {
       //   this.answerQ = "";
@@ -16897,6 +17184,7 @@ export default {
           ? this.chapInfoList[this.courseType].chapterInfo[0].taskJson[index]
               .toolChoose[i].englishList
           : {};
+        this.englishToolIndex = i;
         this.engDialogVisible = true;
       } else if (t == 65) {
         if (this.tType == 2) {
@@ -18280,6 +18568,64 @@ export default {
         })
         .catch(() => {});
     },
+    selectUser(){
+      let params = {
+        userid: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectUser", params)
+        .then((res) => {
+          this.userMes = res.data[0];
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    addCorrect(){
+      this.$confirm("你确定提交批改嘛?", "提示", {
+        confirmButtonText: "确定",
+        showCancelButton: false,
+        closeOnClickModal: false,
+        type: "warning",
+      })
+        .then(() => {
+          let params = {
+            wid: this.engWid,
+            c: this.userid,
+            w: JSON.stringify(this.newEnglishList),
+          };
+          this.ajax
+            .get(this.$store.state.api + "addEngC", params)
+            .then((res) => {
+              this.$message.success("提交成功");
+              this.engUpdateDialogVisible = false;
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        })
+        .catch(() => {});
+    },
+    selectEngC(z){
+      let params = {
+        wid: this.engWid,
+        c: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectEngC", params)
+        .then((res) => {
+          if(res.data[0].length == 0){
+            this.newEnglishList.engTitle = z.engTitle;
+            this.newEnglishList.engText = z.engText;
+          }else{
+            this.newEnglishList = JSON.parse(res.data[0][0].cWork);
+          }
+          this.engUpdateDialogVisible = true;
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     getPick() {
       let params = {
         cid: this.id,
@@ -18426,6 +18772,7 @@ export default {
     this.getCourseDetail();
     this.selectCount();
     this.getHomeWork();
+    this.selectUser();
     this.contentDialog = true;
     this.setContent2(true);
     if (this.tType == 4) {
@@ -22075,19 +22422,20 @@ ol {
   align-items: flex-end;
 }
 
-.worksTitle{
+.worksTitle {
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
   align-items: center;
 }
 
-.worksTitle::before,.worksTop::before{
-  content: '';
+.worksTitle::before,
+.worksTop::before {
+  content: "";
   display: block;
   width: 3px;
   height: 20px;
-  background: #0061FF;
+  background: #0061ff;
   border-radius: 3px;
   margin: 0 5px 0 0;
 }
@@ -22631,4 +22979,94 @@ ol {
   width: 100%;
   height: 100%;
 }
+
+.fullStyle>>>.el-dialog__body {
+  height: calc(100% - 125px) !important;
+  box-sizing: border-box;
+  padding: 30px 0 !important;
+  background: #fff !important;
+}
+
+.fullStyle>>>.el-dialog {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 !important;
+}
+
+.fullStyle {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 auto !important;
+}
+
+.fullStyle>>>.el-dialog__footer{
+  background: #fff !important;
+}
+
+.engUpBox {
+  width: 100%;
+  height: 100%;
+}
+
+.engTitle,
+.engText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;    
+  padding: 0 20px 20px 20px;
+  box-sizing: border-box;
+}
+.correctBox{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+}
+
+.oldBox{
+  width: 50%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+  border-top: 1px solid #d9d9d9;
+  border-left: 1px solid #d9d9d9;
+  border-right: 1px solid #d9d9d9;
+}
+.oldBox>div:first-child{
+  width: 100%;
+  text-align: center;
+  background: #d9d9d9;
+  height: 35px;
+  line-height: 35px;
+  font-weight: bold;
+}
+
+.oldText{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-content: center;
+  justify-content: center;
+  align-items: center;
+}
+
+.detailBox{
+  width: 50%;
+  padding: 10px;
+  background: #f6f6f6;
+  border-radius: 5px;
+}
+
+.oldDetail{
+  padding-bottom: 30px;
+}
 </style>

+ 487 - 2
src/components/studyStudent.vue

@@ -215,6 +215,7 @@
                       <div v-if="t.tool == 66">公式编辑</div>
                       <div v-if="t.tool == 67">分子结构</div>
                       <div v-if="t.tool == 68">时间轴</div>
+                      <div v-if="t.tool == 69">英语写作</div>
                       <div v-if="t.tool == 25">目标管理</div>
                       <div v-if="t.tool == 26">课程设计</div>
                       <div v-if="t.tool == 62">交互视频</div>
@@ -1288,6 +1289,14 @@
                             />
                             <div style="margin: 5px 0">时间轴</div>
                           </div>
+                          <div v-if="tooC == 69">
+                            <img
+                              @click="addTools(tooC, toolIndex, taskCount)"
+                              src="../assets/icon/secondToolList/timeAxis.png"
+                              alt
+                            />
+                            <div style="margin: 5px 0">英语写作</div>
+                          </div>
                         </div>
                       </div>
                     </div>
@@ -1796,6 +1805,45 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      tType == 2 &&
+                      !sIsOpen &&
+                      tool.tool.indexOf(69) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <span class="worksTitle">作业预览</span>
+                      <!-- <el-button type="text" @click="jump()" v-if="tType == 2" class="buttonA">我的评价</el-button> -->
+                    </div>
+                    <div
+                      class="worksDetailBox"
+                      v-if="workStudent[toolIndex].length > 0"
+                    >
+                      <div
+                        class="isWorksName2"
+                        v-for="(w, wIndex) in workStudent[toolIndex]"
+                        :key="wIndex"
+                        @click="
+                          openTools(69, toolIndex, taskCount, w.works, w.sName)
+                        "
+                      >
+                        {{ w.sName }}
+                        <img
+                          class="deleteImg deleteImg2"
+                          src="../assets/deleteworks.png"
+                          v-if="w.userid == userid || tType == 1 || tType == 4"
+                          @click.stop="deleteWorks(w.wid)"
+                          alt
+                        />
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="
                       tType &&
@@ -3681,6 +3729,102 @@
                       </div>
                     </div>
                   </div>
+                  <div
+                    v-if="
+                      tType &&
+                      ((tType == 2 && sIsOpen == true) ||
+                        tType == 1 ||
+                        tType == 4) &&
+                      tool.tool.indexOf(69) != -1
+                    "
+                    class="worksBox"
+                  >
+                    <div
+                      class="zuoyeYulan"
+                      v-if="
+                        worksStudent.length &&
+                        worksStudent[toolIndex].length > 0
+                      "
+                    >
+                      <div class="worksTop">
+                        <div>作业预览</div>
+                        <div
+                          class="corOpen"
+                          @click="contract(toolIndex)"
+                          v-if="
+                            worksStudent[toolIndex].length > 6 &&
+                            isCloseList[toolIndex].isClose == 0
+                          "
+                        >
+                          收缩
+                        </div>
+                        <div
+                          class="corOpen"
+                          @click="contract(toolIndex)"
+                          v-if="isCloseList[toolIndex].isClose == 1"
+                        >
+                          展开
+                        </div>
+                      </div>
+                      <!-- <el-button type="text" @click="jump()" v-if="tType == 2" class="buttonA">我的评价</el-button> -->
+                    </div>
+                    <div>
+                      <div
+                        class="worksDetailBox"
+                        v-if="
+                          worksStudent.length &&
+                          worksStudent[toolIndex].length > 0
+                        "
+                      >
+                        <div
+                          v-for="(w, wIndex) in isCloseList[toolIndex]
+                            .isClose == 0
+                            ? worksStudent[toolIndex]
+                            : worksStudent[toolIndex].slice(0, 6)"
+                          :key="wIndex"
+                          class="isWorksName2"
+                          @click="
+                            openTools(
+                              69,
+                              toolIndex,
+                              taskCount,
+                              w.works,
+                              w.sName,
+                              w.wid
+                            )
+                          "
+                        >
+                          {{ w.sName }}
+                          <img
+                            class="deleteImg deleteImg2"
+                            src="../assets/deleteworks.png"
+                            v-if="
+                              w.userid == userid || tType == 1 || tType == 4
+                            "
+                            @click.stop="deleteWorks(w.wid)"
+                            alt
+                          />
+                        </div>
+                      </div>
+                    </div>
+
+                    <div style="font-size: 18px" v-if="courseDetail.juri != ''">
+                      未提交
+                    </div>
+                    <div
+                      class="noWorksS"
+                      v-if="noWorksS && noWorksS[toolIndex].length"
+                    >
+                      <div
+                        v-for="(s, sIndex) in noWorksS[toolIndex]"
+                        :key="sIndex"
+                        class="noWorksName"
+                        @click="teacherWorkSubmit(69, toolIndex, taskCount, s)"
+                      >
+                        {{ s.student }}
+                      </div>
+                    </div>
+                  </div>
                   <div
                     v-if="
                       tType &&
@@ -8090,6 +8234,23 @@
                 <div v-else class="isChoose"></div>
               </div>
             </div>
+            <div
+              class="tool"
+              :class="{ isToolChoose: checktoolArray.indexOf(69) != -1 }"
+              @click="addTools2(69)"
+            >
+              <div class="whiteBIcon">
+                <img src="../assets/icon/secondToolList/timeAxis.png" alt />
+                <div style="margin: 5px 0">英语写作</div>
+              </div>
+              <div class="check">
+                <div
+                  v-if="checktoolArray.indexOf(69) == -1"
+                  class="noChoose"
+                ></div>
+                <div v-else class="isChoose"></div>
+              </div>
+            </div>
           </div>
           <div class="toolSort" v-if="toolType == 4">
             <div
@@ -11037,6 +11198,81 @@
         <el-button type="primary" @click="updateName">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+      title="英语写作"
+      :visible.sync="engDialogVisible"
+      :append-to-body="true"
+      width="800px"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <onlineWrite
+        @setEnglish="setEnglishList"
+        :englishList="englishList"
+      ></onlineWrite>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="engDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addEnglishWork">确 定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="英语写作"
+      :visible.sync="engUpdateDialogVisible"
+      :append-to-body="true"
+      width="800px"
+      :before-close="handleClose"
+      class="dialog_diy fullStyle"
+    >
+      <div class="engUpBox">
+        <div class="engTitle">
+          <div>作文题目:</div>
+          <div>{{ englishList1.engTitle }}</div>
+        </div>
+        <div class="engText">
+          <div>作文题目:</div>
+          <div v-html="englishList1.englishText"></div>
+        </div>
+
+        <div class="correctBox">
+          <div class="oldBox">
+            <div class="oldMes">原文( 作者:{{ noteName }} )</div>
+            <div class="oldText">
+              <div class="detailBox">
+                <div class="oldDetail">
+                  <div>标题:</div>
+                  <div>{{ oldEnglishJson.engTitle }} </div>
+                </div>
+                <div class="oldDetail">
+                  <div>正文:</div>
+                  <div>{{ oldEnglishJson.engText }} </div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div class="oldBox">
+            <div class="oldMes" style="background: #aacaff;">{{ userMes[0].username }}</div>
+            <div class="oldText">
+              <div class="detailBox">
+                <div class="oldDetail">
+                  <div>标题:</div>
+                  <el-input v-model="newEnglishList.engTitle" />
+                </div>
+                <div class="oldDetail">
+                  <div>正文:</div>
+                  <el-input type="textarea"
+                  :rows="10"
+                  resize="none" v-model="newEnglishList.engText" />
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="engUpdateDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addCorrect">确 定</el-button>
+      </span>
+    </el-dialog>
     <interVideo
       :dialogVisibleVideo.sync="dialogVisibleVideo"
       :videoJson="videoJson"
@@ -11105,6 +11341,7 @@ import wordCloud from "./wordCloud/index.vue";
 import axios from "axios";
 import JSZip from "jszip";
 import FileSaver from "file-saver";
+import onlineWrite from "./components/onlineWrite";
 
 const getFile = (url) => {
   return new Promise((resolve, reject) => {
@@ -11140,6 +11377,7 @@ export default {
     interVideo,
     UpdateMore,
     wordCloud,
+    onlineWrite,
   },
   data() {
     return {
@@ -11173,6 +11411,16 @@ export default {
       dialogVisibleSname: false,
       dialogVisibleVideo: false,
       dialogVisiblePickPeople: false,
+      engDialogVisible: false,
+      engUpdateDialogVisible:false,
+      engWid:"",
+      newEnglishList:{
+        engTitle:"",
+        engText:"",
+      },
+      oldEnglishJson:{},
+      englishList1:{},
+      englishToolIndex:0,
       worksSName: "",
       classJuri: [],
       uploadStudentJuri: [],
@@ -11463,9 +11711,14 @@ export default {
       wordCloudData: [],
       isPickStudent: [],
       pzStype: 1,
+      myAnList: {},
+      userMes:{},
     };
   },
   methods: {
+    setEnglishList(engList) {
+      this.myAnList = engList;
+    },
     addToolChoose() {
       if (!this.checktoolArray.length) {
         this.$message.error("请选择要添加的任务");
@@ -12182,6 +12435,42 @@ export default {
           console.error(err);
         });
     },
+    addEnglishWork() {
+      if (!this.myAnList.engTitle || !this.myAnList.engText || this.myAnList.engTitle == "" || this.myAnList.engText == "") {
+        this.$message.error("请输入作文标题和正文!");
+        return;
+      }
+      let params = [
+        {
+          uid: this.userid,
+          cid: this.id,
+          stage: this.courseType,
+          task: this.taskCount,
+          tool: this.englishToolIndex,
+          content: JSON.stringify(this.myAnList),
+          type: 16,
+          atool: 69,
+          text: "",
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "addCourseWorks5", params)
+        .then((res) => {
+          this.$message({
+            message: "提交成功",
+            type: "success",
+          });
+          this.myAnList = {};
+          this.englishToolIndex = 0;
+          this.engDialogVisible = false;
+          this.selectSWorks();
+          this.selectStudent();
+        })
+        .catch((err) => {
+          this.$message.error("提交失败");
+          console.error(err);
+        });
+    },
     addCourseWorksGong(i, data, tool) {
       let params = [
         {
@@ -12641,7 +12930,8 @@ export default {
                   a[i].tool[0] != 50 &&
                   a[i].tool[0] != 32 &&
                   a[i].tool[0] != 57 &&
-                  a[i].tool[0] != 52
+                  a[i].tool[0] != 52 &&
+                  a[i].tool[0] != 69
                 ) {
                   if (
                     c.indexOf(
@@ -12844,6 +13134,18 @@ export default {
                     userid: b[j].userid,
                     wid: b[j].id,
                   });
+                } else if (b[j].type == 16 && a[i].tool[0] == 69) {
+                  //英语写作
+                  this.workStudent[i].push({
+                    works: b[j].content,
+                    sName: b[j].name,
+                    score: b[j].score,
+                    img: b[j].img,
+                    type: 16,
+                    time: b[j].time,
+                    userid: b[j].userid,
+                    wid: b[j].id,
+                  });
                 }
               }
             }
@@ -13898,6 +14200,26 @@ export default {
                   _worksStudent[i].push(_work);
                   _worksStudent2[i].push(_work);
                   this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
+                } else if (b[j].type == 16 && a[i].tool[0] == 69) {
+                  //选择题
+                  let _work = {
+                    userid: b[j].userid,
+                    ateacher: b[j].ateacher,
+                    wid: b[j].id,
+                    works: b[j].content,
+                    sName: b[j].name,
+                    type: 16,
+                    time: b[j].time,
+                    score: b[j].score,
+                    img: b[j].img,
+                    likesCount: likesCount,
+                    commentCount: commentCount,
+                    isLikes: isLikes,
+                    commentJson: commentJson,
+                  };
+                  _worksStudent[i].push(_work);
+                  _worksStudent2[i].push(_work);
+                  this.isWorksS[i].push({ uid: b[j].userid, sName: b[j].name });
                 } else if (b[j].type == 11 && a[i].tool[0] == 49) {
                   let _gindex = JSON.parse(b[j].content);
                   if (
@@ -16496,7 +16818,7 @@ export default {
           console.error(err);
         });
     },
-    openTools(t, i, index, c, sName) {
+    openTools(t, i, index, c, sName,id) {
       var z = JSON.parse(c);
       this.noteName = sName;
       if (t == 4) {
@@ -16515,6 +16837,12 @@ export default {
         this.testJson = z[0].testJson;
         this.isAnswer = true;
         this.dialogVisibleChoice = true;
+      }else if(t == 69){
+        this.englishList1 = this.chapInfoList[this.courseType].chapterInfo[0].taskJson[index]
+              .toolChoose[i].englishList;
+        this.oldEnglishJson = z;
+        this.engWid = id;
+        this.selectEngC(z);
       }
       //  else if (t == 15) {
       //   this.answerQ = "";
@@ -16827,6 +17155,14 @@ export default {
         window.parent.postMessage({ tools: "61" }, "*");
       } else if (t == 63) {
         window.parent.postMessage({ tools: "63" }, "*");
+      } else if (t == 69) {
+        this.englishList = this.chapInfoList[this.courseType].chapterInfo[0]
+          .taskJson[index].toolChoose[i].englishList
+          ? this.chapInfoList[this.courseType].chapterInfo[0].taskJson[index]
+              .toolChoose[i].englishList
+          : {};
+        this.englishToolIndex = i;
+        this.engDialogVisible = true;
       } else if (t == 65) {
         if (this.tType == 2) {
           this.$message.error("不支持学生使用");
@@ -18209,6 +18545,64 @@ export default {
         })
         .catch(() => {});
     },
+    selectUser(){
+      let params = {
+        userid: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectUser", params)
+        .then((res) => {
+          this.userMes = res.data[0];
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+    addCorrect(){
+      this.$confirm("你确定提交批改嘛?", "提示", {
+        confirmButtonText: "确定",
+        showCancelButton: false,
+        closeOnClickModal: false,
+        type: "warning",
+      })
+        .then(() => {
+          let params = {
+            wid: this.engWid,
+            c: this.userid,
+            w: JSON.stringify(this.newEnglishList),
+          };
+          this.ajax
+            .get(this.$store.state.api + "addEngC", params)
+            .then((res) => {
+              this.$message.success("提交成功");
+              this.engUpdateDialogVisible = false;
+            })
+            .catch((err) => {
+              console.error(err);
+            });
+        })
+        .catch(() => {});
+    },
+    selectEngC(z){
+      let params = {
+        wid: this.engWid,
+        c: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectEngC", params)
+        .then((res) => {
+          if(res.data[0].length == 0){
+            this.newEnglishList.engTitle = z.engTitle;
+            this.newEnglishList.engText = z.engText;
+          }else{
+            this.newEnglishList = JSON.parse(res.data[0][0].cWork);
+          }
+          this.engUpdateDialogVisible = true;
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     getPick() {
       let params = {
         cid: this.id,
@@ -18355,6 +18749,7 @@ export default {
     this.getCourseDetail();
     this.selectCount();
     this.getHomeWork();
+    this.selectUser();
     this.contentDialog = true;
     this.setContent2(true);
     if (this.tType == 4) {
@@ -22561,4 +22956,94 @@ ol {
   width: 100%;
   height: 100%;
 }
+
+.fullStyle>>>.el-dialog__body {
+  height: calc(100% - 125px) !important;
+  box-sizing: border-box;
+  padding: 30px 0 !important;
+  background: #fff !important;
+}
+
+.fullStyle>>>.el-dialog {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 !important;
+}
+
+.fullStyle {
+  width: 100% !important;
+  max-width: 100% !important;
+  height: 100% !important;
+  margin: 0 auto !important;
+}
+
+.fullStyle>>>.el-dialog__footer{
+  background: #fff !important;
+}
+
+.engUpBox {
+  width: 100%;
+  height: 100%;
+}
+
+.engTitle,
+.engText {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;    
+  padding: 0 20px 20px 20px;
+  box-sizing: border-box;
+}
+.correctBox{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: flex-start;
+}
+
+.oldBox{
+  width: 50%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+  border-top: 1px solid #d9d9d9;
+  border-left: 1px solid #d9d9d9;
+  border-right: 1px solid #d9d9d9;
+}
+.oldBox>div:first-child{
+  width: 100%;
+  text-align: center;
+  background: #d9d9d9;
+  height: 35px;
+  line-height: 35px;
+  font-weight: bold;
+}
+
+.oldText{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-content: center;
+  justify-content: center;
+  align-items: center;
+}
+
+.detailBox{
+  width: 50%;
+  padding: 10px;
+  background: #f6f6f6;
+  border-radius: 5px;
+}
+
+.oldDetail{
+  padding-bottom: 30px;
+}
 </style>