车间能级提升-智能设备管理系统
baoshiwei
2025-04-24 89a5fedfe041ebacb2d81ecae1023b206cd3f353
eims-ui/apps/web-antd/src/views/eims/insp-st/data.tsx
@@ -44,9 +44,26 @@
    fixed: 'left'
  },
  {
    title: '保养年月',
    field: 'planTime',
    minWidth: 120
    title: '保养时间',
    field: 'planTimeStr',
    minWidth: 200,
    slots: {
      default: ({ row }) => {
        // 判断是否需要显示时间
        if (!row.type) return '';
        // 获取原始时间字符串
        const fullDate = row.planTimeStr;
        // 根据条件决定显示格式
        // 示例条件:如果 status 是某个特定值(例如 'monthly'),则显示 YYYY-MM
        if (row.type === 'Month') {
          return fullDate.slice(0, 7); // 截取前 7 个字符,得到 YYYY-MM
        }
        // 默认显示完整日期 YYYY-MM-DD
        return fullDate;
      }
    }
  },
  {
    title: '状态',
@@ -54,6 +71,7 @@
    minWidth: 80,
    slots: {
      default: ({ row }) => {
        if (!row.status) return '';
        return renderDict(row.status, DictEnum.EIMS_INSPECT_STATUS);
      }
    }