Bläddra i källkod

新增选择题题目上传图片功能

zengyicheng 2 år sedan
förälder
incheckning
669c78fc92
2 ändrade filer med 76 tillägg och 2 borttagningar
  1. 41 2
      src/components/components/askStatic2.vue
  2. 35 0
      src/components/studyStudent.vue

+ 41 - 2
src/components/components/askStatic2.vue

@@ -10,8 +10,25 @@
         :key="index"
       >
         <div class="a_add_head">
-          <div>
+          <div style="display: flex; align-items: center">
             <span>{{ index + 1 + "、" + item.teststitle }}</span>
+            <div
+              class="timuImgBox"
+              v-if="
+                askJSONC.testJson.testJson[index].timuList &&
+                askJSONC.testJson.testJson[index].timuList.length
+              "
+            >
+              <div
+                v-for="(timg, tIndex) in askJSONC.testJson.testJson[index]
+                  .timuList"
+                :key="tIndex"
+                class="timuImg"
+                @click.stop="previewImg(timg.src)"
+              >
+                <img :src="timg.src" alt="" />
+              </div>
+            </div>
           </div>
           <el-button
             type="primary"
@@ -45,7 +62,10 @@
                       item.checkList[checkIndex].imgType == 1
                     "
                   >
-                    <div class="inImg" @click.stop="previewImg(item.checkList[checkIndex].src)">
+                    <div
+                      class="inImg"
+                      @click.stop="previewImg(item.checkList[checkIndex].src)"
+                    >
                       <img :src="item.checkList[checkIndex].src" alt="" />
                     </div>
                   </div>
@@ -389,4 +409,23 @@ export default {
   height: 100%;
   object-fit: cover;
 }
+
+.timuImgBox {
+  margin: 10px 0 10px 20px;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  align-items: center;
+}
+.timuImg {
+  width: 100%;
+  margin-right: 10px;
+  cursor: pointer;
+}
+
+.timuImg > img {
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
 </style>

+ 35 - 0
src/components/studyStudent.vue

@@ -5257,6 +5257,22 @@
                 style="height: 300px; margin-top: 10px; max-width: 100%"
               />
             </div>
+            <div
+              class="timuImgBox"
+              v-if="
+                testJson.testJson[index1].timuList &&
+                testJson.testJson[index1].timuList.length
+              "
+            >
+              <div
+                v-for="(timg, tIndex) in testJson.testJson[index1].timuList"
+                :key="tIndex"
+                class="timuImg"
+                @click.stop="previewImg(timg.src)"
+              >
+                <img :src="timg.src" alt="" />
+              </div>
+            </div>
             <div class="a_add_body">
               <div class="a_add_input">
                 <el-radio-group
@@ -15283,4 +15299,23 @@ ol {
   height: 100%;
   object-fit: cover;
 }
+
+.timuImgBox {
+  margin: 10px 0;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  align-items: center;
+}
+.timuImg {
+  width: 100px;
+  margin-right: 10px;
+  cursor: pointer;
+}
+
+.timuImg > img {
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
 </style>