ソースを参照

字词卡片满屏

natasha 11 ヶ月 前
コミット
3fa5530711

+ 1 - 1
src/router/index.js

@@ -141,7 +141,7 @@ const routes = [{
         path: '/wordcard/cread',
         component: () =>
             import ('@/views/wordcard/cread'),
-        meta: { title: '创建词汇卡片', keepAlive: true },
+        meta: {  keepAlive: true },
     },
     {
         path: '/wordcard/print',

+ 90 - 39
src/views/corpus/seekPage.vue

@@ -303,50 +303,73 @@
                     fontSize: conSize + 'px',
                   }"
                 >
-                  <div v-for="(txt, indexs) in item.resArr" :key="indexs">
-                    <div
-                      :style="{ padding: fenciShow ? '0 2px' : '', display: 'inline-block' }"
-                      v-for="(txts, indext) in txt"
-                      :key="indext"
+                  <div
+                    v-for="(txt, indexs) in item.resArr"
+                    :key="indexs"
+                    :style="{
+                      width:
+                        indexs === 1 || KWIC_sortIndex === 1
+                          ? ''
+                          : (KWIC_sortIndex === 0 && indexs === 2 && !showLeft) ||
+                            (KWIC_sortIndex === 2 && !showRight && indexs === 0)
+                          ? '944px'
+                          : (KWIC_sortIndex === 0 && indexs === 0 && !showLeft) ||
+                            (KWIC_sortIndex === 2 && !showRight && indexs === 2)
+                          ? '0px'
+                          : '',
+                    }"
+                  >
+                    <template
+                      v-if="
+                        (KWIC_sortIndex === 0 && ((indexs === 0 && showLeft) || indexs !== 0)) ||
+                        (KWIC_sortIndex === 2 && ((showRight && indexs === 2) || indexs !== 2)) ||
+                        KWIC_sortIndex === 1
+                      "
                     >
-                      <!-- <span v-html="txts"></span> -->
-                      <template v-if="sortType === 'pclength' && (KWIC_sortIndex === 0 || KWIC_sortIndex === 2)">
-                        <template v-if="indexs === 0 && KWIC_sortIndex === 0">
-                          <el-tooltip effect="dark" placement="bottom" style="display: inline">
-                            <div slot="content">
-                              {{
-                                item.adjoin_fc_frequency_list_left && item.adjoin_fc_frequency_list_left[indext]
-                                  ? item.adjoin_fc_frequency_list_left[indext]
-                                  : 1
-                              }}
-                            </div>
-                            <div class="">
-                              <span v-html="txts"></span>
-                            </div>
-                          </el-tooltip>
-                        </template>
-                        <template v-else-if="indexs === 2 && KWIC_sortIndex === 2">
-                          <el-tooltip effect="dark" placement="bottom" style="display: inline">
-                            <div slot="content">
-                              {{
-                                item.adjoin_fc_frequency_list_right && item.adjoin_fc_frequency_list_right[indext]
-                                  ? item.adjoin_fc_frequency_list_right[indext]
-                                  : 1
-                              }}
-                            </div>
-                            <div class="">
-                              <span v-html="txts"></span>
-                            </div>
-                          </el-tooltip>
+                      <div
+                        :style="{ padding: fenciShow ? '0 2px' : '', display: 'inline-block' }"
+                        v-for="(txts, indext) in txt"
+                        :key="indext"
+                      >
+                        <!-- <span v-html="txts"></span> -->
+                        <template v-if="sortType === 'pclength' && (KWIC_sortIndex === 0 || KWIC_sortIndex === 2)">
+                          <template v-if="indexs === 0 && KWIC_sortIndex === 0">
+                            <el-tooltip effect="dark" placement="bottom" style="display: inline">
+                              <div slot="content">
+                                {{
+                                  item.adjoin_fc_frequency_list_left && item.adjoin_fc_frequency_list_left[indext]
+                                    ? item.adjoin_fc_frequency_list_left[indext]
+                                    : 1
+                                }}
+                              </div>
+                              <div class="">
+                                <span v-html="txts"></span>
+                              </div>
+                            </el-tooltip>
+                          </template>
+                          <template v-else-if="indexs === 2 && KWIC_sortIndex === 2">
+                            <el-tooltip effect="dark" placement="bottom" style="display: inline">
+                              <div slot="content">
+                                {{
+                                  item.adjoin_fc_frequency_list_right && item.adjoin_fc_frequency_list_right[indext]
+                                    ? item.adjoin_fc_frequency_list_right[indext]
+                                    : 1
+                                }}
+                              </div>
+                              <div class="">
+                                <span v-html="txts"></span>
+                              </div>
+                            </el-tooltip>
+                          </template>
+                          <template v-else>
+                            <span v-html="txts"></span>
+                          </template>
                         </template>
                         <template v-else>
                           <span v-html="txts"></span>
                         </template>
-                      </template>
-                      <template v-else>
-                        <span v-html="txts"></span>
-                      </template>
-                    </div>
+                      </div>
+                    </template>
                   </div>
                 </div>
                 <el-tooltip effect="dark" placement="bottom">
@@ -660,6 +683,8 @@ export default {
       selectDelLijuIds: [], // 选中删除例句id数组
       actvieEditLijuItem: null,
       showEditLijuFlag: false,
+      showLeft: true, //左对齐显示左边
+      showRight: true, //右对齐显示右边
     };
   },
   //计算属性 类似于data概念
@@ -1299,6 +1324,18 @@ export default {
         item.number = index + 1;
       });
       let newarr = arrs.splice((this.page - 1) * this.pageSize, this.pageSize);
+      let showleft = false;
+      let showRight = false;
+      newarr.forEach((item) => {
+        if (item.resArr && item.resArr[0].length > 0) {
+          showleft = true;
+        }
+        if (item.resArr && item.resArr[2].length > 0) {
+          showRight = true;
+        }
+      });
+      this.showLeft = showleft;
+      this.showRight = showRight;
       this.ShowList = JSON.parse(JSON.stringify(newarr));
     },
     padingEvetns() {
@@ -1322,6 +1359,20 @@ export default {
         item.number = index + 1;
       });
       let newarr = arrs.splice((this.page - 1) * this.pageSize, this.pageSize);
+
+      let showleft = false;
+      let showRight = false;
+      newarr.forEach((item) => {
+        if (item.resArr && item.resArr[0].length > 0) {
+          showleft = true;
+        }
+        if (item.resArr && item.resArr[2].length > 0) {
+          showRight = true;
+        }
+      });
+
+      this.showLeft = showleft;
+      this.showRight = showRight;
       this.ShowList = JSON.parse(JSON.stringify(newarr));
     },
     // 删除脏数据

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

@@ -5,7 +5,15 @@
         <div
           class="left left-preview"
           :class="[data.left.fileList.length === 0 ? 'left-big' : '']"
-          :style="{ borderColor: data.borderColor }"
+          :style="{
+            borderColor: data.borderColor,
+            padding:
+              data.left.con && (data.headerCon || data.label)
+                ? ''
+                : !data.left.con && (data.headerCon || data.label)
+                ? '40px 12px 0 12px'
+                : '0 12px',
+          }"
         >
           <div class="header-info-preview">
             <h5 :style="{ textAlign: data.fontAlign }">{{ data.headerCon }}</h5>
@@ -13,13 +21,21 @@
           </div>
           <div class="item-image" v-if="data.left.fileList.length > 0">
             <el-image
-              style="width: 568px; height: 294px"
+              :style="{
+                width: '568px',
+                height:
+                  data.left.con && (data.headerCon || data.label)
+                    ? '294px'
+                    : !data.left.con && (data.headerCon || data.label)
+                    ? '402px'
+                    : ' 450px',
+              }"
               :src="data.left.fileList[0].fileUrl"
               :preview-src-list="[data.left.fileList[0].fileUrl]"
               fit="contain"
             />
           </div>
-          <h2 :class="['con-preview', data.left.fileList.length === 0 ? 'con-preview-big' : '']">
+          <h2 :class="['con-preview', data.left.fileList.length === 0 ? 'con-preview-big' : '']" v-if="data.left.con">
             {{ data.left.con }}
           </h2>
         </div>

+ 19 - 3
src/views/wordcard/writeTableNew.vue

@@ -64,7 +64,15 @@
           class="left left-preview"
           :class="[data.left.fileList.length === 0 ? 'left-big' : '']"
           v-if="(isPreview && showLeft) || !isPreview"
-          :style="{ borderColor: data.borderColor }"
+          :style="{
+            borderColor: data.borderColor,
+            padding:
+              data.left.con && (data.headerCon || data.label)
+                ? ''
+                : !data.left.con && (data.headerCon || data.label)
+                ? '40px 12px 0 12px'
+                : '0 12px',
+          }"
         >
           <div class="header-info-preview">
             <h5 :style="{ textAlign: data.fontAlign }">{{ data.headerCon }}</h5>
@@ -72,13 +80,21 @@
           </div>
           <div class="item-image" v-if="data.left.fileList.length > 0">
             <el-image
-              style="width: 568px; height: 294px"
+              :style="{
+                width: '568px',
+                height:
+                  data.left.con && (data.headerCon || data.label)
+                    ? '294px'
+                    : !data.left.con && (data.headerCon || data.label)
+                    ? '402px'
+                    : ' 450px',
+              }"
               :src="data.left.fileList[0].fileUrl"
               :preview-src-list="[data.left.fileList[0].fileUrl]"
               fit="contain"
             />
           </div>
-          <h2 :class="['con-preview', data.left.fileList.length === 0 ? 'con-preview-big' : '']">
+          <h2 :class="['con-preview', data.left.fileList.length === 0 ? 'con-preview-big' : '']" v-if="data.left.con">
             {{ data.left.con }}
           </h2>
           <a class="overturn-btn" v-if="isPreview" @click="changeShowLeft"><i class="el-icon-refresh"></i></a>