Pārlūkot izejas kodu

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table

lsc 2 gadi atpakaļ
vecāks
revīzija
f534086494
2 mainītis faili ar 64 papildinājumiem un 40 dzēšanām
  1. BIN
      src/assets/icon/xzUpImg.png
  2. 64 40
      src/components/pages/addCourse.vue

BIN
src/assets/icon/xzUpImg.png


+ 64 - 40
src/components/pages/addCourse.vue

@@ -1679,9 +1679,16 @@
               <div class="a_add_input a_add_input_choice">
                 <el-radio-group v-model="testJson.testJson[index1].answer" v-if="testJson.testJson[index1].type == 1">
                   <div class="radioBox">
-                    <el-radio v-for="(item2, checkIndex) in testJson.testJson[index1]
-                    .testItem" :key="checkIndex" :label="checkIndex">
-                      <div style="margin-right: 10px; width: 300px" v-if="
+                    <el-radio
+                      v-for="(item2, checkIndex) in testJson.testJson[index1]
+                        .testItem"
+                      :key="checkIndex"
+                      :label="checkIndex"
+                    >
+                      <div style="margin-right:10px">选项{{ checkIndex + 1 }} </div>
+                      <div
+                        style="margin-right: 10px; width: 300px"
+                        v-if="
                         testJson.testJson[index1].checkList[checkIndex] &&
                         testJson.testJson[index1].checkList[checkIndex]
                           .imgType &&
@@ -1696,38 +1703,46 @@
                         </div>
                       </div>
 
-                      <el-input v-else v-model="
-                        testJson.testJson[index1].checkList[checkIndex]
-                      " placeholder="请输入选项..." style="width: 300px; margin-right: 10px"></el-input>
-                      <!-- <div>
-                        <el-button
-                          type="primary"
-                          size="small"
-                          @click="addImg($event)"
-                          >上传图片
-                          <input
+                      <el-input
+                        v-else
+                        v-model="
+                          testJson.testJson[index1].checkList[checkIndex]
+                        "
+                        placeholder="请输入选项..."
+                        style="width: 300px; margin-right: 10px"
+                      ></el-input>
+                      <div class="xzUpImg" @click="addImg($event)">
+                        <img src="../../assets/icon/xzUpImg.png" alt="">
+                        <input
                             type="file"
                             accept="image/*"
                             style="display: none"
                             @change="beforeUploadTi($event, index1, checkIndex)"
                           />
-                        </el-button>
-                      </div> -->
+                      </div>
                     </el-radio>
                   </div>
                 </el-radio-group>
                 <el-checkbox-group v-model="testJson.testJson[index1].answer"
                   v-if="testJson.testJson[index1].type == '2'">
                   <div class="radioBox">
-                    <el-checkbox v-for="(item2, checkIndex1) in testJson.testJson[index1]
-                    .testItem" :key="checkIndex1" :label="checkIndex1">
-                      <div style="margin-right: 10px; width: 300px" v-if="
-                        testJson.testJson[index1].checkList[checkIndex1] &&
-                        testJson.testJson[index1].checkList[checkIndex1]
-                          .imgType &&
-                        testJson.testJson[index1].checkList[checkIndex1]
-                          .imgType == 1
-                      ">
+                    <el-checkbox
+                      v-for="(item2, checkIndex1) in testJson.testJson[index1]
+                        .testItem"
+                      :key="checkIndex1"
+                      :label="checkIndex1"
+                    >
+                      <div style="margin-right:10px">选项{{ checkIndex1 + 1 }} </div>
+                      <div
+                        style="margin-right: 10px; width: 300px"
+                        v-if="
+                          testJson.testJson[index1].checkList[checkIndex1] &&
+                          testJson.testJson[index1].checkList[checkIndex1]
+                            .imgType &&
+                          testJson.testJson[index1].checkList[checkIndex1]
+                            .imgType == 1
+                        "
+                      >
                         <div class="inImg">
                           <img :src="
                             testJson.testJson[index1].checkList[checkIndex1]
@@ -1736,16 +1751,17 @@
                         </div>
                       </div>
 
-                      <el-input v-else v-model="
-                        testJson.testJson[index1].checkList[checkIndex1]
-                      " placeholder="请输入选项..." style="width: 300px; margin-right: 10px"></el-input>
-                      <!-- <div>
-                        <el-button
-                          type="primary"
-                          size="small"
-                          @click="addImg($event)"
-                          >上传图片
-                          <input
+                      <el-input
+                        v-else
+                        v-model="
+                          testJson.testJson[index1].checkList[checkIndex1]
+                        "
+                        placeholder="请输入选项..."
+                        style="width: 300px; margin-right: 10px"
+                      ></el-input>
+                      <div class="xzUpImg" @click="addImg($event)">
+                        <img src="../../assets/icon/xzUpImg.png" alt="">
+                        <input
                             type="file"
                             accept="image/*"
                             style="display: none"
@@ -1753,8 +1769,7 @@
                               beforeUploadTi($event, index1, checkIndex1)
                             "
                           />
-                        </el-button>
-                      </div> -->
+                      </div>
                     </el-checkbox>
                   </div>
                 </el-checkbox-group>
@@ -3047,6 +3062,7 @@ export default {
       this.dialogVisible7 = true;
     },
     beforeUploadTi(event, i, j) {
+      console.log(event)
       const loading = this.openLoading();
       var file = event.target.files[0];
       var credentials = {
@@ -6852,7 +6868,7 @@ ol {
 
 .a_add_box {
   border-bottom: 2px solid #eee;
-  padding-bottom: 10px;
+  padding-bottom: 30px;
 }
 
 .a_add_head {
@@ -6915,14 +6931,14 @@ ol {
   display: flex;
   align-items: center;
   flex-direction: row-reverse;
-  margin: 10px 0 0 0;
+  margin: 30px 0 0 0;
 }
 
 .a_add_input_choice>>>.el-checkbox {
   display: flex;
   align-items: center;
   flex-direction: row-reverse;
-  margin: 10px 0 0 0;
+  margin: 30px 0 0 0;
 }
 
 .width100 {
@@ -8214,7 +8230,7 @@ ol {
 }
 
 .inImg {
-  width: 100px;
+  width: 50px;
 }
 
 .inImg>img {
@@ -8241,4 +8257,12 @@ ol {
 .tcMember+.tcMember::before {
     content: '、';
 }
+.xzUpImg{
+  width: 25px;
+  height: 25px;
+}
+.xzUpImg>img{
+  width: 100%;
+  height: 100%;
+}
 </style>