|
@@ -27,51 +27,18 @@ class TemplateItems extends React.Component {
|
|
this.clear = this.clear.bind(this);
|
|
this.clear = this.clear.bind(this);
|
|
}
|
|
}
|
|
componentDidMount(){
|
|
componentDidMount(){
|
|
- const {admin} = this.props;
|
|
|
|
- console.log(admin)
|
|
|
|
-
|
|
|
|
const height = getWindowInnerHeight()-195;
|
|
const height = getWindowInnerHeight()-195;
|
|
- // this.$conts.current.style.height = height+"px";
|
|
|
|
this.setState({
|
|
this.setState({
|
|
height:height
|
|
height:height
|
|
})
|
|
})
|
|
windowEventHandler('resize', ()=>{
|
|
windowEventHandler('resize', ()=>{
|
|
if(this.$conts.current){
|
|
if(this.$conts.current){
|
|
const height = getWindowInnerHeight()-195;
|
|
const height = getWindowInnerHeight()-195;
|
|
- // this.$conts.current.style.height = height+"px";
|
|
|
|
this.setState({
|
|
this.setState({
|
|
height:height
|
|
height:height
|
|
})
|
|
})
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- // if(admin){
|
|
|
|
- // const heights = getWindowInnerHeight()-195;
|
|
|
|
- // this.$conts.current.style.height = heights+"px";
|
|
|
|
- // windowEventHandler('resize', ()=>{
|
|
|
|
- // if(this.$conts.current){
|
|
|
|
- // const height = getWindowInnerHeight()-195;
|
|
|
|
- // this.$conts.current.style.height = height+"px";
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // }else{
|
|
|
|
- // const height = getWindowInnerHeight()-195;
|
|
|
|
- // this.$cont.current.style.height = height/2+"px";
|
|
|
|
- // windowEventHandler('resize', ()=>{
|
|
|
|
- // if(this.$cont.current){
|
|
|
|
- // const height = getWindowInnerHeight()-195;
|
|
|
|
- // this.$cont.current.style.height = height/2+"px";
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // const heights = getWindowInnerHeight()-195;
|
|
|
|
- // this.$conts.current.style.height = heights/2+"px";
|
|
|
|
- // windowEventHandler('resize', ()=>{
|
|
|
|
- // if(this.$conts.current){
|
|
|
|
- // const height = getWindowInnerHeight()-195;
|
|
|
|
- // this.$conts.current.style.height = height/2+"px";
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
genItems(items,flg) {
|
|
genItems(items,flg) {
|
|
const Items = [];
|
|
const Items = [];
|
|
@@ -159,7 +126,7 @@ class TemplateItems extends React.Component {
|
|
{//管理员操作
|
|
{//管理员操作
|
|
adminItems&&admin ? (allCheckShowAdmin ?
|
|
adminItems&&admin ? (allCheckShowAdmin ?
|
|
<div className={style.wrapperTop}>
|
|
<div className={style.wrapperTop}>
|
|
- <div className={style['check-wrap']} onClick={handleAllCheckboxAdmin}>
|
|
|
|
|
|
+ <div className={style['check-wrap']} onClick={handleAllCheckboxAdmin} style={{paddingLeft:'10px'}}>
|
|
<img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
|
|
<img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
|
|
</div>
|
|
</div>
|
|
<span onClick={handleAllCheckboxAdmin}>全选</span>
|
|
<span onClick={handleAllCheckboxAdmin}>全选</span>
|
|
@@ -192,9 +159,9 @@ class TemplateItems extends React.Component {
|
|
}
|
|
}
|
|
{
|
|
{
|
|
<div className={style.comAdminWrp}>
|
|
<div className={style.comAdminWrp}>
|
|
- <div className={style.tempLists} ref={this.$cont} style={{display:admin?'none':'block',height:height/2+'px'}}>
|
|
|
|
|
|
+ <div className={`${style.tempLists} ${style.tempListsP}`} ref={this.$cont} style={{display:admin?'none':'block',height:height/2+'px',border:'1px solid #EAEDF1'}}>
|
|
{//个人
|
|
{//个人
|
|
- allCheckShow&&!admin ?<div className={`${style.wrapperTop} ${style.wrapperTopM}`}>
|
|
|
|
|
|
+ allCheckShow&&!admin ?<div className={`${style.wrapperTop} ${style.wrapperTopM} ${style.personalTmp}`}>
|
|
<div className={style['check-wrap']} onClick={handleAllCheckbox}>
|
|
<div className={style['check-wrap']} onClick={handleAllCheckbox}>
|
|
<img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
|
|
<img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
|
|
</div>
|
|
</div>
|
|
@@ -207,29 +174,19 @@ class TemplateItems extends React.Component {
|
|
</div>:null
|
|
</div>:null
|
|
}
|
|
}
|
|
{
|
|
{
|
|
- items.length > 0&&!allCheckShow&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
|
|
|
|
|
|
+ items.length > 0&&20.0&&<div className={`${style.personalTmp} clearfix`}>
|
|
|
|
+ <span className={style.tip}>个人模板</span>
|
|
|
|
+ <i></i>
|
|
|
|
+ <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
|
|
|
|
+ </div>
|
|
}
|
|
}
|
|
{
|
|
{
|
|
this.genItems(items).length > 0?this.genItems(items): <Empty message={this.state.msg}></Empty>
|
|
this.genItems(items).length > 0?this.genItems(items): <Empty message={this.state.msg}></Empty>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
- <div className={style.tempLists} ref={this.$conts} style={{height:admin?height+'px':height/2+'px'}}>
|
|
|
|
- {//管理员
|
|
|
|
- allCheckShowAdmin&&!admin ?<div className={`${style.wrapperTop} ${style.wrapperTopM}`}>
|
|
|
|
- <div className={style['check-wrap']} onClick={handleAllCheckboxAdmin}>
|
|
|
|
- <img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
|
|
|
|
- </div>
|
|
|
|
- <span onClick={handleAllCheckboxAdmin}>全选</span>
|
|
|
|
- <span className={`${style['fr-element']} ${style['done']}`} onClick={handleMangerTemplateAdmin}>完成</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
|
|
|
|
- }
|
|
|
|
|
|
+ <div className={style.tempLists} ref={this.$conts} style={{height:admin?height+'px':(height-20)/2+'px',border:admin?'0':'1px solid #EAEDF1'}}>
|
|
{
|
|
{
|
|
- // adminItems.length > 0&&!admin&&!allCheckShowAdmin&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplateAdmin}>管理</span>
|
|
|
|
- adminItems.length > 0&&!admin&&!allCheckShowAdmin&&<div>标准模板</div>
|
|
|
|
|
|
+ adminItems.length > 0&&!admin&&!allCheckShowAdmin&&<div className={`${style.personalTmp}`}>标准模板</div>
|
|
}
|
|
}
|
|
{
|
|
{
|
|
this.genItems(adminItems,true).length > 0?this.genItems(adminItems,true): <Empty message={this.state.msg}></Empty>
|
|
this.genItems(adminItems,true).length > 0?this.genItems(adminItems,true): <Empty message={this.state.msg}></Empty>
|