|
@@ -1,8 +1,9 @@
|
|
import React from 'react';
|
|
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 styles from './index.less';
|
|
import $ from 'jquery';
|
|
import $ from 'jquery';
|
|
import Textarea from './Textarea';
|
|
import Textarea from './Textarea';
|
|
|
|
+import { getPageCoordinate } from '@utils/tools';
|
|
import close from './img/close.png';
|
|
import close from './img/close.png';
|
|
|
|
|
|
class AddAssistCheck extends React.Component {
|
|
class AddAssistCheck extends React.Component {
|
|
@@ -14,7 +15,9 @@ class AddAssistCheck extends React.Component {
|
|
dateTime: "",
|
|
dateTime: "",
|
|
active: '',
|
|
active: '',
|
|
visible: false,
|
|
visible: false,
|
|
- id: null
|
|
|
|
|
|
+ pageTop:'',
|
|
|
|
+ id: null,
|
|
|
|
+ activeName:''
|
|
}
|
|
}
|
|
this.handleShowDate = this.handleShowDate.bind(this)
|
|
this.handleShowDate = this.handleShowDate.bind(this)
|
|
this.getCurrentDate = this.getCurrentDate.bind(this)
|
|
this.getCurrentDate = this.getCurrentDate.bind(this)
|
|
@@ -25,10 +28,11 @@ class AddAssistCheck extends React.Component {
|
|
this.handleCancel = this.handleCancel.bind(this)
|
|
this.handleCancel = this.handleCancel.bind(this)
|
|
}
|
|
}
|
|
|
|
|
|
- handleDelClick(id) {
|
|
|
|
|
|
+ handleDelClick(id,item) {
|
|
this.setState({
|
|
this.setState({
|
|
visible: true,
|
|
visible: true,
|
|
- id: id
|
|
|
|
|
|
+ id: id,
|
|
|
|
+ activeName:item.name
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -39,7 +43,8 @@ class AddAssistCheck extends React.Component {
|
|
handlePush && handlePush(); //右侧推送
|
|
handlePush && handlePush(); //右侧推送
|
|
this.setState({
|
|
this.setState({
|
|
visible: false,
|
|
visible: false,
|
|
- id: null
|
|
|
|
|
|
+ id: null,
|
|
|
|
+ activeName:''
|
|
})
|
|
})
|
|
Notify.success("删除成功");
|
|
Notify.success("删除成功");
|
|
}
|
|
}
|
|
@@ -47,7 +52,8 @@ class AddAssistCheck extends React.Component {
|
|
handleCancel() {
|
|
handleCancel() {
|
|
this.setState({
|
|
this.setState({
|
|
visible: false,
|
|
visible: false,
|
|
- id: null
|
|
|
|
|
|
+ id: null,
|
|
|
|
+ activeName:''
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -55,18 +61,28 @@ class AddAssistCheck extends React.Component {
|
|
$(document).click((event) => {
|
|
$(document).click((event) => {
|
|
let _con = $('#searchWrapAssist'); // 设置目标区域
|
|
let _con = $('#searchWrapAssist'); // 设置目标区域
|
|
let _cons = $('#datePick'); // 设置目标区域
|
|
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
|
|
if (_con && searchWrapAssist != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
|
|
this.setState({ show: false });
|
|
this.setState({ show: false });
|
|
}
|
|
}
|
|
if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1
|
|
if (!_cons.is(event.target) && _cons.has(event.target).length === 0) { // Mark 1
|
|
this.setState({ date: false });
|
|
this.setState({ date: false });
|
|
}
|
|
}
|
|
|
|
+ if(event.target != _close && event.target != _del && event.target.parentNode != _del){
|
|
|
|
+ this.setState({
|
|
|
|
+ visible: false,
|
|
|
|
+ id: null,
|
|
|
|
+ activeName:''
|
|
|
|
+ })
|
|
|
|
+ }
|
|
});
|
|
});
|
|
this.getCurrentDate();
|
|
this.getCurrentDate();
|
|
}
|
|
}
|
|
handleSearchShow(e) {
|
|
handleSearchShow(e) {
|
|
let tmpShow = this.state.show;
|
|
let tmpShow = this.state.show;
|
|
- this.setState({ show: !tmpShow })
|
|
|
|
|
|
+ this.setState({ show: !tmpShow,pageTop:getPageCoordinate(e).boxTop })
|
|
// e.stopPropagation();
|
|
// e.stopPropagation();
|
|
}
|
|
}
|
|
handleShowDate(idx) {
|
|
handleShowDate(idx) {
|
|
@@ -124,10 +140,11 @@ class AddAssistCheck extends React.Component {
|
|
}
|
|
}
|
|
getAssistLabel() {
|
|
getAssistLabel() {
|
|
const { assistLabel, handleChangeAssistValue, handleChangeDate, isRead, handlePush, winWidth,getInfomation } = this.props;
|
|
const { assistLabel, handleChangeAssistValue, handleChangeDate, isRead, handlePush, winWidth,getInfomation } = this.props;
|
|
|
|
+ const { visible,activeName,id } = this.state;
|
|
return <ul className={styles.labelWrap} id="datePick">
|
|
return <ul className={styles.labelWrap} id="datePick">
|
|
{
|
|
{
|
|
assistLabel.map((item, idx) => {
|
|
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.assistName} style={{ width: winWidth < 1200 ? '120px' : 'auto' }}>
|
|
<span className={styles.tagSpan}>
|
|
<span className={styles.tagSpan}>
|
|
{item.name}:
|
|
{item.name}:
|
|
@@ -140,25 +157,30 @@ class AddAssistCheck extends React.Component {
|
|
<div className={styles.pointerFinger}>
|
|
<div className={styles.pointerFinger}>
|
|
<p onClick={() => this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
|
|
<p onClick={() => this.handleShowDate(idx)}>报告日期:<span>{item.time || this.state.dateTime}</span></p>
|
|
<i onClick={() => this.handleShowDate(idx)}></i>
|
|
<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" }}>
|
|
<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>
|
|
<Calendar isShow={true} handleChange={(info) => { handleChangeDate(info, idx); this.setState({ date: false }) }}></Calendar>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <DelToast show={idx==id?visible:false}
|
|
|
|
+ name={activeName}
|
|
|
|
+ cancel={this.handleCancel}
|
|
|
|
+ confirm={this.delConfirm}/>
|
|
</li>)
|
|
</li>)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
</ul>
|
|
</ul>
|
|
}
|
|
}
|
|
render() {
|
|
render() {
|
|
- const { handleChangeValue, list,assistVal } = this.props;
|
|
|
|
- const { visible } = this.state;
|
|
|
|
|
|
+ const { handleChangeValue, list,assistVal,windowHeight } = this.props;
|
|
|
|
+ const { visible,pageTop } = this.state;
|
|
return (
|
|
return (
|
|
<div className={styles.wrapper}>
|
|
<div className={styles.wrapper}>
|
|
{this.getAssistLabel()}
|
|
{this.getAssistLabel()}
|
|
<div id="searchWrapAssist" style={{ position: "relative", clear: 'both' }}>
|
|
<div id="searchWrapAssist" style={{ position: "relative", clear: 'both' }}>
|
|
<Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck" />
|
|
<Add showText="添加辅检项" handleClick={(e) => this.handleSearchShow(e)} id="assistCheck" />
|
|
- {this.state.show ? <SearchOption handleChangeValue={handleChangeValue} visible={true}>
|
|
|
|
|
|
+ {this.state.show ? <SearchOption windowHeight={windowHeight} pageTop={pageTop} height={280} handleChangeValue={handleChangeValue} visible={true}>
|
|
{list && list.length>0?this.getSearchList(list):(assistVal == ''?'':<p style={{padding:'5px 30px',color:'#bfbfbf'}}>暂无筛选项</p>)}
|
|
{list && list.length>0?this.getSearchList(list):(assistVal == ''?'':<p style={{padding:'5px 30px',color:'#bfbfbf'}}>暂无筛选项</p>)}
|
|
{
|
|
{
|
|
list && list.length>0 || (assistVal != '')?'':<div>
|
|
list && list.length>0 || (assistVal != '')?'':<div>
|
|
@@ -170,7 +192,7 @@ class AddAssistCheck extends React.Component {
|
|
}
|
|
}
|
|
</SearchOption> : ''}
|
|
</SearchOption> : ''}
|
|
</div>
|
|
</div>
|
|
- <ConfirmModal
|
|
|
|
|
|
+ {/*<ConfirmModal
|
|
visible={visible}
|
|
visible={visible}
|
|
confirm={this.delConfirm}
|
|
confirm={this.delConfirm}
|
|
close={this.handleCancel}
|
|
close={this.handleCancel}
|
|
@@ -182,7 +204,7 @@ class AddAssistCheck extends React.Component {
|
|
oKBg={'#3B9ED0'}
|
|
oKBg={'#3B9ED0'}
|
|
>
|
|
>
|
|
<p className={styles['center']}>是否删除该辅检项?</p>
|
|
<p className={styles['center']}>是否删除该辅检项?</p>
|
|
- </ConfirmModal>
|
|
|
|
|
|
+ </ConfirmModal>*/}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|