Sfoglia il codice sorgente

字词卡片上传进度

natasha 1 anno fa
parent
commit
00533c9dff

+ 15 - 1
src/views/Textanalysis/WordTable.vue

@@ -66,7 +66,11 @@
           <tr>
             <template v-for="(item, i) in tableHeader">
               <th
-                v-if="(item.name === '拼音' && typeIndex !== 0) || item.name !== '拼音'"
+                v-if="
+                  (item.name === '拼音' && typeIndex !== 0) ||
+                  (item.name === '词性' && typeIndex === 2) ||
+                  (item.name !== '拼音' && item.name !== '词性')
+                "
                 :key="i"
                 :style="{ width: item.width }"
                 :class="[i === tableHeader.length - 1 ? 'bz' : '']"
@@ -123,6 +127,9 @@
             <td v-if="typeIndex !== 0" class="sort-td" style="font-family: 'League'">
               {{ item.pinyin }}
             </td>
+            <td v-if="typeIndex === 2" class="sort-td" style="font-family: '楷体'">
+              {{ item.cx_name }}
+            </td>
             <td class="sort-td">
               <span
                 :style="{
@@ -382,6 +389,13 @@ export default {
           sortName: 'pin_yin',
         },
         {
+          name: '词性',
+          sortShow: false,
+          sort: '',
+          width: '',
+          sortName: '',
+        },
+        {
           name: '等次',
           sortShow: true,
           sort: '',

+ 18 - 2
src/views/wordcard/UploadDrag.vue

@@ -11,11 +11,13 @@
       :on-success="handleSuccess"
       :file-list="fileList"
       :disabled="disabled"
+      :on-progress="uploadVideoProcess"
     >
       <div class="plus-icon"><i class="el-icon-plus"></i></div>
       <div class="cn-tips">点击或拖拽图片到此上传</div>
       <div class="en-tips">Only png, jpg can be uploaded, and the size does not exceed 100MB</div>
     </el-upload>
+    <el-progress style="width: 100%" v-if="progressFlag" :percentage="loadProgress"></el-progress>
   </div>
 </template>
 
@@ -42,7 +44,10 @@ export default {
     },
   },
   data() {
-    return {};
+    return {
+      loadProgress: 0, // 动态显示进度条
+      progressFlag: false, // 关闭进度条
+    };
   },
   computed: {
     url() {
@@ -82,6 +87,7 @@ export default {
     handleSuccess(response, file, fileList) {
       if (response.status === 1) {
         this.$message.success('上传成功');
+        this.progressFlag = false;
         this.$emit('changeFillId', response.file_info_list[0], fileList);
       }
     },
@@ -93,6 +99,16 @@ export default {
         this.curPercentage = 0;
       }
     },
+    uploadVideoProcess(event, file, fileList) {
+      this.progressFlag = true; // 显示进度条
+      this.loadProgress = parseInt(event.percent); // 动态获取文件上传进度
+      // if (this.loadProgress >= 100) {
+      //   this.loadProgress = 100;
+      //   setTimeout(() => {
+      //     this.progressFlag = false;
+      //   }, 1000); // 一秒后关闭进度条
+      // }
+    },
   },
 };
 </script>
@@ -128,7 +144,7 @@ export default {
 .upload-wrapper-drag {
   .el-upload {
     width: 100%;
-    height: 294px;
+    height: 274px;
   }
   .el-upload-dragger {
     border: none;

+ 4 - 8
src/views/wordcard/printNew.vue

@@ -66,12 +66,10 @@
               :style="{ flex: '1', marginTop: data.right.audio_file ? '100px' : '37px' }"
             >
               <div v-if="data.right.cixing">
-                <label class="card-label">词性:</label>
-                <p>{{ data.right.cixing }}</p>
+                <p>词性:{{ data.right.cixing }}</p>
               </div>
               <div v-if="data.right.definition">
-                <label class="card-label">释义:</label>
-                <p>{{ data.right.definition }}</p>
+                <p>释义:{{ data.right.definition }}</p>
               </div>
             </div>
           </div>
@@ -94,8 +92,7 @@
                 <p>{{ data.right.cixing }}</p>
               </div>
               <div v-if="data.right.definition">
-                <label class="card-label">释义:</label>
-                <p>{{ data.right.definition }}</p>
+                <p>释义:{{ data.right.definition }}</p>
               </div>
             </template>
             <div v-if="data.right.collocation">
@@ -103,8 +100,7 @@
               <p>{{ data.right.collocation }}</p>
             </div>
             <div v-if="data.right.exampleSent">
-              <label class="card-label">例句:</label>
-              <p>{{ data.right.exampleSent }}</p>
+              <p>例句:{{ data.right.exampleSent }}</p>
             </div>
           </div>
         </div>

+ 4 - 8
src/views/wordcard/writeTableNew.vue

@@ -136,12 +136,10 @@
               :style="{ flex: '1', marginTop: data.right.audio_file ? '100px' : '37px' }"
             >
               <div v-if="data.right.cixing">
-                <label class="card-label">词性:</label>
-                <p>{{ data.right.cixing }}</p>
+                <p>词性:{{ data.right.cixing }}</p>
               </div>
               <div v-if="data.right.definition">
-                <label class="card-label">释义:</label>
-                <p>{{ data.right.definition }}</p>
+                <p>释义:{{ data.right.definition }}</p>
               </div>
             </div>
           </div>
@@ -164,8 +162,7 @@
                 <p>{{ data.right.cixing }}</p>
               </div>
               <div v-if="data.right.definition">
-                <label class="card-label">释义:</label>
-                <p>{{ data.right.definition }}</p>
+                <p>释义:{{ data.right.definition }}</p>
               </div>
             </template>
             <div v-if="data.right.collocation">
@@ -173,8 +170,7 @@
               <p>{{ data.right.collocation }}</p>
             </div>
             <div v-if="data.right.exampleSent">
-              <label class="card-label">例句:</label>
-              <p>{{ data.right.exampleSent }}</p>
+              <p>例句:{{ data.right.exampleSent }}</p>
             </div>
           </div>
           <a class="overturn-btn" v-if="isPreview" @click="changeShowLeft"><i class="el-icon-refresh"></i></a>