Commit d0a243c0 authored by baixian's avatar baixian

最新代码提交

parent 733374b7
......@@ -57,7 +57,7 @@ class OpeartorChangeForm extends React.Component {
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>
......
......@@ -54,7 +54,7 @@ class ThemeEditor extends React.Component {
switch (item.type) {
case 'text':
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} />
<div className={pageStyle.sizeNumber}>{item.value.length}/500</div>
<div className={pageStyle.toolList}>
......@@ -68,7 +68,7 @@ class ThemeEditor extends React.Component {
);
case 'img':
return (
<div key={item.type} className={pageStyle.uploadimgbox}>
<div key={index} className={pageStyle.uploadimgbox}>
<div className={pageStyle.imgwrap}>
<div className={pageStyle.uploadimgwrap}> <img alt={item.type} className={pageStyle.teacheruploadimg} src={imagify(item.value)} /></div>
<div className={pageStyle.imghide}>
......@@ -86,7 +86,7 @@ class ThemeEditor extends React.Component {
);
case 'video':
return (
<div key={item.type} className={pageStyle.videowrap}>
<div key={index} className={pageStyle.videowrap}>
<video controls="controls" className={pageStyle.videoPoster} src={ossVideofy(item.value)} />
<div className={pageStyle.toolList}>
{ index === 0 && <div aria-disabled="true" className={pageStyle.noup}><img src={upImg} alt="" /> </div> }
......
......@@ -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}>
{classList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
{classList.map(ele => <Option key={ele.id} value={ele.id}>{ele.title}</Option>)}
</Select>,
)}
</FormItem>
......@@ -410,8 +410,8 @@ class CalendarClockForm extends React.Component {
<div className={pageStyle.rowFlex}>
<div className={pageStyle.calendarlist}>
{
dateArray.map((item, index) =>
<div onClick={() => this.selectWeekDay(item.day)} className={item.isChecked ? pageStyle.calendaritemActive : pageStyle.calendaritem}>{item.title}</div>,
dateArray.map((item, l) =>
<div key={l} onClick={() => this.selectWeekDay(item.day)} className={item.isChecked ? pageStyle.calendaritemActive : pageStyle.calendaritem}>{item.title}</div>,
)
}
</div>
......@@ -419,8 +419,8 @@ class CalendarClockForm extends React.Component {
<span className={pageStyle.freeBtn} onClick={this.handleClickDateShow}>自定义</span>
<div className={pageStyle.checkedNumber}>
{
new_rest_dates && new_rest_dates.length > 0 ? new_rest_dates.map((item, index) =>
<div className={pageStyle.checkedNumItem}><Tooltip title={item}>{index < 2 ? `${item},` : '...'}</Tooltip></div>,
new_rest_dates && new_rest_dates.length > 0 ? new_rest_dates.map((item, p) =>
<div key={p} className={pageStyle.checkedNumItem}><Tooltip title={item}>{p < 2 ? `${item},` : '...'}</Tooltip></div>,
) : '增加额外休息日'
}
</div>
......@@ -445,10 +445,10 @@ class CalendarClockForm extends React.Component {
<div className={pageStyle.weekday}></div>
<div className={pageStyle.weekday}></div>
</div>
{calendarData.targetTimeArr && calendarData.targetTimeArr.map((bigdat) => {
{calendarData.targetTimeArr && calendarData.targetTimeArr.map((bigdat, q) => {
return (
<div className={pageStyle.dayrow}>{bigdat.map((day) => {
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>);
<div key={q} className={pageStyle.dayrow}>{bigdat.map((day, i) => {
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>
);
......
......@@ -149,7 +149,7 @@ class RenewEdit extends React.Component {
})(
<Select style={{ width: 200 }} onChange={this.courseChange}>
<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>)}
</Form.Item>
</Col>
......@@ -314,7 +314,7 @@ class RenewEdit extends React.Component {
// onChange={handleChange}
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>,
)}
</Form.Item>
......
......@@ -281,7 +281,7 @@ class SelfJoinForm extends React.Component {
})(
<Select style={{ width: 200 }} onChange={this.courseChange} placeholder="请选择购买课程">
<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>)}
</Form.Item>
</Col>
......@@ -451,7 +451,7 @@ class SelfJoinForm extends React.Component {
// onChange={handleChange}
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>,
)}
</Form.Item>
......
......@@ -206,7 +206,7 @@ class StudentAddForm extends React.Component {
message: '姓名最多20个字符',
},
],
})(<Input style={{ width: 200 }} maxlength="20" placeholder="输入姓名" />)}
})(<Input style={{ width: 200 }} maxlength={20} placeholder="输入姓名" />)}
</Form.Item>
</Col>
<Col span={24} className={pageStyle.name} >
......@@ -320,7 +320,7 @@ class StudentAddForm extends React.Component {
message: '请输入手机号码',
},
],
})(<Input maxLength="11" style={{ width: 200 }} placeholder="输入手机号码" />)}
})(<Input maxLength={11} style={{ width: 200 }} placeholder="输入手机号码" />)}
</Form.Item>
</Col>
</Col>
......
......@@ -116,7 +116,7 @@ class eliminateEdit extends React.Component {
rules: [{ required: true, message: '课程不能为空' }],
})(
<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>)}
</Form.Item>
{getFieldValue('student_course_id') != undefined ? (
......
......@@ -732,14 +732,14 @@ class StudentMgt extends React.Component {
<div className={pageStyle.formitemlabel}>报读课程</div>
<Select className={pageStyle.selectitem} placeholder="请选择所属课程" value={searchstudentListQueryParams.course_id} onChange={e => this.searchParamsChange(e, 'Select', 'course_id')}>
<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>
</Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>所在班级</div>
<Select className={pageStyle.selectitem} placeholder="班级列表" value={searchstudentListQueryParams.class_id} onChange={e => this.searchParamsChange(e, 'Select', 'class_id')}>
<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>
</Col>
<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 {
</Col>
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 3 }}>
<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 className={pageStyle.searchbtnbox} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<Button className={pageStyle.resetbtn} onClick={this.reset}>重置</Button>
......@@ -807,6 +807,7 @@ class StudentMgt extends React.Component {
<div className={pageStyle.title}>学员管理</div>
<div className={pageStyle.tablebox}>
<Table
rowKey={studentsinfo => studentsinfo.id}
dataSource={studentsinfo}
columns={columns}
pagination={false}
......
......@@ -173,7 +173,7 @@ class NewRenewEdit extends React.Component {
})(
<Select style={{ width: 200 }} onChange={this.courseChange}>
<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>)}
</Form.Item>
</Col>
......@@ -338,7 +338,7 @@ class NewRenewEdit extends React.Component {
// onChange={handleChange}
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>,
)}
</Form.Item>
......
......@@ -231,6 +231,7 @@ class classChange extends React.Component {
{
title: '学员',
dataIndex: 'name',
key: 'name',
render: (text, row, index) => {
const rowInfo = {
children: <span>{row.name}</span>,
......@@ -249,6 +250,7 @@ class classChange extends React.Component {
{
title: '课程名称(剩余课时)',
dataIndex: 'age',
key: 'c',
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>,
props: {
......@@ -260,6 +262,7 @@ class classChange extends React.Component {
{
title: '班级名称',
dataIndex: 'address',
key: 'd',
render: (text, record, index) => {
return (
<div >
......@@ -271,6 +274,7 @@ class classChange extends React.Component {
{
title: '任课老师',
dataIndex: 'teacher',
key: 'f',
render: (text, record, index) => {
return (
<div >
......@@ -284,7 +288,7 @@ class classChange extends React.Component {
<div className={`${pageStyle.container} studentclasscontainer`}>
<div className={pageStyle.headerbox}>
<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>
<Button className={pageStyle.headerbtn} onClick={this.resetStudent}>重置</Button>
</div>
......@@ -313,6 +317,7 @@ class classChange extends React.Component {
<div className={pageStyle.tablebox}>
<Table
columns={columnsr}
rowKey={classList => classList.id}
dataSource={classList}
pagination={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