Procházet zdrojové kódy

上传控件的问题修改 排序题的问题修改 视频控件增加样式

秦鹏 před 3 roky
rodič
revize
39e87d8d51

+ 9 - 5
src/components/Adult/common/UploadView.vue

@@ -44,6 +44,7 @@ export default {
     "uiType",
     "fileList",
     "accept",
+    "type",
   ],
   data() {
     return {
@@ -86,13 +87,18 @@ export default {
       deep: true,
     },
     fileList(newval, oldval) {
-      this.currentfileList = newval||[];
+      this.currentfileList = newval || [];
     },
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.currentfileList = this.fileList || [];
-    this.showList = this.fileList ? true : false;
+    // this.showList = this.fileList ? true : false;
+    if (this.type == "upload_control_preview_chs") {
+      this.showList = true;
+    }else{
+      this.showList = false;
+    }
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
@@ -114,12 +120,10 @@ export default {
           ? response.file_info_list[0].media_duration
           : 10;
         this.$message.success("用户上传成功");
-
         this.changeFillId(fileList, response.duration, this.index);
-
         this.loading.close();
       } else {
-        this.fileList = [];
+        // this.fileList = [];
         this.$message.warning(response.msg);
         this.loading.close();
       }

+ 9 - 6
src/components/Adult/inputModules/UploadControl.vue

@@ -1,12 +1,13 @@
 <!--  -->
 <template>
   <div class="Big-Book-prev-Textdes Tinydemo" v-if="curQue">
-    <template v-if="type =='upload_control_preview_chs'">
+    <template v-if="type == 'upload_control_preview_chs'">
       <UploadView
         :changeFillId="changeFillId"
         :accept="accept"
         :filleNumber="1"
         :fileList="curQue.fileList"
+        :type="type"
       />
     </template>
     <div v-else>
@@ -94,11 +95,13 @@ export default {
     },
     changeFillId(fileList, item, index) {
       this.curQue.fileList = JSON.parse(JSON.stringify(fileList));
-      this.curQue.data = fileList[0].response.file_info_list[0];
-      if (this.curQue.data.file_name.indexOf("pdf") != -1) {
-        this.curQue.data.fileRelativePath =
-          process.env.VUE_APP_BASE_API + this.curQue.data.file_relative_path;
-        this.getNumPages();
+      if (fileList.length > 0) {
+        this.curQue.data = fileList[0]?.response?.file_info_list[0];
+        if (this.curQue.data?.file_name.indexOf("pdf") != -1) {
+          this.curQue.data.fileRelativePath =
+            process.env.VUE_APP_BASE_API + this.curQue.data.file_relative_path;
+          this.getNumPages();
+        }
       }
     },
     // 获取pdf的页数

+ 0 - 1
src/components/Adult/inputModules/VideoControl.vue

@@ -68,7 +68,6 @@ export default {
             name: item.name,
             url: item.response.file_info_list[0].file_url,
             id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
-
             media_duration: item.response.file_info_list[0].media_duration, //音频时长
           };
           articleImgRes.push(obj);

+ 3 - 1
src/components/Adult/preview/SentenceSortQP.vue

@@ -252,6 +252,8 @@ export default {
           margin-right: 2px;
           color: #000000;
           margin-bottom: 2px;
+          cursor: pointer;
+          border: 1px solid #ffffff;
           p {
             margin: 0;
             line-height: 150%;
@@ -290,7 +292,7 @@ export default {
         padding-top: 4px;
         max-height: 103px;
         min-height: 74px;
-        overflow-x: scroll;
+        overflow-x: auto;
 
         .item {
           // width: 82px;

+ 11 - 6
src/components/Adult/preview/UploadControlView.vue

@@ -6,7 +6,8 @@
         :changeFillId="changeFillId"
         :accept="accept"
         :filleNumber="1"
-        :fileList="false"
+        :fileList="curQue.fileList"
+        :type="type"
       />
       <!-- <div class="uploadBtn" @click="downLoad">
         <img
@@ -17,7 +18,7 @@
         下载表格
       </div> -->
     </div>
-    <div class="dv"  v-if="curQue.data">
+    <div class="dv" v-if="curQue.data">
       <div class="main">
         <div class="content">
           <template v-if="curQue.data">
@@ -109,13 +110,16 @@ export default {
         `/GCLSFileServer/WebFileDownload?UserCode=${data.UserCode}&UserType=${data.UserType}&SessionID=${data.SessionID}&FileID=${data.FileID}`;
     },
     remove() {
-      this.data = null;
-      this.curQue.data = null;
-      this.curQue.fileList = [];
-      this.$message.success("删除成功");
+      if (this.curQue.data) {
+        this.data = null;
+        this.curQue.data = null;
+        this.curQue.fileList = [];
+        this.$message.success("删除成功");
+      }
     },
     changeFillId(fileList, item, index) {
       this.curQue.fileList = fileList;
+      // this.$set(this.curQue,data,fileList[0].response.file_info_list[0])
       this.curQue.data = fileList[0].response.file_info_list[0];
       if (this.curQue.data.file_name.indexOf("pdf") != -1) {
         this.curQue.data = fileList[0].response.file_info_list[0];
@@ -123,6 +127,7 @@ export default {
           process.env.VUE_APP_BASE_API + this.curQue.data.file_relative_path;
         this.getNumPages();
       }
+      this.$forceUpdate();
     },
     // 获取pdf的页数
     getNumPages() {

+ 1 - 0
src/components/Adult/preview/VideoControl.vue

@@ -126,6 +126,7 @@ export default {
   box-sizing: border-box;
   border-radius: 8px;
   position: relative;
+  margin-bottom: 16px;
   video {
     width: 100%;
     height: 100%;