From a048b1b1f05adb11dab0d23048db4cdeff07c2bf Mon Sep 17 00:00:00 2001 From: "1747191978@qq.com" <1942943850@qq.com> Date: Mon, 17 Feb 2025 18:04:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=8A=E7=96=97=E7=BB=9F=E8=AE=A1=E4=B8=8D?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E5=A4=B1=E7=9C=A0=E7=84=A6=E8=99=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acupuncture-前台/src/views/indexCom/JM.vue | 139 +++++++++++++++++- acupuncture-前台/src/views/indexCom/index.js | 103 +++++++++++++ .../src/views/indexCom/patient.vue | 2 +- 3 files changed, 238 insertions(+), 6 deletions(-) diff --git a/acupuncture-前台/src/views/indexCom/JM.vue b/acupuncture-前台/src/views/indexCom/JM.vue index 1b834c42..2c6c4ebe 100644 --- a/acupuncture-前台/src/views/indexCom/JM.vue +++ b/acupuncture-前台/src/views/indexCom/JM.vue @@ -27,6 +27,60 @@ +
+
+
+ +
+ 体质分布 +
+
+
+
+
+
+
+
+ +
+ 体态评估(TAPS) +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ 失眠评估(PHQ-9) +
+
+
+
+
+
+
+
+ +
+ 焦虑(HAMD-24) +
+
+
+
+
+
+
+
+
+
@@ -39,7 +93,9 @@ } from "@/api/indexCom.js"; import { diagnoseEcharts, - systemEcharts + systemEcharts, + physiqueEcharts, + postureEcharts } from "./index"; export default { name: "Post", @@ -47,15 +103,18 @@ mixins: [resize], data() { return { - loading: false, - diagnoseValue: null, // 病种 - systemValue: null, // 体系 queryParams: { param: { startTime: "", endTime: "", }, }, + loading: false, + diagnoseValue: null, // 病种 + systemValue: null, // 体系 + physiqueValue: null, // 体质 + postureValue:null, // 体态 + // 体系中文 systemObj: { "yxfpz": "隐形肥胖型", //隐形肥胖型 @@ -67,7 +126,19 @@ "xsx": "消瘦型", //消瘦型 "dzfx": "低脂肪型", //低脂肪型 "ydyx": "运动员型", //运动员型 - } + }, + // 体质 + physiqueObj: { + "phz": "平和质", //平和质 + "qxz": "气虚质", //气虚质 + "yangxz": "阳虚质", //阳虚质 + "yinxz": "阴虚质", //阴虚质 + "tsz": "痰湿质", //痰湿质 + "srz": "湿热质", //湿热质 + "xyz": "血瘀质", //血瘀质 + "qyz": "气郁质", //气郁质 + "tlz": "特禀质", //特禀质 + }, }; }, created() { @@ -106,6 +177,35 @@ this.systemValue.push(data) } this.handleSystem() + // 体质 + this.physiqueValue = [] + delete zytz.total + for (let key in zytz) { + let data = { + name: this.physiqueObj[key], + value: zytz[key], + } + this.physiqueValue.push(data) + } + this.handlePhysique() + // 体态 + this.postureValue = [{ + value: ttfb.score1, + name: "1分" + },{ + value: ttfb.score2, + name: "2分" + },{ + value: ttfb.score3, + name: "3分" + },{ + value: ttfb.score4, + name: "4分" + },{ + value: ttfb.score5, + name: "5分" + }] + this.handlePosture() }); this.loading = false; } catch (e) {} @@ -144,6 +244,35 @@ window.onresize = myChart.resize; }); }, + // 体质 + handlePhysique() { + physiqueEcharts.series[0].data = this.physiqueValue?.map((item) => { + return item.value; + }); + physiqueEcharts.xAxis.data = this.physiqueValue?.map((item) => { + return item.name; + }); + this.$nextTick(() => { + var myChart = echarts.init(document.getElementById("physique"), null, { + height: 300, + }); + myChart.setOption(physiqueEcharts, true); + myChart.resize(); + window.onresize = myChart.resize; + }); + }, + // 体态评估 + handlePosture() { + postureEcharts.series[0].data = this.postureValue + this.$nextTick(() => { + var myChart = echarts.init(document.getElementById("posture"), null, { + height: 300, + }); + myChart.setOption(postureEcharts, true); + myChart.resize(); + window.onresize = myChart.resize; + }); + }, // 数据处理 查询类型判断参数 initial(_data, _type) { _data[0] = this.$moment(_data[0]).format("YYYY-MM-DD"); diff --git a/acupuncture-前台/src/views/indexCom/index.js b/acupuncture-前台/src/views/indexCom/index.js index c982a65c..a23f45a3 100644 --- a/acupuncture-前台/src/views/indexCom/index.js +++ b/acupuncture-前台/src/views/indexCom/index.js @@ -342,6 +342,109 @@ export const systemEcharts = { ], }; +// 体质 +export const physiqueEcharts = { + tooltip: { + trigger: "axis", + axisPointer: { + type: "cross", + label: { + backgroundColor: "#6a7985", + }, + }, + formatter: function (params) { + let res1 = params[0].name; + for (var i = 0, l = params.length; i < l; i++) { + res1 += + "
" + + `` + + params[i].seriesName + + " : " + + params[i].value + + "个"; + } + return res1; + }, + }, + xAxis: { + type: "category", + data: [], + }, + grid: { + top: "12%", + left: "5%", + right: "2%", + bottom: "0%", + containLabel: true, + }, + yAxis: { + name: "数量( 个 )", + type: "value", + minInterval: 1, + splitLine: { + show: true, + lineStyle: { + type: "dashed", + }, + }, + }, + series: [ + { + name: "数量:", + data: [], + type: "bar", + barMaxWidth: 24, //柱图宽度 + color: "#4f8bff", + itemStyle: { + normal: { + //这里设置柱形图圆角 [左上角,右上角,右下角,左下角] + barBorderRadius: [50, 50, 0, 0], + }, + }, + }, + + ], +}; +// 体态 +export const postureEcharts = { + tooltip: { + trigger: "item", + }, + title: { + text: "", + left: "center", + top: "40%", + textStyle: { + textAlign: "center", + color: "#393D4E", + fontSize: 40, + fontWeight: 600, + }, + }, + grid: { + top: "0%", + left: "0", + right: "0%", + bottom: "0%", + containLabel: true, + }, + color: ["#4f8bff", "#ffcd6c", "#00d1a1", "#a794fe","#EE6666"], + series: [ + { + type: "pie", + radius: "80%", + avoidLabelOverlap: false, + label: { + show: false, + position: "center", + }, + labelLine: { + show: false, + }, + data: [], + }, + ], +}; // 患者信息 - 数据分析 export const HZXXSJFX = { tooltip: { diff --git a/acupuncture-前台/src/views/indexCom/patient.vue b/acupuncture-前台/src/views/indexCom/patient.vue index bf1c3591..c1f31125 100644 --- a/acupuncture-前台/src/views/indexCom/patient.vue +++ b/acupuncture-前台/src/views/indexCom/patient.vue @@ -158,7 +158,7 @@ { value: res.data.totalPatients, name: "女" - }, + } ]; // 年龄分布 let ageValue = res.data.age