Commit 848fba31 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加内部状态 Badge展示

parent 7fa2cf99
import { Badge } from "antd"
import { Link, getIntl } from "umi"
import { MATERIAL_INNER_STATUS_BADGE_COLOR } from "./constants"
type Params = {
detailUrl: string,
......@@ -75,6 +77,7 @@ export function getColumn(params: Params) {
{
title: intl.formatMessage({ id: 'material.interiorStateName', defaultMessage: '内部状态' }),
dataIndex: 'interiorStateName',
render: (text, record) => <Badge color={MATERIAL_INNER_STATUS_BADGE_COLOR[record.interiorState]} text={text} />,
}
]
return columns.concat(params?.extraColumn || []);
......
import {
FROZEN,
PENDING_ADD_MATERIAL,
PENDING_EXAM_I,
EXAM_I_FAIL,
PENDING_EXAM_II,
EXAM_II_FAIL,
PENDING_SUBMIT_EXAM,
PENDING_EXAM_CHANGE_I,
PENDING_EXAM_CHANGE_I_FAIL,
PENDING_EXAM_CHANGE_II,
PENDING_EXAM_CHANGE_II_FAIL,
HAS_CONFIRM,
} from '@/constants/material';
/**
* 物料内部状态 Tag badge map
*/
export const MATERIAL_INNER_STATUS_BADGE_COLOR = {
[FROZEN]: 'grey',
[PENDING_ADD_MATERIAL]: 'blue',
[PENDING_EXAM_I]: 'orange',
[EXAM_I_FAIL]: 'red',
[PENDING_EXAM_II]: 'orange',
[EXAM_II_FAIL]: 'red',
[PENDING_SUBMIT_EXAM]: 'orange',
[PENDING_EXAM_CHANGE_I]: 'orange',
[PENDING_EXAM_CHANGE_I_FAIL]: 'red',
[PENDING_EXAM_CHANGE_II]: 'orange',
[PENDING_EXAM_CHANGE_II_FAIL]: 'red',
[HAS_CONFIRM]: 'green',
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment