|
@@ -1,13 +1,12 @@
|
|
import React, { Component } from "react";
|
|
import React, { Component } from "react";
|
|
import styles from "./index.less";
|
|
import styles from "./index.less";
|
|
-import { normalVal,getArrow,timestampToTime,getDomUpDown,getPageCoordinate,setPosition,setFontColorSize } from '@utils/tools';
|
|
|
|
|
|
+import { normalVal,getArrow,getDomUpDown,getPageCoordinate,setPosition,setFontColorSize } from '@utils/tools';
|
|
import { InspectCommon, Notify,DelToast} from '@commonComp';
|
|
import { InspectCommon, Notify,DelToast} from '@commonComp';
|
|
import slideUp from "@common/images/slide-up.png";
|
|
import slideUp from "@common/images/slide-up.png";
|
|
import slideDown from "@common/images/slide-down.png";
|
|
import slideDown from "@common/images/slide-down.png";
|
|
import checkOff from '@common/images/check_off.png';
|
|
import checkOff from '@common/images/check_off.png';
|
|
import checkOn from '@common/images/check_on.png';
|
|
import checkOn from '@common/images/check_on.png';
|
|
import $ from 'jquery';
|
|
import $ from 'jquery';
|
|
-import date1 from '../img/date1.png';
|
|
|
|
import ScrollArea from 'react-scrollbar';
|
|
import ScrollArea from 'react-scrollbar';
|
|
import InspectName from '../InspectName';
|
|
import InspectName from '../InspectName';
|
|
import store from '@store';
|
|
import store from '@store';
|
|
@@ -27,7 +26,6 @@ class SlideSelect extends Component {
|
|
style:'',
|
|
style:'',
|
|
timer: null,
|
|
timer: null,
|
|
};
|
|
};
|
|
- this.toTime = this.toTime.bind(this);
|
|
|
|
this.handleSlide = this.handleSlide.bind(this);
|
|
this.handleSlide = this.handleSlide.bind(this);
|
|
this.handleDel = this.handleDel.bind(this);
|
|
this.handleDel = this.handleDel.bind(this);
|
|
this.handleCancel = this.handleCancel.bind(this);
|
|
this.handleCancel = this.handleCancel.bind(this);
|
|
@@ -64,18 +62,6 @@ class SlideSelect extends Component {
|
|
});
|
|
});
|
|
// this.setState({ dateTime: getCurrentDate(1) })
|
|
// this.setState({ dateTime: getCurrentDate(1) })
|
|
}
|
|
}
|
|
- 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(){
|
|
handleSlide(){
|
|
let tmpShow = this.state.show
|
|
let tmpShow = this.state.show
|
|
this.setState({
|
|
this.setState({
|
|
@@ -149,6 +135,10 @@ class SlideSelect extends Component {
|
|
$('.canEdit').attr('disabled','disabled')
|
|
$('.canEdit').attr('disabled','disabled')
|
|
handlePush && handlePush({mode:8}); //右侧推送
|
|
handlePush && handlePush({mode:8}); //右侧推送
|
|
}
|
|
}
|
|
|
|
+ handleFocus(){
|
|
|
|
+ const {handlePush} = this.props;
|
|
|
|
+ handlePush && handlePush({mode:8}); //右侧推送
|
|
|
|
+ }
|
|
checkOnOff(item,idx){
|
|
checkOnOff(item,idx){
|
|
const {checkOnOff,handlePush} = this.props
|
|
const {checkOnOff,handlePush} = this.props
|
|
checkOnOff(item,idx)
|
|
checkOnOff(item,idx)
|
|
@@ -175,15 +165,16 @@ class SlideSelect extends Component {
|
|
<span className={styles.edit}></span>
|
|
<span className={styles.edit}></span>
|
|
<span className={styles.maxmin}></span>
|
|
<span className={styles.maxmin}></span>
|
|
<span className={styles.pass}>检验时间:
|
|
<span className={styles.pass}>检验时间:
|
|
- <input disabled="disabled" type="text"
|
|
|
|
|
|
+ <input type="text"
|
|
class="canEdit"
|
|
class="canEdit"
|
|
- onDoubleClick={(e)=>this.setEdit(e)}
|
|
|
|
|
|
+ // onDoubleClick={(e)=>this.setEdit(e)}
|
|
style={{color:'#333'}}
|
|
style={{color:'#333'}}
|
|
placeholder='时间'
|
|
placeholder='时间'
|
|
autoComplete="off"
|
|
autoComplete="off"
|
|
value={item.time}
|
|
value={item.time}
|
|
onInput={(e)=>{this.handleInput(e,item,idx)}}
|
|
onInput={(e)=>{this.handleInput(e,item,idx)}}
|
|
- onBlur={()=>{this.handleBlur()}}
|
|
|
|
|
|
+ onFocus={()=>{this.handleFocus()}}
|
|
|
|
+ // onBlur={()=>{this.handleBlur()}}
|
|
/>
|
|
/>
|
|
</span>
|
|
</span>
|
|
<span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item,idx)}}></span>
|
|
<span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item,idx)}}></span>
|
|
@@ -200,28 +191,30 @@ class SlideSelect extends Component {
|
|
<span className={styles.bigname}>{item.name}</span>
|
|
<span className={styles.bigname}>{item.name}</span>
|
|
<span className={styles.smallname}>{item.uniqueName}</span>
|
|
<span className={styles.smallname}>{item.uniqueName}</span>
|
|
<span className={styles.edit}>
|
|
<span className={styles.edit}>
|
|
- <input disabled="disabled" type="text"
|
|
|
|
|
|
+ <input type="text"
|
|
class="canEdit"
|
|
class="canEdit"
|
|
- onDoubleClick={(e)=>this.setEdit(e)}
|
|
|
|
|
|
+ // onDoubleClick={(e)=>this.setEdit(e)}
|
|
style={{ color: style == 2 || style == 4 ? 'red' : style == 1 ? '#D949FF' : '#333', backgroundColor: item.value && item.value.length>0 ? '#eeeeee' : ''}}
|
|
style={{ color: style == 2 || style == 4 ? 'red' : style == 1 ? '#D949FF' : '#333', backgroundColor: item.value && item.value.length>0 ? '#eeeeee' : ''}}
|
|
placeholder='(填写)'
|
|
placeholder='(填写)'
|
|
autoComplete="off"
|
|
autoComplete="off"
|
|
value={item.value||item.otherValue}
|
|
value={item.value||item.otherValue}
|
|
onInput={(e)=>{this.handleInput(e,item,idx)}}
|
|
onInput={(e)=>{this.handleInput(e,item,idx)}}
|
|
- onBlur={()=>{this.handleBlur()}}
|
|
|
|
|
|
+ // onBlur={()=>{this.handleBlur()}}
|
|
|
|
+ onFocus={()=>{this.handleFocus()}}
|
|
/><img style={{display:style==1||style==2?'inline-block':'none'}} src={style==1?down:style==2?up:''} />{item.units}
|
|
/><img style={{display:style==1||style==2?'inline-block':'none'}} src={style==1?down:style==2?up:''} />{item.units}
|
|
</span>
|
|
</span>
|
|
<span className={styles.maxmin}>{normalVal(item.minValue,item.maxValue)}</span>
|
|
<span className={styles.maxmin}>{normalVal(item.minValue,item.maxValue)}</span>
|
|
<span className={styles.pass}>检验时间:
|
|
<span className={styles.pass}>检验时间:
|
|
- <input disabled="disabled" type="text"
|
|
|
|
|
|
+ <input type="text"
|
|
class="canEdit"
|
|
class="canEdit"
|
|
- onDoubleClick={(e)=>this.setEdit(e)}
|
|
|
|
|
|
+ // onDoubleClick={(e)=>this.setEdit(e)}
|
|
style={{color:'#333'}}
|
|
style={{color:'#333'}}
|
|
placeholder='时间'
|
|
placeholder='时间'
|
|
autoComplete="off"
|
|
autoComplete="off"
|
|
value={item.time}
|
|
value={item.time}
|
|
onInput={(e)=>{this.handleInput(e,item,idx,1)}}
|
|
onInput={(e)=>{this.handleInput(e,item,idx,1)}}
|
|
- onBlur={()=>{this.handleBlur()}}
|
|
|
|
|
|
+ // onBlur={()=>{this.handleBlur()}}
|
|
|
|
+ onFocus={()=>{this.handleFocus()}}
|
|
/>
|
|
/>
|
|
</span>
|
|
</span>
|
|
<span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item,idx)}}></span>
|
|
<span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item,idx)}}></span>
|