|
@@ -129,19 +129,11 @@ function initContent(data){
|
|
|
info=formatInfoData(k,obj[k][i]);
|
|
|
moduleId=info.mode_id;
|
|
|
if(global_modules[moduleId]){
|
|
|
- hml=initModuleData(moduleId,obj[k].length);
|
|
|
+ hml=initModuleData(moduleId,obj[k]);
|
|
|
$.tmpl(hml,info).appendTo("#contentInfo");
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
- if(obj["病案首页"]&&obj["病案首页"][0]["出院诊断"]){
|
|
|
- const diag = JSON.parse(obj["病案首页"][0]["出院诊断"]);
|
|
|
- $("#tableTmpl").tmpl({k:"出院诊断",data:diag}).appendTo("#diagTable");
|
|
|
- }
|
|
|
- if(obj["病案首页"]&&obj["病案首页"][0]["手术信息"]){
|
|
|
- const diag = JSON.parse(obj["病案首页"][0]["手术信息"]);
|
|
|
- $("#tableTmpl").tmpl({k:"手术信息",data:diag}).appendTo("#surgeryTable");
|
|
|
- }
|
|
|
$(".content-item[code="+global_activeTab+"]").show();
|
|
|
//console.log(obj)
|
|
|
}
|
|
@@ -459,7 +451,8 @@ function formatFlawKeys(data){
|
|
|
}
|
|
|
|
|
|
//初始化模板
|
|
|
- function initModuleData(mid,n){
|
|
|
+ function initModuleData(mid,obj){
|
|
|
+ const n = obj.length;
|
|
|
const module=global_modules[mid].moduleDetail;
|
|
|
const key = global_modules[mid].modeName.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g,'');
|
|
|
let hml = '<div class="content-item" code="'+key+'">' +
|
|
@@ -473,7 +466,7 @@ function formatFlawKeys(data){
|
|
|
const {tagType} = detal;
|
|
|
switch (tagType) {
|
|
|
case 1:
|
|
|
- hml = hml + simpleStructure(detal);
|
|
|
+ hml = hml + simpleStructure(detal,obj);
|
|
|
break;
|
|
|
case 4:
|
|
|
hml = hml + combineStructure(detal);
|
|
@@ -488,8 +481,23 @@ function formatFlawKeys(data){
|
|
|
}
|
|
|
|
|
|
//基础类型结构生成
|
|
|
- function simpleStructure(data){
|
|
|
+ function simpleStructure(data,obj){
|
|
|
const {name, val,monoLine,addLine,position,bold,retract,id} = data;
|
|
|
+ if(name==="手术记录表格-1"){
|
|
|
+ const value = val.replace("【","").replace("】","");
|
|
|
+ const diag = JSON.parse(obj[0][value]);
|
|
|
+ let thml=`<div class="cont" style="width: 100%;" id="anchor${id}">`;
|
|
|
+ thml+=$("#tableTmpl").tmpl({k:"手术信息",data:diag})[0].outerHTML+"</div>";
|
|
|
+ return thml;
|
|
|
+ }
|
|
|
+ if(name==="出院诊断表格-1"){
|
|
|
+ const value = val.replace("【","").replace("】","");
|
|
|
+ const diag = JSON.parse(obj[0][value]);
|
|
|
+
|
|
|
+ let thml=`<div class="cont" style="width: 100%;" id="anchor${id}">`;
|
|
|
+ thml+=$("#tableTmpl").tmpl({k:"出院诊断",data:diag})[0].outerHTML+"</div>";
|
|
|
+ return thml;
|
|
|
+ }
|
|
|
const posClass = position===1?'text-left':'';
|
|
|
const boldClass = bold===1?'text-bold':'';
|
|
|
const retractClass = retract===1?'text-indent':'';
|