Преглед на файлове

Merge branch 'groupTypeStyle' of http://223.93.170.82:10080/zhouna/newICSS into groupTypeStyle

zhangxc преди 5 години
родител
ревизия
7b4c274574

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

@@ -29,13 +29,14 @@ class SearchList extends React.Component {
       const {windowHeight,pageTop,height,refreshScroller} = this.props;
     }
     handleClearVal(){
-        const { handleChangeValue } = this.props;
+        const { handleChangeValue,handleChangeIpt } = this.props;
         this.textInput.current.value = '';
         this.textInput.current.focus();
         this.setState({
             val:'',
             show:false
         });
+        handleChangeIpt('');
         handleChangeValue('');
     }
     handleInput(e){

+ 8 - 3
src/components/Operation/index.jsx

@@ -39,8 +39,8 @@ class Operation extends Component {
       value:'',//科室name
       folder:'',//文件夹
       folderName:'',
-      folderNameVal:'',//选中文件夹名称
-      folderId:'',//选中文件夹名称
+      folderNameVal:'未分类文件夹',//选中文件夹名称
+      folderId:'11',//选中文件夹名称
       folderListShow:false, //文件夹列表展示
       showSaveModule:false, //保存病例模板
     }
@@ -407,6 +407,12 @@ class Operation extends Component {
     }
   }
   handleChangeIpt(val){//搜索科室
+    if(val == ''){
+      this.setState({
+        deptId:'',
+      })
+      return
+    }
     this.setState({
       value:val
     })
@@ -579,7 +585,6 @@ class Operation extends Component {
         saveOrderFolder = {saveOrderFolder}
         patInfo={patInfo}
         title = '管理文件夹'>
-
         </FolderOrder>
     </div>;
   }

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

@@ -2,7 +2,7 @@ import React, { Component } from 'react';
 import style from './index.less';
 import { Tab, ConfirmModal, Notify } from '@commonComp';
 import { tabChange, allChecked, changeVisible, keepPushData, allCheckedShow,allCheckedAdmin,allCheckedShowAdmin,whichTemp,floderSlide,floderAction,folderModal,clearSearchTemplateNorms,folderOrder } from '@store/actions/tabTemplate';
-import { initItemList,initAdminItemList, delItem,delItemAdmin, delBatchItem, delBatchItemAdmin,changeTitleAsync, setPageView,changeTitleAsyncAdmin,setPageViewAdmin,getFloderList,delFloder,addTemplateQuote,newFloder } from '@store/async-actions/tabTemplate';
+import { initItemList,initAdminItemList, delItem,delItemAdmin, delBatchItem, delBatchItemAdmin,changeTitleAsync, setPageView,changeTitleAsyncAdmin,setPageViewAdmin,getFloderList,delFloder,addTemplateQuote,newFloder,findTemplateNorms } from '@store/async-actions/tabTemplate';
 import { connect } from "react-redux";
 import store from '@store';
 import { billing } from '@store/async-actions/pushMessage';
@@ -436,9 +436,13 @@ class PushContainer extends Component {
       hasCalcIndex: false
     })
   }
-  whichTemp(tab){
+  whichTemp(tab,name){
+    if(tab!=2||!name){
+      store.dispatch(initAdminItemList(1,true))
+    }else{
+      this.templateSearch(name,2)
+    }
     store.dispatch(whichTemp(tab))
-    store.dispatch(initAdminItemList(1,true))
   }
   floderSlideToggle(id){
     store.dispatch(floderSlide(id))

+ 33 - 8
src/components/TemplateItems/index.jsx

@@ -13,7 +13,9 @@ 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'
+import store from '@store';
+import { initCommonItemList,findTemplateNorms,getFloderListAll } from '@store/async-actions/tabTemplate';
+import { windowEventHandler,getWindowInnerHeight } from '@utils/tools'
 
 class TemplateItems extends React.Component {
     constructor(props) {
@@ -36,6 +38,7 @@ class TemplateItems extends React.Component {
         this.clear = this.clear.bind(this);
         this.showTipContent = this.showTipContent.bind(this);
         this.getFloderLis = this.getFloderLis.bind(this);
+        this.whichTemp = this.whichTemp.bind(this);
     }  
     componentDidMount(){
         const height = getWindowInnerHeight()-195;
@@ -92,9 +95,6 @@ class TemplateItems extends React.Component {
                 })
             }
         }
-        
-        
-
     }
     floderAction(e,id){
         e&&e.stopPropagation()
@@ -147,8 +147,8 @@ class TemplateItems extends React.Component {
                         {admin&&<img src={showIndex== i?floderD:floderR} className={style.floderRD}/>}
                         {!admin&&<img src={tmpItm.slide == 1?floderD:floderR} className={style.floderRD}/>}
                         {tmpItm.name}({tmpItm.templateInfoCount})
-                        {admin&&<span className={`${style.floderPartAction}`} id="floderActionBtn" onClick={(e)=>{this.floderAction(e,tmpItm.id)}}>...</span>}
-                        {tmpItm.action == 1&&<div className={style.floderAction} id="floderAction">
+                        {admin&&tmpItm.name!='未分类文件夹'&&<span className={`${style.floderPartAction}`} id="floderActionBtn" onClick={(e)=>{this.floderAction(e,tmpItm.id)}}>...</span>}
+                        {tmpItm.action == 1&&tmpItm.name!='未分类文件夹'&&<div className={style.floderAction} id="floderAction">
                             <p onClick={(e)=>{this.floderRename(e,tmpItm.name,tmpItm.id)}}>重命名文件夹</p>
                             <p onClick={(e)=>{this.floderDelete(e,tmpItm.id)}}>删除文件夹</p>
                         </div>}
@@ -238,8 +238,22 @@ class TemplateItems extends React.Component {
     }
     
     handleChange(){
+        const {admin,selectTemp} = this.props;
         const value = (this.$search.current.value).substring(0,30);
         // this.$search.current.value = value
+        if(!admin&&selectTemp==1&&value == ''){
+            store.dispatch(initCommonItemList(1,""))
+        }else if(!admin&&selectTemp==2&&value == ''){
+            this.setState({
+                hasSearch:false
+            })
+            store.dispatch(findTemplateNorms(''))
+        }else if(admin){
+            this.setState({
+                hasSearch:false
+            })
+            store.dispatch(getFloderListAll(''))
+        }
         setTimeout(() => {
             this.setState({
                 val: value
@@ -248,7 +262,7 @@ class TemplateItems extends React.Component {
     }
 
     clear(){
-        const {clearTemplateSearch} = this.props
+        const {clearTemplateSearch,selectTemp,admin} = this.props
         this.$search.current.value = '';
         this.setState({
             val:''
@@ -259,6 +273,9 @@ class TemplateItems extends React.Component {
             hasSearch: false
         })
         clearTemplateSearch&&clearTemplateSearch()
+        if(!admin){
+            store.dispatch(initCommonItemList(1,""))
+        }
     }
     clickTabChange(){
 
@@ -269,6 +286,14 @@ class TemplateItems extends React.Component {
         this.clear();
       }
     }
+    whichTemp(num,val){
+        this.props.whichTemp(num,val)
+        if(val){
+            this.setState({
+                hasSearch:true
+            })
+        }
+    }
     render() {
         const {selectTemp,whichTemp, checkItemsAdmin,handleAllCheckboxAdmin,handleMangerTemplateAdmin,allCheckShowAdmin,admin,adminItems,allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore,templateNormsSearchList } = this.props;
 
@@ -342,7 +367,7 @@ class TemplateItems extends React.Component {
                                     {
                                         !admin?!allCheckShowAdmin&&<div 
                                             className={`${style.personalTmp} ${style.personalTmpStatand} ${selectTemp==2?style.personalTmpOwn:''}`} 
-                                            onClick={()=>{whichTemp(2);allCheckShow&&handleMangerTemplate()}}
+                                            onClick={()=>{this.whichTemp(2,(this.state.val).trim());allCheckShow&&handleMangerTemplate(2)}}
                                             >标准模板 {selectTemp==2&&<img src={tempTip} className={style.tempTip} alt="" onMouseEnter={this.showTipContent} onMouseLeave={this.showTipContent}/>}
                                             {
                                                 showTipContent&&<div className={style.tempTipContent}>

+ 13 - 13
src/store/async-actions/tabTemplate.js

@@ -26,7 +26,7 @@ import {
   didPushParamChange
 } from '@utils/tools';
 import { billing } from '@store/async-actions/pushMessage';
-import { func } from 'prop-types';
+
 
 export const initItemList = (current,name,selectTemp) => {
   let admin = store.getState().homePage.admin;
@@ -473,7 +473,7 @@ export const getDepartments = (value) => { //获取模板结构化数据
     })
   }
 };
-export const findTemplateNorms = (name) => {
+export const findTemplateNorms = (name) => {//标准模板搜索
     return (dispatch) => {
       if(!name) {
         dispatch(setSearchTemplateNorms([]));
@@ -496,17 +496,17 @@ export const findTemplateNorms = (name) => {
 }
 
 export const getFloderListAll = () => {
-  return (dispatch) => {
-    axios.json('/templateAdmin/getTemplateNorms').then((res) => {
-      const data = res.data;
-      if (data.code == 0) {
-        // data.data.flg = flg||false  //获取下一页,暂时不用
-        dispatch(initAdminItems(data.data));
-      } else {
-        Notify.error(data.msg)
-      }
-    })
-  }
+    return (dispatch) => {
+      axios.json('/templateAdmin/getTemplateNorms').then((res) => {
+        const data = res.data;
+        if (data.code == 0) {
+          // data.data.flg = flg||false  //获取下一页,暂时不用
+          dispatch(initAdminItems(data.data));
+        } else {
+          Notify.error(data.msg)
+        }
+      })
+    }
 }
 
 export const addTemplateQuote = (templateId) => {

+ 1 - 0
src/store/reducers/tabTemplate.js

@@ -202,6 +202,7 @@ export default (state = initDataList, action) => {
   }
   if (action.type === INIT_ADMIN_ITEMS) {//标准模板数据
     const newState = Object.assign({}, state);
+    // action.state[0].slide=1
     newState.adminItems = action.state
     let tmpLis = [];
     for(let k = 0;k < action.state.length;k++){