列数不对

dev_ec
hjm 6 years ago
parent 12f28bcfae
commit 018c2a3ee7

@ -48,7 +48,7 @@ class SelectTable extends Component {
<td >指标点{rowIndex + 1}</td> <td >指标点{rowIndex + 1}</td>
</Tooltip> </Tooltip>
return (<Tooltip title={!!cell ? '取消支撑' : '选择支撑'} > return (<Tooltip title={!!cell ? '取消支撑' : '选择支撑'} >
<td onClick={() => this.props.onCellClick(rowIndex, colIndex, !!cell)}> <td onClick={() => this.props.onCellClick(rowIndex, colIndex , !!cell)}>
<i className={`iconfont icon-gouxuan ${!!cell ? 'color-green' : 'color-grey-eb'} font-16 mr5`}></i> <i className={`iconfont icon-gouxuan ${!!cell ? 'color-green' : 'color-grey-eb'} font-16 mr5`}></i>
</td> </td>
</Tooltip>) </Tooltip>)

@ -72,7 +72,8 @@ class RequirementVsObjective extends Component {
this.graduationRequirementsIdIndexMap[item.id] = index this.graduationRequirementsIdIndexMap[item.id] = index
}) })
this.state.training_subitems.forEach((item, index) => { this.state.training_subitems.forEach((item, index) => {
this.trainingSubitemsIdIndexMap[item.id] = index // 对应table的列数
this.trainingSubitemsIdIndexMap[item.id] = index + 1
}) })
const tableData = [] const tableData = []
this.state.graduation_requirements.forEach((item, index) => { this.state.graduation_requirements.forEach((item, index) => {
@ -87,7 +88,7 @@ class RequirementVsObjective extends Component {
onCellClick = (rowIndex, colIndex, select) => { onCellClick = (rowIndex, colIndex, select) => {
console.log( rowIndex, colIndex, select ) console.log( rowIndex, colIndex, select )
const ec_graduation_requirement_id = this.state.graduation_requirements[rowIndex].id const ec_graduation_requirement_id = this.state.graduation_requirements[rowIndex].id
const ec_training_subitem_id = this.state.training_subitems[colIndex].id const ec_training_subitem_id = this.state.training_subitems[colIndex - 1].id
const yearId = this.props.match.params.yearId const yearId = this.props.match.params.yearId
const url = `/ec_years/${yearId}/requirement_support_objectives.json` const url = `/ec_years/${yearId}/requirement_support_objectives.json`
const method = select ? axios.delete : axios.post const method = select ? axios.delete : axios.post
@ -129,7 +130,17 @@ class RequirementVsObjective extends Component {
return ( return (
<div className="educontent requirementVsObjective"> <div className="educontent requirementVsObjective">
requirementVsObjective <ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'marginBottom': '0px' }} >
<li className="fl">
<p className="font-18 courseSystem"> 毕业要求对培养目标的支撑 </p>
<p>
<span class="color-grey-9 mr10">用矩阵图的形式说明本专业毕业要求对培养目标的支撑关系鼠标左键单击单元格即可</span>
<a href="javascript:void(0)" onClick={() => window.elasticLayer(3531)} class="color-blue">查看详情</a>
</p>
</li>
</ul>
<SelectTable <SelectTable
columns={columns} columns={columns}
tableData={tableData} tableData={tableData}

Loading…
Cancel
Save