|
@@ -8,6 +8,7 @@ import {clearAllLabel} from '@store/actions/inspect';
|
|
|
import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
|
|
|
import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
|
|
|
import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
|
|
|
+import {CLEAR_FIRST_MAIN_DIAG} from "../store/types/treat";
|
|
|
import {tabChange} from '@store/actions/tabTemplate';
|
|
|
import config from '@config/index.js';
|
|
|
|
|
@@ -187,7 +188,8 @@ const getAllDataList =(baseList) =>{ //获取所有模块结构化的
|
|
|
jsonData.addItems = baseList.homePage.addItems||{};
|
|
|
jsonData.mainsuitIds = baseList.mainSuit.mainIds; //主诉去重
|
|
|
jsonData.currentIds = baseList.currentIll.symptomIds; //现病史去重
|
|
|
- //console.log(jsonData,'结构化数据获取')
|
|
|
+ jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag; //治疗方案
|
|
|
+ // console.log(jsonData,'结构化数据获取')
|
|
|
return jsonData;
|
|
|
}
|
|
|
const getAllDataStringList =(baseList) =>{ //获取所有模块文本的数据
|
|
@@ -260,6 +262,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
data:{},
|
|
|
saveText:'',
|
|
|
});
|
|
|
+ store.dispatch({
|
|
|
+ type:CLEAR_FIRST_MAIN_DIAG,
|
|
|
+ flag:true
|
|
|
+ });
|
|
|
storageLocal.remove('emrParam');
|
|
|
// Notify.success('页面已清空')
|
|
|
}else{
|
|
@@ -325,6 +331,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
type:SETREADDITEMS,
|
|
|
data:dataJson.addItems
|
|
|
});
|
|
|
+ store.dispatch({
|
|
|
+ type:CLEAR_FIRST_MAIN_DIAG,
|
|
|
+ flag:dataJson.isFirstMainDiag
|
|
|
+ });
|
|
|
//tab跳回辅助信息
|
|
|
store.dispatch(tabChange('0'));
|
|
|
}else{ //结构化历史病历回读
|
|
@@ -389,6 +399,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
type:SETREADDITEMS,
|
|
|
data:dataJson.addItems
|
|
|
});
|
|
|
+ store.dispatch({
|
|
|
+ type:CLEAR_FIRST_MAIN_DIAG,
|
|
|
+ flag:dataJson.isFirstMainDiag
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
if(type == 'template'){ //纯文本模板回读
|
|
@@ -438,6 +452,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
type:SETREADDITEMS,
|
|
|
data:dataJson.addItems
|
|
|
});
|
|
|
+ store.dispatch({
|
|
|
+ type:CLEAR_FIRST_MAIN_DIAG,
|
|
|
+ flag:dataJson.isFirstMainDiag
|
|
|
+ });
|
|
|
//tab跳回辅助信息
|
|
|
store.dispatch(tabChange('0'));
|
|
|
}else{ //纯文本历史病历回读
|
|
@@ -493,6 +511,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
type:SETREADDITEMS,
|
|
|
data:dataJson.addItems
|
|
|
});
|
|
|
+ store.dispatch({
|
|
|
+ type:CLEAR_FIRST_MAIN_DIAG,
|
|
|
+ flag:dataJson.isFirstMainDiag
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -550,21 +572,25 @@ 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==',')){
|
|
|
+ if(i==0||(it.name&&(it.name.match(config.punctuationReg))||(data[i-1].name&&data[i-1].name.match(config.punctuationReg)))){
|
|
|
+ return it;
|
|
|
+ }
|
|
|
+ if(!it.name){ //主诉现病史病情变化
|
|
|
return it;
|
|
|
}
|
|
|
});
|
|
@@ -717,24 +743,37 @@ function getPageLength(event) { //兼容ie8获取页面距离左和上的距
|
|
|
return page;
|
|
|
}
|
|
|
function dragBox(domWrap,domDrag){
|
|
|
- let wrap = document.getElementById(domWrap);//呗拖拽的元素
|
|
|
let drag = document.getElementById(domDrag);//拖拽区域
|
|
|
+ let wrap = document.getElementById(domWrap);//被拖拽的元素
|
|
|
let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
|
|
|
let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
|
|
|
let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
|
|
|
- let maxDragX = width - wrap.offsetWidth;//最大可推拽x方向距离
|
|
|
- let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
|
|
|
windowEventHandler('mousedown',(event)=>{ //鼠标位置获取,计算点击位置到拖拽元素左边的距离
|
|
|
- wrap = document.getElementById(domWrap);
|
|
|
- drag = document.getElementById(domDrag);
|
|
|
+ let wrap = document.getElementById(domWrap);
|
|
|
let page = getPageLength(event);
|
|
|
+ drag = document.getElementById(domDrag);
|
|
|
mouseX = page.pageX - wrap.offsetLeft //鼠标到拖拽元素的左边界的距离
|
|
|
mouseY = page.pageY - wrap.offsetTop //鼠标到拖拽元素的上边界的距离
|
|
|
isDrag = true
|
|
|
+ isMove = false
|
|
|
},drag)
|
|
|
// windowEventHandler('mousemove',handleMove,document)
|
|
|
windowEventHandler('mousemove',(event)=>{ //移动的
|
|
|
+ let dragDes = document.getElementById('treatDescBox');//展開区域
|
|
|
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
|
|
|
+ }else{
|
|
|
+ dragDesWidth = 0
|
|
|
+ }
|
|
|
+ maxDragX = width - wrap.offsetWidth - dragDesWidth
|
|
|
+ }else{
|
|
|
+ maxDragX = width - wrap.offsetWidth
|
|
|
+ }
|
|
|
if(isDrag){
|
|
|
dragX = page.pageX - mouseX //鼠标可拖拽到左边的最大距离
|
|
|
dragY = page.pageY - mouseY //鼠标可拖拽到上边的最大距离
|
|
@@ -744,8 +783,14 @@ function dragBox(domWrap,domDrag){
|
|
|
if(dragY < 0){ //不能超出上边界
|
|
|
dragY = 0
|
|
|
}
|
|
|
- if(width-dragX < wrap.offsetWidth){ //不能超出右边界
|
|
|
- dragX = maxDragX
|
|
|
+ if(domDrag == 'dragTreatTitle'){
|
|
|
+ if(width-dragX-dragDesWidth < wrap.offsetWidth){ //不能超出右边界
|
|
|
+ dragX = maxDragX
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(width-dragX < wrap.offsetWidth){ //不能超出右边界
|
|
|
+ dragX = maxDragX
|
|
|
+ }
|
|
|
}
|
|
|
if(height-dragY < wrap.offsetHeight){ //不能超出下边界
|
|
|
dragY = maxDragY
|
|
@@ -756,11 +801,12 @@ function dragBox(domWrap,domDrag){
|
|
|
wrap.style.top = dragY + 'px'
|
|
|
}
|
|
|
},document)
|
|
|
- windowEventHandler('mouseup',(event)=>{
|
|
|
- if(isMove){ //有move就设置位置没有移动就不处理
|
|
|
- wrap.style.left = dragX + 'px'
|
|
|
- wrap.style.top = dragY + 'px'
|
|
|
- }
|
|
|
+ windowEventHandler('mouseup',()=>{
|
|
|
+ // if(isMove){ //有move就设置位置没有移动就不处理
|
|
|
+ // console.log(dragX)
|
|
|
+ // wrap.style.left = dragX + 'px'
|
|
|
+ // wrap.style.top = dragY + 'px'
|
|
|
+ // }
|
|
|
isDrag = false
|
|
|
return false
|
|
|
},document)
|