|
@@ -25,6 +25,19 @@ let recommend = require('./../images/recommend.png');
|
|
let hel = require('./../images/icon-hel.png');
|
|
let hel = require('./../images/icon-hel.png');
|
|
|
|
|
|
let showName, noticeName, clinicalPathwayName, clinicalGuidelineName, classicCaseName, isclick, top = 0
|
|
let showName, noticeName, clinicalPathwayName, clinicalGuidelineName, classicCaseName, isclick, top = 0
|
|
|
|
+let calculationFormulaData = {
|
|
|
|
+ title: "基础代谢率(BMR)计算器",
|
|
|
|
+ notes: `基础代谢率是指人体维持心跳、呼吸等基本生理活动所消耗的热量。
|
|
|
|
+ 基础代谢率(Basal Metabolic Rate,BMR)是指在自然温度(18~25°℃)环境中,清醒、静卧、空腹、思想放松状态下,维
|
|
|
|
+ 持生命(心跳、呼吸、腺体分泌、肾脏过滤排泄、解毒等)所需消耗的最低能量。
|
|
|
|
+ 这里采用与实测相差最小的 Miflin-St 公式为计算方法。这是目前最适合中国人体质、最为准确的基础代谢率计算方法。`,
|
|
|
|
+ contentTableData: [
|
|
|
|
+ { name: "性别", unit: "" },
|
|
|
|
+ { name: "体重", unit: "Kg(公斤)" },
|
|
|
|
+ { name: "身高", unit: "cm(厘米)" },
|
|
|
|
+ { name: "年龄", unit: "周岁" },
|
|
|
|
+ ]
|
|
|
|
+}
|
|
function myBrowser() {
|
|
function myBrowser() {
|
|
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
|
|
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
|
|
var isOpera = userAgent.indexOf("Opera") > -1;
|
|
var isOpera = userAgent.indexOf("Opera") > -1;
|
|
@@ -42,11 +55,11 @@ function getInfomation() {
|
|
"mrId": getUrlArgObject('mrId')
|
|
"mrId": getUrlArgObject('mrId')
|
|
};
|
|
};
|
|
showName = param.name
|
|
showName = param.name
|
|
- console.log(showName);
|
|
|
|
|
|
+ // console.log(showName);
|
|
$(".tabBox .title").html(showName);
|
|
$(".tabBox .title").html(showName);
|
|
|
|
|
|
baseType = param.type
|
|
baseType = param.type
|
|
- console.log(baseType);
|
|
|
|
|
|
+ // console.log(baseType);
|
|
|
|
|
|
post(config.information, param).then((res) => {
|
|
post(config.information, param).then((res) => {
|
|
const data = res.data.data
|
|
const data = res.data.data
|
|
@@ -75,9 +88,9 @@ function getInfomation() {
|
|
clinicalPathwayName = data.clinicalPathwayName || "临床路径"
|
|
clinicalPathwayName = data.clinicalPathwayName || "临床路径"
|
|
clinicalGuidelineName = data.clinicalGuidelineName || "诊疗指南"
|
|
clinicalGuidelineName = data.clinicalGuidelineName || "诊疗指南"
|
|
classicCaseName = data.classicCaseName || "经典病例"
|
|
classicCaseName = data.classicCaseName || "经典病例"
|
|
-
|
|
|
|
|
|
+ calculationFormulaData = data.calculatorFormula || null
|
|
renderTab(detailList, scale)
|
|
renderTab(detailList, scale)
|
|
-
|
|
|
|
|
|
+ renderCalculationFormula(calculationFormulaData)
|
|
staticKnowList && renderContent(staticKnowList, 'staticKnowledge')
|
|
staticKnowList && renderContent(staticKnowList, 'staticKnowledge')
|
|
noticeInfo && renderContent(noticeInfo, 'notice')
|
|
noticeInfo && renderContent(noticeInfo, 'notice')
|
|
clinicalPathwayInfo && renderContent(clinicalPathwayInfo, 'clinicalPathway')
|
|
clinicalPathwayInfo && renderContent(clinicalPathwayInfo, 'clinicalPathway')
|
|
@@ -88,12 +101,51 @@ function getInfomation() {
|
|
$('.content img').bind('contextmenu', function () {
|
|
$('.content img').bind('contextmenu', function () {
|
|
return false
|
|
return false
|
|
})
|
|
})
|
|
|
|
+ // 给计算公式的计算按钮添加点击事件
|
|
|
|
+ $(".calculationFormula .content .infos .calculation").on("unclick").on('click', function () {
|
|
|
|
+ const data = {
|
|
|
|
+ conceptId: calculationFormulaData.conceptId,
|
|
|
|
+ params: {}
|
|
|
|
+ }
|
|
|
|
+ $(".calculationFormula .content .infos .calculationFormula-input").each(function (index, element) {
|
|
|
|
+ // console.log(index, $(element).attr('name'), +$(element).val())
|
|
|
|
+ const name = $(element).attr('name')
|
|
|
|
+ data.params[name] = +$(element).val()
|
|
|
|
+ })
|
|
|
|
+ post("/kl/conceptInfo/getCalculatorFormulaResult", data).then(res => {
|
|
|
|
+ console.log("data", res.data)
|
|
|
|
+ if (res.data.code === '0') {
|
|
|
|
+
|
|
|
|
+ let str = `<p><span>得分:</span><span>${res.data.data.score}</span></p>
|
|
|
|
+ <p><span>结果:</span><span>${res.data.data.result}</span></p>`
|
|
|
|
+ $(".calculationFormula .content .infos footer .calculation-result").html(str).css("display", 'block')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ console.log("getCalculatorFormulaResult出错", err)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
getInfomation();
|
|
getInfomation();
|
|
|
|
|
|
-
|
|
|
|
|
|
+/**
|
|
|
|
+ * 渲染计算公式页面页面
|
|
|
|
+ * */
|
|
|
|
+function renderCalculationFormula(data) {
|
|
|
|
+ if (!data) {
|
|
|
|
+ $('.calculationFormula .content .infos').empty()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let str = `<h2 class="item-title">${data.title}</h2><p>${data.notes} </p><ul>`
|
|
|
|
+ for (let i = 0; i < data.contentTableData.length; i++) {
|
|
|
|
+ str += `<li><span class="calculationFormula-name">${data.contentTableData[i].name}:</span><input class='calculationFormula-input' type='number' name='${data.contentTableData[i].name}' /><span>${data.contentTableData[i].unit}</span></li>`
|
|
|
|
+ }
|
|
|
|
+ str += `</ul><footer><button class='calculation'>计算</button>
|
|
|
|
+ <div class='calculation-result'>测试</div></footer>`
|
|
|
|
+ $('.calculationFormula .content .infos').html(str)
|
|
|
|
+}
|
|
|
|
|
|
function renderContent(list, contentWrapClassName) {
|
|
function renderContent(list, contentWrapClassName) {
|
|
for (var i = 0; i < list.length; i++) {
|
|
for (var i = 0; i < list.length; i++) {
|
|
@@ -512,6 +564,7 @@ function renderTab(detailList, scale) {
|
|
if (detailList['静态知识']) {
|
|
if (detailList['静态知识']) {
|
|
$(".tabList").append(`<span class="tab" data-module="staticKnowledge" data-title="` + showName + `">静态知识</span>`)
|
|
$(".tabList").append(`<span class="tab" data-module="staticKnowledge" data-title="` + showName + `">静态知识</span>`)
|
|
}
|
|
}
|
|
|
|
+
|
|
if (detailList['临床路径']) {
|
|
if (detailList['临床路径']) {
|
|
$(".tabList").append(`<span class="tab" data-module="clinicalPathway" data-title="` + clinicalPathwayName + `">临床路径</span>`)
|
|
$(".tabList").append(`<span class="tab" data-module="clinicalPathway" data-title="` + clinicalPathwayName + `">临床路径</span>`)
|
|
//$(".tabBox .title").html(clinicalPathwayName);
|
|
//$(".tabBox .title").html(clinicalPathwayName);
|
|
@@ -525,13 +578,16 @@ function renderTab(detailList, scale) {
|
|
//$(".tabBox .title").html(noticeName);
|
|
//$(".tabBox .title").html(noticeName);
|
|
}
|
|
}
|
|
if (detailList['经典病例']) {
|
|
if (detailList['经典病例']) {
|
|
- console.log('xxxxx');
|
|
|
|
|
|
+ // console.log('xxxxx');
|
|
$(".tabList").append(`<span class="tab" data-module="classicCase" data-title="` + classicCaseName + `">经典病例</span>`)
|
|
$(".tabList").append(`<span class="tab" data-module="classicCase" data-title="` + classicCaseName + `">经典病例</span>`)
|
|
}
|
|
}
|
|
if (!!scale && getUrlArgObject('type') == 8) {
|
|
if (!!scale && getUrlArgObject('type') == 8) {
|
|
$(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
|
|
$(".tabList").append(`<span class="tab" data-module="scale" data-title="` + showName + `">评估内容</span>`)
|
|
//$(".tabBox .title").html(noticeName);
|
|
//$(".tabBox .title").html(noticeName);
|
|
}
|
|
}
|
|
|
|
+ if (calculationFormulaData && getUrlArgObject('type') == 8) {
|
|
|
|
+ $(".tabList").append(`<span class="tab" data-module="calculationFormula" data-title="` + showName + `">计算公式</span>`)
|
|
|
|
+ }
|
|
let defaultModuleName
|
|
let defaultModuleName
|
|
if (getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) {
|
|
if (getUrlArgObject('page') && getUrlArgObject('page') == 1 && scale && detailList['静态知识']) {
|
|
$(".tabList .tab").eq(1).addClass("activeTab")
|
|
$(".tabList .tab").eq(1).addClass("activeTab")
|