luolei 5 yıl önce
ebeveyn
işleme
f560755c51

+ 1 - 1
src/components/Operation/Search/index.jsx

@@ -25,7 +25,7 @@ class SearchList extends React.Component {
     }
     }
     componentDidMount(){
     componentDidMount(){
       this.props.handleChangeValue('');
       this.props.handleChangeValue('');
-      this.textInput.current.focus();
+    //   this.textInput.current.focus();
       const {windowHeight,pageTop,height,refreshScroller} = this.props;
       const {windowHeight,pageTop,height,refreshScroller} = this.props;
     }
     }
     handleClearVal(){
     handleClearVal(){

+ 7 - 14
src/components/PushContainer/index.jsx

@@ -2,7 +2,7 @@ import React, { Component } from 'react';
 import style from './index.less';
 import style from './index.less';
 import { Tab, ConfirmModal, Notify } from '@commonComp';
 import { Tab, ConfirmModal, Notify } from '@commonComp';
 import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow,allCheckedAdmin,allCheckedShowAdmin } from '@store/actions/tabTemplate';
 import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow,allCheckedAdmin,allCheckedShowAdmin } from '@store/actions/tabTemplate';
-import { initItemList, delItem,delItemAdmin, delBatchItem, delBatchItemAdmin,changeTitleAsync, setPageView,changeTitleAsyncAdmin } from '@store/async-actions/tabTemplate';
+import { initItemList, delItem,delItemAdmin, delBatchItem, delBatchItemAdmin,changeTitleAsync, setPageView,changeTitleAsyncAdmin,setPageViewAdmin } from '@store/async-actions/tabTemplate';
 import { connect } from "react-redux";
 import { connect } from "react-redux";
 import store from '@store';
 import store from '@store';
 import { billing } from '@store/async-actions/pushMessage';
 import { billing } from '@store/async-actions/pushMessage';
@@ -256,24 +256,17 @@ class PushContainer extends Component {
         id: this.state.currId,
         id: this.state.currId,
         title: this.state.title
         title: this.state.title
       }
       }
-      if(this.state.admin){
+      if(this.props.admin){
         store.dispatch(changeTitleAsyncAdmin(tempObj))
         store.dispatch(changeTitleAsyncAdmin(tempObj))
       }else{
       }else{
         store.dispatch(changeTitleAsync(tempObj))
         store.dispatch(changeTitleAsync(tempObj))
       }
       }
     } else if (this.state.type == 4) {        //模板引入
     } else if (this.state.type == 4) {        //模板引入
-      const { items } = this.props;
-      store.dispatch(setPageView(this.state.id))
-      // items && items.map((part) => {
-      //   if (this.state.id == part.id) {
-      //     let typeConfig = part.type;
-      //     // store.dispatch(keepPushData(part, 'part'))//引用数据的存储,用于保存模板是判断数据是否变化
-      //     // pushAllDataList(typeConfig, 'push', part, 'template')//引用
-      //     // if (didPushParamChange()) {
-      //       // store.dispatch(billing())
-      //     // }
-      //   }
-      // })
+      if(this.props.admin){
+        store.dispatch(setPageViewAdmin(this.state.id))
+      }else{
+        store.dispatch(setPageView(this.state.id))
+      }
       store.dispatch(changeVisible(false))
       store.dispatch(changeVisible(false))
     }
     }
   }
   }

+ 1 - 1
src/components/TemplateItems/TemplateItem/index.less

@@ -33,7 +33,7 @@
     position: relative;
     position: relative;
     height: 45px;
     height: 45px;
     line-height: 45px;
     line-height: 45px;
-    padding: 0 15px;
+    padding: 0 10px;
     cursor: pointer;
     cursor: pointer;
     img {
     img {
         display: inline-block;
         display: inline-block;

+ 10 - 53
src/components/TemplateItems/index.jsx

@@ -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>

+ 23 - 7
src/components/TemplateItems/index.less

@@ -11,6 +11,9 @@
         background-color: #fff;
         background-color: #fff;
         // margin-top: 15px;
         // margin-top: 15px;
     }
     }
+    .tempListsP {
+        margin-bottom: 10px;
+    }
     .emptyWrap {
     .emptyWrap {
         padding: 0 20px;
         padding: 0 20px;
         margin-top: 15px;
         margin-top: 15px;
@@ -24,8 +27,8 @@
     }
     }
     .wrapperTop {
     .wrapperTop {
         height: 46px;
         height: 46px;
-        padding: 0 30px;
-        margin-top: 10px;
+        padding: 0 15px;
+        // margin-top: 10px;
         // background-color: #EAEDF1;
         // background-color: #EAEDF1;
         cursor: pointer;
         cursor: pointer;
         .check-box {
         .check-box {
@@ -38,7 +41,6 @@
         }
         }
         .check-wrap{
         .check-wrap{
             height: 36px;
             height: 36px;
-            padding-right: 10px;
             float: left;
             float: left;
         }
         }
         span {
         span {
@@ -66,7 +68,7 @@
         }
         }
     }
     }
     .wrapperTopM {
     .wrapperTopM {
-        padding: 0 15px;
+        padding: 0 10px;
     }
     }
     .loadMore {
     .loadMore {
       text-align: center;
       text-align: center;
@@ -83,7 +85,7 @@
         }
         }
         input {
         input {
             box-sizing: border-box;
             box-sizing: border-box;
-            width: 270px;
+            width: 300px;
             display: inline-block;
             display: inline-block;
             line-height: 34px;
             line-height: 34px;
             height: 34px;
             height: 34px;
@@ -97,8 +99,8 @@
             text-align: center;
             text-align: center;
             background-color: #2A9BD5;
             background-color: #2A9BD5;
             color: #fff;
             color: #fff;
-            height: 35px;
-            line-height: 35px;
+            height: 34px;
+            line-height: 34px;
         }
         }
         img {
         img {
             position: absolute;
             position: absolute;
@@ -121,4 +123,18 @@
     display: inline-block;
     display: inline-block;
     height: 36px;
     height: 36px;
     line-height: 36px;
     line-height: 36px;
+}
+.personalTmp {
+    width: 100%;
+    height: 40px !important;
+    line-height: 40px !important;
+    background-color: #EDF8FF;
+    padding: 0 10px;
+    box-sizing: border-box;
+    .tip {
+
+    }
+    .manger {
+        float: right;
+    }
 }
 }

+ 18 - 0
src/store/async-actions/tabTemplate.js

@@ -340,6 +340,24 @@ export const setPageView = (id) => { //获取模板结构化数据
     })
     })
   }
   }
 };
 };
+export const setPageViewAdmin = (id) => { //获取模板结构化数据
+  return (dispatch) => {
+    axios.json('/templateAdmin/getTemplateIdAlls', {
+      id: id
+    }).then((res) => {
+      let data = res.data;
+      if (data.code == 0) {
+        //模板列表不筛选模式后,单个模式引用时看本身的模式
+        pushAllDataList(data.data.type, 'push', data.data, 'template')//引用
+        if(didPushParamChange()){     //诊断变化时会调推送,避免重复调
+          dispatch(billing())
+        }
+      } else {
+        Notify.error(data.msg);
+      }
+    })
+  }
+};
 
 
 export const getDepartments = (value) => { //获取模板结构化数据
 export const getDepartments = (value) => { //获取模板结构化数据
   return (dispatch) => {
   return (dispatch) => {