Browse Source

协同编辑

lsc 2 years ago
parent
commit
6d7b260ed0

+ 1 - 1
dist/index.html

@@ -25,4 +25,4 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.094d3efee093dfcd799ad8fb15686470.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.85f48b0184f614b2b8d9.js></script><script type=text/javascript src=./static/js/vendor.5381b06bfaaab9dbd007.js></script><script type=text/javascript src=./static/js/app.8f6829c8c733309ef2fd.js></script></body></html><script>document.domain = document.domain.split(".").slice(-2).join(".");</script>
+    }</style><link href=./static/css/app.b85ca17c62bec1346f877eefb9f65559.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.85f48b0184f614b2b8d9.js></script><script type=text/javascript src=./static/js/vendor.5381b06bfaaab9dbd007.js></script><script type=text/javascript src=./static/js/app.49b87d4c6abaaef3353d.js></script></body></html><script>document.domain = document.domain.split(".").slice(-2).join(".");</script>

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.094d3efee093dfcd799ad8fb15686470.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.b85ca17c62bec1346f877eefb9f65559.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.b85ca17c62bec1346f877eefb9f65559.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.49b87d4c6abaaef3353d.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.49b87d4c6abaaef3353d.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.8f6829c8c733309ef2fd.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.8f6829c8c733309ef2fd.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.85f48b0184f614b2b8d9.js.map


+ 54 - 5
src/components/pages/addCourse.vue

@@ -236,13 +236,13 @@
                   ></textarea>
                 </div>
               </div>
-              <div style="width: 95%; margin: 15px auto">
+              <!-- <div style="width: 95%; margin: 15px auto">
                 <el-switch
                   v-model="isTeacherSee"
                   active-text="允许给其他老师查看"
                   style="padding-bottom: 30px"
                 ></el-switch>
-              </div>
+              </div> -->
             </div>
           </div>
           <div class="rightBox" v-if="this.steps == 2">
@@ -2199,7 +2199,11 @@ export default {
               this.$message.error("请将信息填写完整");
               return;
             } else {
-              this.updateWork();
+              if(this.userid != this.courseUserid){
+                this.updateWork2();
+              }else{
+                this.updateWork();
+              }
               this.steps++;
             }
           }
@@ -2232,7 +2236,11 @@ export default {
               this.$message.error("请将信息填写完整");
               return;
             } else {
-              this.updateWork();
+              if(this.userid != this.courseUserid){
+                this.updateWork2();
+              }else{
+                this.updateWork();
+              }
               this.steps++;
             }
           }
@@ -2838,6 +2846,43 @@ export default {
     goCourse() {
       window.parent.postMessage({ cid: this.courseId, type: "1" }, "*");
     },
+    updateWork2() {
+      let _unitIndex = this.unitIndex
+        for (
+          var j = 0;
+          j < this.unitJson[_unitIndex].chapterInfo[0].taskJson.length;
+          j++
+        ) {
+          if (this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList) {
+            this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList = this.unitJson[
+              _unitIndex
+            ].chapterInfo[0].taskJson[j].eList.filter((ele) => {
+              return ele.value != "";
+            });
+          }
+        }
+      let params = [
+        {
+          cid: this.cid,
+          chapters: JSON.stringify(this.unitJson).replaceAll(/%/g, "%25"),
+          uid: this.userid,
+          unitIndex: _unitIndex,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "updateWorkNew4", params)
+        .then((res) => {
+          this.$message({
+            message: "修改成功",
+            type: "success",
+          });
+          this.courseId = this.cid;
+        })
+        .catch((err) => {
+          this.$message.error("修改失败");
+          console.error(err);
+        });
+    },
     updateWork() {
       for (var i = 0; i < this.unitJson.length; i++) {
         for (
@@ -3468,14 +3513,18 @@ export default {
         .get(this.$store.state.api + "select_course_detail", params)
         .then((res) => {
           let unitJson = JSON.parse(res.data[0][0].chapters);
+          let _unitJson = JSON.parse(JSON.stringify(this.unitJson));
           let _unitIndex = this.unitIndex;
           for (let i = 0; i < unitJson.length; i++) {
             if (i == _unitIndex) {
               continue;
+            }else if(i > this.unitJson.length - 1){
+              _unitJson.push(unitJson[i]);
             } else {
-              this.unitJson[i] = unitJson[i];
+              _unitJson[i] = unitJson[i];
             }
           }
+          this.unitJson = _unitJson
           this.$forceUpdate();
           this.timer = setTimeout(() => {
             this.seleteCourseUpdate();

+ 70 - 0
src/components/pages/components/report.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="r_box">
+    <div class="r_cbox">
+      <span>学生姓名</span>
+      <el-select class="r_select" v-model="uname" placeholder="全部">
+        <!-- <el-option
+          v-for="item in options"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option> -->
+      </el-select>
+    </div>
+    <div class="r_cbox">
+      <span>选择阶段</span>
+      <el-select  class="r_select" v-model="chap" multiple collapse-tags placeholder="请选择阶段">
+        <!-- <el-option
+          v-for="item in options"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option> -->
+      </el-select>
+    </div>
+    <div class="r_cbox">
+      <span>任务内容</span>
+      <el-select  class="r_select" v-model="task" multiple collapse-tags placeholder="全部">
+        <!-- <el-option
+          v-for="item in options"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option> -->
+      </el-select>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      uname: [],
+      chap: [],
+      task: [],
+    };
+  },
+};
+</script>
+
+<style scoped>
+.r_box {
+}
+.r_cbox {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-bottom: 20px;
+}
+.r_cbox span {
+    margin-right: 20px;
+}
+
+.r_box .r_select{
+    width: 300px;
+}
+</style>

+ 29 - 3
src/components/pages/works.vue

@@ -120,6 +120,7 @@
       class="workdates"
     ></WorkDate>
     <div class="cancelbox" v-if="dialogVisible">
+      <!-- <el-button @click="dialogVisibleBao = true" type="primary" size="small">自定义导出</el-button> -->
       <el-button @click="cancel" type="primary" size="small">返回</el-button>
       <!-- <el-button
         type="primary"
@@ -137,14 +138,33 @@
         >查看作业</el-button
       >-->
     </div>
+    <el-dialog
+      title="自定义导出报告"
+      :visible.sync="dialogVisibleBao"
+      :append-to-body="true"
+      width="550px"
+      :before-close="handleClose"
+      class="dialog_diy"
+    >
+      <div>
+        <div>
+          <Report :cid="dataJson.courseId"></Report>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleBao = false">关 闭</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import WorkDate from "./components/workData";
+import Report from "./components/report";
 export default {
   components: {
     WorkDate,
+    Report
   },
   data() {
     return {
@@ -165,6 +185,7 @@ export default {
       userid: this.$route.query.userid,
       oid: this.$route.query.oid,
       dialogVisible: false,
+      dialogVisibleBao:false,
       dataJson: {},
     };
   },
@@ -315,14 +336,15 @@ export default {
 }
 
 .dialog_diy >>> .el-dialog__header {
-  background: #3d67bc !important;
-  padding: 15px 20px;
+  padding: 9px 20px 10px;
+  background: #32455b !important;
 }
 .dialog_diy >>> .el-dialog__title {
   color: #fff;
+  font-size: 15px;
 }
 .dialog_diy >>> .el-dialog__headerbtn {
-  top: 19px;
+  top: 14px;
 }
 .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
   color: #fff;
@@ -330,6 +352,10 @@ export default {
 .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
   color: #fff;
 }
+.dialog_diy >>> .el-dialog__body,
+.dialog_diy >>> .el-dialog__footer {
+  background: #fafafa;
+}
 .a_addBox {
   height: 570px;
   overflow: auto;

Some files were not shown because too many files changed in this diff