import React, { Component } from "react"; import styles from "./index.less"; import { Notify,DelToast} from '@commonComp'; import $ from 'jquery'; import checkOff from '@common/images/check_off.png'; import checkOn from '@common/images/check_on.png'; import SlideIpt from '../SlideIpt'; class SlidePic extends Component { constructor(props) { super(props); this.state = { show:false, activeInd:false, activeName:'', canEdit:true, style:'' }; this.handleDel = this.handleDel.bind(this); this.handleCancel = this.handleCancel.bind(this); this.delConfirm = this.delConfirm.bind(this); this.setEdit = this.setEdit.bind(this); this.handleBlur = this.handleBlur.bind(this); this.checkOnOff = this.checkOnOff.bind(this); } componentDidMount() { $(document).click((event) => { if($(event.target).attr("id")!='addClose'&&$(event.target).attr("id")!='delTit'){ this.setState({ activeInd:false }) } }); } handleDel(time){ const {handleDelClick,item} = this.props; this.setState({ activeInd:true, activeName:item.uniqueName, }) handleDelClick&&handleDelClick(1,time); } handleCancel(){ this.setState({ activeInd:false, activeName:'' }) } delConfirm(item,idx){ const {handleDelConfirm,handlePush} = this.props; handleDelConfirm&&handleDelConfirm(item,idx); Notify.success("删除成功"); handlePush && handlePush({mode:8}); //右侧推送 this.setState({ activeInd:false, activeName:'' }) } handleInput(e,item,sign){ e.stopPropagation(); const {setTipValue} = this.props setTipValue(item,e.target.value,sign) } handleBlur(){ const {handlePush} = this.props; $('.canEdit').attr('disabled','disabled') handlePush && handlePush({mode:8}); //右侧推送 } checkOnOff(item,idx){ const {checkOnOff,handlePush} = this.props checkOnOff(item,idx) handlePush && handlePush({mode:8}); //右侧推送 } setEdit(e){ // $('.canEdit').blur().attr('disabled','disabled') $(e.target).removeAttr('disabled').focus() } render() { const {item,time,setTipValue,idx,handlePush} = this.props; const {canEdit,activeInd,activeName,value,style} = this.state; return (