|
@@ -5,17 +5,21 @@ import TemplateItem from './TemplateItem'
|
|
|
import check_circle from './TemplateItem/img/check-circle.png';
|
|
|
import delIcon from '@common/images/del_nor.png';
|
|
|
import check_right from './TemplateItem/img/check-right.png';
|
|
|
+import tempTip from './TemplateItem/img/tempTip.png';
|
|
|
+import tempTrd from './TemplateItem/img/tempTrd.png';
|
|
|
+import tmpAllCircle from './TemplateItem/img/tmpAllCircle.png';
|
|
|
+import tmpAllRight from './TemplateItem/img/tmpAllRight.png';
|
|
|
import Empty from '@components/Empty';
|
|
|
import {windowEventHandler,getWindowInnerHeight} from '@utils/tools'
|
|
|
|
|
|
-
|
|
|
class TemplateItems extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state = {
|
|
|
msg:'还没有保存模板',
|
|
|
val:'',
|
|
|
- height:''
|
|
|
+ height:'',
|
|
|
+ showTipContent:false
|
|
|
}
|
|
|
this.$cont = React.createRef();
|
|
|
this.$conts = React.createRef();
|
|
@@ -25,6 +29,7 @@ class TemplateItems extends React.Component {
|
|
|
this.handleEnter = this.handleEnter.bind(this);
|
|
|
this.handleChange = this.handleChange.bind(this);
|
|
|
this.clear = this.clear.bind(this);
|
|
|
+ this.showTipContent = this.showTipContent.bind(this);
|
|
|
}
|
|
|
componentDidMount(){
|
|
|
const height = getWindowInnerHeight()-195;
|
|
@@ -40,6 +45,12 @@ class TemplateItems extends React.Component {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ showTipContent(){
|
|
|
+ let show = this.state.showTipContent
|
|
|
+ this.setState({
|
|
|
+ showTipContent:!show
|
|
|
+ })
|
|
|
+ }
|
|
|
genItems(items,flg) {
|
|
|
const Items = [];
|
|
|
const {admin,adminItems,checkItemsAdmin} = this.props;
|
|
@@ -74,9 +85,9 @@ class TemplateItems extends React.Component {
|
|
|
}
|
|
|
}
|
|
|
if (items.length == checkItems.length && checkItems.length != 0) {
|
|
|
- return check_right;
|
|
|
+ return tmpAllRight;
|
|
|
} else {
|
|
|
- return check_circle;
|
|
|
+ return tmpAllCircle;
|
|
|
}
|
|
|
}
|
|
|
templateSearch(){
|
|
@@ -117,18 +128,21 @@ class TemplateItems extends React.Component {
|
|
|
this.$search.current.focus();
|
|
|
this.templateSearch();
|
|
|
}
|
|
|
- componentWillReceiveProps(next){
|
|
|
+ clickTabChange(){
|
|
|
+
|
|
|
+ }
|
|
|
+ componentWillReceiveProps(next){
|
|
|
//点清空恢复初始状态
|
|
|
if(this.props.clearSearch!==next.clearSearch){
|
|
|
this.clear();
|
|
|
}
|
|
|
}
|
|
|
render() {
|
|
|
- const { checkItemsAdmin,handleAllCheckboxAdmin,handleMangerTemplateAdmin,allCheckShowAdmin,admin,adminItems,allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
|
|
|
- const {height} = this.state
|
|
|
+ const {selectTemp,whichTemp, checkItemsAdmin,handleAllCheckboxAdmin,handleMangerTemplateAdmin,allCheckShowAdmin,admin,adminItems,allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
|
|
|
+ const {height,showTipContent} = this.state
|
|
|
return (
|
|
|
<div className={style.wrapper} >
|
|
|
- {//管理员操作
|
|
|
+ {//管理员操作
|
|
|
adminItems&&admin ? (allCheckShowAdmin ?
|
|
|
<div className={style.wrapperTop}>
|
|
|
<div className={style['check-wrap']} onClick={handleAllCheckboxAdmin} style={{paddingLeft:'10px'}}>
|
|
@@ -166,7 +180,7 @@ class TemplateItems extends React.Component {
|
|
|
<div className={style.comAdminWrp}>
|
|
|
<div className={`${style.tempLists} ${style.tempListsP}`} ref={this.$cont} style={{display:admin?'none':'block',border:'1px solid #EAEDF1'}}>
|
|
|
{//个人
|
|
|
- allCheckShow&&!admin ?<div className={`${style.wrapperTop} ${style.wrapperTopM} ${style.personalTmp}`}>
|
|
|
+ allCheckShow ?<div className={`${style.wrapperTop} ${style.wrapperTopM} ${style.personalTmp} ${selectTemp==1?style.personalTmpOwn:null}`} onClick={()=>whichTemp(1)}>
|
|
|
<i></i>
|
|
|
<i></i>
|
|
|
<div className={style['check-wrap']} onClick={handleAllCheckbox}>
|
|
@@ -174,37 +188,55 @@ class TemplateItems extends React.Component {
|
|
|
</div>
|
|
|
<span onClick={handleAllCheckbox}>全选</span>
|
|
|
<span className={`${style['fr-element']} ${style['done']}`} onClick={handleMangerTemplate}>完成</span>
|
|
|
- {
|
|
|
+ {checkItems.length>0&&<span className={`${style['fr-element']} ${style['del-items']}`} onClick={handleDelList}>删除</span>}
|
|
|
+ {/* {
|
|
|
checkItems.length>0?<span className={`${style['fr-element']} ${style['del-items']}`} onClick={handleDelList}>删除</span>:
|
|
|
<span className={`${style['fr-element']} ${style['del-items-gray']}`}>删除</span>
|
|
|
- }
|
|
|
+ } */}
|
|
|
</div>:null
|
|
|
}
|
|
|
{
|
|
|
- !allCheckShow&&<div className={`${style.personalTmp} clearfix`}>
|
|
|
- <span className={style.tip}>个人模板</span>
|
|
|
- <i></i>
|
|
|
+ <div className={`${style.topBorder} clearfix`}>
|
|
|
{
|
|
|
- items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
|
|
|
+ !allCheckShow&&<div className={`${style.personalTmp} ${selectTemp==1?style.personalTmpOwn:''} clearfix`} onClick={()=>whichTemp(1)}>
|
|
|
+ <span className={style.tip}>个人模板</span>
|
|
|
+ <i></i>
|
|
|
+ {
|
|
|
+ items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ !admin?!allCheckShowAdmin&&<div
|
|
|
+ className={`${style.personalTmp} ${style.personalTmpStatand} ${selectTemp==2?style.personalTmpOwn:''}`}
|
|
|
+ onClick={()=>{whichTemp(2);allCheckShow&&handleMangerTemplate()}}
|
|
|
+ >标准模板 {selectTemp==2&&<img src={tempTip} className={style.tempTip} alt="" onMouseEnter={this.showTipContent} onMouseLeave={this.showTipContent}/>}
|
|
|
+ {
|
|
|
+ showTipContent&&<div className={style.tempTipContent}>
|
|
|
+ <img src={tempTrd} alt=""/>
|
|
|
+ <p>1. 标准模版中的科室,对应的是经朗通医疗团队整理的,符合临床医学意义的科室。</p>
|
|
|
+ <p>2.只有特定的“管理员”账号,可对“标准模板”进行修改,普通账号仅可进行“引用”;</p>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ </div>:''
|
|
|
}
|
|
|
</div>
|
|
|
}
|
|
|
{
|
|
|
- <div style={{height:height/2-42+'px',overflow:'auto'}}>
|
|
|
- {this.genItems(items).length > 0?this.genItems(items): <Empty message={this.state.msg}></Empty>}
|
|
|
+ <div style={{height:height-52+'px',overflow:'auto'}}>
|
|
|
+ {
|
|
|
+ selectTemp==1&&this.genItems(items).length > 0?this.genItems(items):selectTemp==2&&this.genItems(adminItems,true).length > 0?this.genItems(adminItems,true): <Empty message={this.state.msg}></Empty>
|
|
|
+ }
|
|
|
</div>
|
|
|
}
|
|
|
</div>
|
|
|
- <div className={style.tempLists} ref={this.$conts} style={{border:admin?'0':'1px solid #EAEDF1'}}>
|
|
|
- {
|
|
|
- !admin?!allCheckShowAdmin&&<div className={`${style.personalTmp}`}>标准模板</div>:''
|
|
|
- }
|
|
|
- {
|
|
|
- <div style={{height:admin?height+'px':(height-20)/2-42+'px',overflow:'auto'}}>
|
|
|
+ {
|
|
|
+ admin&&<div className={style.tempLists} ref={this.$conts} style={{border:admin?'0':'1px solid #EAEDF1'}}>
|
|
|
+ <div style={{height:height+'px',overflow:'auto'}}>
|
|
|
{this.genItems(adminItems,true).length > 0?this.genItems(adminItems,true): <Empty message={this.state.msg}></Empty>}
|
|
|
</div>
|
|
|
- }
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ }
|
|
|
</div>
|
|
|
}
|
|
|
{/* <div className={style.tempLists} ref={this.$cont}>
|