浏览代码

修改表格问题和计时器

zengyicheng 2 年之前
父节点
当前提交
363fa0c5a8
共有 2 个文件被更改,包括 18 次插入4 次删除
  1. 8 2
      src/components/studyStudent.vue
  2. 10 2
      src/components/tools/time.vue

+ 8 - 2
src/components/studyStudent.vue

@@ -208,7 +208,7 @@
                         </div>
                       </el-form-item>
                       <!-- <div style="color: #918f8f; width: 85%">文档内容</div> -->
-                      <div v-html="text.url" class="textContent"></div>
+                      <div v-html="text.url" class="textContent cont"></div>
                     </el-form>
                   </div>
                   <div class="wheel" v-if="showType == 2" style="height: 650px; width: 95%; margin: 0 auto">
@@ -3122,7 +3122,7 @@
     <el-dialog title="倒计时" :visible.sync="timeDialogVisible" :append-to-body="true" width="800px"
       :before-close="handleClose" class="dialog_diy">
       <div>
-        <Time v-if="timeDialogVisible"></Time>
+        <Time :preTime="preTime" v-if="timeDialogVisible"></Time>
       </div>
       <div slot="footer">
         <el-button @click="timeDialogVisible = false">关 闭</el-button>
@@ -4261,6 +4261,7 @@ export default {
       file: [],
       vedioTime: [],
       upToolImg: "",
+      preTime:0,
       rateList: {
         ca: 0,
       },
@@ -7926,6 +7927,11 @@ export default {
           a = this.timeCount;
           this.toolsCount(a, t);
         }
+        this.preTime = this.chapInfoList[this.courseType].chapterInfo[0]
+          .taskJson[index].toolChoose[i].preTime
+          ? this.chapInfoList[this.courseType].chapterInfo[0].taskJson[index]
+            .toolChoose[i].preTime
+          : "";
         this.timeDialogVisible = true;
       } else if (t == 15) {
         this.answerQ = "";

+ 10 - 2
src/components/tools/time.vue

@@ -69,6 +69,7 @@
 
 <script>
 export default {
+  props: ["preTime"],
   data() {
     return {
       length: Math.PI * 2 * 100,
@@ -178,11 +179,18 @@ export default {
       this.update(this.wholeTime, this.wholeTime, 1);
       this.displayTimeLeft(this.wholeTime, 1);
     },
+    getValue() {
+      this.wholeTime = this.preTime;
+      this.update(this.wholeTime, this.wholeTime, 1);
+      this.displayTimeLeft(this.wholeTime,1);
+      // this.$forceUpdate();
+    },
   },
   created() {
     this.offset = this.length;
-    this.update(this.wholeTime, this.wholeTime);
-    this.displayTimeLeft(this.wholeTime);
+    // this.update(this.wholeTime, this.wholeTime);
+    // this.displayTimeLeft(this.wholeTime);
+    this.getValue();
   },
   beforeDestroy() {
     clearInterval(this.intervalTimer);