You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vehiclePlateColor.js 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. export const vehiclePlateColor = [{
  2. id: 0,
  3. color: '蓝色'
  4. },
  5. {
  6. id: 1,
  7. color: '黄色'
  8. },
  9. {
  10. id: 2,
  11. color: '黑色'
  12. },
  13. {
  14. id: 3,
  15. color: '白色'
  16. },
  17. {
  18. id: 4,
  19. color: '渐变绿色'
  20. },
  21. {
  22. id: 5,
  23. color: '黄绿双拼色'
  24. },
  25. // {
  26. // id: 6,
  27. // color: '蓝白渐变色'
  28. // },
  29. {
  30. id: 9,
  31. color: '未确定'
  32. },
  33. {
  34. id: 11,
  35. color: '绿色'
  36. },
  37. {
  38. id: 12,
  39. color: '红色'
  40. }
  41. ]
  42. export const vehiclePlateColorPai = [{
  43. id: 0,
  44. color: '蓝牌',
  45. showColor: "rgb(56,139,252)",
  46. style: {
  47. color: '#FFFFFF',
  48. background: 'rgb(56,139,252)'
  49. }
  50. },
  51. {
  52. id: 1,
  53. color: '黄牌',
  54. showColor: "rgb(255,156,0)",
  55. style: {
  56. color: '#FFFFFF',
  57. background: 'rgb(255,156,0)'
  58. }
  59. },
  60. {
  61. id: 2,
  62. color: '黑牌',
  63. showColor: "rgb(0,0,0)",
  64. style: {
  65. color: '#FFFFFF',
  66. background: 'rgb(0,0,0)'
  67. }
  68. },
  69. {
  70. id: 3,
  71. color: '白牌',
  72. showColor: "white",
  73. style: {
  74. color: '#000000',
  75. background: 'rgb(255, 255, 255)'
  76. }
  77. },
  78. {
  79. id: 4,
  80. color: '渐变绿牌',
  81. showColor: "rgb(56,139,252)",
  82. style: {
  83. color: '#000000',
  84. background: 'linear-gradient(135deg, #00b09b, #2ec46d, #00b09b)'
  85. }
  86. },
  87. {
  88. id: 5,
  89. color: '黄绿双拼牌',
  90. showColor: "rgb(252,204,1)",
  91. style: {
  92. color: '#000000',
  93. background: 'rgb(255, 255, 255)'
  94. }
  95. },
  96. // {
  97. // id: 6,
  98. // color: '蓝白渐变牌',
  99. // showColor: "rgb(56,139,252)",
  100. // },
  101. {
  102. id: 9,
  103. color: '未确定',
  104. showColor: "",
  105. style: {
  106. color: '#FFFFFF',
  107. background: 'rgb(56,139,252)'
  108. }
  109. },
  110. {
  111. id: 11,
  112. color: '绿牌',
  113. showColor: "rgb(26,250,31)",
  114. style: {
  115. color: '#000000',
  116. background: 'rgb(26,250,31)'
  117. }
  118. },
  119. {
  120. id: 12,
  121. color: '红牌',
  122. showColor: "red",
  123. style: {
  124. color: '#FFFFFF',
  125. background: 'red'
  126. }
  127. }
  128. ]
  129. //获取车牌颜色
  130. export const getVehiclePlateColor = (id) => {
  131. let colors = vehiclePlateColor.filter(item => item.id == id);
  132. if (colors) {
  133. return colors[0] ? colors[0].color : ''
  134. } else {
  135. return ''
  136. }
  137. }
  138. //获取车牌颜色
  139. export const getVehiclePlateColorPai = (id = 0) => {
  140. if (id) {
  141. id = Number(id)
  142. let colors = vehiclePlateColorPai.filter(item => item.id == id);
  143. return colors[0] ? colors[0].color : ''
  144. } else {
  145. return "蓝色"
  146. }
  147. }
  148. // 获取车牌展示颜色
  149. export const getVehiclePlateColorPaiShow = (id = 0) => {
  150. if (id) {
  151. id = Number(id)
  152. let colors = vehiclePlateColorPai.filter(item => item.id == id);
  153. return colors[0] ? colors[0].showColor : ''
  154. } else {
  155. return "rgb(56,139,252)"
  156. }
  157. }
  158. export const getVehiclePlateStyle = (id = 0) => {
  159. if (id) {
  160. id = Number(id)
  161. let colors = vehiclePlateColorPai.filter(item => item.id == id);
  162. return colors[0] ? colors[0].style : {}
  163. } else {
  164. return {
  165. color: '#FFFFFF',
  166. background: 'rgb(56,139,252)'
  167. }
  168. }
  169. }