|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { SearchOption, Calendar, ConfirmModal, Notify, Add } from '@commonComp';
|
|
|
+import { SearchOption, Calendar, ConfirmModal, Notify, Add ,DelToast} from '@commonComp';
|
|
|
import styles from './index.less';
|
|
|
import $ from 'jquery';
|
|
|
import Textarea from './Textarea';
|
|
@@ -14,7 +14,8 @@ class AddAssistCheck extends React.Component {
|
|
|
dateTime: "",
|
|
|
active: '',
|
|
|
visible: false,
|
|
|
- id: null
|
|
|
+ id: null,
|
|
|
+ activeName:''
|
|
|
}
|
|
|
this.handleShowDate = this.handleShowDate.bind(this)
|
|
|
this.getCurrentDate = this.getCurrentDate.bind(this)
|
|
@@ -25,10 +26,11 @@ class AddAssistCheck extends React.Component {
|
|
|
this.handleCancel = this.handleCancel.bind(this)
|
|
|
}
|
|
|
|
|
|
- handleDelClick(id) {
|
|
|
+ handleDelClick(id,item) {
|
|
|
this.setState({
|
|
|
visible: true,
|
|
|
- id: id
|
|
|
+ id: id,
|
|
|
+ activeName:item.name
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -39,7 +41,8 @@ class AddAssistCheck extends React.Component {
|
|
|
handlePush && handlePush(); //右侧推送
|
|
|
this.setState({
|
|
|
visible: false,
|
|
|
- id: null
|
|
|
+ id: null,
|
|
|
+ activeName:''
|
|
|
})
|
|
|
Notify.success("删除成功");
|
|
|
}
|
|
@@ -47,7 +50,8 @@ class AddAssistCheck extends React.Component {
|
|
|
handleCancel() {
|
|
|
this.setState({
|
|
|
visible: false,
|
|
|
- id: null
|
|
|
+ id: null,
|
|
|
+ activeName:''
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -55,12 +59,22 @@ class AddAssistCheck extends React.Component {
|
|
|
$(document).click((event) => {
|
|
|
let _con = $('#searchWrapAssist'); // 设置目标区域
|
|
|
let _cons = $('#datePick'); // 设置目标区域
|
|
|
+ let _del = $('#delBox')[0]; // 删除弹窗
|
|
|
+ let _close = $('#assiClose')[0]; // 删除icon
|
|
|
+ // console.log(111,event.target,_del,_close)
|
|
|
if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
|
|
|
this.setState({ show: false });
|
|
|
}
|
|
|
if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1
|
|
|
this.setState({ date: false });
|
|
|
}
|
|
|
+ if(event.target != _close && event.target != _del && event.target.parentNode != _del){
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ id: null,
|
|
|
+ activeName:''
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
this.getCurrentDate();
|
|
|
}
|
|
@@ -124,10 +138,11 @@ class AddAssistCheck extends React.Component {
|
|
|
}
|
|
|
getAssistLabel() {
|
|
|
const { assistLabel, handleChangeAssistValue, handleChangeDate, isRead, handlePush, winWidth,getInfomation } = this.props;
|
|
|
+ const { visible,activeName,id } = this.state;
|
|
|
return <ul className={styles.labelWrap} id="datePick">
|
|
|
{
|
|
|
assistLabel.map((item, idx) => {
|
|
|
- return (<li key={item.id} className={styles.assistLists}>
|
|
|
+ return (<li key={item.questionId} className={styles.assistLists}>
|
|
|
<span className={styles.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
|
|
|
<span className={styles.tagSpan}>
|
|
|
{item.name}:
|
|
@@ -140,11 +155,16 @@ class AddAssistCheck extends React.Component {
|
|
|
<div className={styles.pointerFinger}>
|
|
|
<p onClick={() => this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
|
|
|
<i onClick={() => this.handleShowDate(idx)}></i>
|
|
|
- <a href="javascript:void(0);" onClick={() => { this.handleDelClick(idx) }}><img src={close} alt="" /></a>
|
|
|
+ {/*<a href="javascript:void(0);" onClick={() => { this.handleDelClick(idx,item) }}><img src={close} alt="" /></a>*/}
|
|
|
+ <span className={styles.closeIcon} id="assiClose" onClick={() => { this.handleDelClick(idx,item) }}></span>
|
|
|
<div style={{ display: this.state.date && idx == this.state.active ? "block" : "none", position: "relative" }}>
|
|
|
<Calendar isShow={true} handleChange={(info) => { handleChangeDate(info, idx); this.setState({ date: false }) }}></Calendar>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <DelToast show={idx==id?visible:false}
|
|
|
+ name={activeName}
|
|
|
+ cancel={this.handleCancel}
|
|
|
+ confirm={this.delConfirm}/>
|
|
|
</li>)
|
|
|
})
|
|
|
}
|
|
@@ -170,7 +190,7 @@ class AddAssistCheck extends React.Component {
|
|
|
}
|
|
|
</SearchOption> : ''}
|
|
|
</div>
|
|
|
- <ConfirmModal
|
|
|
+ {/*<ConfirmModal
|
|
|
visible={visible}
|
|
|
confirm={this.delConfirm}
|
|
|
close={this.handleCancel}
|
|
@@ -182,7 +202,7 @@ class AddAssistCheck extends React.Component {
|
|
|
oKBg={'#3B9ED0'}
|
|
|
>
|
|
|
<p className={styles['center']}>是否删除该辅检项?</p>
|
|
|
- </ConfirmModal>
|
|
|
+ </ConfirmModal>*/}
|
|
|
</div>
|
|
|
)
|
|
|
}
|