computedPriorityStyle.js 636 B

123456789101112131415161718192021222324252627
  1. import { computed } from "vue"
  2. export function computedPriorityStyle() {
  3. /**
  4. * 紧急度颜色回显
  5. */
  6. const priorityStyle = computed(() => {
  7. return function(priority){
  8. if(priority){
  9. if(priority.value === 'L4' || priority.value === 'L5'){
  10. return { color: '#49B856' };
  11. } else if (priority.value === 'L2' || priority.value === 'L3'){
  12. return { color: '#F3A73F' };
  13. } else if (priority.value === 'L1'){
  14. return { color: '#FF0000' };
  15. } else {
  16. return {}
  17. }
  18. }else{
  19. return {};
  20. }
  21. }
  22. })
  23. return {
  24. priorityStyle
  25. };
  26. }