Selaa lähdekoodia

Merge branch 'dev/new1' of http://192.168.2.236:10080/zhouna/newICSS into dev/new1

Luolei 6 vuotta sitten
vanhempi
commit
4afc214a34

+ 5 - 5
src/components/ChronicInfo/index.jsx

@@ -222,9 +222,9 @@ class ChronicInfo extends React.Component{
     chronicMagItem&&this.handleAddAssessItem(v,pIndex,i);
   }
   handleReg(e){   //只能输入数字
-    const hasDot = e.target.value.indexOf('.')!=-1;
+    //const hasDot = e.target.value.indexOf('.')!=-1;
     const key = e.key;
-    if(key!='Backspace'&&((/[^\d]/.test(key)&&key!='.')||(key=='.'&&(hasDot||!e.target.value)))){
+    if(key!='Backspace'&&((/[^\d|.\/%*~]/.test(key)))){
       e.preventDefault();
     }
   }
@@ -233,10 +233,10 @@ class ChronicInfo extends React.Component{
     let obj = deepClone(calcuValues);
     let values = (obj&&obj[id])||deepClone(calcuContent);
     const txt = e.target.value;
-    values[i].value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.]/g,'');       //处理中文输入法的情况
+    values[i].value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.\/%*~]/g,'');       //处理中文输入法的情况
     obj[id] = values;
-    if(/[\u4e00-\u9fa5]|[^\d|.]/g.test(txt)){
-      e.target.value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.]/g,'');
+    if(/[\u4e00-\u9fa5]|[^\d|.\/%*~]/g.test(txt)){
+      e.target.value = txt.replace(/[\u4e00-\u9fa5]|[^\d|.\/%*~]/g,'');
     }
     this.setState({
       isCalculated:false,

+ 0 - 1
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -50,7 +50,6 @@ class HistoryCaseContainer extends React.Component {
       }else{
         tmpItems=items[idx]
       }
-      console.log(tmpItems)
       this.setState({
         activeId:idx,
         activeHis:tmpItems,

+ 8 - 5
src/components/MedicalInfo/index.jsx

@@ -10,7 +10,8 @@ class MedicalInfo extends Component {
         this.$cont = React.createRef();
         this.state={
           val:'',
-          hasSearch: false
+          hasSearch: false,
+          msg:''
         };
         this.search = this.search.bind(this);
         this.handleChange = this.handleChange.bind(this);
@@ -31,7 +32,8 @@ class MedicalInfo extends Component {
     search(){
       if(this.state.hasSearch === false) {
         this.setState({
-          hasSearch: true
+          hasSearch: true,
+          msg:'暂无搜索结果!'
         })
       }
       const {handleChangeValue} = this.props;
@@ -53,7 +55,8 @@ class MedicalInfo extends Component {
       this.$inp.current.value = '';
       this.setState({
         val:'',
-        hasSearch: false
+        hasSearch: false,
+        msg:''
       });
       clearResult&&clearResult();
   }
@@ -74,7 +77,7 @@ class MedicalInfo extends Component {
   }
     render() {
         const {searchResult} = this.props;
-        const {val, hasSearch} = this.state;
+        const {val, hasSearch,msg} = this.state;
         return (
             <div className={style['search-cont']} ref={this.$cont}>
               <div className={style['search-box']}>
@@ -90,7 +93,7 @@ class MedicalInfo extends Component {
                     <ul>
                       {this.getSearchList()}
                     </ul>
-              </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':'暂无搜索结果!'}</p>}
+              </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':msg}</p>}
              </div>
 
 

+ 3 - 1
src/components/MultSpread/index.jsx

@@ -198,7 +198,9 @@ class MultSpread extends Component{
     const {saveAddItem,fullData,copyId,showAdd} = this.props;
     if(showAdd){
       const data = tools.deepClone(fullData);
+    setTimeout(function(){        //修改个别历史病例引用报错bug
       saveAddItem&&saveAddItem(copyId,data);
+    })
     }
   }
   getContClass(){
@@ -218,7 +220,7 @@ class MultSpread extends Component{
                  ref = {this.$cont}
                  contentEditable={this.state.editable}
                  onBlur={this.handleEdit}
-                 onkeydown={tools.handleEnter}>
+                 onKeyDown={tools.handleEnter}>
       {textPrefix?<span>{textPrefix}</span>:''}
       <div className={this.getClass()}>
       {this.getLabels()}

+ 8 - 5
src/components/ScaleSearch/index.jsx

@@ -10,7 +10,8 @@ class ScaleSearch extends Component {
     this.$cont = React.createRef();
     this.state={
       val:'',
-      hasSearch: false
+      hasSearch: false,
+      msg:''
     };
     this.search = this.search.bind(this);
     this.handleChange = this.handleChange.bind(this);
@@ -46,7 +47,8 @@ class ScaleSearch extends Component {
   search(){
     if(this.state.hasSearch === false){
       this.setState({
-        hasSearch: true
+        hasSearch: true,
+        msg:'暂无搜索结果!'
       })
     }
     const {handleChangeValue} = this.props;
@@ -68,7 +70,8 @@ class ScaleSearch extends Component {
     this.$inp.current.value = '';
     this.setState({
       val:'',
-      hasSearch: false
+      hasSearch: false,
+      msg:''
     });
     clearResult&&clearResult();
   }
@@ -89,7 +92,7 @@ class ScaleSearch extends Component {
   }
   render() {
     const {searchResult} = this.props;
-    const {val, hasSearch} = this.state;
+    const {val, hasSearch,msg} = this.state;
     return (
         <div className={style['search-cont']} ref={this.$cont}>
           <div className={style['search-box']}>
@@ -105,7 +108,7 @@ class ScaleSearch extends Component {
             <ul>
               {this.getSearchList()}
             </ul>
-          </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':'暂无搜索结果!'}</p>}
+          </div>:<p className={style['no-data']}>{hasSearch?'搜索中...':msg}</p>}
         </div>
     )
 

+ 0 - 1
src/containers/CurrentIll.js

@@ -29,7 +29,6 @@ function mapStateToProps(state) {
         type: state.typeConfig.typeConfig,
         mainIds:mainSuit.mainIds,//主诉症状选中的id(去重用)
         mainTailIds:mainSuit.mainTailIds,//主诉症状选中的id(去重用)
-        showArr:homePage.showDrop,
         totalHide: homePage.totalHide,
         saveText:currentIll.saveText,
         selecteds:currentIll.selecteds,       //普通多选选中状态

+ 2 - 2
src/containers/MultSpread.js

@@ -58,9 +58,9 @@ function mapDispatchToProps(dispatch){
         num:1
       });
     },
-    saveAddItem(id,data){       //保存有加号的标签原始数据
+    saveAddItem(id,data){      //保存有加号的标签原始数据
       dispatch({
-        type: SETADDITEMINIT,
+        type:SETADDITEMINIT,
         id,
         data
       });

+ 0 - 1
src/containers/eleType.js

@@ -123,7 +123,6 @@ function multLabels(params){
                      ikey={boxMark+'-'+i}
                      selecteds={selecteds&&selecteds[i]}
                      saveText={saveText}
-                     /*name={data.name||data.tagName}*/
                      textPrefix={data.prefix}
                      textSuffix={data.suffix}></MultSpread>
 }

+ 2 - 2
src/modules/HomePage/index.jsx

@@ -62,9 +62,9 @@ class HomePage extends Component {
             {
               (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)?<EmergencyProcedure data={dataLis[this.state.idx]||dataLis[setPushEmergencyIdx]} idx={this.state.idx||setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>:null
             }
-            <div className={style['mask']} style={{display:flag?"block":"none"}}>
+          {flag?<div className={style['mask']}>
                 <img src={loading} className={style['load']}/>
-            </div>
+            </div>:""}
         </div>;
     }
 }

+ 5 - 2
src/store/actions/currentIll.js

@@ -727,7 +727,8 @@ export function insertLabelData(state,action){
   let id = data.id;
   let searchData = action.name;
   // res.symptomIds.push(id);
-  const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id});
+  // const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id});
+  const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id},{conceptId:conceptId});
   const textEmpty = Object.assign({},JSON.parse(config.textLabel));
   let focusIndex = res.focusIndex;
   let saveText = res.saveText;
@@ -908,7 +909,8 @@ export function removeId(state,action){
   let res = Object.assign({},state);
   const {index,text} = action;
   const data = res.data;
-  const id = data[index].id;
+  // const id = data[index].id;
+  const id = data[index].conceptId;
   let ids = res.symptomIds;
   if(ids.includes(id)){
     ids.splice(ids.indexOf(id),1);
@@ -918,6 +920,7 @@ export function removeId(state,action){
     res.saveText.splice(index,1);
   }else{
     data[index].id = "";
+    data[index].conceptId = "";
     data[index].name = text;
     data[index].value = text;
   }

+ 20 - 15
src/store/actions/mainSuit.js

@@ -345,6 +345,7 @@ export const setSearch = (state,action)=>{
   let searchData = action.data;
   res.searchDatas = searchData;
   res.searchStr = action.inpStr;
+  res.isEnd = action.isEnd;
   return res;
 }
 
@@ -406,25 +407,29 @@ export const insertSearch = (state,action)=>{
     
     // 从新插入一个span标签
     const searchStr = res.searchStr;
+    const isEnd = res.isEnd;
     let innerText = span.current.innerText || span.current.innerHTML;
-    const value = innerText.replace(searchStr,"");
-    let index = innerText.indexOf(searchStr);
-    if(index < 1){//前
-      if(data[focusIndex].value==searchStr){//为空标签则替换
+    if(!isEnd){//前
+      const reg = new RegExp("^"+searchStr)
+      const value = innerText.replace(reg,"");
+      res.data.splice(focusIndex,0,nText);
+      res.saveText.splice(focusIndex,0,searchData);
+      res.data[focusIndex+1].value = value;
+      res.saveText[focusIndex+1] = value;
+      span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value); 
+    }else{
+      const reg = new RegExp(searchStr+"$")
+      const value = innerText.replace(reg,"");
+      if(data[focusIndex].value.trim()==searchStr){//为空标签则替换-否则会多一个空标签
         res.data.splice(focusIndex,1,nText);
         res.saveText.splice(focusIndex,1,searchData);
       }else{
-        res.data.splice(focusIndex,0,nText);
-        res.saveText.splice(focusIndex,0,searchData);
-        res.data[focusIndex+1].value = value;
-        res.saveText[focusIndex+1] = value;
-      }  
-    }else{
-      res.data.splice(focusIndex+1,0,nText);
-      res.saveText.splice(focusIndex+1,0,searchData);
-      res.data[focusIndex].value = value;
-    }
-    span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
+        res.data.splice(focusIndex+1,0,nText);
+        res.saveText.splice(focusIndex+1,0,searchData);
+        res.data[focusIndex].value = value;
+      }
+      span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
+    } 
     res.mainIds.push(ids);
     if(id){
       res.mainTailIds.push(id);

+ 3 - 1
src/store/async-actions/pushMessage.js

@@ -7,6 +7,7 @@ import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
 import dataLis from '@components/EmergencyProcedure/emergency';
 import { Notify} from '@commonComp';
 import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
+import {tabChange} from '@store/actions/tabTemplate';
 const api={
   push:'/push/pushInner',
   getTableList:'/scale/getList', //获取量表列表
@@ -137,7 +138,8 @@ export const getConceptDetail = (item) => {
 
         json(api.getConceptDetail, params).then((res) => {
             if(res.data.code == '0'&& res.data.data.details && res.data.data.details.length > 0) {
-                if(item.position == '1') {  //右侧提示信息
+              dispatch(tabChange(0));     //tab跳回推送
+              if(item.position == '1') {  //右侧提示信息
                     dispatch({
                         type: SET_CLICK_DIAG,
                         clickDiag: item

+ 4 - 2
src/store/reducers/assessResult.js

@@ -97,8 +97,10 @@ export default (state=init,action)=>{
           });
           return subInx!=-1;
         });
-        const trueInx = res.wholeIndexs[inx].findIndex((i)=>i==subInx);
-        res.wholeIndexs[inx].splice(trueInx,1);
+        if(inx!=-1){
+          const trueInx = inx!=-1&&res.wholeIndexs[inx].findIndex((i)=>i==subInx);
+          res.wholeIndexs[inx].splice(trueInx,1);
+        }
       }else{
         res.addedScaleIds.push(action.id);
       }