liuhaidi123 3 недель назад
Родитель
Сommit
551b5546de

+ 23 - 7
src/views/book/courseware/create/components/question/article/CheckArticle.vue

@@ -21,7 +21,7 @@
             </el-radio-group>
           </div>
           <div class="remark-box" @click="showRemark(index)"><SvgIcon icon-class="edit-line" />添加备注</div>
-          <!-- <el-upload
+          <el-upload
             action="no"
             accept="image/*,video/*"
             :http-request="handleImage"
@@ -29,9 +29,11 @@
             :on-exceed="handleExceed"
             :limit="1"
             :key="index"
+            @click.native="handleItem(index)"
+            class="upload-resource"
           >
-            <span>上传图片/视频</span>
-          </el-upload> -->
+            <div class="remark-box"><i class="el-icon-upload"></i>上传图片/视频</div>
+          </el-upload>
         </template>
         <div v-for="(items, indexs) in item.sentenceStr" :key="indexs + 'words'" class="sentence-box">
           <div class="sentence">
@@ -188,6 +190,7 @@ export default {
       showStyleFlag: false,
       remarkVisible: false,
       remark: null,
+      activeItem: null,
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -256,9 +259,12 @@ export default {
         `当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`,
       );
     },
+    // 记录段落
+    handleItem(index) {
+      this.activeItem = this.data.detail[index];
+    },
     // 图片上传前处理
-    handleBeforeImage(file, index) {
-      console.log(index);
+    handleBeforeImage(file) {
       // 判断文件是否为图片
       if (!file.type.includes('image') && !file.type.includes('video')) {
         this.$message.error('请选择图片或视频文件');
@@ -266,11 +272,17 @@ export default {
       }
     },
     // 图片上传
-    handleImage(file, index) {
+    handleImage(file) {
       fileUpload('Mid', file, { isGlobalprogress: true }).then(({ file_info_list }) => {
         if (file_info_list.length > 0) {
           const { file_id, file_url_open, type } = file_info_list[0];
-          console.log(index);
+          this.activeItem.sourceList = [
+            {
+              file_id,
+              file_url_open,
+              type,
+            },
+          ];
         }
       });
     },
@@ -415,4 +427,8 @@ export default {
   border: 1px solid #165dff;
   border-radius: 2px;
 }
+
+.upload-resource {
+  text-align: left;
+}
 </style>

+ 3 - 1
src/views/book/courseware/preview/components/article/NormalModelChs.vue

@@ -1355,7 +1355,7 @@ export default {
           this.isHasRemark = true;
         }
         let paraArr = [];
-        if (!dItem.isTitle) {
+        if (dItem.paraAlign !== 'center') {
           paraArr = [
             {
               pinyin: '',
@@ -1685,12 +1685,14 @@ export default {
       display: flex;
       flex-flow: wrap;
       justify-content: center;
+      width: 100%;
     }
 
     .para-right {
       display: flex;
       flex-flow: wrap;
       justify-content: end;
+      width: 100%;
     }
 
     .NNPE-words {

+ 3 - 1
src/views/book/courseware/preview/components/article/PhraseModelChs.vue

@@ -1075,7 +1075,7 @@ export default {
         }
 
         let paraArr = [];
-        if (!dItem.isTitle) {
+        if (dItem.paraAlign !== 'center') {
           paraArr = [
             {
               pinyin: '',
@@ -1626,12 +1626,14 @@ export default {
       display: flex;
       flex-flow: wrap;
       justify-content: center;
+      width: 100%;
     }
 
     .para-right {
       display: flex;
       flex-flow: wrap;
       justify-content: end;
+      width: 100%;
     }
 
     .NNPE-words {

+ 3 - 1
src/views/book/courseware/preview/components/article/WordModelChs.vue

@@ -972,7 +972,7 @@ export default {
       curQue.detail.forEach((dItem, dIndex) => {
         dhaspinyin = false;
         let paraArr = [];
-        if (!dItem.isTitle) {
+        if (dItem.paraAlign !== 'center') {
           paraArr = [
             {
               pinyin: '',
@@ -1295,12 +1295,14 @@ export default {
       display: flex;
       flex-flow: wrap;
       justify-content: center;
+      width: 100%;
     }
 
     .para-right {
       display: flex;
       flex-flow: wrap;
       justify-content: end;
+      width: 100%;
     }
 
     .NNPE-words {