Bläddra i källkod

字词卡片调整样式

natasha 1 år sedan
förälder
incheckning
7d90eedfec
2 ändrade filer med 17 tillägg och 5 borttagningar
  1. 9 3
      src/views/wordcard/printNew.vue
  2. 8 2
      src/views/wordcard/writeTableNew.vue

+ 9 - 3
src/views/wordcard/printNew.vue

@@ -29,9 +29,10 @@
               display: 'flex',
               justifyContent:
                 !(data.right.collocation && data.right.exampleSent) && data.left.con.length < 4 ? 'center' : 'auto',
+              columnGap: '16px',
             }"
           >
-            <div style="width: max-content">
+            <div style="width: max-content" v-if="data.right.hz_info.length > 0">
               <AudioPlay
                 :file-id="data.right.audio_file"
                 v-if="data.right.audio_file"
@@ -51,7 +52,7 @@
                     :palyWidth="'18px'"
                     :BoxbgType="'0'"
                     :curItem="itemh.hzDetail.hz_json"
-                    :targetDiv="'writeTops-item-' + '-' + indexh + '-' + itemh.con"
+                    :targetDiv="'writeTops-item-' + indexT + '-' + indexh + '-' + itemh.con"
                     :class="[indexh !== 0 ? 'writeTop-item-noLeft' : '']"
                     class="writeTop-item"
                     :style="{ borderColor: data.borderColor }"
@@ -62,7 +63,7 @@
             <div
               class="definition-box"
               v-if="(data.right.collocation || data.right.exampleSent) && data.left.con.length < 4"
-              style="flex: 1; margin: 100px 0 0 16px"
+              :style="{ flex: '1', marginTop: data.right.audio_file ? '100px' : '37px' }"
             >
               <div v-if="data.right.cixing">
                 <label class="card-label">词性:</label>
@@ -469,6 +470,11 @@ export default {
           label {
             width: 68px;
           }
+          p {
+            flex: 1;
+            word-break: break-word;
+            white-space: pre-wrap;
+          }
         }
       }
     }

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

@@ -98,9 +98,10 @@
               display: 'flex',
               justifyContent:
                 !(data.right.collocation && data.right.exampleSent) && data.left.con.length < 4 ? 'center' : 'auto',
+              columnGap: '16px',
             }"
           >
-            <div style="width: max-content">
+            <div style="width: max-content" v-if="data.right.hz_info.length > 0">
               <AudioPlay
                 :style="{ background: data.borderColor }"
                 :file-id="data.right.audio_file"
@@ -132,7 +133,7 @@
             <div
               class="definition-box"
               v-if="(data.right.collocation || data.right.exampleSent) && data.left.con.length < 4"
-              style="flex: 1; margin: 100px 0 0 16px"
+              :style="{ flex: '1', marginTop: data.right.audio_file ? '100px' : '37px' }"
             >
               <div v-if="data.right.cixing">
                 <label class="card-label">词性:</label>
@@ -576,6 +577,11 @@ export default {
           label {
             width: 68px;
           }
+          p {
+            flex: 1;
+            word-break: break-word;
+            white-space: pre-wrap;
+          }
         }
       }
     }