Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
848fba31
Commit
848fba31
authored
Apr 21, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加内部状态 Badge展示
parent
7fa2cf99
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
columns.tsx
src/pages/commodity/material/common/columns.tsx
+3
-0
constants.tsx
src/pages/commodity/material/common/constants.tsx
+33
-0
No files found.
src/pages/commodity/material/common/columns.tsx
View file @
848fba31
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
||
[]);
...
...
src/pages/commodity/material/common/constants.tsx
0 → 100644
View file @
848fba31
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment