Browse Source

患者统计(患者总数、性别、年龄)

newMaster
1747191978@qq.com 4 months ago
parent
commit
1534347f87
  1. 11
      acupuncture-前台/src/api/indexCom.js
  2. 2
      acupuncture-前台/src/views/index.vue
  3. 185
      acupuncture-前台/src/views/indexCom/index.js
  4. 515
      acupuncture-前台/src/views/indexCom/patient.vue

11
acupuncture-前台/src/api/indexCom.js

@ -105,3 +105,14 @@ export function queryData(data) {
data: data, data: data,
}); });
} }
// 患者信息
export function patientTotal(data) {
return request({
url: "/statistics/patientTotal",
method: "post",
data: data,
});
}
// 诊疗信息
// 治疗类型
// 随访分布

2
acupuncture-前台/src/views/index.vue

@ -6,7 +6,7 @@
<search <search
@radio-change="radioChange" @radio-change="radioChange"
@picker-change="pickerChage" @picker-change="pickerChage"
title="病例统计" title="患者信息统计"
type="1" type="1"
></search> ></search>
</el-card> </el-card>

185
acupuncture-前台/src/views/indexCom/index.js

@ -1,5 +1,5 @@
import * as echarts from "echarts"; import * as echarts from "echarts";
// 患者信息 // 患者总数
export const HZXX = { export const HZXX = {
tooltip: { tooltip: {
trigger: "item", trigger: "item",
@ -52,8 +52,48 @@ export const HZXX = {
}, },
], ],
}; };
// 患者信息 - 数据分析 // 患者性别
export const HZXXSJFX = { export const gende = {
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", "#FE4943"],
series: [
{
type: "pie",
radius: "80%",
avoidLabelOverlap: false,
label: {
show: false,
position: "center",
},
labelLine: {
show: false,
},
data: [],
},
],
};
// 年龄分布
export const ageEcharts = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
axisPointer: { axisPointer: {
@ -78,20 +118,7 @@ export const HZXXSJFX = {
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: [ data: ["<40","41-50","51-60","61-70","71-80",">80",],
"2023-01",
"2023-02",
"2023-03",
"2023-04",
"2023-05",
"2023-06",
"2023-07",
"2023-08",
"2023-09",
"2023-10",
"2023-11",
"2023-12",
],
}, },
grid: { grid: {
top: "12%", top: "12%",
@ -101,7 +128,7 @@ export const HZXXSJFX = {
containLabel: true, containLabel: true,
}, },
yAxis: { yAxis: {
name: "单位( 个 )", name: "数量( 个 )",
type: "value", type: "value",
minInterval: 1, minInterval: 1,
splitLine: { splitLine: {
@ -113,8 +140,8 @@ export const HZXXSJFX = {
}, },
series: [ series: [
{ {
name: "仅溶栓人数", name: "<40",
data: [20, 20, 50, 80, 70, 11, 15], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#4f8bff", color: "#4f8bff",
@ -126,8 +153,8 @@ export const HZXXSJFX = {
}, },
}, },
{ {
name: "仅介入人数", name: "41-50",
data: [120, 200, 150, 80, 70, 110, 10], data: [],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#ffcd6c", color: "#ffcd6c",
@ -138,12 +165,114 @@ export const HZXXSJFX = {
}, },
}, },
}, },
{
name: "51-60",
data: [],
type: "bar",
barMaxWidth: 24, //柱图宽度
color: "#ffcd6c",
itemStyle: {
normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0],
},
},
},
{
name: "61-70",
data: [],
type: "bar",
barMaxWidth: 24, //柱图宽度
color: "#4f8bff",
itemStyle: {
normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0],
},
},
},
{
name: "71-80",
data: [120, 200, 150, 80, 70, 110, 10],
type: "bar",
barMaxWidth: 24, //柱图宽度
color: "#ffcd6c",
itemStyle: {
normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0],
},
},
},
{
name: ">80",
data: [],
type: "bar",
barMaxWidth: 24, //柱图宽度
color: "#ffcd6c",
itemStyle: {
normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
barBorderRadius: [50, 50, 0, 0],
},
},
},
],
};
// 患者信息 - 数据分析
export const HZXXSJFX = {
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 +=
"<br/>" +
`<span style="background:${params[i].color};width:12px;display:inline-block;height:12px;border-radius:50%;margin-right:5px;"></span>` +
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: "未溶栓且未介入人数", name: "",
data: [120, 200, 150, 80, 70, 110, 15], data: [20, 20, 50, 80, 70, 11, 15],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#00d1a1", color: "#4f8bff",
itemStyle: { itemStyle: {
normal: { normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]
@ -152,11 +281,11 @@ export const HZXXSJFX = {
}, },
}, },
{ {
name: "溶栓+介入人数", name: "",
data: [120, 200, 150, 80, 70, 110, 15], data: [120, 200, 150, 80, 70, 110, 10],
type: "bar", type: "bar",
barMaxWidth: 24, //柱图宽度 barMaxWidth: 24, //柱图宽度
color: "#a794fe", color: "#ffcd6c",
itemStyle: { itemStyle: {
normal: { normal: {
//这里设置柱形图圆角 [左上角,右上角,右下角,左下角] //这里设置柱形图圆角 [左上角,右上角,右下角,左下角]

515
acupuncture-前台/src/views/indexCom/patient.vue

@ -1,246 +1,285 @@
<template> <template>
<div class="app-container"> <div>
<div class="dis" style="width: 100%"> <div class="app-container">
<div style="flex: 1; margin-right: 20px; min-width: 600px"> <div class="dis" style="width: 100%">
<el-card shadow="always"> <div style="flex: 1; margin-right: 20px">
<div class="dis title-box"> <el-card shadow="always">
<span class="header-title">病例统计</span> <div class="dis title-box">
<div class="dis"> <span class="header-title">患者总数</span>
<div class="dian-box dis"> <div class="dis"></div>
<div class="dian-box dis"> </div>
<span class="dian" style="background: #4f8bff"></span> <!-- 患者总数统计图 -->
仅溶栓人数 <div style="height: 300px" v-loading="loading">
</div> <div id="patienty" style="width: 100%"></div>
<span class="dian" style="background: #ffcd6c"></span> </div>
仅介入人数 </el-card>
</div> </div>
<div class="dian-box dis"> <div style="flex: 1">
<span class="dian" style="background: #00d1a1"></span> <el-card shadow="always">
未溶栓且未介入人数 <div class="dis title-box">
</div> <span class="header-title">性别数量</span>
<div class="dian-box dis"> <div class="dis">
<span class="dian" style="background: #a794fe"></span> <div class="dian-box dis">
溶栓+介入人数 <div class="dian-box dis">
</div> <span class="dian" style="background: #4f8bff"></span>
</div>
</div> </div>
<!-- 统计图 --> <span class="dian" style="background: #fe4943"></span>
<div style="height: 300px" v-loading="loading">
<div id="patienty" style="width: 100%"></div> </div>
</div> </div>
</el-card> </div>
</div> <!-- 性别统计图 -->
<div style="flex: 2; min-width: 610px"> <div style="height: 300px" v-loading="loading">
<el-card shadow="always"> <div id="gender" style="width: 100%"></div>
<div class="dis title-box"> </div>
<span class="header-title">数据对比 </span> </el-card>
<div class="dis"> </div>
<div class="dian-box dis"> </div>
<div class="dian-box dis"> </div>
<span class="dian" style="background: #4f8bff"></span> <div class="app-container">
仅溶栓人数 <div class="dis" style="width: 100%">
</div> <div style="flex: 1; margin-right: 20px">
<span class="dian" style="background: #ffcd6c"></span> <el-card shadow="always">
仅介入人数 <div class="dis title-box">
</div> <span class="header-title">年龄分布</span>
<div class="dian-box dis"> <div class="dis"></div>
<span class="dian" style="background: #00d1a1"></span> </div>
未溶栓且未介入人数 <!-- 患者总数统计图 -->
</div> <div style="height: 300px" v-loading="loading">
<div class="dian-box dis"> <div id="age" style="width: 100%"></div>
<span class="dian" style="background: #a794fe"></span> </div>
溶栓+介入人数 </el-card>
</div> </div>
</div> <div style="flex: 1">
</div> <el-card shadow="always">
<!-- 统计图 --> <div class="dis title-box">
<div style="height: 300px" v-loading="loading"> <span class="header-title">性别统计</span>
<div id="patientz" style="width: 100%"></div> <div class="dis">
</div> <div class="dian-box dis">
</el-card> <div class="dian-box dis">
</div> <span class="dian" style="background: #4f8bff"></span>
</div>
</div> </div>
<span class="dian" style="background: #ffcd6c"></span>
</div>
</div>
</div>
<!-- 性别统计图 -->
<div style="height: 300px" v-loading="loading">
<!-- <div id="gender" style="width: 100%"></div> -->
</div>
</el-card>
</div>
</div>
</div>
</div>
</template> </template>
<script> <script>
import * as echarts from "echarts"; import * as echarts from "echarts";
require("echarts/theme/macarons"); // echarts theme require("echarts/theme/macarons"); // echarts theme
import resize from "@/views/dashboard/mixins/resize"; import resize from "@/views/dashboard/mixins/resize";
import { queryPatient, queryByDatePatient } from "@/api/indexCom.js"; import {
import { HZXX, HZXXSJFX } from "./index"; patientTotal,
export default { queryByDatePatient
name: "Post", } from "@/api/indexCom.js";
props: ["title"], import {
mixins: [resize], HZXX,
data() { HZXXSJFX,
return { gende,
loading: false, ageEcharts
HZXXvalue: null, } from "./index";
SJDBvalue: null, export default {
queryParams: { name: "Post",
param: { props: ["title"],
timeType: 4, mixins: [resize],
startTime: "", data() {
endTime: "", return {
}, loading: false,
}, HZXXvalue: null, //
}; gendeValue: null, //
}, ageValue: null, //
created() { queryParams: {
// this.Linepatient() param: {
// this.getData(); startTime: "",
}, endTime: "",
methods: { },
statistics(_data, _type) { },
this.initial(_data, _type); // };
this.loading = true; },
this.getData(); // created() {
}, // this.Linepatient()
// this.getData();
async getData() { },
try { methods: {
// statistics(_data, _type) {
await queryPatient(this.queryParams).then((res) => { this.initial(_data, _type); //
this.HZXXvalue = res.data; this.loading = true;
this.Linepatient(); this.getData(); //
}); },
// //
await queryByDatePatient(this.queryParams).then((res) => { async getData() {
this.SJDBvalue = res.data.list; try {
this.columnar(); await patientTotal(this.queryParams).then((res) => {
}); //
this.loading = false; this.HZXXvalue = [{
} catch (e) {} value: res.data.totalPatients,
}, name: "患者总数"
}, ];
//
this.gendeValue = [{
value: res.data.totalPatients,
name: "男"
},
{
value: res.data.totalPatients,
name: "女"
},
];
//
let ageValue = res.data.age
this.ageValue = [ageValue.num1, ageValue.num2, ageValue.num2, ageValue.num4, ageValue
.num5, ageValue.num6
]
this.Linepatient(); //
this.handleAge(); //
this.columnar(); //
});
this.loading = false;
} catch (e) {}
},
// //
Linepatient() { Linepatient() {
HZXX.title.text = this.HZXXvalue?.total; HZXX.title.text = this.HZXXvalue[0].value;
HZXX.series[0].data = [ HZXX.series[0].data = this.HZXXvalue;
{ value: this.HZXXvalue?.onlyRs, name: "仅溶栓人数", roundCap: true }, this.$nextTick(() => {
{ var myChart = echarts.init(document.getElementById("patienty"), null, {
value: this.HZXXvalue?.onlyXgzl, height: 300,
name: "仅介入人数", });
roundCap: true, myChart.setOption(HZXX, true);
}, myChart.resize();
{ value: this.HZXXvalue?.neither, name: "未溶栓且未介入人数" }, window.onresize = myChart.resize;
{ value: this.HZXXvalue?.both, name: "溶栓+介入人数" }, });
// { value: 200, name: "", roundCap: true }, },
// { value: 150, name: "", roundCap: true }, //
// { value: 100, name: "" }, columnar() {
]; gende.series[0].data = this.gendeValue;
this.$nextTick(() => { this.$nextTick(() => {
// domecharts var myChart = echarts.init(document.getElementById("gender"), null, {
var myChart = echarts.init(document.getElementById("patienty"), null, { height: 300,
height: 300, });
}); myChart.setOption(gende, true);
myChart.setOption(HZXX, true); myChart.resize();
myChart.resize(); window.onresize = myChart.resize;
window.onresize = myChart.resize; });
}); },
}, handleAge() {
// - console.log('ageEcharts',ageEcharts)
columnar() { ageEcharts.series[0].data = [this.ageValue[0]]
HZXXSJFX.series[0].data = this.SJDBvalue?.map((item) => { ageEcharts.series[1].data = [this.ageValue[1]]
return item.onlyRs; // ageEcharts.series[2].data = [this.ageValue[2]]
}); ageEcharts.series[3].data = [this.ageValue[3]]
HZXXSJFX.series[1].data = this.SJDBvalue?.map((item) => { ageEcharts.series[4].data = [this.ageValue[4]]
return item.onlyXgzl; // ageEcharts.series[5].data = [this.ageValue[5]]
});
HZXXSJFX.series[2].data = this.SJDBvalue?.map((item) => { this.$nextTick(() => {
return item.neither; // // domecharts
}); var myChart = echarts.init(document.getElementById("age"), null, {
HZXXSJFX.series[3].data = this.SJDBvalue?.map((item) => { height: 300,
return item.both; //+ });
}); myChart.setOption(ageEcharts, true);
HZXXSJFX.xAxis.data = this.SJDBvalue?.map((item) => { myChart.resize();
return item.date; //X window.onresize = myChart.resize;
}); });
this.$nextTick(() => { },
// domecharts //
var myChart = echarts.init(document.getElementById("patientz"), null, { initial(_data, _type) {
height: 300, _data[0] = this.$moment(_data[0]).format("YYYY-MM-DD");
}); _data[1] = this.$moment(_data[1]).format("YYYY-MM-DD");
myChart.setOption(HZXXSJFX, true); this.queryParams.param = {
myChart.resize(); startTime: _data[0] + " " + "00:00:00",
window.onresize = myChart.resize; endTime: _data[1] + " " + "23:59:59",
}); };
}, },
// //
initial(_data, _type) { getRenew() {
console.log("_data, _type: ", _data, _type); this.Linepatient();
_data[0] = this.$moment(_data[0]).format("YYYY-MM-DD"); this.columnar();
_data[1] = this.$moment(_data[1]).format("YYYY-MM-DD"); },
this.queryParams.param = { },
timeType: _type, };
startTime: _data[0] + " " + "00:00:00",
endTime: _data[1] + " " + "23:59:59",
};
},
//
getRenew() {
this.Linepatient();
this.columnar();
},
},
};
</script> </script>
<style scoped src="@/assets/styles/common.css"></style> <style scoped src="@/assets/styles/common.css"></style>
<style scoped> <style scoped>
>>> .el-card__body { >>>.el-card__body {
padding: 10px 0 !important; padding: 10px 0 !important;
} }
.dis {
display: flex; .dis {
} display: flex;
.header-title { }
font-size: 18px;
} .header-title {
.title-box { font-size: 18px;
padding: 10px 20px; }
border-bottom: 1px solid #dfe6ec;
} .title-box {
.dian-box { padding: 10px 20px;
align-items: center; border-bottom: 1px solid #dfe6ec;
} }
.dian {
display: inline-block; .dian-box {
width: 16px; align-items: center;
height: 16px; }
border-radius: 50%;
margin: 0 10px; .dian {
} display: inline-block;
.title-box { width: 16px;
justify-content: space-between; height: 16px;
} border-radius: 50%;
. >>> .el-radio--small.is-bordered { margin: 0 10px;
margin-right: 20px !important; }
margin-left: 0 !important;
} .title-box {
>>> .el-radio__input { justify-content: space-between;
display: none; }
}
>>> .el-radio__label { .>>>.el-radio--small.is-bordered {
padding-left: 5px; margin-right: 20px !important;
} margin-left: 0 !important;
.app-container { }
padding: 0;
display: flex; >>>.el-radio__input {
justify-content: space-between; display: none;
} }
.title {
display: flex; >>>.el-radio__label {
align-items: center; padding-left: 5px;
font-size: 20px; }
font-weight: 600;
} .app-container {
.title-bor { padding: 0;
display: inline-block; display: flex;
height: 20px; justify-content: space-between;
width: 6px; }
background: #4f8bff;
margin-right: 10px; .title {
border-radius: 8px; display: flex;
} align-items: center;
</style> font-size: 20px;
font-weight: 600;
}
.title-bor {
display: inline-block;
height: 20px;
width: 6px;
background: #4f8bff;
margin-right: 10px;
border-radius: 8px;
}
</style>
Loading…
Cancel
Save