|
@@ -162,11 +162,17 @@ const getUrlArgObject = (parm) => {
|
|
|
}
|
|
|
const getAllDataList =(baseList) =>{ //获取所有模块结构化的数据
|
|
|
let jsonData = {};
|
|
|
+ //月经史公式
|
|
|
+ const other = baseList.otherHistory;
|
|
|
jsonData.lis = {};
|
|
|
jsonData.chief = baseList.mainSuit.data; //主诉
|
|
|
jsonData.present = baseList.currentIll.data; //现病史
|
|
|
- jsonData.other = baseList.otherHistory.data; //其他史
|
|
|
- jsonData.otherHistoryIsEmpty = baseList.otherHistory.isEmpty;
|
|
|
+ jsonData.other = other.data; //其他史
|
|
|
+ jsonData.otherHistoryIsEmpty = other.isEmpty;
|
|
|
+ jsonData['yjs_1'] = other['yjs_1'];
|
|
|
+ jsonData['yjs_2'] = other['yjs_2'];
|
|
|
+ jsonData['yjs_3'] = other['yjs_3'];
|
|
|
+ jsonData['yjs_4'] = other['yjs_4'];
|
|
|
jsonData.vital = baseList.checkBody.data; //查体
|
|
|
jsonData.checkBodyIsEmpty = baseList.checkBody.isEmpty;
|
|
|
jsonData.lis.labelList = baseList.inspect.labelList; //化验
|
|
@@ -282,6 +288,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
store.dispatch({
|
|
|
type: CLEAROTHERHISTORY,
|
|
|
data:dataJson.other,
|
|
|
+ yjs_1:dataJson.yjs_1,
|
|
|
+ yjs_2:dataJson.yjs_2,
|
|
|
+ yjs_3:dataJson.yjs_3,
|
|
|
+ yjs_4:dataJson.yjs_4,
|
|
|
selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
|
|
|
isEmpty:onlyOneText?true:false,//dataJson.otherHistoryIsEmpty,
|
|
|
saveText:JSON.parse(dataJsonStr.other),
|
|
@@ -339,6 +349,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{ //回读清
|
|
|
store.dispatch({
|
|
|
type: CLEAROTHERHISTORY,
|
|
|
data:dataJson.other,
|
|
|
+ yjs_1:dataJson.yjs_1,
|
|
|
+ yjs_2:dataJson.yjs_2,
|
|
|
+ yjs_3:dataJson.yjs_3,
|
|
|
+ yjs_4:dataJson.yjs_4,
|
|
|
selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
|
|
|
saveText:dataJsonStr[2].content ? JSON.parse(dataJsonStr[2].content):[],
|
|
|
isEmpty:onlyOneText?true:false,//dataJson.otherHistoryIsEmpty,回读回来后判断是否只有一个空标签,是的话要使用模板
|
|
@@ -507,10 +521,42 @@ function filterDataArr(arrTmp){ //数据处理
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- return tmpArr.join('').replace(config.punReg,function(word){
|
|
|
+ return trimDots(tmpArr.join('')); //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
|
|
|
+}
|
|
|
+//其他史预览数据处理-月经史
|
|
|
+function filterOtherDataArr(arrTmp,jsonArr){
|
|
|
+ let tmpArr = [];
|
|
|
+ let index1 = jsonArr.findIndex((item)=>{
|
|
|
+ return item.formulaCode=='yjs_1';
|
|
|
+ });
|
|
|
+ let index2 = jsonArr.findIndex((item)=>{
|
|
|
+ return item.formulaCode=='yjs_2';
|
|
|
+ });
|
|
|
+ let index3 = jsonArr.findIndex((item)=>{
|
|
|
+ return item.formulaCode=='yjs_3';
|
|
|
+ });
|
|
|
+ let index4 = jsonArr.findIndex((item)=>{
|
|
|
+ return item.formulaCode=='yjs_4';
|
|
|
+ });
|
|
|
+ tmpArr = arrTmp.map((it,i)=>{ //连续的标点符号保留第一个
|
|
|
+ if(!it.match(config.punctuationReg)&&!arrTmp[i-1]||[index1,index2,index3,index4].includes(i)){ //只有标点符号或者前一个标签无值是(说明本标点灰显,不显示在预览中)
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ return it.replace(config.punReg,function(word){
|
|
|
return word.substr(0,1);
|
|
|
- }).replace(/^[,,.。::"“?”;;、!!]+/,''); //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
|
|
|
+ });
|
|
|
+ });
|
|
|
+ const str1 = [...tmpArr].splice(0,index1).join("");
|
|
|
+ const str2 = [...tmpArr].splice(index1).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(/^[,,.。::"“?”;;、!!]+/,'');
|
|
|
+}
|
|
|
+
|
|
|
// 取消默认行为
|
|
|
function preventDefault(event) {
|
|
|
if (event.preventDefault) {
|
|
@@ -661,6 +707,7 @@ module.exports = {
|
|
|
pushAllDataList,
|
|
|
filterArr,
|
|
|
filterDataArr,
|
|
|
+ filterOtherDataArr,
|
|
|
preventDefault,
|
|
|
handleEnter,
|
|
|
didPushParamChange,
|