Przeglądaj źródła

Merge branch 'ctrlzDev' into dev5.3.1

# Conflicts:
#	src/store/actions/mainSuit.js
zhouna 5 lat temu
rodzic
commit
df644289b8

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

@@ -3,6 +3,7 @@ import style from "./index.less";
 import printImg from '@common/images/icon_print_blue.png';
 import preview from '@common/images/preview.png';
 import saveHistory from '@common/images/saveHistory.png';
+import cancelTag from '@common/images/icon_back.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
@@ -323,12 +324,13 @@ class Operation extends Component {
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
     const { visible, preVisible,diagShow } = this.props.print;
-    const {winWidth} = this.props;
+    const {winWidth,cancelDelTag} = this.props;
     const {zIndex,type,le} = this.state;
     return <div className={style['container']} style={{zIndex:zIndex,left:le}}>
       <span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>
       <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span>
       <span className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</span>
+      <span className={style['preButton']} onClick={cancelDelTag}><img src={cancelTag} /> 还原标签</span>
       <span className={winWidth<=1082?`${style['saveButton']} ${style['minstyle']}`: style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
       <span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['minstyle']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
       {visible?<PrintPreviewContainer visible={visible} onClose={closePrint} />:null}

+ 1 - 0
src/config/index.js

@@ -34,4 +34,5 @@ export default {
     radioOptionPer:'()',     //单选项输入占位符
     textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
     slideTime:400,      //右侧指标推送展开/收起动画时间
+    recoverTagNum:3,    //可回退标签的个数
 };

+ 24 - 0
src/containers/OperationContainer.js

@@ -12,6 +12,11 @@ import {saveMessage,clearMessages} from "../store/async-actions/print";
 import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
 import {saveClickNum,getInitModules} from '@store/async-actions/homePage';
 import {getOtherHisRecord} from '@store/async-actions/fetchModules';
+import {RECOVER_TAG_MAIN} from '@store/types/mainSuit';
+import {RECOVER_TAG_CURRENT} from '@store/types/currentIll';
+import {RECOVER_TAG_OTHER} from '@store/types/otherHistory';
+import {RECOVER_TAG_CHECK} from '@store/types/checkBody';
+import {Notify} from '@commonComp';
 
 // function mapStateToProps({print}) {
 function mapStateToProps(state) {
@@ -66,6 +71,25 @@ function mapDispatchToProps(dispatch) {
             type: DIAG_SHOW,
             data:bool
           });
+        },
+        cancelDelTag(){
+            const maps = {
+               '1':RECOVER_TAG_MAIN,
+               '2':RECOVER_TAG_CURRENT,
+               '3':RECOVER_TAG_OTHER,
+               '4':RECOVER_TAG_CHECK
+            };
+            const deledTags = localStorage.getItem('deletedTags')?JSON.parse(localStorage.getItem('deletedTags')):[];
+            if(deledTags.length===0){
+              Notify.info('暂无标签可还原');
+              return ;
+            }
+            const arr = deledTags[0].delIndex.split("-");
+            dispatch({
+              type:maps[arr[0]],
+              data:deledTags[0],
+              index:arr[1]
+            });
         }
     };
 }

+ 15 - 1
src/store/actions/checkBody.js

@@ -1,5 +1,5 @@
 import config from '@config/index.js';
-import {formatContinueDots,getLabelIndex,fullfillText,checkFullfillText} from '@utils/tools.js';
+import {formatContinueDots,getLabelIndex,checkFullfillText,handleLocalDelTag,shiftLocalDelTag} from '@utils/tools.js';
 
 export function preSetCheckbody(state,action) {
   let res = Object.assign({},state);
@@ -468,6 +468,7 @@ export function backspaceText(state,action){
       res.saveText.splice(delIndex,1);
     }
     else{
+      handleLocalDelTag(4,delIndex-1,data[delIndex-1]);
       data.splice(delIndex-1,2);
       res.selecteds.splice(delIndex-1,2); 
       res.saveText.splice(delIndex-1,2);
@@ -481,6 +482,7 @@ export function backspaceText(state,action){
       res.saveText.splice(delIndex,1);
     }
     else{
+      handleLocalDelTag(4,delIndex,data[delIndex]);
       data.splice(delIndex,2);
       res.selecteds.splice(delIndex,2);  
       res.saveText.splice(delIndex,2);
@@ -539,4 +541,16 @@ export function setImportCheckbodyLabel(state,action) {
   res.importLabel = action.labels;
   res.update = Math.random();
   return res;
+}
+//恢复已删除的标签
+export function recoveTag(state,action) {
+  let res = Object.assign({},state);
+  let arr = [...res.data];
+  const text = Object.assign({},JSON.parse(config.textLabel));
+  arr.splice(action.index,0,action.data,text);
+  res.data = checkFullfillText(arr).newArr;
+  res.saveText = checkFullfillText(arr).saveText;
+  shiftLocalDelTag();
+  res.update = Math.random();
+  return res;
 }

+ 15 - 1
src/store/actions/currentIll.js

@@ -1,5 +1,5 @@
 import config from '@config/index.js';
-import {formatContinueDots,getLabelIndex,fullfillText,getIds,resetTagtype} from '@utils/tools';
+import {formatContinueDots,getLabelIndex,fullfillText,getIds,resetTagtype,handleLocalDelTag,shiftLocalDelTag} from '@utils/tools';
 import {Notify} from '@commonComp';
 //插入病程变化模板
 function insertPro(data,processModule){
@@ -901,6 +901,7 @@ export function backspaceText(state,action){
       res.saveText.splice(delIndex,1);
     }
     else{
+      handleLocalDelTag(2,delIndex-1,data[delIndex-1]);
       data.splice(delIndex-1,2);
       res.selecteds.splice(delIndex-1,2); 
       res.saveText.splice(delIndex-1,2);
@@ -914,6 +915,7 @@ export function backspaceText(state,action){
       res.saveText.splice(delIndex,1);
     }
     else{
+      handleLocalDelTag(2,delIndex,data[delIndex]);
       data.splice(delIndex,2);
       res.selecteds.splice(delIndex,2);  
       res.saveText.splice(delIndex,2);
@@ -1002,4 +1004,16 @@ export function delSingleLable(state,action){
   }
   res.update = Math.random();
   return res;
+}
+//恢复已删除的标签
+export function recoveTag(state,action) {
+  let res = Object.assign({},state);
+  let arr = [...res.data];
+  const text = Object.assign({},JSON.parse(config.textLabel));
+  arr.splice(action.index,0,action.data,text);
+  res.data = fullfillText(arr).newArr;
+  res.saveText = fullfillText(arr).saveText;
+  shiftLocalDelTag();
+  res.update = Math.random();
+  return res;
 }

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

@@ -1,4 +1,4 @@
-import {getLabelIndex,fullfillText,getIds,resetTagtype,storageLocal} from '@utils/tools.js';
+import {getLabelIndex,fullfillText,getIds,resetTagtype,storageLocal,handleLocalDelTag,shiftLocalDelTag} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
 
@@ -131,7 +131,7 @@ export const insertMain = (state,action) => {
           storageLocal.set('mainSymp',newArr.slice(newArr.length-5,));
         }else{
           storageLocal.set('mainSymp',newArr);
-        }  
+        }
       }else{
         storageLocal.set('mainSymp',items);
       }
@@ -219,7 +219,7 @@ export const confirm = (state,action) =>{
         }else{
           storageLocal.set('mainSymp',newArr);
         }
-        
+
       }else{
         storageLocal.set('mainSymp',items);
       }
@@ -430,8 +430,8 @@ export const insertSearch = (state,action)=>{
       arr.push(items);
       storageLocal.set('mainSymp',arr);
     }
-    
-  if(data.length==0){   
+
+  if(data.length==0){
     let inserIndx = null;
     moduleData.map((it,i)=>{
       if(it.flag == 1){//在此处插入主诉数据
@@ -833,6 +833,7 @@ export function backspaceText(state,action){
       res.saveText.splice(delIndex,1);
     }
     else{
+      handleLocalDelTag(1,delIndex-1,data[delIndex-1]);
       data.splice(delIndex-1,2);
       res.saveText.splice(delIndex-1,2);
     }
@@ -844,6 +845,7 @@ export function backspaceText(state,action){
       res.saveText.splice(delIndex,1);
     }
     else{
+      handleLocalDelTag(1,delIndex,data[delIndex]);
       data.splice(delIndex,2);
       res.saveText.splice(delIndex,2);
     }
@@ -940,4 +942,17 @@ export function getSymptomFeature(state,action){
   }
   res.update = Math.random();
   return res;
+}
+
+//恢复已删除的标签
+export function recoveTag(state,action) {
+  let res = Object.assign({},state);
+  let arr = [...res.data];
+  const text = Object.assign({},JSON.parse(config.textLabel));
+  arr.splice(action.index,0,action.data,text);
+  res.data = fullfillText(arr).newArr;
+  res.saveText = fullfillText(arr).saveText;
+  shiftLocalDelTag();
+  res.update = Math.random();
+  return res;
 }

+ 15 - 1
src/store/actions/otherHistory.js

@@ -1,5 +1,5 @@
 import config from '@config/index';
-import {formatContinueDots,getLabelIndex,fullfillText} from '@utils/tools.js';
+import {formatContinueDots,getLabelIndex,fullfillText,handleLocalDelTag,shiftLocalDelTag} from '@utils/tools.js';
 
 //多选标签选中确定处理
 export const confirm = (state,action) =>{
@@ -464,6 +464,7 @@ export function backspaceText(state,action){
       if(data[delIndex-1].formulaCode){
         res[data[delIndex-1].formulaCode]=undefined;
       }
+      handleLocalDelTag(3,delIndex-1,data[delIndex-1]);      //记录被删除的标签
       data.splice(delIndex-1,2);
       res.selecteds.splice(delIndex-1,2);      //杂音类样式选中状态对应
       res.saveText.splice(delIndex-1,2);
@@ -481,6 +482,7 @@ export function backspaceText(state,action){
       if(data[delIndex+1] &&data[delIndex+1].formulaCode){
         res[data[delIndex+1].formulaCode]=undefined;
       }
+      handleLocalDelTag(3,delIndex,data[delIndex]);
       data.splice(delIndex,2);
       res.selecteds.splice(delIndex,2);  
       res.saveText.splice(delIndex,2);
@@ -553,4 +555,16 @@ export function delSingleLable(state,action){
   }
   res.update = Math.random();
   return res;
+}
+//恢复已删除的标签
+export function recoveTag(state,action) {
+  let res = Object.assign({},state);
+  let arr = [...res.data];
+  const text = Object.assign({},JSON.parse(config.textLabel));
+  arr.splice(action.index,0,action.data,text);
+  res.data = fullfillText(arr).newArr;
+  res.saveText = fullfillText(arr).saveText;
+  shiftLocalDelTag();
+  res.update = Math.random();
+  return res;
 }

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

@@ -24,12 +24,18 @@ export const closePreview=(state,action)=>{
 
 export const saveMessage=(state,action)=>{
   const res=Object.assign({},state);
-  res.saveMessage = action.data
+  res.saveMessage = action.data;
   return res;
 };
 
 export const diagShow=(state,action)=>{
   const res=Object.assign({},state);
-  res.diagShow = action.data
+  res.diagShow = action.data;
   return res;
 };
+
+export const recoverTag = (state,action)=> {
+  const res = Object.assign({}, state);
+  console.log(res);
+  return res;
+}

+ 1 - 0
src/store/async-actions/patInfo.js

@@ -120,6 +120,7 @@ export async function getPatientMessage(dispatch, getState){
     type: CONFIRM_TYPE,
     confirmType:data1.modeValue||config.defaultValue.mode
   });
+  localStorage.removeItem('deletedTags');
   dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
   dispatch(getCommonList(5));     //获取常用化验标签列表
   dispatch(getCommonList(6));     //获取常用辅检标签列表if(allModules.length == 0){//模板为空才回读

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

@@ -1,8 +1,8 @@
-import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
+import {RECOVER_TAG_CHECK,SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
   SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,
   SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER,CHECKCONFIRMSELECTED,
   CHECKBODY_MUL,DEL_CHECKBODY_LABLE,SET_CK_RADIO_INPUT_VAL,SET_IMPORT_CHECKBODY_LABEL,PRESET} from '../types/checkBody.js';
-import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,
+import {recoveTag,set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,
   setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,
   changeNumLabelVal,confirm,multipleComfirn,delSingleLable,setRadioInputValue,setImportCheckbodyLabel,preSetCheckbody} from '../actions/checkBody.js';
 import config from '@config/index.js';
@@ -66,6 +66,8 @@ export default function(state=initState,action){
       return setRadioInputValue(state,action);
     case SET_IMPORT_CHECKBODY_LABEL:
       return setImportCheckbodyLabel(state,action);
+    case RECOVER_TAG_CHECK:
+      return recoveTag(state,action);
     default:
       return res;
   }

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

@@ -1,9 +1,9 @@
 // 现病史
-import {SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRENT_DATA,SET_LABEL_MODULE,SETMAINCHECKBOX,
+import {RECOVER_TAG_CURRENT,SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRENT_DATA,SET_LABEL_MODULE,SETMAINCHECKBOX,
   CURRENT_RADIO,CURRENT_NUMBER,CURRENT_TEXT_LABEL,CLEAR_CURRENT_ILL,SETTEXTMODEVALUE,CURRENT_GET_BIGDATAPUSH,CURRENT_CLEAR,
   SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,
   SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE,CURRENT_CHRONIC,SAVE_CURR_FREE} from '../types/currentIll';
-import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
+import {recoveTag,confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
   setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,
   backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,setRadioInputValue,fillChronicModule} from '../actions/currentIll';
 
@@ -86,6 +86,8 @@ export default function(state=initState,action){
       res.saveText[0] = action.data;
       res.update = Math.random();
       return res;
+    case RECOVER_TAG_CURRENT:
+      return recoveTag(state,action);
     default:
       return state;
   }

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

@@ -1,9 +1,9 @@
-import {COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
+import {RECOVER_TAG_MAIN,COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
   INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,
   REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC} from '../types/mainSuit'
-import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
+import {recoveTag,getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
   addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,
   getSymptomFeature,setRadioInputValue} from '../actions/mainSuit'
@@ -105,6 +105,8 @@ export default function(state=initState,action){
     case SAVE_CHRONIC:
       res.chronicDesease = action.data;
       return res;
+    case RECOVER_TAG_MAIN:
+      return recoveTag(state,action);
     default:
       return state;
   }

+ 12 - 3
src/store/reducers/otherHistory.js

@@ -1,13 +1,20 @@
-import {SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT,SETOTHERSEARCHDATA,
+import {RECOVER_TAG_OTHER,SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT,SETOTHERSEARCHDATA,
   SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,
   OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER,OTHERHIS_MUL,REMOVE_OTHER_ID,DEL_OTHERHIS_LABLE,SET_OT_RADIO_INPUT_VAL} from '../types/otherHistory';
-import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,
+import {recoveTag,confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,
   changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,
   removeId,delSingleLable,setRadioInputValue} from '../actions/otherHistory';
 import config from '@config/index';
 
 const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
-const initState = {data:[block],isEmpty:true,saveText:[],selecteds:[],focusIndex:'',editClear:true};
+const initState = {
+                    data:[block],
+                    isEmpty:true,
+                    saveText:[],
+                    selecteds:[],
+                    deledTags:{},
+                    focusIndex:'',
+                    editClear:true};
 
 export default function(state=initState,action){//console.log(state)
   const res = Object.assign({},state);
@@ -69,6 +76,8 @@ export default function(state=initState,action){//console.log(state)
         return delSingleLable(state,action);
     case SET_OT_RADIO_INPUT_VAL:
       return setRadioInputValue(state,action);
+    case RECOVER_TAG_OTHER:
+      return recoveTag(state,action);
     default:
       return res;
   }

+ 4 - 4
src/store/reducers/print.js

@@ -1,5 +1,5 @@
-import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,CLEAR_MESSAGE,DIAG_SHOW } from "../types/print";
-import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";
+import { RECOVER_TAG,SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,DIAG_SHOW } from "../types/print";
+import {recoverTag, showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";
 
 const initState = {
   visible: false,
@@ -19,10 +19,10 @@ export default function(state = initState, action) {
       return closePreview(state, action);
     case SAVE_MESSAGE:
       return saveMessage(state, action);
-    case CLEAR_MESSAGE:
-      return clearMessage(state, action);
     case DIAG_SHOW:
       return diagShow(state, action);
+    case RECOVER_TAG:
+      return recoverTag(state,action);
     default:
       return state;
   }

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

@@ -19,4 +19,5 @@ export const CHECKBODY_MUL = 'CHECKBODY_MUL';//单列多选
 export const DEL_CHECKBODY_LABLE = 'DEL_CHECKBODY_LABLE';
 export const SET_CK_RADIO_INPUT_VAL = 'SET_CK_RADIO_INPUT_VAL';
 export const SET_IMPORT_CHECKBODY_LABEL='SET_IMPORT_CHECKBODY_LABEL';
-export const PRESET = 'PRESET_CHECKBODY_DATA';
+export const PRESET = 'PRESET_CHECKBODY_DATA';
+export const RECOVER_TAG_CHECK = 'RECOVER_TAG_CHECK';     //恢复已删除标签

+ 1 - 0
src/store/types/currentIll.js

@@ -29,4 +29,5 @@ export const SET_RADIO_INPUT_VALUE = 'SET_RADIO_INPUT_VALUE';
 export const CURRENT_CHRONIC = 'CURRENT_CHRONIC';//慢病填充模板
 export const SAVE_CURR_FREE = 'SAVE_CURR_FREE';//自由输入
 export const CHANGE_CURRENT_LABELVAL = 'CHANGE_CURRENT_LABELVAL';//双击标签输入改变值
+export const RECOVER_TAG_CURRENT = 'RECOVER_TAG_CURRENT';     //恢复已删除标签
 

+ 1 - 0
src/store/types/mainSuit.js

@@ -29,3 +29,4 @@ export const DEL_MAIN_LABLE = 'DEL_MAIN_LABLE';
 export const SET_FEATURE = 'SET_FEATURE';  //主诉分词
 export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL';
 export const SAVE_CHRONIC = 'SAVE_CHRONIC'; //储存慢病信息
+export const RECOVER_TAG_MAIN = 'RECOVER_TAG_MAIN';   //恢复已删除标签

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

@@ -21,4 +21,5 @@ export const CHANGEOTHERTEXTLABEL_NUMBER = 'CHANGEOTHERTEXTLABEL_NUMBER';    //
 export const OTHERHIS_MUL = 'OTHERHIS_MUL';    //单列多选
 export const REMOVE_OTHER_ID = 'REMOVE_OTHER_ID';    
 export const DEL_OTHERHIS_LABLE = 'DEL_OTHERHIS_LABLE';
-export const SET_OT_RADIO_INPUT_VAL = 'SET_OT_RADIO_INPUT_VAL'
+export const SET_OT_RADIO_INPUT_VAL = 'SET_OT_RADIO_INPUT_VAL';
+export const RECOVER_TAG_OTHER = 'RECOVER_TAG_OTHER'; //恢复已删除标签

+ 7 - 7
src/store/types/print.js

@@ -1,7 +1,7 @@
-export const SHOW_PRINT_PREVIEW = 'SHOW_PRINT_PREVIEW'
-export const CLOSE_PRINT_PREVIEW = 'CLOSE_PRINT_PREVIEW'
-export const SAVE_MESSAGE = 'SAVE_MESSAGE'
-export const CLEAR_MESSAGE = 'CLEAR_MESSAGE'
-export const SHOW_PREVIEW = 'SHOW_PREVIEW'
-export const CLOSE_PREVIEW = 'CLOSE_PREVIEW'
-export const DIAG_SHOW = 'DIAG_SHOW'
+export const SHOW_PRINT_PREVIEW = 'SHOW_PRINT_PREVIEW';
+export const CLOSE_PRINT_PREVIEW = 'CLOSE_PRINT_PREVIEW';
+export const SAVE_MESSAGE = 'SAVE_MESSAGE';
+export const SHOW_PREVIEW = 'SHOW_PREVIEW';
+export const CLOSE_PREVIEW = 'CLOSE_PREVIEW';
+export const DIAG_SHOW = 'DIAG_SHOW';
+export const RECOVER_TAG = 'RECOVER_TAG';

+ 19 - 1
src/utils/tools.js

@@ -1346,6 +1346,21 @@ function resetTagtype(data){
   return newDataArr;
 }
 
+//记录最近3次被删除的标签
+function handleLocalDelTag(mark,index,tag){
+  const deledTag =  localStorage.getItem('deletedTags')?JSON.parse(localStorage.getItem('deletedTags')):[];
+  deledTag.unshift(Object.assign({delIndex:mark+'-'+index},tag));
+  deledTag.length = deledTag.length>config.recoverTagNum?config.recoverTagNum:deledTag.length;
+  localStorage.setItem('deletedTags',JSON.stringify(deledTag));
+}
+
+//删除被恢复的标签
+function shiftLocalDelTag(){
+  const deledTags = localStorage.getItem('deletedTags')?JSON.parse(localStorage.getItem('deletedTags')):[];
+  deledTags.shift();
+  localStorage.setItem('deletedTags',JSON.stringify(deledTags));
+}
+
 module.exports = {
     checkType: Type.checkType,
     getIds,
@@ -1398,5 +1413,8 @@ module.exports = {
     getPushLists,
     getPushList,
     getAllString,
-    resetTagtype
+    resetTagtype,
+  handleLocalDelTag,
+  shiftLocalDelTag,
+
 };