import React from "react";
import style from "../index.less";
import check_circle from '../img/check-circle.png';
import check_right from '../img/check-right.png';
import {getStatusImg} from '@utils/tools';
class WrapModalTableSon extends React.Component {
constructor(props) {
super(props);
this.state = {
msg:'选中异常值数据'
}
this.getImgPath = this.getImgPath.bind(this)
this.selectWaring = this.selectWaring.bind(this)
this.allCheckImportIns = this.allCheckImportIns.bind(this)
this.selectOneCheck = this.selectOneCheck.bind(this)
}
selectOneCheck(name,groupName,item){
const {selectOneCheck,allCheck} = this.props
selectOneCheck&&selectOneCheck(name,groupName,item)
setTimeout(() => {
console.log(allCheck,78787)
}, 1000);
}
getImgPath(name,groupName,item){
const { checkedList } = this.props;
let num = 0;
for(let k = 0;k < checkedList.length;k++){
let tmpLis = checkedList[k];
if(tmpLis == name){
return
this.selectOneCheck(name,groupName,item)} src={check_right} alt="" />
}else{
++num
}
}
if(num == checkedList.length){
return
this.selectOneCheck(name,groupName,item)} src={check_circle} alt="" />
}
}
selectWaring(){
let tmpMsg = this.state.msg
const { selectWaring,hospitalSonInspect,checkedList,allCheck } = this.props;
// console.log(checkedList)
// let tmpAll = false,num=0;
// if(hospitalSonInspect&&hospitalSonInspect.lisExcelWrapper){
// for(let i = 0;i < hospitalSonInspect.lisExcelWrapper.length;i++){
// for(let j = 0;j < checkedList.length;j++){
// if(hospitalSonInspect.lisExcelWrapper[i].itemName == checkedList[j]&&hospitalSonInspect.lisExcelWrapper[i].type!=0){
// num++
// }
// }
// }
// }
// console.log(num,'sssssssssssssss')
// this.setState({
// msg:(num == 0)?'取消选中异常值数据集':'选中异常值数据'
// },()=>{
// selectWaring&&selectWaring()
// })
this.setState({
msg:tmpMsg=='取消选中异常值数据集'?'选中异常值数据':'取消选中异常值数据集'
})
selectWaring&&selectWaring()
}
allCheckImportIns(){
const { allCheckImportIns,allCheck } = this.props;
if(!allCheck){
this.setState({
msg:'取消选中异常值数据集'
})
}else{
this.setState({
msg:'选中异常值数据'
})
}
allCheckImportIns&&allCheckImportIns()
}
render() {
const { hospitalSonInspect,allCheck } = this.props;
return
组名称 : {hospitalSonInspect.groupName}{this.state.msg}
全选 |
编号 |
项目名称 |
结果 |
单位 |
参考值 |
5?'':'none'}}> |
{/* {type-0正常1异常2上升3下降} */}
{
hospitalSonInspect && hospitalSonInspect.lisExcelWrapper && hospitalSonInspect.lisExcelWrapper.map((item, idx) => {
return
{
this.getImgPath(item.itemName,hospitalSonInspect.groupName,item)
}
|
{idx+1} |
{item.itemName} |
{
getStatusImg(item.type,item.value,1)
}
|
{item.unit} |
{item.min}-{item.max} |
})
}
}
}
export default WrapModalTableSon;