dedsudiyu 1 年間 前
コミット
8484c669dc
共有2 個のファイルを変更した71 個の追加184 個の削除を含む
  1. 0 141
      src/views/safetyEducationExam/safeLearning/el_resources/index.vue
  2. 71 43
      src/views/safetyEducationExam/safeLearning/safeLearning/learning.vue

+ 0 - 141
src/views/safetyEducationExam/safeLearning/el_resources/index.vue

@@ -338,7 +338,6 @@ export default {
     }
     return {
       tableButtonType:this.hasPermiDom(['exam:elResources:add','exam:elResources:edit','exam:elResources:del']),
-      aa:'1111111',
       //页面状态
       pageType:1,
       pageData:{
@@ -569,94 +568,6 @@ export default {
       this.richTextAddType = false;
       this.richTextEditType = false;
     },
-    //上传
-    handleRemove(file, fileList) {
-      this.fileList = [];
-    },
-    fileListAdd(file, fileList){
-      this.fileList.push(file);
-      this.$forceUpdate()
-    },
-    //树点击事件
-    editCheck(event) {
-      this.$refs.ditTree.setCheckedKeys([event.id]);
-      this.editForm.cateId = event.id;
-    },
-    editCheckTwo(event) {
-      this.$refs.ditTree.setCheckedKeys([event.id]);
-      this.richTextForm.cateId = event.id;
-    },
-    beforeAvatarUpload(file) {
-      console.log('file',file);
-      let type = false;
-      if (
-        //图片
-        file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif' ||
-        //pdf
-        file.type == 'application/pdf' ||
-        //视频
-        file.type == 'video/mp4' ||
-        //word
-        file.type == 'application/msword' || file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
-      ) {
-        type = true;
-      }else{
-        this.$message.error('只能上传png/jpeg/gif/mp4/doc/docx/pdf格式文件');
-        type = false;
-      }
-      return type;
-    },
-    //开始上传
-    progressUpEdit(event, file, fileList){
-      this.loading = true;
-    },
-    //上传成功
-    handleAvatarSuccessEdit(res, file,index) {
-      if(res.code == 200){
-        this.msgSuccess("上传成功");
-        this.loading = false;
-        this.openEdit = false;
-        this.getList();
-      }else{
-        this.loading = false;
-        this.msgError(res.message);
-      }
-    },
-    //上传失败
-    errorUpEdit(err, file, fileList){
-      this.loading = false;
-    },
-    editUpClick(){
-      let self = this;
-      this.uploadImgUrl = window.location.href.split('://')[0]+'://' + this.judgmentNetworkReturnAddress() + "/exam/el_resources/update?cateId=" + this.editForm.cateId +'&id=' + this.editForm.id + '&title=' + this.editForm.title
-      if(this.fileList[0]){
-        setTimeout(function(){
-          self.submitUpload();
-        },100);
-      }else{
-        let obj = {
-          id:this.editForm.id,
-          cateId:this.editForm.cateId,
-          title:this.editForm.title,
-        };
-        examElResourcesUpdate(obj).then( response => {
-          this.msgSuccess("修改成功");
-          this.loading = false;
-          this.openEdit = false;
-          this.getList();
-        });
-      }
-    },
-    submitUpload() {
-      if(this.loading){
-        return
-      }
-      this.$refs["editForm"].validate(valid => {
-        if (valid) {
-          this.$refs.editFormUp.submit();
-        }
-      });
-    },
     //关闭新增上传页面
     offUpPage(done){
       if(this.upTextList[0]){
@@ -736,25 +647,6 @@ export default {
       forFn(arr1, id)
       return temp
     },
-
-    //开始上传
-    progressUp(event, file, fileList){
-      this.loading = true;
-    },
-    //上传成功
-    handleAvatarSuccess(res, file,index) {
-      let obj = {
-        title:res.data.title,
-        postfix:res.data.postfix,
-        sizeStr:res.data.sizeStr
-      }
-      this.upTextList.push(obj);
-      this.loading = false;
-    },
-    //上传失败
-    errorUp(err, file, fileList){
-      this.loading = false;
-    },
     /** 查询课件资源列表 */
     getList() {
       this.loading = true;
@@ -946,12 +838,6 @@ export default {
           this.msgSuccess("删除成功");
         }).catch(() => {});
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('exam/el_resources/export', {
-        ...this.queryParams
-      }, `exam_el_resources.xlsx`)
-    },
     fileSuccess(rootFile, file, response, chunk) {
 
       const result = JSON.parse(response);
@@ -992,7 +878,6 @@ export default {
       // 上传完毕。
     },
     filesAdded(file, fileList, event) {
-      console.log('file',file)
       file.forEach((item)=>{
         if(["image/png","image/jpeg","image/gif",
           "application/pdf",
@@ -1005,18 +890,6 @@ export default {
           this.computeMD5(item);
         }
       })
-      // if (["image/png","image/jpeg","image/gif",
-      //   "application/pdf",
-      //   "video/mp4",
-      //   "application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].indexOf(file[0].fileType) === -1){
-      //   this.$message.error("请上传正确的格式");
-      //   file.ignored = true;
-      // }else{
-      //   file.forEach((e) => {
-      //     this.fileList.push(e);
-      //     this.computeMD5(e);
-      //   });
-      // }
     },
     computeMD5(file) {
       let fileReader = new FileReader();
@@ -1054,20 +927,6 @@ export default {
         fileReader.readAsArrayBuffer(blobSlice.call(file.file, start, end));
       }
     },
-    allStart() {
-      this.fileList.map((e) => {
-        if (e.paused) {
-          e.resume();
-        }
-      });
-    },
-    allStop() {
-      this.fileList.map((e) => {
-        if (!e.paused) {
-          e.pause();
-        }
-      });
-    },
     allRemove() {
       this.fileList.map((e) => {
         e.cancel();

+ 71 - 43
src/views/safetyEducationExam/safeLearning/safeLearning/learning.vue

@@ -6,11 +6,10 @@
       <p class="title-p">实验室安全学习与考试系统</p>
       <p class="time-p">{{timeText}}</p>
       <div class="user-box">
-        <img :src="userInfo.avatar">
+        <img v-if="avatar" :src="userInfo.avatar">
+        <img v-else src="@/assets/ZDimages/basicsModules/tx_cion.png">
         <p>{{userInfo.userName}}</p>
       </div>
-      <!--<p class="button-p">退出</p>-->
-      <p class="right-button page-out-common-style-button" style="margin-top:28px;margin-right:20px;" @click="outClick">返回</p>
     </div>
     <div class="learning-data-box">
       <div class="top-title-box">
@@ -18,7 +17,12 @@
           <p class="top-name-p">{{newList[chapterIndex].title}}<span style="margin-left:20px;">{{learningData.title}}</span></p>
           <p class="top-time-max-p">已学习时长:<span v-if="learningData.hourTwo">{{learningData.hourTwo}}小时</span><span v-if="learningData.minuteTwo>0">{{learningData.minuteTwo}}分钟</span>{{learningData.secondTwo}}秒</p>
         </div>
-        <p class="top-time-p">时长:<span v-if="learningData.hourOne>0">{{learningData.hourOne}}小时</span><span v-if="learningData.minuteOne>0">{{learningData.minuteOne}}分钟</span>{{learningData.secondOne}}秒</p>
+        <div class="top-button-box">
+          <p class="top-time-p">时长:<span v-if="learningData.hourOne>0">{{learningData.hourOne}}小时</span><span v-if="learningData.minuteOne>0">{{learningData.minuteOne}}分钟</span>{{learningData.secondOne}}秒</p>
+          <p class="top-null-p"></p>
+          <div class="button-bottom-max-box" :class="timeType?'button-color-a':'button-color-b'" @click="shadeTypeClick(1)">完成学习</div>
+          <p class="out-button" @click="outClick">返回</p>
+        </div>
       </div>
       <div class="bottom-data-box scrollbar-box" :class="videoDraggable==0?'video-jz-box':''">
         <!--图片-->
@@ -53,7 +57,7 @@
         <!--富文本-->
         <div v-if="learningData.type == 5" v-html="learningData.chapterData" style="width:896px;margin:0 auto;"></div>
       </div>
-      <div class="button-bottom-max-box" :class="timeType?'button-color-a':'button-color-b'" @click="shadeTypeClick(1)">完成学习</div>
+      <!--<div class="button-bottom-max-box" :class="timeType?'button-color-a':'button-color-b'" @click="shadeTypeClick(1)">完成学习</div>-->
     </div>
     <div class="shade-max-box" v-if="shadeType">
       <div class="shade-big-box">
@@ -388,28 +392,31 @@
     }
     .learn-top-user-info-box{
       display: flex;
+      background: #0045AF;
       box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
       .logo-img{
-        height:57px;
-        width:57px;
-        margin:21px 20px 0 40px;
+        height:50px;
+        width:50px;
+        margin:15px 12px 15px 18px;;
       }
       .title-p{
         width: 300px;
-        font-size:18px;
-        font-weight:700;
-        line-height:100px;
+        font-size:24px;
+        line-height:80px;
+        color:#fff;
       }
       .time-p{
         flex:1;
-        font-weight:700;
-        line-height:100px;
-        font-size:14px;
+        line-height:80px;
+        font-size:18px;
+        color:#fff;
+        text-align: center;
+        margin-right:100px;
       }
       .home-box{
         width:100px;
         display: flex;
-        margin-top:35px;
+        margin-top:25px;
         margin-right:30px;
         img{
           width:30px;
@@ -417,21 +424,24 @@
           margin-right:20px;
         }
         p{
+          color:#fff;
           line-height:30px;
         }
       }
       .user-box{
         min-width:100px;
         display: flex;
-        margin-top:35px;
+        margin-top:20px;
         margin-right:30px;
         img{
-          width:30px;
-          height:30px;
+          width:40px;
+          height:40px;
           margin-right:20px;
+          border-radius:50%;
         }
         p{
-          line-height:30px;
+          color:#fff;
+          line-height:40px;
         }
       }
       .button-p{
@@ -441,7 +451,7 @@
         color:#fff;
         text-align: center;
         line-height:34px;
-        margin:33px 20px 0 0;
+        margin:23px 20px 0 0;
         border-radius:4px;
         cursor:pointer;
       }
@@ -477,11 +487,47 @@
             font-size:16px;
           }
         }
-        .top-time-p{
-          font-size:16px;
-          line-height:40px;
-          padding:0 20px;
-
+        .top-button-box{
+          display: flex;
+          .top-time-p{
+            font-size:16px;
+            line-height:40px;
+            padding:0 20px;
+          }
+          .top-null-p{
+            flex:1;
+          }
+          .button-color-a{
+            background: #0045AF;
+            color:#fff;
+          }
+          .button-color-b{
+            background: #999;
+            color:#fff;
+          }
+          .button-bottom-max-box{
+            width:100px;
+            height:28px;
+            font-size:14px;
+            text-align: center;
+            line-height: 28px;
+            border-radius:4px;
+            cursor:pointer;
+            margin-right:20px;
+          }
+          .out-button{
+            width:80px;
+            height:28px;
+            font-size:14px;
+            text-align: center;
+            line-height: 28px;
+            border-radius:4px;
+            cursor:pointer;
+            color:#666;
+            border:1px solid #666;
+            background-color: #fff;
+            margin-right:20px;
+          }
         }
       }
       .bottom-data-box{
@@ -499,24 +545,6 @@
           margin:auto auto;
         }
       }
-      .button-color-a{
-        background: #0045af;
-        color:#fff;
-      }
-      .button-color-b{
-        background: #999;
-        color:#fff;
-      }
-      .button-bottom-max-box{
-        width:300px;
-        height:40px;
-        margin:20px auto;
-        font-size:18px;
-        text-align: center;
-        line-height: 40px;
-        border-radius:6px;
-        cursor:pointer;
-      }
     }
     .shade-max-box{
       height:100%;