tools.js 813 B

123456789101112131415161718192021
  1. export var lessonStatus = [
  2. {"index": 0, "state": null, "name": 'onGoing', "color": '#F7C405'},
  3. {"index": 1, "state": 45, "name": 'absence', "color": '#F7C405', "image":require('../static/lesson/lesson_wsk.png')},
  4. {"index": 2, "state": 47, "name": 'finished', "color": '#99CA3A', "image":require('../static/lesson/lesson_sk.png')},
  5. {"index": 3, "state": 686, "name": 'kqCancel', "color": '#A1A9B5', "image":require('../static/lesson/lesson_qx.png')},
  6. ]
  7. export function getLessonStatus(state) {
  8. var item = lessonStatus.find(e=>e.state==state)
  9. return item || {}
  10. }
  11. export function getLessonStatusName(state) {
  12. var item = lessonStatus.find(e=>e.state==state)
  13. return item.name || ''
  14. }
  15. export function getLessonStatusImage(state) {
  16. var item = lessonStatus.find(e=>e.state==state)
  17. return item.image || ''
  18. }