issue status and priority color

This commit is contained in:
呱呱呱 2023-11-08 16:24:10 +08:00
parent e66ae562b7
commit fcea1193b9
4 changed files with 39 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -1 +1 @@
json.(priority, :id, :name)
json.(priority, :id, :name,:mp_color)

View File

@ -1 +1 @@
json.(status, :id, :name)
json.(status, :id, :name, :mp_color)