lsc 2 년 전
부모
커밋
a3d841683e
5개의 변경된 파일430개의 추가작업 그리고 36개의 파일을 삭제
  1. BIN
      src/assets/icon/word2.png
  2. BIN
      src/assets/icon/zip.png
  3. 326 0
      src/components/pages/a.vue
  4. 14 4
      src/components/pages/components/proMan.vue
  5. 90 32
      src/components/pages/student/addCourse.vue

BIN
src/assets/icon/word2.png


BIN
src/assets/icon/zip.png


+ 326 - 0
src/components/pages/a.vue

@@ -0,0 +1,326 @@
+<template>
+    <div class="container">
+      <div class="setters">
+        <div class="minutes-set">
+          <button
+            data-setter="minutes-plus"
+            @click="changeTime('minutes-plus')"
+            :disabled="isStarted"
+            :style="{ opacity: isStarted ? 0.5 : 1 }"
+          >
+            +
+          </button>
+          <button
+            data-setter="minutes-minus"
+            @click="changeTime('minutes-minus')"
+            :disabled="isStarted"
+            :style="{ opacity: isStarted ? 0.5 : 1 }"
+          >
+            -
+          </button>
+        </div>
+        <div class="seconds-set">
+          <button
+            data-setter="seconds-plus"
+            @click="changeTime('seconds-plus')"
+            :disabled="isStarted"
+            :style="{ opacity: isStarted ? 0.5 : 1 }"
+          >
+            +
+          </button>
+          <button
+            data-setter="seconds-minus"
+            @click="changeTime('seconds-minus')"
+            :disabled="isStarted"
+            :style="{ opacity: isStarted ? 0.5 : 1 }"
+          >
+            -
+          </button>
+        </div>
+      </div>
+      <div class="circle">
+        <svg width="300" viewBox="0 0 220 220" xmlns="http://www.w3.org/2000/svg">
+          <g transform="translate(110,110)">
+            <circle r="100" class="e-c-base" />
+            <g transform="rotate(-90)">
+              <circle
+                r="100"
+                class="e-c-progress"
+                :style="{ strokeDasharray: offset }"
+              />
+              <g id="e-pointer" :style="{ transform: pointerTransform }">
+                <circle cx="100" cy="0" r="8" class="e-c-pointer" />
+              </g>
+            </g>
+          </g>
+        </svg>
+      </div>
+      <div class="controlls">
+        <div class="display-remain-time">{{ displayString }}</div>
+        <!-- <button
+          :class="{ play: !play, pause: play }"
+          id="pause"
+          @click="pauseTimer"
+        ></button> -->
+      </div>
+      <el-button type="primary" @click="reset" class="reset_btn">重置</el-button>
+    </div>
+  </template>
+  
+  <script>
+  export default {
+    props: ["preTime"],
+    data() {
+      return {
+        length: Math.PI * 2 * 100,
+        offset: 0,
+        pointerTransform: "",
+        play: false,
+        intervalTimer: null,
+        wholeTime: 0,
+        timeLeft: "",
+        isPaused: false,
+        isStarted: false,
+        displayString: "",
+      };
+    },
+    watch: {
+      displayString: {
+        immediate: true,
+        deep: true,
+        handler(newValue, oldValue) {
+          this.getValue();
+        },
+      },
+    },
+    methods: {
+      changeWholeTime(seconds) {
+        if (this.wholeTime + seconds >= 0) {
+          this.wholeTime += seconds;
+          this.update(this.wholeTime, this.wholeTime);
+        }
+      },
+      changeTime(param) {
+        switch (param) {
+          case "minutes-plus":
+            this.changeWholeTime(1 * 60);
+            break;
+          case "minutes-minus":
+            this.changeWholeTime(-1 * 60);
+            break;
+          case "seconds-plus":
+            this.changeWholeTime(1);
+            break;
+          case "seconds-minus":
+            this.changeWholeTime(-1);
+            break;
+        }
+        this.displayTimeLeft(this.wholeTime);
+      },
+      update(value, timePercent, type) {
+        this.offset = -this.length - (this.length * value) / timePercent;
+        if (value === 0 && type === 1) {
+          this.pointerTransform = `rotate(${360}deg)`;
+        } else {
+          this.pointerTransform = `rotate(${(360 * value) / timePercent}deg)`;
+        }
+      },
+      displayTimeLeft(timeLeft, type) {
+        //displays time on the input
+        let minutes = Math.floor(timeLeft / 60);
+        let seconds = timeLeft % 60;
+        this.displayString = `${minutes < 10 ? "0" : ""}${minutes}:${
+          seconds < 10 ? "0" : ""
+        }${seconds}`;
+        // displayOutput.textContent = displayString;
+        this.update(timeLeft, this.wholeTime, type);
+        this.updateTimeNum();
+      },
+      timer(seconds) {
+        //counts time, takes seconds
+        let remainTime = Date.now() + seconds * 1000;
+        this.displayTimeLeft(seconds);
+  
+        let _this = this;
+        _this.intervalTimer = setInterval(function () {
+          _this.timeLeft = Math.round((remainTime - Date.now()) / 1000);
+          if (_this.timeLeft < 0) {
+            clearInterval(_this.intervalTimer);
+            _this.isStarted = false;
+            _this.play = false;
+            // setterBtns.forEach(function (btn) {
+            //   btn.disabled = false;
+            //   btn.style.opacity = 1;
+            // });
+            _this.displayTimeLeft(_this.wholeTime);
+            _this.$message.success("时间到!!!");
+            // pauseBtn.classList.remove("pause");
+            // pauseBtn.classList.add("play");
+            return;
+          }
+          _this.displayTimeLeft(_this.timeLeft);
+        }, 1000);
+      },
+      pauseTimer() {
+        if (!this.play && !this.isPaused) {
+          this.play = true;
+          this.isStarted = true;
+          this.timer(this.wholeTime);
+        } else if (this.isPaused) {
+          this.play = true;
+          this.timer(this.timeLeft);
+          this.isStarted = true;
+          this.isPaused = this.isPaused ? false : true;
+        } else {
+          this.play = false;
+          this.isStarted = true;
+          clearInterval(this.intervalTimer);
+          this.isPaused = this.isPaused ? false : true;
+        }
+        console.log(1);
+      },
+      reset() {
+        clearInterval(this.intervalTimer);
+        this.play = false;
+        this.isStarted = false;
+        this.isPaused = false;
+        this.wholeTime = 0;
+        this.timeLeft = null;
+        this.update(this.wholeTime, this.wholeTime, 1);
+        this.displayTimeLeft(this.wholeTime, 1);
+      },
+      updateTimeNum() {
+        this.$emit("updateTimeNum", this.displayString);
+      },
+      getValue() {
+        this.displayString = this.preTime;
+        this.$forceUpdate();
+      },
+    },
+    created() {
+      this.offset = this.length;
+      this.update(this.wholeTime, this.wholeTime);
+      this.displayTimeLeft(this.wholeTime);
+      this.getValue();
+    },
+    beforeDestroy() {
+      clearInterval(this.intervalTimer);
+    },
+  };
+  </script>
+  
+  <style scoped>
+  button[data-setter] {
+    outline: none;
+    background: transparent;
+    border: none;
+    font-family: "Roboto";
+    font-weight: 300;
+    font-size: 36px;
+    width: 32px;
+    /* height: 30px; */
+    color: #409eff;
+    cursor: pointer;
+  }
+  button[data-setter]:hover {
+    opacity: 0.5;
+  }
+  .container {
+    position: relative;
+    /* top: 30px; */
+    width: 300px;
+    margin: 0 auto;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+  }
+  .setters {
+    position: absolute;
+    /* left: 85px;
+    top: 75px; */
+    left: 78px;
+    top: 75px;
+  }
+  .minutes-set {
+    float: left;
+    /* margin-right: 28px; */
+    margin-right: 20px;
+  }
+  .seconds-set {
+    float: right;
+  }
+  .controlls {
+    position: absolute;
+    left: 75px;
+    top: 105px;
+    text-align: center;
+  }
+  .display-remain-time {
+    font-family: "Roboto";
+    font-weight: 100;
+    font-size: 65px;
+    color: #409eff;
+  }
+  #pause {
+    outline: none;
+    background: transparent;
+    border: none;
+    margin-top: 10px;
+    width: 50px;
+    height: 50px;
+    position: relative;
+  }
+  .play::before {
+    display: block;
+    content: "";
+    position: absolute;
+    top: 8px;
+    left: 16px;
+    border-top: 15px solid transparent;
+    border-bottom: 15px solid transparent;
+    border-left: 22px solid #77a4d3;
+  }
+  .pause::after {
+    content: "";
+    position: absolute;
+    top: 8px;
+    left: 12px;
+    width: 15px;
+    height: 30px;
+    background-color: transparent;
+    border-radius: 1px;
+    border: 5px solid #77a4d3;
+    border-top: none;
+    border-bottom: none;
+  }
+  #pause:hover {
+    opacity: 0.8;
+  }
+  .e-c-base {
+    fill: none;
+    stroke: #b6b6b6;
+    stroke-width: 4px;
+  }
+  .e-c-progress {
+    fill: none;
+    stroke: #6eaded;
+    stroke-width: 4px;
+    transition: stroke-dashoffset 0.7s;
+  }
+  .e-c-pointer {
+    fill: #fff;
+    stroke: #6eaded;
+    stroke-width: 2px;
+  }
+  #e-pointer {
+    transition: transform 0.7s;
+  }
+  
+  .reset_btn {
+    width: 100px;
+    margin: 15px auto 0px;
+    background: #527aa3;
+    border: none;
+  }
+  </style>
+  

+ 14 - 4
src/components/pages/components/proMan.vue

@@ -7,6 +7,10 @@
             <div class="rwTouImg"></div>
             <div>{{ getMan(item2.people) }}</div>
           </div>
+          <div class="rwTop" v-if="item2.tcMember && item2.tcMember.length">
+            <div class="rwTouImg" style="background:#ff9219"></div>
+            <div><span class="tcMember" v-for="(mam,mIndex) in item2.tcMember" :key="mIndex">{{ getMan(mam) }}</span></div>
+          </div>
           <div class="rwMidBox">
             <div>{{ item2.task }}</div>
             <div class="rwMessage">
@@ -120,15 +124,17 @@ export default {
   display: flex;
   flex-direction: row;
   flex-wrap: nowrap;
-  align-items: center;
+  align-items: top;
+}
+.rwTop + .rwTop{
+  margin-top: 5px;
 }
-
 .rwTouImg {
-  width: 13px;
+  min-width: 13px;
   height: 13px;
   background: #0258f1 100%;
   border-radius: 50%;
-  margin: 0 10px;
+  margin: 5px 10px 0;
 }
 
 .rwMidBox {
@@ -175,4 +181,8 @@ export default {
 .rwBoxMessage>div:nth-child(2) {
   font-size: 12px;
 }
+
+.tcMember+.tcMember::before {
+  content: '、';
+}
 </style>

+ 90 - 32
src/components/pages/student/addCourse.vue

@@ -554,7 +554,9 @@
                                               " /> -->
                                                             <el-select v-model="unitJson[unitIndex].chapterInfo[0].taskJson[
                                                                 itemTaskIndex
-                                                            ].people" placeholder="请选择负责人" clearable filterable>
+                                                            ].people" placeholder="请选择负责人" clearable filterable @change="peopleChange(unitJson[unitIndex].chapterInfo[0].taskJson[
+                                                                itemTaskIndex
+                                                            ].people,itemTaskIndex)">
                                                                 <el-option v-for="item in ManAarray" :key="item.userid"
                                                                     :label="item.name + (item.type == 1 ? '(老师)' : '(学生)')"
                                                                     :value="item.userid">
@@ -565,8 +567,10 @@
                                                     <div class="addPeople" @click="addTcMember(itemTaskIndex)"
                                                         style="background: rgb(107, 146, 201);margin: 0 0 10px 15px;margin-bottom: 10px;width: 100px;">
                                                         {{
-                                                            unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember
-                                                                ? '已添加' : '添加协同者'
+                                                        (unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember
+    &&
+    unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember.length)
+    ? '已添加' : '添加协同者'
                                                         }}
                                                     </div>
                                                 </div>
@@ -579,6 +583,25 @@
                                           justify-content: flex-start;
                                           align-items: center;
                                           display: flex;
+                                        " v-if="unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember && unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember.length">
+                                                <div style="
+                                            height: 20px;
+                                            padding-left: 16px;
+                                            line-height: 22px;
+                                          ">
+                                                    协同人员
+                                                </div>
+                                                <div style="margin-left:20px">
+                                                    <span class="tcMember"
+                                                        v-for="(tc, tcIndex) in unitJson[unitIndex].chapterInfo[0].taskJson[itemTaskIndex].tcMember"
+                                                        :key="tcIndex">{{ getMan(tc) }}</span>
+                                                </div>
+                                            </div>
+                                            <div style="
+                                          flex-direction: row;
+                                          justify-content: flex-start;
+                                          align-items: center;
+                                          display: flex;
                                           margin-top: 10px;
                                         ">
                                                 <div style="
@@ -942,9 +965,8 @@
                                                             <img src="../../../assets/icon/fourthToolList/zip.png"
                                                                 alt />
                                                             <div style="margin: 5px 0">压缩文件</div>
-                                                            <input type="file"
-                                                                accept=".zip,.rar"
-                                                                capture="camera" style="display: none"
+                                                            <input type="file" accept=".zip,.rar" capture="camera"
+                                                                style="display: none"
                                                                 @change="beforeUploadCC($event, 3, itemTaskIndex, toolIndex, 55)" />
                                                             <div v-if="itemTool.proVisible" class="mask">
                                                                 <div class="lbox2">
@@ -1085,17 +1107,15 @@
                                                             </el-tooltip>
                                                         </div>
                                                         <img v-if="photo.type == 10"
-                                                            src="../../../assets/icon/isWord.png" alt=""
+                                                            src="../../../assets/icon/word2.png" alt=""
                                                             @click="openTable(photo.content)">
-                                                        <img v-if="photo.type == 4"
-                                                            src="../../../assets/icon/isWord.png" alt=""
-                                                            @click="openFile(photo.content)">
+                                                        <img v-if="photo.type == 4" src="../../../assets/icon/word2.png"
+                                                            alt="" @click="openFile(photo.content)">
                                                         <img v-if="photo.type == 12"
-                                                            src="../../../assets/icon/isWord.png" alt=""
+                                                            src="../../../assets/icon/word2.png" alt=""
                                                             @click="openText(photo.content)">
-                                                        <img v-if="photo.type == 13"
-                                                            src="../../../assets/icon/isWord.png" alt=""
-                                                            @click="downloadFile(photo.content)">
+                                                        <img v-if="photo.type == 13" src="../../../assets/icon/zip.png"
+                                                            alt="" @click="downloadFile(photo.content)">
                                                         <img v-if="photo.type == 5"
                                                             src="../../../assets/icon/isVideo.png" alt=""
                                                             @click="openVideo(photo.content)">
@@ -1118,12 +1138,12 @@
                                                     </div>
                                                     <div>添加工具</div>
                                                 </div>
-                                                <div class="addToolFun" @click="addSourceFunD(itemTaskIndex)">
+                                                <!-- <div class="addToolFun" @click="addSourceFunD(itemTaskIndex)">
                                                     <div class="addToolImg">
                                                         <img src="../../../assets/icon/add.png" alt />
                                                     </div>
                                                     <div>添加资源</div>
-                                                </div>
+                                                </div> -->
                                             </div>
                                         </div>
                                     </div>
@@ -1382,8 +1402,8 @@
                     <span>账号</span>
                     <span>学校</span>
                 </div>
-                <el-checkbox-group v-model="tcMember" class="people_name" v-if="ManAarray.length">
-                    <el-checkbox v-for="item in ManAarray" :key="item.userid" :label="item.userid">
+                <el-checkbox-group v-model="tcMember" class="people_name" v-if="ManAarray2.length">
+                    <el-checkbox v-for="item in ManAarray2" :key="item.userid" :label="item.userid">
                         <div class="t_j_box">
                             <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
                                 <span>{{ item.name ? item.name : "暂无姓名" }}</span>
@@ -1792,7 +1812,7 @@
                           <el-input v-model="AttText.title" auto-complete="off" @input="change2" placeholder="请输入文本标题..."></el-input>
                         </el-form-item> -->
                 <div>表格内容</div>
-                <Table v-model="tableJson.text" @change="change"></Table>
+                <Table v-model="tableJson.text" @change="change" v-if="dialogVisibleTable"></Table>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisibleTable = false">取 消</el-button>
@@ -1806,7 +1826,7 @@
                           <el-input v-model="AttText.title" auto-complete="off" @input="change2" placeholder="请输入文本标题..."></el-input>
                         </el-form-item> -->
                 <div>表格内容</div>
-                <Table v-model="tableJson.text" @change="change"></Table>
+                <Table v-model="tableJson.text" @change="change" v-if="dialogVisibleTable1"></Table>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisibleTable1 = false">取 消</el-button>
@@ -2175,7 +2195,7 @@
             :before-close="handleClose" class="dialog_diy">
             <el-form>
                 <div>文档内容</div>
-                <EditorBar v-model="tableJson.text" @change="change" v-if="dialogVisibleText"></EditorBar>
+                <editor-bar v-model="tableJson.text" @change="change" v-if="dialogVisibleText"></editor-bar>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisibleText = false">取 消</el-button>
@@ -2186,7 +2206,7 @@
             :before-close="handleClose" class="dialog_diy">
             <el-form>
                 <div>文档内容</div>
-                <EditorBar v-model="tableJson.text" @change="change" v-if="dialogVisibleText3"></EditorBar>
+                <EditorBar2 v-model="tableJson.text" @change="change" v-if="dialogVisibleText3"></EditorBar2>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisibleText3 = false">取 消</el-button>
@@ -2209,8 +2229,7 @@
                     @play="onPlayerPlay($event)" style="width: 100%; height: 100%"></video-player>
             </div>
             <div slot="footer">
-                <el-button style="background: #409efe; color: #fff"
-                    @click="(videoVisible = false), (videoDetail = {})">
+                <el-button style="background: #409efe; color: #fff" @click="(videoVisible = false), (videoDetail = {})">
                     关 闭</el-button>
             </div>
         </el-dialog>
@@ -2220,6 +2239,7 @@
 import "../../../common/aws-sdk-2.235.1.min.js";
 import $ from "jquery";
 import EditorBar from "../../../components/tools/wangEnduit";
+import EditorBar2 from "../../../components/tools/wangEnduit";
 import Table from "../../../components/tools/table";
 import TextT from "../../../components/tools/text";
 import Mind from "../../tools/jsmind2";
@@ -2232,6 +2252,7 @@ import * as imageConversion from "image-conversion";
 export default {
     components: {
         EditorBar,
+        EditorBar2,
         Mind,
         Sunburst,
         SeeBoard,
@@ -2453,6 +2474,7 @@ export default {
             dialogVisibleGroup: false,
             fpath: "",
             ManAarray: [],
+            ManAarray2: [],
             proVisible: false,
             progress: 0,
             playerOptions: {
@@ -2503,6 +2525,20 @@ export default {
                 return d
             }
         },
+        getMan() {
+            return function (people) {
+                let _people = people
+                if (this.ManAarray.length) {
+                    for (var i = 0; i < this.ManAarray.length; i++) {
+                        if (this.ManAarray[i].userid == people) {
+                            _people = this.ManAarray[i].name;
+                            break;
+                        }
+                    }
+                }
+                return _people
+            }
+        },
     },
     watch: {
         unitIndex(newValue, oldValue) {
@@ -2604,6 +2640,7 @@ export default {
         },
         change(val) {
             console.log(val);
+            this.$forceUpdate();
         },
         change2(val) {
             console.log(val);
@@ -3835,20 +3872,20 @@ export default {
                                 "OGM",
                             ];
                             if (type == 1) {
-                                if (['ZIP'].indexOf(data.Location.split(".")[data.Location.split(".").length - 1].toLocaleUpperCase()) != -1){
+                                if (['ZIP'].indexOf(data.Location.split(".")[data.Location.split(".").length - 1].toLocaleUpperCase()) != -1) {
                                     _this.addCourseWorksS(tool, 13, data.Location, task, toolindex);
-                                }else{
+                                } else {
                                     _this.addCourseWorksS(tool, 4, data.Location, task, toolindex);
                                 }
                             } else if (type == 2) {
                                 if (c.indexOf(data.Location.split(".")[data.Location.split(".").length - 1].toLocaleUpperCase()) != -1) {
                                     _this.addCourseWorksS(tool, 5, data.Location, task, toolindex);
-                                }  else {
+                                } else {
                                     _this.addCourseWorksS(tool, 1, data.Location, task, toolindex);
-                                } 
-                            }else if (type == 3) {
+                                }
+                            } else if (type == 3) {
                                 _this.addCourseWorksS(tool, 13, data.Location, task, toolindex);
-                            } 
+                            }
                             console.log(data.Location);
                             // _this.$message.success('上传成功'+data.Location)
                         }
@@ -4016,7 +4053,7 @@ export default {
                 this.tableJson.text = ''
                 this.dialogVisibleText = true;
             } else if (tool == 51) {
-
+                this.addSourceFunD(this.taskCount)
             } else {
                 this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
                     this.taskCount
@@ -4088,6 +4125,7 @@ export default {
             this.editSourceType = 1
             this.sourcesData = []
             this.dialogVisibleSource = false
+            this.dialogVisibleTool = false
             this.setVHeight();
         },
         openToolFun(tool, taskCount, i) {
@@ -4677,10 +4715,26 @@ export default {
         addTcMember(index) {
             this.taskCount = index
             // this.searchTN = ""
-            this.tcMember = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].tcMember ? this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].tcMember : []
+            let tcMember = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index].tcMember ? this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index].tcMember : []
+            const people = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index].people
+            let ManAarray = JSON.parse(JSON.stringify(this.ManAarray))
+            for(var i = 0;i<ManAarray.length;i++){
+                if(ManAarray[i].userid === people){
+                    ManAarray.splice(i, 1)
+                }
+            }
+            this.tcMember = tcMember
+            this.ManAarray2 = ManAarray
             // this.getTeacher();
             this.dialogVisibleTcMember = true;
         },
+        peopleChange(people,index){
+            let tcMember = this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index].tcMember ? this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index].tcMember : []
+            if (tcMember.indexOf(people) != -1) {
+                tcMember.splice(tcMember.indexOf(people), 1)
+            }
+            this.unitJson[this.unitIndex].chapterInfo[0].taskJson[index].tcMember = tcMember
+        },
         getTemplate() {
             let params = {
                 oid: this.oid
@@ -9347,4 +9401,8 @@ ol {
     height: 100% !important;
     margin: 0 !important;
 }
+
+.tcMember+.tcMember::before {
+    content: '、';
+}
 </style>