import PropTypes from "prop-types"
import React from "react"
import style from "./index.less"
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 floderR from './TemplateItem/img/floderR.png';
import floderD from './TemplateItem/img/floderD.png';
import Empty from '@components/Empty';
import $ from 'jquery';
import {windowEventHandler,getWindowInnerHeight} from '@utils/tools'
class TemplateItems extends React.Component {
constructor(props) {
super(props);
this.state = {
msg:'还没有保存模板',
val:'',
height:'',
showTipContent:false
}
this.$cont = React.createRef();
this.$conts = React.createRef();
this.$search = React.createRef();
this.genItems = this.genItems.bind(this);
this.templateSearch = this.templateSearch.bind(this);
this.handleEnter = this.handleEnter.bind(this);
this.handleChange = this.handleChange.bind(this);
this.clear = this.clear.bind(this);
this.showTipContent = this.showTipContent.bind(this);
this.getFloderLis = this.getFloderLis.bind(this);
}
componentDidMount(){
const height = getWindowInnerHeight()-195;
this.setState({
height:height
})
windowEventHandler('resize', ()=>{
if(this.$conts.current){
const height = getWindowInnerHeight()-195;
this.setState({
height:height
})
}
});
$(document).click((event) => {
let _del = $('#floderAction')[0]; // 弹窗
let _dels = $(event.target).attr("id"); // 触发弹窗列表
if (_del) {//onMousedown的目标为滚动条时,删除弹窗不关闭
if (!event.target.isEqualNode(_del) && event.target.parentNode != _del &&_dels != 'floderActionBtn') {
this.floderAction(false,'none')
}
}
})
}
showTipContent(){
let show = this.state.showTipContent
this.setState({
showTipContent:!show
})
}
floderSlide(e,item){
const {floderSlide} = this.props
if(!item.templateInfo){
return;
}
$(e.target).next().slideToggle()
let domLis = $(e.target).parent().siblings()
for(let i = 0;i < domLis.length;i++){
let tmpD = domLis[i]
$(tmpD).children().eq(1).slideUp()
}
floderSlide(item.id)
}
floderAction(e,id){
e&&e.stopPropagation()
const {floderAction} = this.props;
floderAction(id)
}
genItems(items,flg) {
const Items = [];
const {admin,checkItems,allCheckShow,handleContentClick,handleTemplateDel,handleTitleChange,checkItemsAdmin,allCheckShowAdmin} = this.props;
items.forEach((v,idx) => {
Items.push(
{this.floderRename(e)}}>重命名文件夹
{this.floderDelete(e)}}>删除文件夹
1. 标准模版中的科室,对应的是经朗通医疗团队整理的,符合临床医学意义的科室。
2.只有特定的“管理员”账号,可对“标准模板”进行修改,普通账号仅可进行“引用”;
handleClickGetMore(current)} className={style.loadMore}>点击查看更多
:null }