瀏覽代碼

Merge branch 'dev/new1' into dev/byll

Luolei 6 年之前
父節點
當前提交
1861896d2a
共有 50 個文件被更改,包括 471 次插入190 次删除
  1. 1 1
      src/common/components/Notify/index.less
  2. 4 3
      src/common/components/NumberPan/index.jsx
  3. 20 0
      src/common/components/NumberPan/index.less
  4. 2 2
      src/common/components/TailInlineTag/index.jsx
  5. 11 1
      src/common/components/Textarea/index.jsx
  6. 20 14
      src/common/js/func.js
  7. 23 9
      src/components/CheckBody/index.jsx
  8. 1 1
      src/components/CopyRight/index.jsx
  9. 3 3
      src/components/CurrentIll/index.jsx
  10. 3 2
      src/components/DiagnosticList/index.jsx
  11. 1 0
      src/components/DiagnosticList/index.less
  12. 12 6
      src/components/Inspect/index.jsx
  13. 1 0
      src/components/Inspect/index.less
  14. 3 2
      src/components/MainSuit/index.jsx
  15. 1 0
      src/components/MultSpread/index.jsx
  16. 3 2
      src/components/NumberDrop/index.jsx
  17. 6 6
      src/components/PushItems/index.jsx
  18. 2 2
      src/components/RadioDrop/index.jsx
  19. 1 1
      src/components/SpreadDrop/index.jsx
  20. 2 1
      src/config/index.js
  21. 1 0
      src/containers/CheckBody.js
  22. 4 1
      src/containers/CurrentIll.js
  23. 5 2
      src/containers/MainSuit.js
  24. 2 2
      src/containers/Multiple.js
  25. 14 8
      src/containers/SpreadDrop.js
  26. 3 2
      src/containers/eleType.js
  27. 52 8
      src/store/actions/checkBody.js
  28. 95 29
      src/store/actions/currentIll.js
  29. 21 11
      src/store/actions/mainSuit.js
  30. 57 7
      src/store/actions/otherHistory.js
  31. 1 1
      src/store/async-actions/assistCheck.js
  32. 2 2
      src/store/async-actions/copyRight.js
  33. 1 1
      src/store/async-actions/diagnosticSearch.js
  34. 10 10
      src/store/async-actions/fetchModules.js
  35. 1 1
      src/store/async-actions/getInfoByUuid.js
  36. 1 1
      src/store/async-actions/historyTemplates.js
  37. 11 4
      src/store/async-actions/homePage.js
  38. 2 2
      src/store/async-actions/inspect.js
  39. 2 2
      src/store/async-actions/mainSuit.js
  40. 4 4
      src/store/async-actions/patInfo.js
  41. 2 2
      src/store/async-actions/print.js
  42. 4 4
      src/store/async-actions/pushMessage.js
  43. 5 5
      src/store/async-actions/tabTemplate.js
  44. 5 5
      src/store/async-actions/treat.js
  45. 6 2
      src/store/reducers/homePage.js
  46. 1 1
      src/store/reducers/inspect.js
  47. 2 1
      src/store/types/homePage.js
  48. 16 8
      src/utils/ajax.js
  49. 2 1
      src/utils/config.js
  50. 19 7
      src/utils/tools.js

+ 1 - 1
src/common/components/Notify/index.less

@@ -27,7 +27,7 @@
 .notify-text {
   min-width: 224px;
   height: 70px;
-  
+  padding:  0 40px 0 0;
   // overflow: hidden;
   position: relative;
   left: 66px;

+ 4 - 3
src/common/components/NumberPan/index.jsx

@@ -1,6 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import ReactDom from "react-dom";
+import backspace from '../../images/backspace.png'
 
 class NumberPan extends Component{
   constructor(props){
@@ -74,19 +75,19 @@ class NumberPan extends Component{
           <td><button onClick={select}>4</button></td>
           <td><button onClick={select}>5</button></td>
           <td><button onClick={select}>6</button></td>
-          <td><button onClick={this.handleBack.bind(this)}>回退</button></td>
+          <td><button onClick={this.handleBack.bind(this)}><img src={backspace} onClick={this.handleBack.bind(this)} /></button></td>
         </tr>
         <tr>
           <td><button onClick={select}>7</button></td>
           <td><button onClick={select}>8</button></td>
           <td><button onClick={select}>9</button></td>
-          <td><button onClick={this.handleClear.bind(this)}>清空</button></td>
+          <td><button onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</button></td>
         </tr>
         <tr>
           <td><button onClick={select}>.</button></td>
           <td><button onClick={select}>0</button></td>
           <td><button onClick={select}>~</button></td>
-          <td><button onClick={this.handleClose.bind(this)}>确定</button></td>
+          <td><button onClick={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
         </tr>
       </table>
       </div>

+ 20 - 0
src/common/components/NumberPan/index.less

@@ -21,4 +21,24 @@
   button:hover{
     border-color: @blue;
   }
+  .confirm{
+    color: #3B9ED0;
+    font-weight: bold;
+    text-align: center;
+    padding-left: 14px;
+    font-size: 14px;
+    line-height: normal;
+  }
+  .imgN{
+    text-align: right;
+    vertical-align: middle;
+    padding-right: 8px;
+    cursor: pointer;
+  }
+  .clearN{
+    color:#F6514A;
+    text-align: center;
+    padding-left: 8px;
+    font-weight: bold;
+  }
 }

+ 2 - 2
src/common/components/TailInlineTag/index.jsx

@@ -19,8 +19,8 @@ class TailInlineTag extends Component {
 
   handleClick(e){
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
-    const {handleTailClick,questionMapping,id} = this.props;
-    handleTailClick && handleTailClick({questionMapping,id});
+    const {handleTailClick,questionMapping,id,relationModule} = this.props;
+    handleTailClick && handleTailClick({questionMapping,id,relationModule});
   }
 
   render(){

+ 11 - 1
src/common/components/Textarea/index.jsx

@@ -18,6 +18,7 @@ class Textarea extends Component {
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
+    this.handleKeydown = this.handleKeydown.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput} = this.props;
@@ -98,6 +99,14 @@ class Textarea extends Component {
     //存值到store
     handleInput&&handleInput({text});
   }
+  handleKeydown(e){
+    const {boxMark} = this.props;
+    const ev = e||window.event;
+    if(+boxMark==1){
+      //禁止回车事件
+      if(ev.keyCode==13){return false;}
+    }
+  }
   render() {
     const { title } = this.props;
     return (
@@ -109,7 +118,8 @@ class Textarea extends Component {
              ref={this.$dom}
              contentEditable={true}
              onInput={this.handleInput}
-             onBlur={this.handleBlur}>
+             onBlur={this.handleBlur}
+             onkeydown={this.handleKeydown}>
         </div>
       </div>
     );

+ 20 - 14
src/common/js/func.js

@@ -82,7 +82,8 @@ function notTextLabel(label){
 * 入参:arr源数组,
 *       noPre是否不添加前置文本标签,默认false即添加
 *       noEnd是否不添加后置文本标签,默认false即添加
-*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体
+*       ifEmpty是否添加空标签,默认true即添加,传false添加逗号,如查体,
+*       showInCheck是否默认在查体中展开
 * */
 export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
   let newArr =[],
@@ -92,19 +93,22 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       notText = true,
       saveText=[],
       tempText = '',
-      value = '';
+      value = '',
+      item={},
+      checkHiddenDefault=false;
   arr.map((it,i)=>{
     notText = notTextLabel(it);
     value = it.value||'';
-    textLabel = JSON.parse(config.textLabel);
-    _textLabel = JSON.parse(config._textLabel);
+    textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);
+    _textLabel = !ifEmpty&&i<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
         newArr.push(textLabel);
         saveText.push('');
       }
-      newArr.push(it);
+      item = ifEmpty?it:Object.assign({},it,{showInCheck:true});
+      newArr.push(item);
       if(it.tagType != 3){
         tempText = value?it.labelPrefix+value+it.labelSuffix:'';
         tempText = notText?tempText:it.value||it.name;
@@ -114,23 +118,25 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       saveText.push(tempText);
     }else{
       pre = arr[i-1];
+      item = !ifEmpty&&i<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
+      //判断单选项是否有默认选中,位置在隐藏区域时,查体所有标签展示
+      if(!ifEmpty&&!checkHiddenDefault&&i>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
+        if(it.questionDetailList.find((it)=>it.defaultSelect=='1')){
+          checkHiddenDefault=true;
+        }
+      }
       //如果本身不是文本标签且前面一个也不是文本标签,该标签前面添加文本标签
       if(notTextLabel(pre)&&notText){
           // newArr.push(textLabel,it);
-          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
+          ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,item);
           if(it.tagType != 3) {
             tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           }else{
             tempText = getSaveText(it);
           }
-          saveText.push("",tempText); 
-        //最后一个非文本标签,后面添加一个文本标签
-        /*if(!noEnd&&i===arr.length-1){
-          newArr.push(textLabel);
-          saveText.push("");
-        }*/
+          saveText.push("",tempText);
       }else{    //本身是或者前面是文本标签时,前面不添加文本标签
-        newArr.push(it);
+        newArr.push(item);
         if(it.tagType != 3) {
           tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
           // tempText = notText?tempText:it.value||it.name;
@@ -147,7 +153,7 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       }
     }
   });
-  return {newArr,saveText};
+  return {newArr,saveText,checkHiddenDefault};
 };
 
 

+ 23 - 9
src/components/CheckBody/index.jsx

@@ -31,15 +31,25 @@ class CheckBody extends Component{
   }
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
-    let arr = [],list=[];
-    const {boxMark,showAll} = this.state;
-    const showData = showAll?[...data]:[...data].splice(0,config.showCheckNum*2+1);
+    let arr = [],list=[];//console.log(data,saveText)
+    const {boxMark,showAll} = this.state;//console.log(data)
+    const moreNum =data.length-[...data].reverse().findIndex((it)=>it.showInCheck)-1;//被隐藏的位置
+    //console.log(moreNum,this.props.defaultShowAll,showAll);
+    const moreText = filterDataArr([...saveText].splice(moreNum));      //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
+    const more = this.props.defaultShowAll||showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
+    const showMoreBtn = data.length>moreNum&&!moreText;
+    let showArray = data.filter((it)=>{
+      if(it.showInCheck)
+        return it;
+    });
+    const showData = moreText||this.props.defaultShowAll||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
         return chooseType({item:it,boxMark,i,showArr,saveText,selecteds});
       });
     }
+    showMoreBtn&&arr.push(more);      //是否显示收起展开按钮
     return arr;
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
@@ -89,6 +99,14 @@ class CheckBody extends Component{
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
     if(hasMain&&isEmpty!=false){
       this.props.getInit();
+      //隐藏区域有默认选中项,默认全部展开-有延迟,弃用
+      /*const that = this;
+      setTimeout(function(){
+        that.props.showAll&&that.setState({
+          showAll:true
+        });
+      },900)*/
+
     }
   }
   showHide(){
@@ -105,15 +123,11 @@ class CheckBody extends Component{
   }
   render(){
     const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
-    const {showAll} = this.state;
-    const moreNum =config.showCheckNum*2+1;
-    const moreText = filterDataArr([...saveText].splice(moreNum));
-    const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
-    const showMoreBtn = data.length>moreNum&&!moreText;
+
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}
-        {showMoreBtn?more:''}
+        {/*{showMoreBtn?more:''}*/}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
     </div>

+ 1 - 1
src/components/CopyRight/index.jsx

@@ -59,7 +59,7 @@ class CopyRight extends Component {
   render() {
     const { number, date, content, copyVisible, disVisible, disContent, hasNewVersion } = this.props.copyRight;
     const { showCopyModal, closeCopyModal, showDisclatmerModal, closeDisclatmerModal } = this;
-    const copyContent = content.map(item => {
+    const copyContent = content&&content.map(item => {
       return (
         <div className={style['message']}>
           {item.title}

+ 3 - 3
src/components/CurrentIll/index.jsx

@@ -128,12 +128,12 @@ class CurrentIll extends Component{
   }
 
   getInlineTag(){  
-    const {data,showArr,selecteds,processModuleName,saveText,insertProcess,symptomIds} = this.props;
+    const {data,showArr,selecteds,processModuleName,saveText,insertProcess,symptomIds,allModules} = this.props;
     const boxMark = '2';
 
     let list = data&&data.map((item,i)=>{
-      if(item.relationModule && item.relationModule==3){
-        return <TailInlineTag {...item} showText={processModuleName} handleTailClick={(obj)=>{insertProcess(obj)}}></TailInlineTag>
+      if(item.flag && item.flag==3){
+        return <TailInlineTag {...item} showText={item.relationModuleName} handleTailClick={(obj)=>{insertProcess(obj,allModules)}}></TailInlineTag>
       }else {
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds:symptomIds});
       }

+ 3 - 2
src/components/DiagnosticList/index.jsx

@@ -63,7 +63,7 @@ class DiagnosticList extends Component {
         })
     }
     showTreat(item, index) {
-        item.treatIndex = index
+        // item.treatIndex = index
         const  { showTreat, getTreatResult } = this.props;
         getTreatResult && getTreatResult(item);
         showTreat && showTreat();
@@ -92,7 +92,8 @@ class DiagnosticList extends Component {
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
-                                          style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray'}}
+                                        //   style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray', cursor: hasTreat ? '' : 'text'}}
+                                          style ={hasTreat ? '' : { color: 'gray', border: '1px solid gray', cursor: 'auto'}}
                                           onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>

+ 1 - 0
src/components/DiagnosticList/index.less

@@ -101,4 +101,5 @@
 .diag-up, .diag-down, .diag-del {
     width: 20px;
     margin-bottom: 4px;
+    cursor: pointer;
 }

+ 12 - 6
src/components/Inspect/index.jsx

@@ -6,8 +6,8 @@ import { getExcelList } from '@store/actions/inspect';
 import Notify from '@commonComp/Notify';
 import store from '@store';
 import $ from 'jquery';
-import { host } from '@utils/config.js';
-import {isIE} from '@utils/tools.js';
+import { host,prefix } from '@utils/config.js';
+import {isIE,getUrlArgObject} from '@utils/tools.js';
 
 
 (function ($) {
@@ -27,9 +27,9 @@ import {isIE} from '@utils/tools.js';
 import "./dists/FileAPI.js";
 
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host:'';
+const qhost = isLocal?host+prefix:prefix;
 const api = {
-    upload: qhost+'/api/icss/lisExcelRes/lisExcelAnalysis'
+    upload: qhost+'/lisExcelRes/lisExcelAnalysis'
 };
 
 class Inspect extends React.Component {
@@ -78,13 +78,19 @@ class Inspect extends React.Component {
             },
             function (files, rejected){
                 if( files.length ){
-                    console.log(files[0])
+                    //console.log(files[0])
+                  const securityCode = getUrlArgObject("code");
+                  const appKeyId = getUrlArgObject("appI");
+                  const appKeySecret = getUrlArgObject("appS");
                     FileAPI.upload({
                         // url: '/api/icss/lisExcelRes/lisExcelAnalysis',
                         url: api.upload,
                         data:{ hospitalCode:baseData == '{}'? '' : baseData.hospitalCode },
                         files: { uploadfile: files[0] },
                         headers:{
+                          appKeyId:appKeyId,
+                          appKeySecret:appKeySecret,
+                          securityCode:securityCode
                             // 'Content-Type':'Content-Type: multipart/form-data'
                             // 'Content-Type':'application/json;charset=UTF-8'
                             // 'Content-type': "text/plain"
@@ -97,7 +103,7 @@ class Inspect extends React.Component {
                                 let message = res.data.messages;
                                 store.dispatch(getExcelList(res.data));
                                 fetchPushInfos&&fetchPushInfos();
-                                if (message.length != 0) {
+                                if (message&&message.length != 0) {
                                     that.setState({
                                         visible:true,
                                         dom:message,

+ 1 - 0
src/components/Inspect/index.less

@@ -40,6 +40,7 @@
         line-height: 28px;
         border-radius: 5px;
         color: @template-color;
+        cursor: pointer;
     }
 }
 .title {

+ 3 - 2
src/components/MainSuit/index.jsx

@@ -49,11 +49,12 @@ class MainSuit extends Component{
 
 
   getInlineTag(){
-    const {datas,showArr,handleTailClick,selecteds,saveText,addModuleName,mainIds} = this.props;
+    const {datas,showArr,handleTailClick,selecteds,saveText,addModuleName,mainIds,allModules} = this.props;
     const boxMark = '1';
     let list = datas&&datas.map((item,i)=>{
       if(item.flag && item.flag==3){
-        return <TailInlineTag {...item} showText={addModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText)}}></TailInlineTag>
+        /*return <TailInlineTag {...item} showText={addModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText)}}></TailInlineTag>*/
+        return <TailInlineTag {...item} showText={item.relationModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText,allModules)}}></TailInlineTag>
       }else {
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds});
       }

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

@@ -54,6 +54,7 @@ class MultSpread extends Component{
         case +it.controlType===1:
           const list = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
           return <RadioDrop data={list}
+                            boxMark={boxMark}
                             prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}

+ 3 - 2
src/components/NumberDrop/index.jsx

@@ -77,7 +77,7 @@ class NumberDrop extends Component{
   }
   beyondArea(){
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
-    Notify.info("数值在正常值范围内,请重新输入");
+    Notify.info("输入数值不在合理值范围内,请重新输入!");
     handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
     this.setState({
       placeholder:this.props.placeholder,
@@ -97,7 +97,6 @@ class NumberDrop extends Component{
   }
   handleNumClick(e){     //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    this.$span.current.focus();
     if(show) {
       handleHide && handleHide();
       return;
@@ -111,6 +110,7 @@ class NumberDrop extends Component{
       clearTimeout(that.state.timer);
       const timer = setTimeout(function(){
         //只有弹窗关闭则点击数字键盘会清空当前数据
+        that.$span.current.focus();
         that.setState({
           hasSelect:false
         });
@@ -138,6 +138,7 @@ class NumberDrop extends Component{
     if(show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
+    //输入超出合理范围提示且清空
     const txt = e.target.innerText.replace(/^\s*/,'');
     if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
       this.beyondArea();

+ 6 - 6
src/components/PushItems/index.jsx

@@ -170,7 +170,7 @@ class PushItems extends Component {
       assayNum = assayNum + item.name.length + 2;
       if (assayNum > 28) {
         assayNum2 = assayNum2 + item.name.length + 2; 
-        if(assayNum2 > 23) {
+        if(assayNum2 > 21) {
           return;
         } else {
           return (
@@ -222,7 +222,7 @@ class PushItems extends Component {
       checkNum = checkNum + item.name.length + 2;
       if (checkNum > 28) {
         checkNum2 = checkNum2 + item.name.length + 2; 
-        if(checkNum2 > 23) {
+        if(checkNum2 > 21) {
           return;
         }else {
           return (
@@ -344,7 +344,7 @@ class PushItems extends Component {
                           : moreAssay
                           ? assays
                           : assayHide}
-                        {assayNum2 > 23 ? (
+                        {assayNum2 > 21 ? (
                           <span
                             style={
                               moreAssay
@@ -382,7 +382,7 @@ class PushItems extends Component {
                           : moreCheck
                           ? checks
                           : checkHide}
-                        {checkNum2 > 23 ? (
+                        {checkNum2 > 21 ? (
                           <span
                             style={
                               moreCheck
@@ -450,7 +450,7 @@ class PushItems extends Component {
                               />
                               {item.isReason === 1 && (
                                 <div className={style["warn"]}>
-                                  {tipsDiscalimer.data.data[0].description}
+                                  {tipsDiscalimer.data.data[0]&&tipsDiscalimer.data.data[0].description}
                                 </div>
                               )}
                             </div>
@@ -465,7 +465,7 @@ class PushItems extends Component {
             </div>
           </div>
         </div>
-        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1].description}}></div>}
+        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1]&&tipsDiscalimer.data.data[1].description}}></div>}
         {showTipsDetails && <DetailsModal  
             showTipsDetails = {showTipsDetails}
             hideTips = {this.hideTips}

+ 2 - 2
src/components/RadioDrop/index.jsx

@@ -99,14 +99,14 @@ class RadioDrop extends Component{
     },$("#addScrollEvent")[0])
   }
   componentDidMount(){    //默认值选中
-    const {data,ikey,handleSelect,hideTag} = this.props;
+    const {data,ikey,handleSelect,hideTag,mainSaveText,value} = this.props;
     const selected = data.find((it)=>{
       return it.selected === undefined&&+it.defaultSelect===1;
     });
     if(!hideTag&&selected){
       // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
       const text = selected.name;
-      handleSelect&&handleSelect({ikey,id:selected.id,text});
+      handleSelect&&handleSelect({ikey,id:selected.id,text,mainSaveText,value});
     }
   }
   handleEditLabel(e){

+ 1 - 1
src/components/SpreadDrop/index.jsx

@@ -228,7 +228,7 @@ class SpreadDrop extends Component{
       const tIndex= exists.findIndex((it)=>it.questionId===item.questionId);
       const bIndex= withs.findIndex((it)=>it.questionId===item.questionId);
       if(tIndex!=-1){
-        exists.splice(tIndex,1,item);
+        exists.splice(tIndex,1,Object.assign({},item,{name}));    //修改单选列连接字符不显示bug
         this.setState({
           exists,
         })

+ 2 - 1
src/config/index.js

@@ -44,5 +44,6 @@ export default {
     },
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
-    Params
+    textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
+  Params
 };

+ 1 - 0
src/containers/CheckBody.js

@@ -11,6 +11,7 @@ function mapStateToProps(state){
   const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
   return {
     data:checkBody.data,
+    defaultShowAll:checkBody.showAll,
     isEmpty:checkBody.isEmpty,
     update:checkBody.update,   //用于触发更新
     showArr:homePage.showDrop,

+ 4 - 1
src/containers/CurrentIll.js

@@ -41,6 +41,7 @@ function mapStateToProps(state) { //console.log(111,state);
         fuzhen:state.diagnosticList.mainSuitStr,//诊断第一个复诊值
         boxTop:state.homePage.boxTop,
         boxLeft:state.homePage.boxLeft,
+        allModules:state.homePage.allModules,
 
     }
 }
@@ -48,7 +49,7 @@ function mapStateToProps(state) { //console.log(111,state);
 
 function mapDispatchToProps(dispatch) {
     return {
-       insertProcess(obj){//点击病程变化
+       insertProcess(obj,allModules){//点击病程变化
         // 埋点dispatch
         dispatch({
           type:CLICKCOUNT,
@@ -58,6 +59,8 @@ function mapDispatchToProps(dispatch) {
         });
         dispatch({
           type:INSERT_PROCESS,
+          id:obj.relationModule,
+          allModules:allModules
         });
         dispatch({
           type:ISREAD

+ 5 - 2
src/containers/MainSuit.js

@@ -37,6 +37,7 @@ function mapStateToProps(state) {//console.log(11,state);
     boxTop:state.homePage.boxTop,
     boxLeft:state.homePage.boxLeft,
     currentData:state.currentIll.data,
+    allModules:state.homePage.allModules,
   }
 }
 
@@ -55,7 +56,7 @@ function mapDispatchToProps(dispatch) {
             type: CLEAR_COMSYMPTOMS
           })
         },
-        handleTailClick:(obj,saveText)=>{//点击带尾巴的标签,如添加病程变化
+        handleTailClick:(obj,saveText,allModules)=>{//点击带尾巴的标签,如添加病程变化
           let text = filterDataArr(saveText);
           if(text.length >= config.limited){
             Notify.info(config.limitText);
@@ -70,7 +71,9 @@ function mapDispatchToProps(dispatch) {
           });
           dispatch({
             type: SHOW_TAIL,
-            info:obj.questionMapping
+            info:obj.questionMapping,
+            id:obj.relationModule,
+            allModules:allModules
           })
           dispatch({
             type:ISREAD

+ 2 - 2
src/containers/Multiple.js

@@ -32,7 +32,7 @@ function handleCurrent(dispatch,params){
   const index = getLabelIndex(ikey);
   dispatch({
     type:CURRENT_MUL,
-    data:{seleData,seleId,ikey:index}
+    data:{seleData,seleId,ikey:index,fullIkey:ikey}
   })
 }
 
@@ -41,7 +41,7 @@ function handleOtherHis(dispatch,params){
   const index = getLabelIndex(ikey);
   dispatch({
     type:OTHERHIS_MUL,
-    data:{seleData,seleId,ikey:index}
+    data:{seleData,seleId,ikey:index,fullIkey:ikey}
   })
 }
 

+ 14 - 8
src/containers/SpreadDrop.js

@@ -136,7 +136,7 @@ function currentIll(dispatch,store,params){
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   // const ids = existsId.join(",")+withsId.join(",");
-  const ids = (existsId.concat(withsId)).join(",");console.log("点击的下标是:",index,"选中的id是:",ids)
+  const ids = (existsId.concat(withsId)).join(",");
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -292,8 +292,10 @@ function handleModuleDiff(dispatch,store,params){
 
 //主诉普通多选确定
 function mainSuitCheck(dispatch,store,params){
-  const {nones,exists,withs,order,mainSaveText,value} = params;
+  const {nones,exists,withs,order,mainSaveText,value,ikey} = params;
   let existsName = getNames(exists,order);
+  let withsName = getNames(withs);
+  let labelInx = getLabelIndex(ikey);
   let text = filterDataArr(mainSaveText);
   /*if(text.length >= config.limited){
     Notify.info(config.limitText);
@@ -305,11 +307,12 @@ function mainSuitCheck(dispatch,store,params){
     Notify.info(config.limitText);
     return
   }
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
+  // const index = params.ikey;
+  // let ikey = getLabelIndex(index);
   dispatch({
     type: COMM_CONFIRM,
-    data: {exists:exists,existsName:existsName,ikey}
+    // data: {exists:exists,existsName:existsName,ikey}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   });
   dispatch({//隐藏下拉
     type:HIDEDROP
@@ -324,7 +327,8 @@ function currentCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETMAINCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 
@@ -337,7 +341,8 @@ function checkBodyCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 //其他史普通多选确定
@@ -348,7 +353,8 @@ function otherHisCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   dispatch({
     type:SETOTHERCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
 }
 

+ 3 - 2
src/containers/eleType.js

@@ -19,14 +19,15 @@ import Multiple from '@containers/Multiple';
  * *******/
 //单选类型
 export function singleRadio(params){
-  const data = params.item;//console.log(111,data);
+  const data = params.item;
   const {i,hideTag,boxMark,showArr,selecteds,boxTop,boxLeft} = params;
   const showInx = boxMark+i+'0';    //单括号多标签的情况下需要识别同一个标签内多个下拉组件的显示状态
   switch (+data.controlType){
     case 0:
     case 1:
+      const custom= JSON.parse(localStorage.getItem('radio'+data.id));
       const list = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
-      return <RadioDrop data={list}
+      return <RadioDrop data={custom&&custom.length?[...custom,...list]:list}
                         prefix={data.labelPrefix}
                         suffix={data.labelSuffix}
                         placeholder={data.name}

+ 52 - 8
src/store/actions/checkBody.js

@@ -4,8 +4,10 @@ import {getLabelIndex,fullfillText} from '@common/js/func.js';
 export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
-  res.data = [...data];
-  res.saveText = fullfillText(res.data).saveText;//存逗号
+  const obj = fullfillText(data,false,false,false);
+  res.data = obj.newArr;
+  res.saveText = obj.saveText;//存逗号
+  res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();
   res.isEmpty = action.isEmpty;
   return res;
@@ -103,7 +105,11 @@ export function setRadioValue(state,action){
   }
   if(+item.tagType===1){      //独立单选组件
     item.value = text;
-    res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -111,6 +117,7 @@ export function setRadioValue(state,action){
         its.selected = false;
       }
     });
+    res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
   }else{      //组合组件中的单选组件
     item.questionMapping[subInx].value = text;
     let hasValue = false;
@@ -203,7 +210,7 @@ export const setRadioInputValue = (state,action)=>{
 export function addLabelItem(state,action){
   let res = Object.assign({},state);
   const {data,i} = action;
-  const textLabel = JSON.parse(config.textLabel);
+  const textLabel = Object.assign({},JSON.parse(config._textLabel),{showInCheck:JSON.parse(data).showInCheck});
   //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
   if(!data) return res;
   res.data.splice(+i+2,0,JSON.parse(data),textLabel);
@@ -228,8 +235,8 @@ export function setCheckText(state,action) {
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
@@ -254,11 +261,17 @@ export function setSearchData(state,action){
 //插入标签数据-搜索
 export function insertLabelData(state,action){
   let res = Object.assign({},state);
-  const text = Object.assign({},JSON.parse(config.textLabel));
   const searchStr = res.searchStr;
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  let tempLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  //查体中,默认显示区域搜索出来的标签要默认显示,隐藏区域搜索出的默认隐藏
+  let hideAreaIndex = [...res.data].reverse().findIndex((it)=>it.showInCheck);
+  hideAreaIndex = res.data.length-hideAreaIndex-1;        //默认显示的最后一个标签的位置
+  const text = Object.assign({},JSON.parse(config._textLabel),{showInCheck:index>hideAreaIndex?false:true});
+  let spreadLabels =tempLabels.map((it)=>{
+    return Object.assign({},it,{showInCheck:index>hideAreaIndex?false:true});
+  });
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||'';
   if(!isReplace){
@@ -308,6 +321,33 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   if(labText && labText.trim()){
     if(item){
       item.value = newVal;
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+        //取消原选中状态
+        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+      }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       // res.saveText[index] = totalVal;
@@ -323,6 +363,10 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
+
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);

+ 95 - 29
src/store/actions/currentIll.js

@@ -1,5 +1,6 @@
 import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
 import config from '@config/index.js';
+import {getInitModules} from '@store/async-actions/homePage.js';
 
 //插入病程变化模板
 function insertPro(data,processModule){
@@ -38,12 +39,23 @@ export const setModule = (state,action)=>{
 //插入病程变化
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
-  const processModule = JSON.parse(JSON.stringify(res.processModule));
+  const sonId = action.id;//子模板id
+  // const processModule = JSON.parse(JSON.stringify(res.processModule));
+  let addSmoduleData;
+  // let allModules = JSON.parse(localStorage.getItem('modules'));
+  let allModules = action.allModules;
+  for(let k=0; k<allModules.length; k++){
+    if(allModules[k].id==sonId){
+      addSmoduleData = JSON.parse(JSON.stringify(allModules[k].moduleDetailDTOList));
+    }
+  }
   let data = res.data;
-  res.data = insertPro(data,processModule);
+  let newData = insertPro(data,addSmoduleData);
+  res.data = fullfillText(newData).newArr;
   res.saveText = fullfillText(res.data).saveText;
   res.update=Math.random();
   return res;
+
 }
 
 
@@ -63,12 +75,10 @@ export const setData = (state,action) =>{
   res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
   const symptomFeature = action.info.symptomFeature;//分词
-  // const useEmpty = action.info.useEmpty;
   let useEmpty,mainData;
-  // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
-  let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
+  // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
@@ -102,7 +112,7 @@ export const setData = (state,action) =>{
     })
     useEmpty = existData&&existData.length>0?false:true;
   }
-  // console.log(888,useEmpty);
+  
   if (useEmpty) {
     // res.data = res.emptyData;
     res.data = JSON.parse(JSON.stringify(res.emptyData));
@@ -137,12 +147,8 @@ export const setData = (state,action) =>{
       // 主症状添加tongYong标签选中文字
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let mainCopy = JSON.parse(JSON.stringify(main));
-      /*if(tongYText){
-        for(let j=0; j<mainCopy.length; j++){
-          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
-          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
-        }
-      }*/
+      let manInput = [];
+      // 去掉主诉添加的顿号 
       for(let j=0; j<mainCopy.length; j++){
         if(tongYText){
           mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
@@ -150,11 +156,18 @@ export const setData = (state,action) =>{
         }else{
           mainCopy[j].name = (mainCopy[j].name).replace('、',"");
           mainCopy[j].value = (mainCopy[j].value).replace('、',"");
+        }  
+        //查询是否有手动输入--输入的内容放到最后(3-27)
+        if(mainCopy[j].name != mainCopy[j].value){
+          const inputText = mainCopy[j].value.replace(mainCopy[j].name,"");
+          const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+          if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+             manInput.push(textObj);
+          }
+          mainCopy[j].value = mainCopy[j].name;
         }
-        
       }
 
-
        // 将ids接口获取到的模板匹配到对应主症状后面
       // 主症状
       let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
@@ -193,15 +206,20 @@ export const setData = (state,action) =>{
       }
       // 伴随
       // 去掉顿号
-     /* for(let b=0; b<withs.length; b++){
-        withs[b].name = withs[b].name.replace('、',"");
-      }*/
-      // let newWiths = JSON.parse(JSON.stringify(withs));
       let newWiths = [];
+      let manWithInput = [];
       if(withs.length>0){
         for(let b=0; b<withs.length; b++){
           withs[b].name = withs[b].name.replace('、',"");
           withs[b].value = withs[b].value.replace('、',"");
+          if(withs[b].name != withs[b].value){
+            const inputText = withs[b].value.replace(withs[b].name,"");
+            const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+            if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+              manWithInput.push(textObj);
+            }           
+            withs[b].value = withs[b].name;  
+          }
         }
         newWiths = JSON.parse(JSON.stringify(withs));
         let withInd = 0;
@@ -237,7 +255,7 @@ export const setData = (state,action) =>{
         }
       }
       
-      let symptomArr = newMainCopy.concat(newWiths);
+      let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
       let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       let insertIdx = null;
@@ -363,16 +381,15 @@ export const confirm = (state,action) =>{
 //普通多选确定事件-主诉通用特征、初为后为等
 export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
-  const {exists,labelInx,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[labelInx].value = names;
-  res.saveText[labelInx] = names;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;
@@ -427,6 +444,11 @@ export function setRadioValue(state,action){
   if(+item.tagType===1){
     item.value = text;
     res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -519,6 +541,33 @@ export const changeLabelVal = (state,action)=>{
   if(labText.trim()){
     if(item){
       item.value = newVal;
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+        //取消原选中状态
+        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+      }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       res.saveText[index] = labText;
@@ -532,6 +581,9 @@ export const changeLabelVal = (state,action)=>{
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
@@ -826,12 +878,26 @@ export function removeId(state,action){
 // 单列多选
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
-  const {ikey,seleData} = action.data;
-  let data = res.data;
+  const {ikey,seleData,fullIkey} = action.data;
+  let data = res.data;//console.log(action,data[ikey])
+  let index = fullIkey.substr(fullIkey.length-1,1);
+  if(data[ikey].tagType==3){    //在组合项中
+    let item = data[ikey].questionMapping;
+    let arr=[];
+    item[index].value = seleData;
+    item.map((it)=>{
+      if(it.value){
+        arr.push(it.labelPrefix+it.value+it.labelSuffix);
+      }
+    });
+    res.saveText[ikey] = arr.join("");
+    res.update = Math.random();
+    res.selecteds[ikey] = {[index]:action.data};
+    return res;
+  }
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;
-  res.update = Math.random();
   return res;
 }
 

+ 21 - 11
src/store/actions/mainSuit.js

@@ -69,22 +69,33 @@ export const getBigSymptom = (state,action) => {
 //点击插入新模板--添加病程变化
 export const handleTailClick = (state,action)=>{
   const res = Object.assign({},state);
-  res.showDrop = !res.showDrop;
+  const sonId = action.id;//子模板id
   let num = res.moduleNum.num;
   num++;
-  const addSmoduleData = JSON.parse(JSON.stringify(res.addSmoduleData));
+  // const addSmoduleData = JSON.parse(JSON.stringify(res.addSmoduleData));
   // const addDatas = JSON.parse(JSON.stringify(fullfillText(action.info).newArr));
+  let addSmoduleData;
+  // const allModules = JSON.parse(localStorage.getItem('modules'));
+  let allModules = action.allModules;
+  for(let k=0; k<allModules.length; k++){
+    if(allModules[k].id==sonId){
+      addSmoduleData = JSON.parse(JSON.stringify(allModules[k].moduleDetailDTOList));
+    }
+  }
   let datas = JSON.parse(JSON.stringify(res.data));
   let leng = datas.length;
+  
   for(let i=0; i<addSmoduleData.length; i++){
     addSmoduleData[i].pos = num;
     // let pos = leng-1+i;
    /* let pos = leng-2+i;
     datas.splice(pos,0,addDatas[i]);*/
   }
-  res.data = insertPro(datas,addSmoduleData);
+  let newData = insertPro(datas,addSmoduleData);
+  res.data = fullfillText(newData).newArr;
   res.saveText = fullfillText(res.data).saveText;
   res.moduleNum.num = num;
+  res.showDrop = !res.showDrop;
   return res;
 }
 
@@ -264,17 +275,16 @@ export const confirm = (state,action) =>{
 // 普通多选确定事件
 export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
-  const {exists,ikey,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
-  let arr = res.data;
-  arr[ikey].value = names;
-  res.saveText[ikey] = names;
-  res.selecteds[ikey] = action.data;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
+  res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   return res;
 }

+ 57 - 7
src/store/actions/otherHistory.js

@@ -69,6 +69,11 @@ export function setRadioValue(state,action){
   if(+item.tagType===1){
     item.value = text;
     res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -196,10 +201,10 @@ export function setOtherInput(state,action){
 
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
-  let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const res = Object.assign({},state);
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
@@ -207,7 +212,7 @@ export function setCheckBoxValue(state,action) {
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
-  res.update = Math.random();
+  res.update=Math.random();
   return res;
 }
 //搜索结果
@@ -278,6 +283,33 @@ export function changeTextLabel(state,action) {
       if(item.formulaCode){
         res[item.formulaCode] = newVal;
       }
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+        //取消原选中状态
+        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+      }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       res.saveText[index] = labText;
@@ -296,6 +328,10 @@ export function changeTextLabel(state,action) {
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
+
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
@@ -404,12 +440,26 @@ export function removeId(state,action){
 // 单列多选
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
-  const {ikey,seleData} = action.data;
-  let data = res.data;
+  const {ikey,seleData,fullIkey} = action.data;
+  let data = res.data;//console.log(action,data[ikey])
+  let index = fullIkey.substr(fullIkey.length-1,1);
+  if(data[ikey].tagType==3){    //在组合项中
+    let item = data[ikey].questionMapping;
+    let arr=[];
+    item[index].value = seleData;
+    item.map((it)=>{
+      if(it.value){
+        arr.push(it.labelPrefix+it.value+it.labelSuffix);
+      }
+    });
+    res.saveText[ikey] = arr.join("");
+    res.update = Math.random();
+    res.selecteds[ikey] = {[index]:action.data};
+    return res;
+  }
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;
-  res.update = Math.random();
   return res;
 }
 

+ 1 - 1
src/store/async-actions/assistCheck.js

@@ -11,7 +11,7 @@ export const getSearchList = (val) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/api/icss/retrieval/getTagInfos',{
+        axios.json('/retrieval/getTagInfos',{
             type:'6',
             age:baseList.patInfo.message.patientAge,
             inputStr:val,

+ 2 - 2
src/store/async-actions/copyRight.js

@@ -5,7 +5,7 @@ import { storageLocal } from "@utils/tools"
 export const getMessage = (dispatch, getState) => {
     const state = getState();
     // 请求地址
-    post('/api/icss/versionInfo/getVersionInfoAlls')
+    post('/versionInfo/getVersionInfoAlls')
     .then((data) => {
         
         const versionInfo = JSON.parse(storageLocal.get('versionInfo'));
@@ -33,7 +33,7 @@ export const getMessage = (dispatch, getState) => {
 export const getDisMessage = (dispatch, getState) => {
     const state = getState();
     // 请求地址
-    post('/api/icss/disclaimerInformation/getDisclaimerInformations')
+    post('/disclaimerInformation/getDisclaimerInformations')
     .then((data) => {
         dispatch({
             type: GET_DISCLAIMER_MESSAGE,

+ 1 - 1
src/store/async-actions/diagnosticSearch.js

@@ -18,7 +18,7 @@ export const getSearchList = (val) => {
         for(let i = 0; i < diagnosticList.length; i++) {
             noIds.push(diagnosticList[i].id)
         }
-        json('/api/icss/retrieval/getTagInfos',{
+        json('/retrieval/getTagInfos',{
             type:'7',
             age:state.patInfo.message.patientAge,
             inputStr:val,

+ 10 - 10
src/store/async-actions/fetchModules.js

@@ -9,13 +9,13 @@ import {SETOTHERHISTORY} from "../types/homePage";
 import config from "@config/index";
 
 const api={
-  getSpreadModule:'/api/icss/questionInfo/getByIds',
-  getModule:'/api/icss/questionInfo/getById',
-  searchURL: '/api/icss/retrieval/getTagInfos',
-  getOtherHisRecord: '/api/icss/inquiryInfo/getLastOther',
-  getBigPush:'/api/icss/push/pushInner',
-  saveMode:'/api/icss/doctorPageMode/saveDoctorPageModes',
-  getSymptomFeature:'/api/icss/feature/getSymptomFeature'
+  getSpreadModule:'/questionInfo/getByIds',
+  getModule:'/questionInfo/getById',
+  searchURL: '/retrieval/getTagInfos',
+  getOtherHisRecord: '/inquiryInfo/getLastOther',
+  getBigPush:'/push/pushInner',
+  saveMode:'/doctorPageMode/saveDoctorPageModes',
+  getSymptomFeature:'/feature/getSymptomFeature'
 };
 
 export const getFeature = (item)=>{
@@ -147,11 +147,11 @@ export function getInitData(){
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){
         const data = res.data.data&&res.data.data.vital;
-        const str = JSON.stringify(data);
-        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
+        //const str = JSON.stringify(data);
+        //const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
-          data:[...arr],
+          data:[...data],
           isEmpty:false
         });
       }else{

+ 1 - 1
src/store/async-actions/getInfoByUuid.js

@@ -6,7 +6,7 @@ import { getUrlArgObject } from '@utils/tools';
 
 export const initPersonInfo = () => {        //初始化数据
     return (dispatch) => {
-        axios.json('/api/icss/tranFieldInfo/getInfoByUuid',{
+        axios.json('/tranFieldInfo/getInfoByUuid',{
             "uuid":getUrlArgObject('hospitalId'),
         }).then((res)=>{
             const data =res.data;

+ 1 - 1
src/store/async-actions/historyTemplates.js

@@ -8,7 +8,7 @@ export const initItemList = () => {
     // let whichSign = baseList.typeConfig.typeConfig;
     let state = baseList.patInfo.message;
     return (dispatch) => {
-        axios.json('/api/icss/inquiryInfo/hisInquirys',{
+        axios.json('/inquiryInfo/hisInquirys',{
             "hospitalId": state.hospitalId, 
             "patientId": state.patientId, 
             // "sign":whichSign

+ 11 - 4
src/store/async-actions/homePage.js

@@ -1,16 +1,17 @@
 import {post,json} from '@utils/ajax.js';
-import {SETINITDATA,MODI_LOADING} from '@store/types/homePage.js';
+import {SETINITDATA,MODI_LOADING,SETALLMODULES} from '@store/types/homePage.js';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
 import store from '@store';
 import {fullfillText} from '@common/js/func';
+import {formatContinueDots} from '@utils/tools';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
 
 const api = {
-  getModules:'/api/icss/moduleInfo/getAll',
-  clickCount:'/api/icss/buriedSomeStatistical/saveBuriedSomeStatisticals' //埋点统计
+  getModules:'/moduleInfo/getAll',
+  clickCount:'/buriedSomeStatistical/saveBuriedSomeStatisticals' //埋点统计
 };
 
 function modulesParseJson(data){
@@ -18,7 +19,7 @@ function modulesParseJson(data){
   data.map((it)=>{
     moduleName[config.moduleCP[it.id]] = it.name;//添加病情变化/病程变化子模板需要使用模板名称
     obj = fullfillText(it.moduleDetailDTOList);
-    json[config.moduleCP[it.id]] = obj.newArr;
+    json[config.moduleCP[it.id]] = formatContinueDots(obj.newArr);
     saveTextJson[config.moduleCP[it.id]] = obj.saveText;
   });
   return {json,saveTextJson,moduleName};
@@ -41,6 +42,12 @@ export const getInitModules= (dispatch,getStore)=>{
         const initData = newObj.json;
         const initSaveText = newObj.saveTextJson;
         const initModuleName = newObj.moduleName;
+        // 将所有模板缓存,方便根据id取子模板
+        // localStorage.setItem('modules',JSON.stringify(res.data.data));
+        dispatch({
+          type: SETALLMODULES,
+          data: res.data.data
+        });
         dispatch({
           type: SETINITDATA,
           data: initData

+ 2 - 2
src/store/async-actions/inspect.js

@@ -12,7 +12,7 @@ export const getSearchList = (val) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/api/icss/retrieval/getTagInfos',{
+        axios.json('/retrieval/getTagInfos',{
             type:'5',
             age:baseList.patInfo.message.patientAge,
             inputStr:val,
@@ -28,7 +28,7 @@ export const getSublableList = (id,idx) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/api/icss/questionInfo/getById',{
+        axios.json('/questionInfo/getById',{
             age:baseList.patInfo.message.patientAge,
             sexType:sex == '男'?'1' : sex == '女'?'2':'3',
             id: id

+ 2 - 2
src/store/async-actions/mainSuit.js

@@ -4,8 +4,8 @@ import {getEMRParams} from '@utils/tools';
 
 const host = '/api/icss/';
 const api = {
-  'getCommSymptoms': host + 'questionUsual/getQuestionUsual',
-  'symptomPush': host +'push/pushInner',
+  'getCommSymptoms': '/questionUsual/getQuestionUsual',
+  'symptomPush':'/push/pushInner',
 }
 
 

+ 4 - 4
src/store/async-actions/patInfo.js

@@ -9,13 +9,13 @@ import {ISREAD,MODI_LOADING} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
-    getPatInfo: '/api/icss/patientInfo/getTopPatientInfo',
-    getPatBaseInfo: '/api/icss/patientInfo/getPatientInfo'
+    getPatInfo: '/patientInfo/getTopPatientInfo',
+    getPatBaseInfo: '/patientInfo/getPatientInfo'
 };
 
 //参数转换
 export const initPersonInfo = (dispatch, getState) => {
-    json('/api/icss/tranFieldInfo/getInfoByUuid', {
+    json('/tranFieldInfo/getInfoByUuid', {
         "uuid": getUrlArgObject('hospitalId'),
     }).then((res) => {
         const data = res.data;
@@ -34,7 +34,7 @@ export const initHistoryDetails = (dispatch) => {
     let baseList = store.getState();
     let state = baseList.patInfo.message;
     return (dispatch) => {
-        json('/api/icss/inquiryInfo/readInquiry', {
+        json('/inquiryInfo/readInquiry', {
             "doctorId": state.doctorId,
             "hospitalDeptId": state.hospitalDeptId,
             "hospitalId": state.hospitalId,

+ 2 - 2
src/store/async-actions/print.js

@@ -18,7 +18,7 @@ export const saveMessage = (bool) => {
     let jsonData = getAllDataList(baseList);
     // console.log(jsonStr.diag,'保存历史病历')
     
-    json('/api/icss/inquiryInfo/saveInquiry', {
+    json('/inquiryInfo/saveInquiry', {
         "doctorId": state.doctorId,
         "hospitalDeptId": state.hospitalDeptId,
         "hospitalId": state.hospitalId,
@@ -73,7 +73,7 @@ export const saveMessage = (bool) => {
         }
     })
     if(bool){
-        json('/api/icss/printRecord/savePrintRecords', {
+        json('/printRecord/savePrintRecords', {
             "dataJson": JSON.stringify(getAllDataList(baseList)),
             "doctorId": state.doctorId,
             "hospitalDeptId": state.hospitalDeptId,

+ 4 - 4
src/store/async-actions/pushMessage.js

@@ -4,8 +4,8 @@ import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
 
 const api={
-  push:'/api/icss/push/pushInner',
-  textPush:'/api/icss/push/pushText'
+  push:'/push/pushInner',
+  textPush:'/push/pushText'
 }
 
 //获取右侧推送信息
@@ -74,7 +74,7 @@ export const getTips = (diagItem) =>{
             type: SET_CLICK_DIAG,
             clickDiag: diagItem
         })
-        const url = '/api/icss/introduceInfo/getByQuestionId';
+        const url = '/introduceInfo/getByQuestionId';
         const params = {
             questionId: diagItem.id,
             type: 7,
@@ -100,7 +100,7 @@ export const getTipsDetails = () => {
         // window.open(`/static/pages/information.html?type=7&&questionId=${state.diagnosticList.clickDiag.id}`);
 
         //弹窗显示
-        const url ='/api/icss/introduceInfo/getByQuestionId'
+        const url ='/introduceInfo/getByQuestionId'
         const imageUrlPrefix = 'http://192.168.2.241:82'
         
         const params = {

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

@@ -21,7 +21,7 @@ export const initItemList = (type) => { //初始化数据
   let state = baseList.patInfo.message;
 
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/getByDoctorIdTemplates', {
+    axios.json('/templateInfo/getByDoctorIdTemplates', {
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,
@@ -67,7 +67,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
     return tmpObj;
   }
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/saveTemplateInfo', getdata()).then((res) => {
+    axios.json('/templateInfo/saveTemplateInfo', getdata()).then((res) => {
       const data = res.data;
       if (data.code == 0) {
         Notify.success('模板保存成功');
@@ -97,7 +97,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
 
 export const delItem = (id) => { //删除
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/cancelTemplateInfos', {
+    axios.json('/templateInfo/cancelTemplateInfos', {
       ids: id
     }).then((res) => {
       let data = res.data;
@@ -112,7 +112,7 @@ export const delItem = (id) => { //删除
 };
 export const delBatchItem = (ids) => { //批量删除
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/cancelTemplateInfos', {
+    axios.json('/templateInfo/cancelTemplateInfos', {
       ids: ids.join(",")
     }).then((res) => {
       let data = res.data;
@@ -133,7 +133,7 @@ export const changeTitleAsync = (obj) => { //改标题
     return;
   }
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/updateByIdUsNames', {
+    axios.json('/templateInfo/updateByIdUsNames', {
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,

+ 5 - 5
src/store/async-actions/treat.js

@@ -7,8 +7,8 @@ import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
 const api={
-    push:'/api/icss/push/pushInner',
-    textPush:'/api/icss/push/pushText'
+    push:'/push/pushInner',
+    textPush:'/push/pushText'
 }
 
 export const addDiagnostic = (item) => {
@@ -219,7 +219,7 @@ export const getTreatResult = (item) =>{
 export const getInstroduce = (item)=>{
 
     return (dispatch, getState) =>{
-        const url = '/api/icss/introduceInfo/getByQuestionId';
+        const url = '/introduceInfo/getByQuestionId';
         const params = {
             questionId: item.id,
             type: 8,
@@ -253,7 +253,7 @@ export const  getInstroduceMore = (drugIdList) =>{
     return (dispatch, getState) =>{
         let drugInfoList = [];
         for (let i = 0; i < drugIdList.drugIdList.length; i++ ) {
-            const url = '/api/icss/introduceInfo/getByQuestionId';
+            const url = '/introduceInfo/getByQuestionId';
             const params = {
                 questionId: drugIdList.drugIdList[i],
                 type: 8,
@@ -293,7 +293,7 @@ export const  getInstroduceMore = (drugIdList) =>{
 export const commonTreatAddToAdvice = () => {
     return (dispatch, getState) => {
         const state = getState();
-        if(state.treat.treatItem.treatIndex === 0 && state.treat.isFirstMainDiag) {
+        if(state.treat.treatItem.id === state.diagnosticList.diagnosticList[0].id && state.treat.isFirstMainDiag) {
             dispatch({
                 type: IS_FIRST_MAIN_DIAG
             })

+ 6 - 2
src/store/reducers/homePage.js

@@ -1,5 +1,5 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION} from '../types/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION,SETALLMODULES} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,searchDropLocation} from '../actions/homePage.js';
 import SearchDrop from '../../components/SearchDrop/index.jsx';
 
@@ -13,7 +13,8 @@ const initState = {
   commSymHide:false,
   loadingFlag:true,
   boxTop:0,
-  boxLeft:0
+  boxLeft:0,
+  allModules:[]
 };
 
 export default function (state=initState,action) {
@@ -65,6 +66,9 @@ export default function (state=initState,action) {
       return res;
     case SEARCH_DROP_LOCATION:
       return searchDropLocation(state,action);
+    case SETALLMODULES:
+      res.allModules = action.data;
+      return res;
     default:
       return res;
   }

+ 1 - 1
src/store/reducers/inspect.js

@@ -178,7 +178,7 @@ export default (state = initSearchList, action) => {
 
 function getExcelString(action,newState,tmpArr,tmpArr2) {
   let tmpString = '';
-  if(JSON.stringify(action.data) != '{}' && action.data.lisExcelRes.length > 0){
+  if(JSON.stringify(action.data||{}) != '{}' && action.data.lisExcelRes.length > 0){
     action.data.lisExcelRes.map((item)=>{
         item.lisExcelItem.map((part)=>{
             if(part.type == 1){

+ 2 - 1
src/store/types/homePage.js

@@ -12,4 +12,5 @@ export const ISREAD = 'is_history_or_template';     //是否回读或模板数
 export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
 export const SETMINSCREEN = 'SETMINSCREEN';    //1024标识
 export const MODI_LOADING = 'MODI_LOADING';    //1024标识
-export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
+export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
+export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据

+ 16 - 8
src/utils/ajax.js

@@ -1,20 +1,24 @@
-import {host} from './config'
+import {host,prefix} from './config'
 import { getUrlArgObject } from "@utils/tools";
 const $ = require('jquery');
 $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host:'';
+const qhost = isLocal?host+prefix:prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时
 
 
-    // const appkeyId = getUrlArgObject("appkey");
+    const securityCode = getUrlArgObject("code");
+    const appKeyId = getUrlArgObject("appI");
+    const appKeySecret = getUrlArgObject("appS");
     axios.interceptors.request.use(
         req => {
-            // req.headers.appKey = appkeyId;
+          req.headers.appKeyId = appKeyId;
+          req.headers.appKeySecret = appKeySecret;
+          req.headers.securityCode = securityCode;
             return req;
         },
         error => {
@@ -33,10 +37,10 @@ axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded
             if (error.response) {
                 switch (error.response.status) {
                     case 401:
-                        //alert(401)
+                        //alert("服务正在升级,请稍后再试");
                         break;
                     case 500:
-                        //alert(500)
+                        //alert('后台接口报错');
                         break;
                     default:
                         //alert('其他')
@@ -61,7 +65,11 @@ const post=(url,data)=>{
 //json传参
 const json=(url,data)=>{
   //兼容ie8,axios在ie8下content-type设置不成功且会把headers置为null
-  return new Promise((resolve,reject)=>{
+  return axios({
+    method:'post',
+    url:qhost+url,
+    data
+  });/*new Promise((resolve,reject)=>{
     $.ajax({
       method:'post',
       url:qhost+url,
@@ -74,7 +82,7 @@ const json=(url,data)=>{
         reject(error);
       },
     });
-  });
+  });*/
 };
 
 const get=(url)=>{

+ 2 - 1
src/utils/config.js

@@ -6,5 +6,6 @@ const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.117:8080'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 module.exports={
-    host
+    host,
+    prefix:'/api/icss'            //带权限验证的api
 };

+ 19 - 7
src/utils/tools.js

@@ -572,15 +572,26 @@ function filterOtherDataArr(arrTmp,jsonArr){
       return word.substr(0,1);
     });
   });
-  const str1 = [...tmpArr].splice(0,index1).join("");
-  const str2 = [...tmpArr].splice(index1).join("");
+  const splitNum = [index1,index2,index3,index4].find((i)=>i!=-1);
+  const str1 = [...tmpArr].splice(0,splitNum).join("");
+  const str2 = [...tmpArr].splice(splitNum).join("");
   return {str1:trimDots(str1),str2:trimDots(str2),index:index1};
 }
 //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 function trimDots(str){
   return str.replace(config.punReg,function(word){
     return word.substr(0,1);
-  }).replace(/^[,,.。::"“??”;;、!!]+/,'');
+  }).replace(/^[,,.。::"“??”;;、!!\s]+/,'');
+}
+
+//标签间连续标点只保留一个,保留前面一个
+function formatContinueDots(data){
+  let arr=data.filter((it,i)=>{
+    if(!(it.name==','&&data[i-1].name==',')){
+      return it;
+    }
+  });
+  return arr;
 }
 
 // 取消默认行为
@@ -718,9 +729,9 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
 }
 function getPageLength(event) {     //兼容ie8获取页面距离左和上的距离,包括滚动距离
   let e = event || window.event;
-  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; 
-  let scrollY = document.documentElement.scrollTop || document.body.scrollTop; 
-  let x = e.pageX || e.clientX + scrollX; 
+  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+  let scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+  let x = e.pageX || e.clientX + scrollX;
   let y = e.pageY || e.clientY + scrollY;
   let page = {
     pageX:x,
@@ -749,7 +760,7 @@ function dragBox(domWrap,domDrag){
     let page = getPageLength(event);
     let maxDragX = 0,dragDesWidth = 0;
     let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
-    
+
     if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
       if(dragDes != null){
         dragDesWidth = dragDes.offsetWidth
@@ -830,4 +841,5 @@ module.exports = {
     timestampToTime,
     getPageLength,
     dragBox,
+    formatContinueDots
 };