src/views/hrm/leave/index.vue
@@ -4,7 +4,10 @@
import { Page, useVbenModal } from '#/packages/effects/common-ui/src';
import { message } from 'ant-design-vue';
import { message, Tag } from 'ant-design-vue';
import { DICT_TYPE } from '#/packages/constants/src';
import { getDictLabel } from '#/packages/effects/hooks/src';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
@@ -72,6 +75,20 @@
  handleRefresh();
}
/** 请假类型颜色 */
function getLeaveTypeColor(type: number): string {
  switch (type) {
    case 1: return 'green';      // 年假
    case 2: return 'orange';     // 事假
    case 3: return 'red';        // 病假
    case 4: return 'purple';     // 婚假
    case 5: return 'cyan';       // 产假
    case 6: return 'magenta';    // 丧假
    case 7: return 'geekblue';   // 调休
    default: return 'default';
  }
}
const [Grid, gridApi] = useVbenVxeGrid({
  formOptions: {
    schema: useGridFormSchema(),
@@ -119,6 +136,11 @@
          ]"
        />
      </template>
      <template #leaveType="{ row }">
        <Tag :color="getLeaveTypeColor(row.leaveType)">
          {{ getDictLabel(DICT_TYPE.HRM_LEAVE_TYPE, row.leaveType) }}
        </Tag>
      </template>
      <template #actions="{ row }">
        <TableAction
          :actions="[