import React, { Component } from "react"; import styles from "./index.less"; import { normalVal, timestampToTime, getStatusImg,setFontColorSize } from '@utils/tools'; import slideUp from "@common/images/slide-up.png"; import slideDown from "@common/images/slide-down.png"; class SlideExcel extends Component { constructor(props) { super(props); this.state = { show: false }; this.toTime = this.toTime.bind(this) this.handleSlide = this.handleSlide.bind(this) } toTime(time) { let tmpTim = time.split(',').join('') - 0 if (time && tmpTim.toString() != 'NaN') { let date = new Date('1900-01-01'); let dateTim = date.getTime(); let times = (tmpTim - 2) * 24 * 60 * 60 * 1000; let result = timestampToTime(dateTim + times).split(' ')[0] return result; } else { return time; } } handleSlide() { let tmpShow = this.state.show this.setState({ show: !tmpShow }) } render() { const { items, item, idx, getInfomation, dateTime } = this.props; const { show } = this.state; return (
{value.itemName} getInfomation({ name: value.uniqueName || '', type: 12, position: 1 })}> | { getStatusImg(value.type, value.value, 1) } {value.unit} | {normalVal(value.min, value.max)} | {value.time == '' ? ('导入时间: ' + dateTime) : '检验时间: ' + this.toTime(value.time)} |
{value.itemName} getInfomation({ name: value.uniqueName || '', type: 12, position: 1 })}> | { getStatusImg(value.type, value.value, 1) } {value.unit} | {normalVal(value.min, value.max)} | {value.time == '' ? ('导入时间: ' + dateTime) : '检验时间: ' + this.toTime(value.time)} |