issue status and priority color
This commit is contained in:
parent
e66ae562b7
commit
fcea1193b9
|
@ -38,4 +38,21 @@ class IssuePriority < ApplicationRecord
|
|||
priority.(self, :id, :name)
|
||||
end
|
||||
end
|
||||
|
||||
def mp_color
|
||||
case name
|
||||
when '低'
|
||||
'#13b33e'
|
||||
when '正常'
|
||||
'#0d5ef8'
|
||||
when '高'
|
||||
'#ff6f00'
|
||||
when '紧急'
|
||||
'#d20f0f'
|
||||
when '立刻'
|
||||
'#f5222d'
|
||||
else
|
||||
'13b33e'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -45,9 +45,28 @@ class IssueStatus < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def to_builder
|
||||
def to_builder
|
||||
Jbuilder.new do |status|
|
||||
status.(self, :id, :name)
|
||||
end
|
||||
end
|
||||
|
||||
def mp_color
|
||||
case name
|
||||
when '新增'
|
||||
'#ff6f00'
|
||||
when '正在解决'
|
||||
'#0d5ef8'
|
||||
when '已解决'
|
||||
'#13b33e'
|
||||
when '关闭'
|
||||
'#b1aaa5'
|
||||
when '反馈'
|
||||
'#13c2c2'
|
||||
when '拒绝'
|
||||
'#ff0000'
|
||||
else
|
||||
'#ff6f00'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1 +1 @@
|
|||
json.(priority, :id, :name)
|
||||
json.(priority, :id, :name,:mp_color)
|
||||
|
|
|
@ -1 +1 @@
|
|||
json.(status, :id, :name)
|
||||
json.(status, :id, :name, :mp_color)
|
||||
|
|
Loading…
Reference in New Issue