gaoluyang
昨天 b64a0deae5b5d33f9e20671a68936b27f0b9b00b
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
<script lang="ts" setup>
import { Tag } from 'ant-design-vue';
 
/** 配色说明项:色块 + 文案 */
const legendItems: Array<{ color: string; label: string }> = [
  { color: 'bg-[#95d475]', label: '白班' },
  { color: 'bg-[#f0a020]', label: '中班(三班倒)' },
  { color: 'bg-[#909399]', label: '中班(两班倒)/ 夜班' },
];
</script>
 
<template>
  <div
    class="text-muted-foreground flex flex-wrap items-center gap-x-4 gap-y-1 px-1 py-2 text-xs"
  >
    <span class="shrink-0">配色说明:</span>
    <span
      v-for="item in legendItems"
      :key="item.label"
      class="flex items-center gap-1"
    >
      <span
        class="inline-block h-2.5 w-2.5 shrink-0 rounded-sm"
        :class="item.color"
      ></span>
      {{ item.label }}
    </span>
    <span class="flex items-center gap-1">
      <span
        class="inline-block h-2.5 w-2.5 shrink-0 rounded-sm bg-[#f56c6c] opacity-60"
      ></span>
      <span class="text-red-500">红色日期</span>
      = 周末
    </span>
    <span class="flex items-center gap-1">
      <Tag color="green" class="!m-0"> 休 </Tag>
      = 节假日(不显示排班)
    </span>
  </div>
</template>