zhou zhou
7 天以前 029559f7cedded183bd1fbd09a5ebb576a9fa21d
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<template>
  <div class="matnr-print-field-panel">
    <div class="matnr-print-field-panel__title">{{
      t('pages.basicInfo.whMat.printTemplate.fieldPanel.title')
    }}</div>
    <ElScrollbar max-height="220px">
      <div class="matnr-print-field-panel__list">
        <button
          v-for="field in fields"
          :key="field.path"
          type="button"
          class="matnr-print-field-panel__item"
          @click="$emit('insert-field', field.placeholder)"
        >
          <span>{{ field.label }}</span>
          <small>{{ field.placeholder }}</small>
        </button>
      </div>
    </ElScrollbar>
  </div>
</template>
 
<script setup>
  import { useI18n } from 'vue-i18n'
 
  defineOptions({ name: 'MatnrPrintFieldPanel' })
 
  const { t } = useI18n()
 
  defineProps({
    fields: {
      type: Array,
      default: () => []
    }
  })
 
  defineEmits(['insert-field'])
</script>
 
<style scoped>
  .matnr-print-field-panel {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
  }
 
  .matnr-print-field-panel__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--art-text-primary);
  }
 
  .matnr-print-field-panel__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
 
  .matnr-print-field-panel__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 10px;
    background: #ffffff;
    color: var(--art-text-primary);
    cursor: pointer;
    transition:
      border-color 0.2s ease,
      transform 0.2s ease;
  }
 
  .matnr-print-field-panel__item:hover {
    border-color: rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
  }
 
  .matnr-print-field-panel__item small {
    color: var(--art-text-secondary);
    font-size: 12px;
  }
</style>