diff --git a/acupuncture-前台/src/views/indexCom/JM.vue b/acupuncture-前台/src/views/indexCom/JM.vue index 1894741f..1b834c42 100644 --- a/acupuncture-前台/src/views/indexCom/JM.vue +++ b/acupuncture-前台/src/views/indexCom/JM.vue @@ -16,12 +16,12 @@
- 体型分布 + 体系分布
- +
@@ -38,7 +38,8 @@ zlInfo } from "@/api/indexCom.js"; import { - diagnoseEcharts + diagnoseEcharts, + systemEcharts } from "./index"; export default { name: "Post", @@ -47,32 +48,25 @@ data() { return { loading: false, - diagnoseValue: null, // 患者总数统计值 + diagnoseValue: null, // 病种 + systemValue: null, // 体系 queryParams: { param: { startTime: "", endTime: "", }, }, - jwbzObj: { - "gxy": "高血压", //高血压 - "nxgb": "脑血管病", //脑血管病 - "exzl": "恶性肿瘤", //恶性肿瘤 - "gxb": "冠心病", //冠心病 - "jsjb": "精神疾病", //精神疾病 - "whsezcky": "胃和十二指肠溃疡", //胃和十二指肠溃疡 - "fpz": "肥胖症", //肥胖症 - "gzssz": "骨质疏松症", //骨质疏松症 - "ycxXtxjb": "遗传性、先天性疾病", //遗传性、先天性疾病 - "tnb": "糖尿病", //糖尿病 - "mxfxjb": "慢性肺系疾病", //慢性肺系疾病 - "gzxz": "高脂血症", //高脂血症 - "gzjb": "肝脏疾病", //肝脏疾病 - "gmxjb": "过敏性疾病", //过敏性疾病 - "gjy": "关节炎", //关节炎 - "tf": "痛风", //痛风 - "sySb": "肾炎、肾病", //肾炎、肾病 - "other": "其他" //其他 + // 体系中文 + systemObj: { + "yxfpz": "隐形肥胖型", //隐形肥胖型 + "zfgdx": "脂肪过多型", //脂肪过多型 + "fpx": "肥胖型", //肥胖型 + "jrbzx": "肌肉不足型", //肌肉不足型 + "jkjcx": "健康匀称型", //健康匀称型 + "czjrx": "超重肌肉型", //超重肌肉型 + "xsx": "消瘦型", //消瘦型 + "dzfx": "低脂肪型", //低脂肪型 + "ydyx": "运动员型", //运动员型 } }; }, @@ -90,24 +84,40 @@ async getData() { try { await zlInfo(this.queryParams).then((res) => { - const {jlfb,smfb,sort,ttfb,txfb,zytz} = res.data + const { + jlfb, + smfb, + sort, + ttfb, + txfb, + zytz + } = res.data // 病种(主要诊断) - this.diagnoseValue = sort.sort((a, b) => a.total-b.total) + this.diagnoseValue = sort.sort((a, b) => a.total - b.total) this.handleDiagnose() + // 体系 + this.systemValue = [] + delete txfb.total + for (let key in txfb) { + let data = { + name: this.systemObj[key], + value: txfb[key] + } + this.systemValue.push(data) + } + this.handleSystem() }); this.loading = false; } catch (e) {} }, // 病种(主要诊断) handleDiagnose() { - diagnoseEcharts.series[0].data = this.diagnoseValue?.map((item) => { return item.total; }); diagnoseEcharts.yAxis.data = this.diagnoseValue?.map((item) => { return item.type; }); - console.log('diagnoseEcharts',diagnoseEcharts) this.$nextTick(() => { var myChart = echarts.init(document.getElementById("diagnose"), null, { height: 300, @@ -117,6 +127,23 @@ window.onresize = myChart.resize; }); }, + // 体系 + handleSystem() { + systemEcharts.series[0].data = this.systemValue?.map((item) => { + return item.value; + }); + systemEcharts.xAxis.data = this.systemValue?.map((item) => { + return item.name; + }); + this.$nextTick(() => { + var myChart = echarts.init(document.getElementById("system"), null, { + height: 300, + }); + myChart.setOption(systemEcharts, 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 f79be0c5..c982a65c 100644 --- a/acupuncture-前台/src/views/indexCom/index.js +++ b/acupuncture-前台/src/views/indexCom/index.js @@ -1,5 +1,5 @@ import * as echarts from "echarts"; -// 患者信息统计 +// -------- 患者信息统计 -------- // 患者总数 export const HZXX = { tooltip: { @@ -220,6 +220,8 @@ export const diseaseEcharts = { ], }; +// -------- 诊疗信息统计 -------- +// 病种 export const diagnoseEcharts = { tooltip: { trigger: "axis", @@ -257,8 +259,8 @@ export const diagnoseEcharts = { }, grid: { top: "12%", - left: "3%", - right: "12%", + left: "1%", + right: "14%", bottom: "0%", containLabel: true, }, @@ -277,6 +279,69 @@ export const diagnoseEcharts = { ], }; +// 体系 +export const systemEcharts = { + 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 HZXXSJFX = { tooltip: {