Przeglądaj źródła

句模式加标点显示

natasha 1 rok temu
rodzic
commit
0576b1e988

+ 8 - 7
src/views/wordcard/cread.vue

@@ -506,9 +506,9 @@ export default {
         } else {
           let contentItem = '';
           for (let s = 0; s < contentArr[i].length; s++) {
-            if (/^[\u4e00-\u9fa5]/.test(contentArr[i][s])) {
-              contentItem += contentArr[i][s];
-            }
+            // if (/^[\u4e00-\u9fa5]/.test(contentArr[i][s])) {
+            contentItem += contentArr[i][s];
+            // }
           }
           if (contentItem) option.push(contentItem);
         }
@@ -535,7 +535,7 @@ export default {
         .then((res) => {
           this.loading = false;
           for (let key in res) {
-            if (key != 'status' && key != ',') {
+            if (key != 'status' && key != ',' && res[key]) {
               res[key] = JSON.parse(res[key]);
             }
           }
@@ -583,9 +583,9 @@ export default {
         } else {
           let contentItem = '';
           for (let s = 0; s < contentArr[i].length; s++) {
-            if (/^[\u4e00-\u9fa5]/.test(contentArr[i][s])) {
-              contentItem += contentArr[i][s];
-            }
+            // if (/^[\u4e00-\u9fa5]/.test(contentArr[i][s])) {
+            contentItem += contentArr[i][s];
+            // }
           }
           if (contentItem) data.option.push(contentItem);
         }
@@ -968,6 +968,7 @@ export default {
                   hz_json: null,
                 };
                 this.$set(data.result[index].list[indexs][indexss], 'hzDetail', res);
+                this.$set(data.result[index].list[indexs][indexss], 'isPunctuation', !res);
               }
             });
           });

+ 54 - 1
src/views/wordcard/print.vue

@@ -117,7 +117,35 @@
               borderColor: dataConfig.borderColor,
             }"
           >
-            <template v-if="itemI && itemI.con && !itemI.write && !itemI.answer && !itemI.miaoRed">
+            <template v-if="itemI && itemI.con && itemI.isPunctuation">
+              <!-- 不是汉字的内容 -->
+              <div class="punctuation-box">
+                <div class="character-target-div">
+                  <svg-icon
+                    icon-class="tian"
+                    className="tian-bg"
+                    v-if="dataConfig.BoxbgType == 0"
+                    :style="{ color: '#DEDEDE' }"
+                  />
+                  <svg-icon
+                    icon-class="mi"
+                    className="tian-bg"
+                    v-if="dataConfig.BoxbgType == 1"
+                    :style="{ color: '#DEDEDE' }"
+                  />
+                </div>
+                <h3
+                  :style="{
+                    lineHeight: dataConfig.width,
+                    color: itemI.miaoRed ? dataConfig.writeColor : dataConfig.fontColor,
+                    fontSize: dataConfig.fontSize,
+                  }"
+                >
+                  {{ itemI.con }}
+                </h3>
+              </div>
+            </template>
+            <template v-else-if="itemI && itemI.con && !itemI.write && !itemI.answer && !itemI.miaoRed">
               <Strockplay
                 v-if="'writeTop-item-' + indexT + '-' + indexR + '-' + indexI"
                 className="adult-strockplay"
@@ -535,4 +563,29 @@ export default {
 .writeTop-item {
   border: 1px solid #de4444;
 }
+.punctuation-box {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  .character-target-div {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    .svg-icon {
+      width: 100%;
+      height: 100%;
+    }
+  }
+  h3 {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    font-family: FZJCGFKTK;
+    text-align: center;
+  }
+}
 </style>

+ 54 - 1
src/views/wordcard/writeTable.vue

@@ -152,7 +152,35 @@
             borderColor: dataConfig.borderColor,
           }"
         >
-          <template v-if="itemI && itemI.con && !itemI.write && !itemI.answer && !itemI.miaoRed">
+          <template v-if="itemI && itemI.con && itemI.isPunctuation">
+            <!-- 不是汉字的内容 -->
+            <div class="punctuation-box">
+              <div class="character-target-div">
+                <svg-icon
+                  icon-class="tian"
+                  className="tian-bg"
+                  v-if="dataConfig.BoxbgType == 0"
+                  :style="{ color: '#DEDEDE' }"
+                />
+                <svg-icon
+                  icon-class="mi"
+                  className="tian-bg"
+                  v-if="dataConfig.BoxbgType == 1"
+                  :style="{ color: '#DEDEDE' }"
+                />
+              </div>
+              <h3
+                :style="{
+                  lineHeight: dataConfig.width,
+                  color: itemI.miaoRed ? dataConfig.writeColor : dataConfig.fontColor,
+                  fontSize: dataConfig.fontSize,
+                }"
+              >
+                {{ itemI.con }}
+              </h3>
+            </div>
+          </template>
+          <template v-else-if="itemI && itemI.con && !itemI.write && !itemI.answer && !itemI.miaoRed">
             <Strockplay
               v-if="'writeTop-item-' + pageNumber + '-' + indexI + type"
               className="adult-strockplay"
@@ -600,5 +628,30 @@ export default {
       padding-top: 0px;
     }
   }
+  .punctuation-box {
+    position: relative;
+    width: 100%;
+    height: 100%;
+    .character-target-div {
+      position: absolute;
+      width: 100%;
+      height: 100%;
+      top: 0;
+      left: 0;
+      .svg-icon {
+        width: 100%;
+        height: 100%;
+      }
+    }
+    h3 {
+      position: absolute;
+      width: 100%;
+      height: 100%;
+      top: 0;
+      left: 0;
+      font-family: FZJCGFKTK;
+      text-align: center;
+    }
+  }
 }
 </style>