您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

133 行
5.1 KiB

  1. import {getStatusTag} from "utils/statusUtils/Base";
  2. export function getStatus(params) {
  3. return getStatusByText(params.row.status, params.row.creditor);
  4. }
  5. export function getStatusByText(status, creditor) {
  6. switch (status) {
  7. case "submitted":
  8. return getStatusTag({ color: "#f5a83d", text: "處理中" })
  9. case "reviewed":
  10. return getStatusTag({ color: "#f5a83d", text: "處理中" })
  11. case "confirmed":
  12. if (creditor)
  13. return getStatusTag({ color: "#22a13f", text: "待發佈" })
  14. else
  15. return getStatusTag({ color: "#22a13f", text: "待付款" })
  16. case "published":
  17. return getStatusTag({ color: "#22a13f", text: "待付款" })
  18. case "paid":
  19. return getStatusTag({ color: "#22a13f", text: "待發佈" })
  20. case "completed":
  21. return getStatusTag({ color: "#8a8784", text: "已完成" })
  22. case "notAccepted":
  23. return getStatusTag({ color: "#d9372b", text: "不接受" })
  24. case "resubmit":
  25. return getStatusTag({ color: "#757373", text: "需重新提交" })
  26. case "cancelled":
  27. return getStatusTag({ color: "#909497", text: "已取消" })
  28. case "withdrawn":
  29. return getStatusTag({ color: "#909497", text: "已撤銷" })
  30. default:
  31. return getStatusTag({ text: status })
  32. }
  33. }
  34. export function getStatusEng(params) {
  35. return getStatusByTextEng(params.row.status, params.row.creditor);
  36. }
  37. export function getStatusByTextEng(status, creditor) {
  38. switch (status) {
  39. case "submitted":
  40. return getStatusTag({ color: "#F1C40F", text: "Submitted" })
  41. case "reviewed":
  42. return getStatusTag({ color: "#0C489E", text: "Reviewed" })
  43. case "confirmed":
  44. if (creditor)
  45. return getStatusTag({ color: "#3498DB", text: "Pending Publish" })
  46. else
  47. return getStatusTag({ color: "#F39C12", text: "Pending Payment" })
  48. case "published":
  49. return getStatusTag({ color: "#F39C12", text: "Pending Payment" })
  50. case "paid":
  51. return getStatusTag({ color: "#3498DB", text: "Pending Publish" })
  52. case "completed":
  53. return getStatusTag({ color: "#8a8784", text: "Completed" })
  54. case "notAccepted":
  55. return getStatusTag({ color: "#d9372b", text: "Not Accepted" })
  56. case "resubmit":
  57. return getStatusTag({ color: "#757373", text: "Re-Submit Required" })
  58. case "cancelled":
  59. return getStatusTag({ color: "#8a8784", text: "Cancelled" })
  60. case "withdrawn":
  61. return getStatusTag({ color: "#8a8784", text: "Withdrawn" })
  62. default:
  63. return getStatusTag({ text: status })
  64. }
  65. }
  66. export function getStatusIntl(params, intl) {
  67. return getStatusByTextIntl(params.row.status, params.row.creditor, intl);
  68. }
  69. export function getStatusByTextIntl(status, creditor, intl) {
  70. switch (status) {
  71. case "submitted":
  72. return getStatusTag({ color: "#f5a83d", text: intl.formatMessage({id: 'processing'}) })
  73. case "reviewed":
  74. return getStatusTag({ color: "#f5a83d", text: intl.formatMessage({id: 'processing'}) })
  75. case "confirmed":
  76. if (creditor)
  77. return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPublish'}) })
  78. else
  79. return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPayment'}) })
  80. case "published":
  81. return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPayment'}) })
  82. case "paid":
  83. return getStatusTag({ color: "#22a13f", text: intl.formatMessage({id: 'pendingPublish'}) })
  84. case "completed":
  85. return getStatusTag({ color: "#8a8784", text: intl.formatMessage({id: 'completed'}) })
  86. case "notAccepted":
  87. return getStatusTag({ color: "#d9372b", text: intl.formatMessage({id: 'notAccepted'}) })
  88. case "resubmit":
  89. return getStatusTag({ color: "#757373", text: intl.formatMessage({id: 'resubmit'}) })
  90. case "cancelled":
  91. return getStatusTag({ color: "#909497", text: intl.formatMessage({id: 'cancelled'}) })
  92. case "withdrawn":
  93. return getStatusTag({ color: "#909497", text: intl.formatMessage({id: 'withdrawn'}) })
  94. default:
  95. return getStatusTag({ text: status })
  96. }
  97. }
  98. export function getModeEng(params) {
  99. return getModeByTextEng(params.row.mode);
  100. }
  101. export function getModeByTextEng(mode) {
  102. switch (mode) {
  103. case "offline":
  104. return "Offline"
  105. case "online":
  106. return "Online"
  107. default:
  108. return ""
  109. }
  110. }
  111. export function getModeIntl(params,intl) {
  112. return getModeByTextIntl(params.row.mode, intl);
  113. }
  114. export function getModeByTextIntl(mode, intl) {
  115. switch (mode) {
  116. case "offline":
  117. return intl.formatMessage({id: 'applicationModeOffline'})
  118. case "online":
  119. return intl.formatMessage({id: 'applicationModeOnline'})
  120. default:
  121. return ""
  122. }
  123. }