Prechádzať zdrojové kódy

fix: 优化258表格水印

ldong 2 mesiacov pred
rodič
commit
e67faba999
1 zmenil súbory, kde vykonal 20 pridanie a 4 odobranie
  1. 20 4
      src/components/sheet.vue

+ 20 - 4
src/components/sheet.vue

@@ -21,10 +21,11 @@ const dynamicSty = computed(()=>{
 
 <template>
 <div :class="['table-wrapper',dynamicSty ]">
-  <table 
+  <table
     cellpadding="0" 
     cellspacing="0" 
-    :style="`font-size: ${props.config.FontSize||12}px`"
+    :class="props.config.Watermark?'background-watermark':'no-water'"
+    :style="{'font-size':(props.config.FontSize||12)+'px',backgroundImage: 'url('+props.config.Watermark+')'}"
   >
     <tbody>
       <tr 
@@ -33,7 +34,7 @@ const dynamicSty = computed(()=>{
       >
         <td 
           :class="['data-cell',{
-            'one-bg':(index+1)%2&&index>0,
+            'one-bg':(index+1)%2&&index>0&&!props.config.Watermark,
             'tow-bg': (index+1)%2!==0&&index>0,
             'head-column': index === 0
           }]"
@@ -106,7 +107,6 @@ table {
     border: 1px solid #dcdfe6;
     // height: 40px;
     text-align: center;
-    background-color: #fff;
     border-left: none;
     border-top: none;
     &:first-child {
@@ -138,6 +138,17 @@ table {
   }
 }
 
+.no-water{
+  td,
+  th {
+    background-color: #fff;
+  }
+  .head-column {
+    background-color: #505B78;
+    color: #fff;
+  }
+}
+
 .pc-sty table {
   table-layout: auto;
   td,th {
@@ -154,4 +165,9 @@ table {
     height: 40px;
   }
 }
+.background-watermark{
+  background-repeat: no-repeat;
+  background-position: center center;
+  background-size: 100%;
+}
 </style>