Commit d0a243c0 authored by baixian's avatar baixian

最新代码提交

parent 733374b7
...@@ -57,7 +57,7 @@ class OpeartorChangeForm extends React.Component { ...@@ -57,7 +57,7 @@ class OpeartorChangeForm extends React.Component {
message: '请选择操作人', message: '请选择操作人',
}, },
], ],
})(<Select>{teacherList.map(ele => <Option value={ele.id}>{ele.nickname}</Option>)}</Select>) })(<Select>{teacherList.map(ele => <Option key={ele.id} value={ele.id}>{ele.nickname}</Option>)}</Select>)
} }
</Form.Item> </Form.Item>
</Form> </Form>
......
...@@ -54,7 +54,7 @@ class ThemeEditor extends React.Component { ...@@ -54,7 +54,7 @@ class ThemeEditor extends React.Component {
switch (item.type) { switch (item.type) {
case 'text': case 'text':
return ( return (
<div key={item.type} className={pageStyle.textWrap}> <div key={index} className={pageStyle.textWrap}>
<TextArea autoSize={{ minRows: 4, maxRows: 10 }} value={item.value} onChange={e => editorChange(e, index)} placeholder="请输入内容" style={{ width: 560 }} maxLength={500} /> <TextArea autoSize={{ minRows: 4, maxRows: 10 }} value={item.value} onChange={e => editorChange(e, index)} placeholder="请输入内容" style={{ width: 560 }} maxLength={500} />
<div className={pageStyle.sizeNumber}>{item.value.length}/500</div> <div className={pageStyle.sizeNumber}>{item.value.length}/500</div>
<div className={pageStyle.toolList}> <div className={pageStyle.toolList}>
...@@ -68,7 +68,7 @@ class ThemeEditor extends React.Component { ...@@ -68,7 +68,7 @@ class ThemeEditor extends React.Component {
); );
case 'img': case 'img':
return ( return (
<div key={item.type} className={pageStyle.uploadimgbox}> <div key={index} className={pageStyle.uploadimgbox}>
<div className={pageStyle.imgwrap}> <div className={pageStyle.imgwrap}>
<div className={pageStyle.uploadimgwrap}> <img alt={item.type} className={pageStyle.teacheruploadimg} src={imagify(item.value)} /></div> <div className={pageStyle.uploadimgwrap}> <img alt={item.type} className={pageStyle.teacheruploadimg} src={imagify(item.value)} /></div>
<div className={pageStyle.imghide}> <div className={pageStyle.imghide}>
...@@ -86,7 +86,7 @@ class ThemeEditor extends React.Component { ...@@ -86,7 +86,7 @@ class ThemeEditor extends React.Component {
); );
case 'video': case 'video':
return ( return (
<div key={item.type} className={pageStyle.videowrap}> <div key={index} className={pageStyle.videowrap}>
<video controls="controls" className={pageStyle.videoPoster} src={ossVideofy(item.value)} /> <video controls="controls" className={pageStyle.videoPoster} src={ossVideofy(item.value)} />
<div className={pageStyle.toolList}> <div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> } { index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
......
...@@ -322,7 +322,7 @@ class CalendarClockForm extends React.Component { ...@@ -322,7 +322,7 @@ class CalendarClockForm extends React.Component {
], ],
})( })(
<Select disabled={(calendarParams.class_id && calendarParams.class_id != undefined) && (isCopy === 0)} placeholder="请选择班级" style={{ width: 174 }} showSearch onChange={this.handleStudentChange}> <Select disabled={(calendarParams.class_id && calendarParams.class_id != undefined) && (isCopy === 0)} placeholder="请选择班级" style={{ width: 174 }} showSearch onChange={this.handleStudentChange}>
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {classList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>, </Select>,
)} )}
</FormItem> </FormItem>
...@@ -410,8 +410,8 @@ class CalendarClockForm extends React.Component { ...@@ -410,8 +410,8 @@ class CalendarClockForm extends React.Component {
<div className={pageStyle.rowFlex}> <div className={pageStyle.rowFlex}>
<div className={pageStyle.calendarlist}> <div className={pageStyle.calendarlist}>
{ {
dateArray.map((item, index) => dateArray.map((item, l) =>
<div onClick={() => this.selectWeekDay(item.day)} className={item.isChecked ? pageStyle.calendaritemActive : pageStyle.calendaritem}>{item.title}</div>, <div key={l} onClick={() => this.selectWeekDay(item.day)} className={item.isChecked ? pageStyle.calendaritemActive : pageStyle.calendaritem}>{item.title}</div>,
) )
} }
</div> </div>
...@@ -419,8 +419,8 @@ class CalendarClockForm extends React.Component { ...@@ -419,8 +419,8 @@ class CalendarClockForm extends React.Component {
<span className={pageStyle.freeBtn} onClick={this.handleClickDateShow}>自定义</span> <span className={pageStyle.freeBtn} onClick={this.handleClickDateShow}>自定义</span>
<div className={pageStyle.checkedNumber}> <div className={pageStyle.checkedNumber}>
{ {
new_rest_dates && new_rest_dates.length > 0 ? new_rest_dates.map((item, index) => new_rest_dates && new_rest_dates.length > 0 ? new_rest_dates.map((item, p) =>
<div className={pageStyle.checkedNumItem}><Tooltip title={item}>{index < 2 ? `${item},` : '...'}</Tooltip></div>, <div key={p} className={pageStyle.checkedNumItem}><Tooltip title={item}>{p < 2 ? `${item},` : '...'}</Tooltip></div>,
) : '增加额外休息日' ) : '增加额外休息日'
} }
</div> </div>
...@@ -445,10 +445,10 @@ class CalendarClockForm extends React.Component { ...@@ -445,10 +445,10 @@ class CalendarClockForm extends React.Component {
<div className={pageStyle.weekday}></div> <div className={pageStyle.weekday}></div>
<div className={pageStyle.weekday}></div> <div className={pageStyle.weekday}></div>
</div> </div>
{calendarData.targetTimeArr && calendarData.targetTimeArr.map((bigdat) => { {calendarData.targetTimeArr && calendarData.targetTimeArr.map((bigdat, q) => {
return ( return (
<div className={pageStyle.dayrow}>{bigdat.map((day) => { <div key={q} className={pageStyle.dayrow}>{bigdat.map((day, i) => {
return (<div onClick={() => this.selectPlanDay(day)} className={`${pageStyle.dayitem} ${day.open ? '' : pageStyle.notopen} ${day.type == 'current' ? pageStyle.current : ''} ${selectPlanDays.indexOf(day.date) != -1 ? pageStyle.dayselected : ''} ${day.istoday ? pageStyle.istoday : ''}`}>{day.day}</div>); return (<div key={i} onClick={() => this.selectPlanDay(day)} className={`${pageStyle.dayitem} ${day.open ? '' : pageStyle.notopen} ${day.type == 'current' ? pageStyle.current : ''} ${selectPlanDays.indexOf(day.date) != -1 ? pageStyle.dayselected : ''} ${day.istoday ? pageStyle.istoday : ''}`}>{day.day}</div>);
})} })}
</div> </div>
); );
......
...@@ -149,7 +149,7 @@ class RenewEdit extends React.Component { ...@@ -149,7 +149,7 @@ class RenewEdit extends React.Component {
})( })(
<Select style={{ width: 200 }} onChange={this.courseChange}> <Select style={{ width: 200 }} onChange={this.courseChange}>
<Option value="">请选择课程</Option> <Option value="">请选择课程</Option>
{renewCourses.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {renewCourses.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>)} </Select>)}
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -314,7 +314,7 @@ class RenewEdit extends React.Component { ...@@ -314,7 +314,7 @@ class RenewEdit extends React.Component {
// onChange={handleChange} // onChange={handleChange}
style={{ width: '55%' }} style={{ width: '55%' }}
> >
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {classList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>, </Select>,
)} )}
</Form.Item> </Form.Item>
......
...@@ -281,7 +281,7 @@ class SelfJoinForm extends React.Component { ...@@ -281,7 +281,7 @@ class SelfJoinForm extends React.Component {
})( })(
<Select style={{ width: 200 }} onChange={this.courseChange} placeholder="请选择购买课程"> <Select style={{ width: 200 }} onChange={this.courseChange} placeholder="请选择购买课程">
<Option value="">请选择购买课程</Option> <Option value="">请选择购买课程</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {courseList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>)} </Select>)}
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -451,7 +451,7 @@ class SelfJoinForm extends React.Component { ...@@ -451,7 +451,7 @@ class SelfJoinForm extends React.Component {
// onChange={handleChange} // onChange={handleChange}
style={{ width: '55%' }} style={{ width: '55%' }}
> >
{classList.filter(ele => ele.graduation_status == 1).map(ele => <Option value={`${ele.id}`}>{ele.title}</Option>)} {classList.filter(ele => ele.graduation_status == 1).map(ele => <Option key={ele.id} value={`${ele.id}`}>{ele.title}</Option>)}
</Select>, </Select>,
)} )}
</Form.Item> </Form.Item>
......
...@@ -206,7 +206,7 @@ class StudentAddForm extends React.Component { ...@@ -206,7 +206,7 @@ class StudentAddForm extends React.Component {
message: '姓名最多20个字符', message: '姓名最多20个字符',
}, },
], ],
})(<Input style={{ width: 200 }} maxlength="20" placeholder="输入姓名" />)} })(<Input style={{ width: 200 }} maxlength={20} placeholder="输入姓名" />)}
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={24} className={pageStyle.name} > <Col span={24} className={pageStyle.name} >
...@@ -320,7 +320,7 @@ class StudentAddForm extends React.Component { ...@@ -320,7 +320,7 @@ class StudentAddForm extends React.Component {
message: '请输入手机号码', message: '请输入手机号码',
}, },
], ],
})(<Input maxLength="11" style={{ width: 200 }} placeholder="输入手机号码" />)} })(<Input maxLength={11} style={{ width: 200 }} placeholder="输入手机号码" />)}
</Form.Item> </Form.Item>
</Col> </Col>
</Col> </Col>
......
...@@ -116,7 +116,7 @@ class eliminateEdit extends React.Component { ...@@ -116,7 +116,7 @@ class eliminateEdit extends React.Component {
rules: [{ required: true, message: '课程不能为空' }], rules: [{ required: true, message: '课程不能为空' }],
})( })(
<Select style={{ width: 200 }} onChange={this.selectMyCourse} placeholder="请选择课程"> <Select style={{ width: 200 }} onChange={this.selectMyCourse} placeholder="请选择课程">
{courseExcludeClassTypeList.map(ele => <Option value={ele.id}>{ele.course.title}</Option>)} {courseExcludeClassTypeList.map(ele => <Option key={ele.id} value={ele.id}>{ele.course.title}</Option>)}
</Select>)} </Select>)}
</Form.Item> </Form.Item>
{getFieldValue('student_course_id') != undefined ? ( {getFieldValue('student_course_id') != undefined ? (
......
...@@ -732,14 +732,14 @@ class StudentMgt extends React.Component { ...@@ -732,14 +732,14 @@ class StudentMgt extends React.Component {
<div className={pageStyle.formitemlabel}>报读课程</div> <div className={pageStyle.formitemlabel}>报读课程</div>
<Select className={pageStyle.selectitem} placeholder="请选择所属课程" value={searchstudentListQueryParams.course_id} onChange={e => this.searchParamsChange(e, 'Select', 'course_id')}> <Select className={pageStyle.selectitem} placeholder="请选择所属课程" value={searchstudentListQueryParams.course_id} onChange={e => this.searchParamsChange(e, 'Select', 'course_id')}>
<Option value="">全部课程</Option> <Option value="">全部课程</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {courseList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select> </Select>
</Col> </Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}> <Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>所在班级</div> <div className={pageStyle.formitemlabel}>所在班级</div>
<Select className={pageStyle.selectitem} placeholder="班级列表" value={searchstudentListQueryParams.class_id} onChange={e => this.searchParamsChange(e, 'Select', 'class_id')}> <Select className={pageStyle.selectitem} placeholder="班级列表" value={searchstudentListQueryParams.class_id} onChange={e => this.searchParamsChange(e, 'Select', 'class_id')}>
<Option value="">全部班级</Option> <Option value="">全部班级</Option>
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {classList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select> </Select>
</Col> </Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}> <Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
...@@ -793,7 +793,7 @@ class StudentMgt extends React.Component { ...@@ -793,7 +793,7 @@ class StudentMgt extends React.Component {
</Col> </Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 3 }}> <Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 3 }}>
<div className={pageStyle.formitemlabel} >学员年龄</div> <div className={pageStyle.formitemlabel} >学员年龄</div>
<InputNumber style={{ width: 50 }} value={searchstudentListQueryParams.age_start} min="0" onChange={e => this.searchParamsChange(e, 'Select', 'age_start')} /> ~ <InputNumber style={{ width: 50 }} min="0" value={searchstudentListQueryParams.age_end} onChange={e => this.searchParamsChange(e, 'Select', 'age_end')} /> <InputNumber style={{ width: 50 }} value={searchstudentListQueryParams.age_start} min={0} onChange={e => this.searchParamsChange(e, 'Select', 'age_start')} /> ~ <InputNumber style={{ width: 50 }} min={0} value={searchstudentListQueryParams.age_end} onChange={e => this.searchParamsChange(e, 'Select', 'age_end')} />
</Col> </Col>
<Col className={pageStyle.searchbtnbox} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}> <Col className={pageStyle.searchbtnbox} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<Button className={pageStyle.resetbtn} onClick={this.reset}>重置</Button> <Button className={pageStyle.resetbtn} onClick={this.reset}>重置</Button>
...@@ -807,6 +807,7 @@ class StudentMgt extends React.Component { ...@@ -807,6 +807,7 @@ class StudentMgt extends React.Component {
<div className={pageStyle.title}>学员管理</div> <div className={pageStyle.title}>学员管理</div>
<div className={pageStyle.tablebox}> <div className={pageStyle.tablebox}>
<Table <Table
rowKey={studentsinfo => studentsinfo.id}
dataSource={studentsinfo} dataSource={studentsinfo}
columns={columns} columns={columns}
pagination={false} pagination={false}
......
...@@ -173,7 +173,7 @@ class NewRenewEdit extends React.Component { ...@@ -173,7 +173,7 @@ class NewRenewEdit extends React.Component {
})( })(
<Select style={{ width: 200 }} onChange={this.courseChange}> <Select style={{ width: 200 }} onChange={this.courseChange}>
<Option value="">请选择课程</Option> <Option value="">请选择课程</Option>
{renewCourses.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {renewCourses.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>)} </Select>)}
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -338,7 +338,7 @@ class NewRenewEdit extends React.Component { ...@@ -338,7 +338,7 @@ class NewRenewEdit extends React.Component {
// onChange={handleChange} // onChange={handleChange}
style={{ width: '55%' }} style={{ width: '55%' }}
> >
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {classList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>, </Select>,
)} )}
</Form.Item> </Form.Item>
......
...@@ -231,6 +231,7 @@ class classChange extends React.Component { ...@@ -231,6 +231,7 @@ class classChange extends React.Component {
{ {
title: '学员', title: '学员',
dataIndex: 'name', dataIndex: 'name',
key: 'name',
render: (text, row, index) => { render: (text, row, index) => {
const rowInfo = { const rowInfo = {
children: <span>{row.name}</span>, children: <span>{row.name}</span>,
...@@ -249,6 +250,7 @@ class classChange extends React.Component { ...@@ -249,6 +250,7 @@ class classChange extends React.Component {
{ {
title: '课程名称(剩余课时)', title: '课程名称(剩余课时)',
dataIndex: 'age', dataIndex: 'age',
key: 'c',
render: (text, record, index) => ({ render: (text, record, index) => ({
children: <div className={`${pageStyle.coursetd} ${selectedCourse.course_id == record.course_id ? pageStyle.courseselectedtd : ''}`} onClick={() => this.courseSelect(record)}>{record.course[0].course.title}</div>, children: <div className={`${pageStyle.coursetd} ${selectedCourse.course_id == record.course_id ? pageStyle.courseselectedtd : ''}`} onClick={() => this.courseSelect(record)}>{record.course[0].course.title}</div>,
props: { props: {
...@@ -260,6 +262,7 @@ class classChange extends React.Component { ...@@ -260,6 +262,7 @@ class classChange extends React.Component {
{ {
title: '班级名称', title: '班级名称',
dataIndex: 'address', dataIndex: 'address',
key: 'd',
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<div > <div >
...@@ -271,6 +274,7 @@ class classChange extends React.Component { ...@@ -271,6 +274,7 @@ class classChange extends React.Component {
{ {
title: '任课老师', title: '任课老师',
dataIndex: 'teacher', dataIndex: 'teacher',
key: 'f',
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<div > <div >
...@@ -284,7 +288,7 @@ class classChange extends React.Component { ...@@ -284,7 +288,7 @@ class classChange extends React.Component {
<div className={`${pageStyle.container} studentclasscontainer`}> <div className={`${pageStyle.container} studentclasscontainer`}>
<div className={pageStyle.headerbox}> <div className={pageStyle.headerbox}>
<Select className={pageStyle.selectitem} placeholder="请选择学员" value={studentDetail.id} onChange={e => this.studentChange(e)}> <Select className={pageStyle.selectitem} placeholder="请选择学员" value={studentDetail.id} onChange={e => this.studentChange(e)}>
{allStudentList.map(ele => <Option value={ele.id}>{ele.name}</Option>)} {allStudentList.map(ele => <Option key={ele.id} value={ele.id}>{ele.name}</Option>)}
</Select> </Select>
<Button className={pageStyle.headerbtn} onClick={this.resetStudent}>重置</Button> <Button className={pageStyle.headerbtn} onClick={this.resetStudent}>重置</Button>
</div> </div>
...@@ -313,6 +317,7 @@ class classChange extends React.Component { ...@@ -313,6 +317,7 @@ class classChange extends React.Component {
<div className={pageStyle.tablebox}> <div className={pageStyle.tablebox}>
<Table <Table
columns={columnsr} columns={columnsr}
rowKey={classList => classList.id}
dataSource={classList} dataSource={classList}
pagination={false} pagination={false}
showHeader={false} showHeader={false}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment