color.js 720 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. export const red1 = (num, flag, then) => {
  2. if (num == flag)
  3. return {
  4. color: 'red',
  5. num: then,
  6. }
  7. else {
  8. return {
  9. color: 'black',
  10. num,
  11. }
  12. }
  13. }
  14. export const c250_100Red = (num) => {
  15. return red1(num, 250, -100)
  16. }
  17. export const c250_1Red = (num) => {
  18. return red1(num, 250, -1)
  19. }
  20. // 温度
  21. export const temp1 = c250_100Red
  22. // 湿度
  23. export const hum1 = c250_1Red
  24. export const application = (state) => {
  25. switch(state + '') {
  26. case '1': return 'green'
  27. case '3': return 'red'
  28. case '4': return 'orange'
  29. default: return 'black'
  30. }
  31. }
  32. export const result= (result) => {
  33. switch (result) {
  34. case '待审核': return 'green'
  35. default: return 'black'
  36. }
  37. }