| | |
| | | let datelist = this.getDateList(this.state.selectYear) |
| | | let monthlist = null |
| | | |
| | | datelist = this.mountdata(datelist, nextProps.data || []) |
| | | datelist = this.mountdata(datelist, nextProps.data) |
| | | |
| | | if (this.state.levels.includes('month') || this.state.levels.includes('year')) { |
| | | monthlist = datelist.filter(item => item.month === this.state.selectMonth)[0] |
| | |
| | | let levels = { red: 1, orange: 2, yellow: 3, green: 4, cyan: 5, blue: 6, purple: 7, gray: 8 } |
| | | let colors = { red: '#d0021b', orange: '#f5a623', yellow: '#f8e71c', green: '#7ed321', cyan: '#50e3c2', blue: '#1890ff', purple: '#bd10e0', gray: '#9b9b9b' } |
| | | |
| | | data.forEach(item => { |
| | | data && data.forEach(item => { |
| | | let startTime = item[calendar.startfield] |
| | | let endTime = item[calendar.endfield] |
| | | let color = item[calendar.colorfield] |
| | |
| | | } |
| | | |
| | | monthChange = (value) => { |
| | | const { datelist } = this.state |
| | | const { datelist, levels, selectYear } = this.state |
| | | |
| | | if (!levels.includes('month')) { |
| | | if (this.props.triggerDate) { |
| | | this.props.triggerDate({ |
| | | time: `${selectYear}${value}01` |
| | | }) |
| | | } |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | level: 'month', |