lsc 2 år sedan
förälder
incheckning
05823d0176

BIN
src/assets/audio.png


BIN
src/assets/picture.png


+ 31 - 6
src/components/components/answerData2.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="data_body">
+  <div class="data_body" v-resize="resize">
     <div class="title">
       <span>答对数量</span>
       <el-button type="primary" @click="getA()">查看学生</el-button>
@@ -46,6 +46,7 @@
 </template>
 
 <script>
+
 export default {
   props: ["problemJson", "answer", "people"],
   data() {
@@ -105,6 +106,25 @@ export default {
       },
     };
   },
+  directives: {  // 使用局部注册指令的方式
+    resize: { // 指令的名称
+      bind(el, binding) { // el为绑定的元素,binding为绑定给指令的对象
+        let width = '', height = '';
+        function isReize() {
+          const style = document.defaultView.getComputedStyle(el);
+          if (width !== style.width || height !== style.height) {
+            binding.value();  // 关键
+          }
+          width = style.width;
+          height = style.height;
+        }
+        el.__vueSetInterval__ = setInterval(isReize, 300);
+      },
+      unbind(el) {
+        clearInterval(el.__vueSetInterval__);
+      }
+    }
+  },
   methods: {
     handleClose(done) {
       done();
@@ -131,6 +151,11 @@ export default {
         this.chartObj.setOption(this.option);
       });
     },
+    resize(){
+      if (this.chartObj) {
+        this.chartObj.resize();
+      }
+    }
   },
   // watch: {
   //   problemJson(val) {
@@ -248,11 +273,11 @@ export default {
     this.count = count;
     this.setChart(this.ooption);
     var _this = this;
-    window.addEventListener("resize", () => {
-      if (_this.chartObj) {
-        _this.chartObj.resize();
-      }
-    });
+    // window.addEventListener("resize", () => {
+    //   if (_this.chartObj) {
+    //     _this.chartObj.resize();
+    //   }
+    // });
   },
 };
 </script>

+ 54 - 20
src/components/studyStudent.vue

@@ -1447,19 +1447,12 @@
                       <span>作业预览</span>
                       <el-button type="text" @click="jump()" v-if="tType == 2" class="buttonA">我的评价</el-button>
                     </div>
-                    <div
-                      class="worksDetailBox"
-                      v-if="
-                        worksStudent.length &&
-                        worksStudent[toolIndex].length > 0
-                      "
-                    >
-                      <div
-                        v-for="(w, wIndex) in worksStudent[toolIndex]"
-                        :key="wIndex"
-                        class="isWorksName"
-                        @click="openXz(w, toolIndex)"
-                      >
+                    <div class="worksDetailBox" v-if="
+                      worksStudent.length &&
+                      worksStudent[toolIndex].length > 0
+                    ">
+                      <div v-for="(w, wIndex) in worksStudent[toolIndex]" :key="wIndex" class="isWorksName"
+                        @click="openXz(w, toolIndex)">
                         {{ w.sName }}
                       </div>
                       <!-- <div
@@ -1830,11 +1823,14 @@
             <div class="pzContent cont" v-html="pz.content" v-if="pz.type == '1'">
               <!-- {{ }} -->
             </div>
-            <div class="pzContent cont" v-if="pz.type == '2'">
+            <div class="pzContent" v-if="pz.type == '2'">
               <audio :src="pz.content" controls="controls" ref="audio">
                 Your browser does not support the audio element.
               </audio>
             </div>
+            <div class="pzContent" v-if="pz.type == '3'">
+              <img :src="pz.content"  style="width: 90%;margin: 0 auto;display: block;" @click="previewImg(pz.content)"/>
+            </div>
             <div class="time">
               {{ pz.time }}
             </div>
@@ -1843,7 +1839,13 @@
         <div class="noPz" v-else>
           <img src="../assets/icon/noPz.png" alt="" />
         </div>
-        <div class="addPz" @click="addPzDialog = true,pzType = 1">添加批注</div>
+        <div class="addPzButton">
+          <div class="addPz" @click="addPzDialog = true,pzType = 1">添加批注</div>
+          <div class="img1">
+            <img src="../assets/audio.png" @click="addPzDialog = true,pzType = 2" />
+            <!-- <img src="../assets/picture.png" @click="addPzDialog = true,pzType = 3" /> -->
+          </div>
+        </div>
       </div>
     </div>
     <div v-if="addPzDialog == true" class="addDialogCss">
@@ -1861,16 +1863,25 @@
       <div class="addPzBox">
         <div class="addPzCheck">
           <span :class="{isChooseActive:pzType==1}" @click="pzType = 1">文本</span>
+          <!-- <span :class="{isChooseActive:pzType==3}" @click="pzType = 3">图片</span> -->
           <span :class="{isChooseActive:pzType==2}" @click="pzType = 2">音频</span>
         </div>
         <div style="height: calc(100% - 95px);">
-          <!-- <textarea class="binfo_input pzConText" cols placeholder="请填写项目课程关键问题...." v-model="pzConText"></textarea> -->
+          <!-- <textarea class="binfo_input pzConText" cols placeholder="请填写项目课程关键问题...." v-model="pzConText"
+            v-if="pzType == 1"></textarea> -->
           <editor-bar class="binfo_input pzConText" style="width: 100% !important;" placeholder="请输入任务描述" v-model="
             pzConText
           " @change="change" v-if="pzType == 1"></editor-bar>
           <Audio @addPz="addPz" class="pzAudioClass" v-if="pzType == 2"></Audio>
+          <!-- <div class="pzAudioClass" v-if="pzType == 3">
+            <div @click="addImg($event)">
+              <el-button type="primary">上传图片</el-button>
+              <input type="file" accept="image/png, image/gif, image/jpeg" style="display: none"
+                @change="beforeUpload1($event, 4)" />
+            </div>
+          </div> -->
         </div>
-        <div class="addTextCss" @click="addPz" v-if="pzType == 1">确定</div>
+        <div class="addTextCss" @click="addPz('1')" v-if="pzType == 1">确定</div>
       </div>
     </div>
     <div v-if="proVisible" class="mask">
@@ -3344,7 +3355,7 @@ export default {
           file.name
             .split(".")
           [file.name.split(".").length - 1].toLocaleUpperCase()
-        ) != -1
+        ) != -1 && type != 4
       ) {
         // const blob = await imageConversion.compress(file, 0.8)
         const blob = await imageConversion.compressAccurately(file, 32);
@@ -3456,6 +3467,8 @@ export default {
                 _this.upToolImg = data.Location;
                 _this.imgChange(null, null, type);
                 _this.addCourseWorks(i);
+              } else if (type == 4) {
+                _this.addPz('3', data.Location);
               }
               _this.imgChange(null, null, type);
               console.log(data.Location);
@@ -7129,6 +7142,27 @@ export default {
   overflow: auto;
 }
 
+.addPzButton {
+  position: relative;
+  margin-top: 3px;
+}
+
+.addPzButton .img1 {
+  position: absolute;
+  top: 50%;
+  right: 15px;
+  transform: translateY(-50%);
+  height: 100%;
+  display: flex;
+  align-items: center;
+}
+
+.addPzButton .img1 img {
+  width: 28px;
+  margin-left: 10px;
+  cursor: pointer;
+}
+
 .addPz {
   background: #4b79ce;
   width: 100px;
@@ -7189,9 +7223,9 @@ export default {
 .pzConText {
   width: 95%;
   height: 100%;
-  margin: 0 auto;
+  margin: 10px auto 0;
   border: none;
-  /* background: #fff; */
+  background: #fff;
   border-radius: 0px;
 }