Browse Source

患者统计(既往病种)

newMaster
1747191978@qq.com 4 months ago
parent
commit
dd7129a001
  1. 64
      acupuncture-前台/src/views/indexCom/index.js
  2. 63
      acupuncture-前台/src/views/indexCom/patient.vue

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

@ -155,7 +155,69 @@ export const ageEcharts = {
], ],
}; };
// 病种分布
export const diseaseEcharts = {
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: ["<40岁","41-50岁","51-60岁","61-70岁","71-80岁",">80岁",],
},
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 = { export const HZXXSJFX = {
tooltip: { tooltip: {

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

@ -56,19 +56,19 @@
<div class="dis title-box"> <div class="dis title-box">
<span class="header-title">既往病种分布</span> <span class="header-title">既往病种分布</span>
<div class="dis"> <div class="dis">
<div class="dian-box dis"> <!-- <div class="dian-box dis">
<div class="dian-box dis"> <div class="dian-box dis">
<span class="dian" style="background: #4f8bff"></span> <span class="dian" style="background: #4f8bff"></span>
</div> </div>
<span class="dian" style="background: #ffcd6c"></span> <span class="dian" style="background: #ffcd6c"></span>
</div> </div> -->
</div> </div>
</div> </div>
<!-- 既往病种分布 --> <!-- 既往病种分布 -->
<div style="height: 300px" v-loading="loading"> <div style="height: 300px" v-loading="loading">
<!-- <div id="gender" style="width: 100%"></div> --> <div id="disease" style="width: 100%"></div>
</div> </div>
</el-card> </el-card>
</div> </div>
@ -89,7 +89,8 @@
HZXX, HZXX,
HZXXSJFX, HZXXSJFX,
gende, gende,
ageEcharts ageEcharts,
diseaseEcharts
} from "./index"; } from "./index";
export default { export default {
name: "Post", name: "Post",
@ -101,12 +102,33 @@
HZXXvalue: null, // HZXXvalue: null, //
gendeValue: null, // gendeValue: null, //
ageValue: null, // ageValue: null, //
diseaseValue: null, //
queryParams: { queryParams: {
param: { param: {
startTime: "", startTime: "",
endTime: "", endTime: "",
}, },
}, },
jwbzObj: {
"gxy": "高血压", //
"nxgb": "脑血管病", //
"exzl": "恶性肿瘤", //
"gxb": "冠心病", //
"jsjb": "精神疾病", //
"whsezcky": "胃和十二指肠溃疡", //
"fpz": "肥胖症", //
"gzssz": "骨质疏松症", //
"ycxXtxjb": "遗传性、先天性疾病", //
"tnb": "糖尿病", //尿
"mxfxjb": "慢性肺系疾病", //
"gzxz": "高脂血症", //
"gzjb": "肝脏疾病", //
"gmxjb": "过敏性疾病", //
"gjy": "关节炎", //
"tf": "痛风", //
"sySb": "肾炎、肾病", //
"other": "其他" //
}
}; };
}, },
created() { created() {
@ -143,10 +165,20 @@
this.ageValue = [ageValue.num1, ageValue.num2, ageValue.num2, ageValue.num4, ageValue this.ageValue = [ageValue.num1, ageValue.num2, ageValue.num2, ageValue.num4, ageValue
.num5, ageValue.num6 .num5, ageValue.num6
] ]
//
let diseaseValue = res.data.jwbz
this.diseaseValue = []
for (let key in diseaseValue) {
let data = {
name: this.jwbzObj[key],
value: diseaseValue[key]
}
this.diseaseValue.push(data)
}
this.Linepatient(); // this.Linepatient(); //
this.handleAge(); // this.handleAge(); //
this.columnar(); // this.columnar(); //
this.handleDisease(); //
}); });
this.loading = false; this.loading = false;
} catch (e) {} } catch (e) {}
@ -177,12 +209,10 @@
window.onresize = myChart.resize; window.onresize = myChart.resize;
}); });
}, },
//
handleAge() { handleAge() {
console.log('ageEcharts',ageEcharts)
ageEcharts.series[0].data = this.ageValue ageEcharts.series[0].data = this.ageValue
this.$nextTick(() => { this.$nextTick(() => {
// domecharts
var myChart = echarts.init(document.getElementById("age"), null, { var myChart = echarts.init(document.getElementById("age"), null, {
height: 300, height: 300,
}); });
@ -191,6 +221,23 @@
window.onresize = myChart.resize; window.onresize = myChart.resize;
}); });
}, },
//
handleDisease() {
diseaseEcharts.series[0].data = this.diseaseValue?.map((item) => {
return item.value;
});
diseaseEcharts.xAxis.data = this.diseaseValue?.map((item) => {
return item.name;
});
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("disease"), null, {
height: 300,
});
myChart.setOption(diseaseEcharts, true);
myChart.resize();
window.onresize = myChart.resize;
});
},
// //
initial(_data, _type) { initial(_data, _type) {
_data[0] = this.$moment(_data[0]).format("YYYY-MM-DD"); _data[0] = this.$moment(_data[0]).format("YYYY-MM-DD");

Loading…
Cancel
Save