1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  | <script setup> 
 |  import { toRefs, ref, defineProps } from 'vue'; 
 |  import { globalState } from '@/config.js' 
 |  import { formatMessage } from '@/utils/localeUtils'; 
 |    
 |  const props = defineProps({ 
 |      list: { 
 |          type: Array, 
 |          default: [] 
 |      }, 
 |      repeatNum: { 
 |          type: Number, 
 |          default: 1 
 |      } 
 |  }); 
 |  const { list, repeatNum } = toRefs(props) 
 |  </script> 
 |    
 |  <template> 
 |      <div id="printMe"> 
 |          <div v-for="(item, index) in list" :key="index"> 
 |              <div v-for="count in repeatNum" style="font-size: 16px;margin-top: 20px;"> 
 |                  <div style="text-align: center;"> 
 |                      <img :src="globalState.url + '/api/code/auth?type=1¶m=' + item.barcode" /> 
 |                  </div> 
 |                  <div style="text-align: center;"> 
 |                      {{ item.barcode }} 
 |                  </div> 
 |              </div> 
 |          </div> 
 |      </div> 
 |  </template> 
 |    
 |  <style> 
 |  @media print { 
 |      body { 
 |          margin: 0; 
 |          padding: 0; 
 |      } 
 |    
 |      .print-area { 
 |          margin: 0; 
 |          padding: 0; 
 |          height: auto; 
 |      } 
 |  } 
 |  </style> 
 |  
  |