

export const showPrintPreview=(state,action)=>{
  const res=Object.assign({},state);
  res.visible = true
  return res;
};

export const closePrintPreview=(state,action)=>{
  const res=Object.assign({},state);
  res.visible = false
  return res;
};

export const showPreview=(state,action)=>{
  const res=Object.assign({},state);
  res.preVisible = true
  return res;
};

export const closePreview=(state,action)=>{
  const res=Object.assign({},state);
  res.preVisible = false
  return res;
};

export const saveMessage=(state,action)=>{
  const res=Object.assign({},state);
  res.saveMessage = action.data;
  return res;
};

export const diagShow=(state,action)=>{
  const res=Object.assign({},state);
  res.diagShow = action.data;
  return res;
};

export const clearSearchParam=(state,action)=>{
  const res=Object.assign({},state);
  res.clearSearch = action.data;
  return res;
};
// 推送保存mrid信息
export const setMrId=(state,action)=>{
  const res=Object.assign({},state);
  const {update} = res.mrInfo;
  res.mrInfo.update = +update+1;
  res.mrInfo.mrId = action.data.data;
  res.mrInfo.mode = action.data.action;
  res.mrInfo.isTcm = action.isTcm;

  return res;
};

export const clearMrId = (state, action) => {
  const res = Object.assign({}, state);
  res.mrInfo = {
    update: 0,
    mrId: 'reStart'+Math.random(),
    mode: 'patientia',
  };
  return res;
};