Browse Source

页面尺寸变化重新渲染图表

newMaster
1747191978@qq.com 4 months ago
parent
commit
7bb4eb30e3
  1. 8
      acupuncture-前台/src/views/index.vue
  2. 752
      acupuncture-前台/src/views/indexCom/JM.vue
  3. 80
      acupuncture-前台/src/views/indexCom/XGZL.vue
  4. 4
      acupuncture-前台/src/views/indexCom/follow.vue
  5. 6
      acupuncture-前台/src/views/indexCom/patient.vue

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

@ -65,9 +65,11 @@
},
methods: {
resize() {
// this.$refs.patient.getRenew();
// this.$refs.JM.getRenew();
// this.$refs.XGZL.getRenew();
console.log(111)
this.$refs.patient.getRenew();
this.$refs.JM.getRenew();
this.$refs.XGZL.getRenew();
this.$refs.follow.getRenew();
},
//
radioChange(_data, _type, _timeType) {

752
acupuncture-前台/src/views/indexCom/JM.vue

@ -1,392 +1,404 @@
<template>
<div>
<div class="app-container">
<div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">病种排名</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="diagnose" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">体系分布</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="system" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">体质分布</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="physique" style="width: 100%"></div>
</div>
</el-card>
<div>
<div class="app-container">
<div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">病种排名</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="diagnose" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">体系分布</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="system" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">体质分布</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="physique" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">体态评估TAPS</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="posture" style="width: 100%"></div>
</div>
</el-card>
</div>
</div>
</div>
<div style="flex: 1">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">体态评估TAPS</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="posture" style="width: 100%"></div>
</div>
</el-card>
<div class="app-container">
<div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">失眠评估PHQ-9</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="agrypnia" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">焦虑HAMD-24</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="anxiety" style="width: 100%"></div>
</div>
</el-card>
</div>
</div>
</div>
</div>
</div>
<div class="app-container">
<div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">失眠评估PHQ-9</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="agrypnia" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">焦虑HAMD-24</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="anxiety" style="width: 100%"></div>
</div>
</el-card>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import * as echarts from "echarts";
require("echarts/theme/macarons"); // echarts theme
import resize from "@/views/dashboard/mixins/resize";
import { zlInfo } from "@/api/indexCom.js";
import {
diagnoseEcharts,
systemEcharts,
physiqueEcharts,
postureEcharts,
agrypniaEcharts,
anxietyEcharts,
} from "./index";
export default {
name: "Post",
props: ["title"],
mixins: [resize],
data() {
return {
queryParams: {
param: {
startTime: "",
endTime: "",
},
},
import * as echarts from "echarts";
require("echarts/theme/macarons"); // echarts theme
import resize from "@/views/dashboard/mixins/resize";
import {
zlInfo
} from "@/api/indexCom.js";
import {
diagnoseEcharts,
systemEcharts,
physiqueEcharts,
postureEcharts,
agrypniaEcharts,
anxietyEcharts,
} from "./index";
export default {
name: "Post",
props: ["title"],
mixins: [resize],
data() {
return {
queryParams: {
param: {
startTime: "",
endTime: "",
},
},
loading: false,
diagnoseValue: null, //
systemValue: null, //
physiqueValue: null, //
postureValue: null, //
agrypniaValue: null, //
anxietyValue: null, //
//
systemObj: {
yxfpz: "隐形肥胖型", //
zfgdx: "脂肪过多型", //
fpx: "肥胖型", //
jrbzx: "肌肉不足型", //
jkjcx: "健康匀称型", //
czjrx: "超重肌肉型", //
xsx: "消瘦型", //
dzfx: "低脂肪型", //
ydyx: "运动员型", //
},
//
physiqueObj: {
phz: "平和质", //
qxz: "气虚质", //
yangxz: "阳虚质", //
yinxz: "阴虚质", //
tsz: "痰湿质", //湿
srz: "湿热质", //湿
xyz: "血瘀质", //
qyz: "气郁质", //
tlz: "特禀质", //
},
};
},
created() {
// this.Linepatient();
this.getData();
},
methods: {
statistics(_data, _type) {
this.initial(_data, _type); //
this.loading = true;
this.getData(); //
},
//
async getData() {
try {
await zlInfo(this.queryParams).then((res) => {
const { jlfb, smfb, sort, ttfb, txfb, zytz } = res.data;
//
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.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();
// PHQ-9
this.agrypniaValue = [];
for (let key in smfb) {
this.agrypniaValue.push(smfb[key]);
}
this.handleAgrypnia();
//
this.anxietyValue = [];
for (let key in jlfb) {
this.anxietyValue.push(jlfb[key]);
}
this.handleAnxiety();
});
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;
});
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("diagnose"), null, {
height: 300,
});
myChart.setOption(diagnoseEcharts, true);
myChart.resize();
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;
});
},
//
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");
_data[1] = this.$moment(_data[1]).format("YYYY-MM-DD");
this.queryParams.param = {
startTime: _data[0] + " " + "00:00:00",
endTime: _data[1] + " " + "23:59:59",
};
},
//
handleAgrypnia() {
agrypniaEcharts.series[0].data = this.agrypniaValue;
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("agrypnia"), null, {
height: 300,
});
myChart.setOption(agrypniaEcharts, true);
myChart.resize();
window.onresize = myChart.resize;
});
},
//
handleAnxiety() {
anxietyEcharts.series[0].data = this.anxietyValue;
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("anxiety"), null, {
height: 300,
});
myChart.setOption(anxietyEcharts, true);
myChart.resize();
window.onresize = myChart.resize;
});
},
//
getRenew() {
this.Linepatient();
this.columnar();
},
},
};
loading: false,
diagnoseValue: null, //
systemValue: null, //
physiqueValue: null, //
postureValue: null, //
agrypniaValue: null, //
anxietyValue: null, //
//
systemObj: {
yxfpz: "隐形肥胖型", //
zfgdx: "脂肪过多型", //
fpx: "肥胖型", //
jrbzx: "肌肉不足型", //
jkjcx: "健康匀称型", //
czjrx: "超重肌肉型", //
xsx: "消瘦型", //
dzfx: "低脂肪型", //
ydyx: "运动员型", //
},
//
physiqueObj: {
phz: "平和质", //
qxz: "气虚质", //
yangxz: "阳虚质", //
yinxz: "阴虚质", //
tsz: "痰湿质", //湿
srz: "湿热质", //湿
xyz: "血瘀质", //
qyz: "气郁质", //
tlz: "特禀质", //
},
};
},
created() {
// this.Linepatient();
this.getData();
},
methods: {
statistics(_data, _type) {
this.initial(_data, _type); //
this.loading = true;
this.getData(); //
},
//
async getData() {
try {
await zlInfo(this.queryParams).then((res) => {
const {
jlfb,
smfb,
sort,
ttfb,
txfb,
zytz
} = res.data;
//
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.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();
// PHQ-9
this.agrypniaValue = [];
for (let key in smfb) {
this.agrypniaValue.push(smfb[key]);
}
this.handleAgrypnia();
//
this.anxietyValue = [];
for (let key in jlfb) {
this.anxietyValue.push(jlfb[key]);
}
this.handleAnxiety();
});
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;
});
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("diagnose"), null, {
height: 300,
});
myChart.setOption(diagnoseEcharts, true);
myChart.resize();
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;
});
},
//
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");
_data[1] = this.$moment(_data[1]).format("YYYY-MM-DD");
this.queryParams.param = {
startTime: _data[0] + " " + "00:00:00",
endTime: _data[1] + " " + "23:59:59",
};
},
//
handleAgrypnia() {
agrypniaEcharts.series[0].data = this.agrypniaValue;
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("agrypnia"), null, {
height: 300,
});
myChart.setOption(agrypniaEcharts, true);
myChart.resize();
window.onresize = myChart.resize;
});
},
//
handleAnxiety() {
anxietyEcharts.series[0].data = this.anxietyValue;
this.$nextTick(() => {
var myChart = echarts.init(document.getElementById("anxiety"), null, {
height: 300,
});
myChart.setOption(anxietyEcharts, true);
myChart.resize();
window.onresize = myChart.resize;
});
},
//
getRenew() {
this.handleDiagnose();
this.handleSystem();
this.handlePhysique();
this.handlePosture();
this.handleAgrypnia();
this.handleAnxiety();
},
},
};
</script>
<style scoped src="@/assets/styles/common.css"></style>
<style scoped>
>>> .el-card__body {
padding: 10px 0 !important;
}
>>>.el-card__body {
padding: 10px 0 !important;
}
.dis {
display: flex;
}
.dis {
display: flex;
}
.header-title {
font-size: 18px;
}
.header-title {
font-size: 18px;
}
.title-box {
padding: 10px 20px;
border-bottom: 1px solid #dfe6ec;
}
.title-box {
padding: 10px 20px;
border-bottom: 1px solid #dfe6ec;
}
.dian-box {
align-items: center;
}
.dian-box {
align-items: center;
}
.dian {
display: inline-block;
width: 16px;
height: 16px;
border-radius: 50%;
margin: 0 10px;
}
.dian {
display: inline-block;
width: 16px;
height: 16px;
border-radius: 50%;
margin: 0 10px;
}
.title-box {
justify-content: space-between;
}
.title-box {
justify-content: space-between;
}
. >>> .el-radio--small.is-bordered {
margin-right: 20px !important;
margin-left: 0 !important;
}
.>>>.el-radio--small.is-bordered {
margin-right: 20px !important;
margin-left: 0 !important;
}
>>> .el-radio__input {
display: none;
}
>>>.el-radio__input {
display: none;
}
>>> .el-radio__label {
padding-left: 5px;
}
>>>.el-radio__label {
padding-left: 5px;
}
.app-container {
padding: 0;
display: flex;
justify-content: space-between;
}
.app-container {
padding: 0;
display: flex;
justify-content: space-between;
}
.title {
display: flex;
align-items: center;
font-size: 20px;
font-weight: 600;
}
.title {
display: flex;
align-items: center;
font-size: 20px;
font-weight: 600;
}
.title-bor {
display: inline-block;
height: 20px;
width: 6px;
background: #4f8bff;
margin-right: 10px;
border-radius: 8px;
}
</style>
.title-bor {
display: inline-block;
height: 20px;
width: 6px;
background: #4f8bff;
margin-right: 10px;
border-radius: 8px;
}
</style>

80
acupuncture-前台/src/views/indexCom/XGZL.vue

@ -22,33 +22,74 @@
</div>
</el-card>
</div>
<div style="flex: 1; margin-right: 20px">
<!-- <div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">病种方法分布</span>
<div class="dis"></div>
</div>
<div style="height: 300px" v-loading="loading">
<!-- <div id="diseaseMethod" style="width: 100%"></div> -->
<div id="diseaseMethod" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1;">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">病种穴位分布</span>
<div class="dis">
<div style="flex: 1;">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">病种穴位分布</span>
<div class="dis">
</div>
</div>
</div>
<div style="height: 300px" v-loading="loading">
<!-- <div id="acupoint" style="width: 100%"></div> -->
</div>
</el-card>
</div>
<div style="height: 300px" v-loading="loading">
<div id="acupoint" style="width: 100%"></div>
</div>
</el-card>
</div> -->
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">治疗效果</span>
<div class="dis">
<div class="dian-box dis">
<div class="dian-box dis">
<span class="dian" style="background: #5C7BD9"></span>
治愈
</div>
<div class="dian-box dis">
<span class="dian" style="background: #91CC75"></span>
显效
</div>
<div class="dian-box dis">
<span class="dian" style="background: #FAC858"></span>
好转
</div>
<div class="dian-box dis">
<span class="dian" style="background: #EE6666"></span>
无效
</div>
</div>
</div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="effect" style="width: 100%"></div>
</div>
</el-card>
</div>
<div style="flex: 1">
<el-card shadow="always">
<div class="dis title-box">
<span class="header-title">诊疗费用分布</span>
<div class="dis">
</div>
</div>
<div style="height: 300px" v-loading="loading">
<div id="cost" style="width: 100%"></div>
</div>
</el-card>
</div>
</div>
</div>
<div class="app-container">
<!-- <div class="app-container">
<div class="dis" style="width: 100%">
<div style="flex: 1; margin-right: 20px">
<el-card shadow="always">
@ -93,7 +134,7 @@
</el-card>
</div>
</div>
</div>
</div> -->
</div>
</template>
@ -198,7 +239,7 @@
]
this.handleEffect()
//
this.costValue =[zlfy.score1,zlfy.score2,zlfy.score3,zlfy.score4,zlfy.score5]
this.costValue = [zlfy.score1, zlfy.score2, zlfy.score3, zlfy.score4, zlfy.score5]
this.handleCost()
});
this.loading = false;
@ -263,8 +304,9 @@
},
//
getRenew() {
this.Linepatient();
this.columnar();
this.handleHealType();
this.handleEffect();
this.handleCost()
},
},
};

4
acupuncture-前台/src/views/indexCom/follow.vue

@ -146,8 +146,8 @@
},
//
getRenew() {
// this.Linepatient();
// this.columnar();
this.handleFollow();
this.handleLossFollow()
},
},
};

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

@ -245,8 +245,10 @@
},
//
getRenew() {
// this.Linepatient();
// this.columnar();
this.Linepatient(); //
this.handleAge(); //
this.columnar(); //
this.handleDisease(); //
},
},
};

Loading…
Cancel
Save