import React, { Component } from 'react'; import "./index.less"; const elm = { a:
A班次A: 9:00〜10:00
, b:
B班次B: 10:00〜13:00
, c:
C班次C: 13:00〜18:00
, d:
D班次D: 13:00〜18:00
, xiu:
休息
}; const elmL = { a: A, b: B, c: C, d: D, e: E, xiu: , }; export default class LetterElment extends Component { render() { let tag = elm; const name = this.props.name && this.props.name.toLowerCase(); const type = this.props.type && this.props.type.toLowerCase(); tag = elm; if (type) { tag = elmL; } if (name) { let s1 = ['a','e','i','m','q','u','y']; let s2 = ['b','f','j','n','r','v','z']; let s3 = ['c','g','k','o','s','w']; let s4 = ['d','h','l','p','t','x']; let s5 = ['休']; // return tag[name]; if(s1.includes(name)){ return {name.toUpperCase()} } if(s2.includes(name)){ return {name.toUpperCase()} } if(s3.includes(name)){ return {name.toUpperCase()} } if(s4.includes(name)){ return {name.toUpperCase()} } if(s5.includes(name)){ return } else { // console.log('班次图标没有对应名称的图标,请检查传入值和图标数组'); return ''; } } else { return tag.a; } // return '' } }